Menu

Support for LaTeX Commands in ODT

Help
2012-03-28
2013-05-28
  • barahir1983

    barahir1983 - 2012-03-28

    Today I installed writer2latex for a friend who is relatively new to LaTeX and prepared some of his work using LibreOffice, but with the conversion to LaTeX in mind has used things such as \footcite in the OpenDocument file. When we now converted the odt to latex, every backslash was translated into \textbackslash and the curly braces were also altered. Is there any way to prevent writer2latex from doing this, for example via string-replace?
    A simple try to do this with

    <string-replace input="\" latex-code="\" />
    

    did very strange things such as adding null before every \.
    Is there actually any way? Thank you for all help in advance!
    barahir1983

     
  • barahir1983

    barahir1983 - 2012-03-28

    forgot to add the specifics: we installed writer2latex 1.2 on a Windows 7 x64 machine and use LibreOffice 3.5.1.

     
  • Henrik Just

    Henrik Just - 2012-04-02

    Hi

    Thanks for your feedback. It turns out that there is a bug in Writer2LaTeX 1.2 beta; this will be fixed in the final release.

    Meanwhile, add fontenc="any" to the rule:

    <string-replace input="\" latex-code="\" fontenc="any" />
    

    This should fix the problem.

    A better way to handle embedded LaTeX code is this: Create a new text style called e.g. LaTeX, containing for example a bold typewriter font. Map this style as follows:

     <style-map name="LaTeX" before="" after="" family="text" verbatim="true" />
    

    All text marked up with the text style will then be exported as verbatim LaTeX code.

    Best regards
    Henrik

     
  • barahir1983

    barahir1983 - 2012-04-02

    Thank you very much, I will try both of these solutions.

    Best regards
    David

     

Log in to post a comment.