Tex output and amsmath

Deplate
Edwin
2010-10-07
2013-04-17
  • Edwin
    Edwin
    2010-10-07

    While (according to the readme) deplate loads amsmath when converting #Ltx regions to jpg files for html output it does not seem to set
    \usepackage{amsmath}
    in the generated tex file when generating tex output. As a result I can't (easily) create matrices in tex output.

    I tried setting:
    #VAR inlatexPrelude="\usepackage{amsmath}"
    but that didn't seem to have any effect. Am I doing something wrong?

    Cheers, Edwin

     
  • Tom Link
    Tom Link
    2010-10-07

    Could you please provide a minimal example and the command line you use to translate the input file. The latex code used for the latex snippets is saved along with the images. If you use the makefile module, that would be the html subdirectory. You could take a look at the latex code to find out what's wrong.

    I tried the following input:

    * AMS
    #Ltx <<
    $\alpha^2$

    The resulting latex code for the #Ltx region was:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
    \begin{document}
    \pagestyle{empty}
    $\alpha^2$
    \end{document}

    Regards,
    Tom

     
  • Edwin
    Edwin
    2010-10-07

    Hi,

    I think that is what happens when you generate html. I'm talking about generating latex directly with deplate:

    deplate -pdf -f latex  -m particle-math -x -X -color -quiet -e FILEname

    The preamble of the tex file looked like this:
    \documentclass{article}
    \pdfcompresslevel9
    \usepackage{inputenc}
    \usepackage{hyperref}
    \usepackage{color}
    \usepackage{deplate}
    \begin{document}

    Edwin

     
  • Tom Link
    Tom Link
    2010-10-07

    Ok, I see.

    For the moment, you have to include those packages for latex output only. The above example would thus be:

    * AMS

    #Ltx fmt=latex <<
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}

    #Ltx <<
    $\alpha^2$

    The latex formatter will now load amsmath by default. Are there any known incompatibilities of amsmath with other packages?

    HTH
    Tom

     
  • Edwin
    Edwin
    2010-10-08

    Ok, that seems to work. Thanks for the quick help.

    Those are very common packages, so I would be surprised if there are any incompatibilities, but I am not sure.