When converting a LyX document to a TeX file, I've noticed that the resulting code is not formatted in a "pretty" way. For example, when writing my own documents in LaTeX, I will tab lines with equations in them:
Here is an equation:
\[
r^2 = x^2 + y^2
\]
That was an equation.
whereas the file output by LyX has no tabbing:
Here is an equation:
\[
r^2 = x^2 + y^2
\]
That was an equation.
I was wondering if there is a way to tell Lyx to do this automatically, so that when I export a LyX file to a LaTeX document I don't have to go back and tab every equation myself. In general, this applies to other cases as well, such as enumerate or itemize.
In summary: Can I control the "format" of the code in the TeX file that LyX outputs?
In case it is relevant: I am using LyX 2.3.2 on Ubuntu 18.04.01 LTS.
LyXoutput. InEmacswithAUCTeX, there is a menu item in theLaTeXmenu called"Format environment", which will format the current environment (so where the cursor is), and it will format the whole document if the environment is thedocumentone. The actualEmacscommand isM-x LaTeX-fill-environment. – Máté Wierdl Feb 05 '19 at 20:09StackExchangetoo, and they recommend the program latexindent. – Máté Wierdl Feb 09 '19 at 16:41