0

I am looking for an automated way of presenting my Mathematica results in latex. My workflow at the moment is the following

  1. I use TeXForm[] Mathematica function to generate a latex code from my expression
  2. I copy the output to a latex document to dmath environment from breqn package, so I don't have to care about line breaking when expressions are lengthy.

Unfortunately, the method above doesn't work when fractions generated by Mathematica are too long (namely dmath doesn't have a built-in way to break \frac{}{}).

How could I deal with it?

The only way to break fractions I know, is \splitfrac but one has to put it by hand, which can be cumbersome for lengthy expressions.

I also tried to force Mathematica to generate latex code that uses a division symbol / instead of \frac{}{}, but I didn't manage to get a neatly working solution (with this style of output dmath would be sufficient).

What are the other possible solutions? Could you provide both Mathematica and latex snippets? What is your general workflow when presenting Mathematica results in latex?

  • 2
    Welcome to TeX.SE! Please show us a short compilable TeX code generating your issue! Then we do not have to guess what you are doing ... – Mensch Feb 23 '24 at 18:28
  • probable duplicate of https://tex.stackexchange.com/questions/381002/write-huge-equation-width-8-meters/381066#381066 – David Carlisle Feb 23 '24 at 19:17
  • This is a great answer, thank you. However when using this solution I get the error "double superscript" at the end of each fraction: \mathsup

    l.70 ...} \left(\sigma p_{0}^{4}+1\right)\right)} +\frac{i \delta m \left(1... I treat x^1^2' essentially likex^1{}^2'.

    \mathsup

    l.70 ...} \left(\sigma p_{0}^{4}+1\right)\right)}

    I treat x^1^2' essentially likex^1{}^2'.

    – Paweł Korzeb Feb 25 '24 at 18:55

0 Answers0