## Latex with Libreoffice (proposal)

Situation: I think latex is a better way of writing scientific manuscripts and I would like to use it for that purpose. Some prefer to do it with MS word or Libreoffice. This post is about a work-flow that will allow me to write stuff in latex and collaborate with colleagues that use Libreoffice. Caveat: I am the main author of the manuscript that I’m writing and this work-flow is tailored with that mind.

I did not want to translate my latex doc into an intermediate format and then give it to my collaborators because it would be difficult to incorporate any changes done in that format back into my tex file. I’m using git to track all changes and would like to receive diffs against my original doc. I discarded pushing latex down my collaborators throats because they are already busy as it is :). I need a solution that allows my collaborators to make changes against the main latex file with what they are using for writing.

Work-flow

1. Give them my tex file.

2. Tell them to run the following macro so they can easily distinguish between latex stuff and content stuff.

Option Explicit
Public oDocAuto as Object
Sub Main()
Dim oSearchDesc as Object
Dim oFoundall as Object
Dim xFound as Object
oDocAuto = ThisComponent
oSearchDesc = oDocAuto.createsearchDescriptor()
oSearchDesc.SearchRegularExpression = True
oSearchDesc.SearchWords = False
oSearchDesc.SearchString = "\$^ %][a-zA-Z0-9 {1}\.\[$\-]*\{|\}|\$|\\hline|\\ |tbl:[a-zA-Z0-9]*\}|fig:[a-zA-Z0-9]*\}|\\circ|\\\\|\\[a-zA-Z]*$"
oFoundall = oDocAuto.FindAll(oSearchDesc)
xFound = oDocAuto.findFirst(oSearchDesc)
do while not IsNull(xFound)
xFound.CharColor = 16711680
xFound = oDocAuto.findNext( xFound.End, oSearchDesc )
loop
End Sub

3. Tell my collaborators that they should edit as if they were writing a normal document and make clear to them to save to a text file (as opposed to odf or doc). I’ll also make it clear that they are to ignore the red text (macro paints common latex stuff in red)

4. If they edit and save in text format, I should be able to diff the resulting document with git and manually pic individual parts of the diff as separate commits.

I don’t have clear how to handle tables and figures.