I've followed the instructions in the error message and installed
File::HomeDir. Latexindent now works, but despite the image of comprehensiveness the documentation seems to provide, it seems to lack some features of the previous version of latex tidy. Is there anyway to get the previous version back?
Although latexindent nicely formats align environments and matrices, some of the automation available in the previous version of latex tidy seems to have been lost.
For example, consider the following:
\begin{lem}
\label{1.19:lem1}
\[ \left\{
\begin{matrix}
p \in \al\\
q \notin \al
\end{matrix}
\right\}\implies p < q.\]
\end{lem}
which was indented by latex tidy. Latexindent now indents this as:
\begin{lem}\label{1.19:lem1}
\[ \left\{
\begin{matrix}
p \in \al \\
q \notin \al
\end{matrix}
\right\}
\implies p < q.\]
\end{lem}
If I move the last \] to the next line, latexindent indents this as
\begin{lem}\label{1.19:lem1}
\[ \left\{
\begin{matrix}
p \in \al \\
q \notin \al
\end{matrix}
\right\}
\implies p < q.
\]
\end{lem}
which looks better, but means that I now have to format my files according to latexindent's rules for it to work correctly. Somehow, this seems to defeat the purpose of an automatic text formatter. The pattern in the example is repeated often in documents of mine thousands of lines long and so, when this behavior of latexindent cascades, it causes lines that should not be indented, to be indented. For example, the following was formatted by latexindent:
\begin{lem}\label{xyz}
\[ \left\{
\begin{matrix}
p \in \al \\
q \notin \al
\end{matrix}
\right\}
\implies p < q.\]
\end{lem}
This text should be at the beginning of the line.
\begin{lem}\label{xyz}
\[ \left\{
\begin{matrix}
p \in \al \\
q \notin \al
\end{matrix}
\right\}
\implies p < q.\]
\end{lem}
Latex tidy would have had no problem with this. The documents of mine tend to consist of environments nested several levels deep, (which is why latex tidy is important to me) and now the test copy on which I tried latexindent has text indented off the screen. Other examples of unexpected behavior, which might not be a complete list... :
after \documentclass{...} latexindent does not adjust indentation, and so
\documentclass{article}
\usepackage{...}
\usepackage{...}
\usepackage{...}
is left untouched. Latex tidy would have brought them to the beginning of the line.
Latexindent does not seem to put text inside \[ \] on a separate line, whereas latex tidy did, and so,
asdadfa \[ sdfada \] asdfasdfa
would have been changed to
asdadfa
\[ sdfada \]
asdfasdfa
Latexindent leaves it unchanged.
It is the same with environments:
\begin{abc} jkl \end{abc}
would have been changed to
\begin{abc}
this text would be indented.
\end{abc}
but latexindent leaves it untouched.
It also doesn't compress multiple blank lines. In summary, latex tidy could take almost any mess I typed and put it in the right place.
Would it be possible for the old latex tidy to be re-added to the bundle alongside latexindent? Or would it be possible to configure latexindent to mimic certain features of latextidy?
Anthony