Closed AntoineMissier closed 7 months ago
Thanks for this, I hope to get to it soon. Apologies for the delay.
I present two options:
indentAfterItems:
itemize: 0
enumerate: 0
description: 0
list: 0
specialBeginEnd:
specialBeforeCommand: 1
indentAfterItems:
itemize: 0
enumerate: 0
description: 0
list: 0
fineTuning:
commands:
name: (?!infty)[+a-zA-Z@\*0-9_\:]+?
Both options give your desired output
\begin{enumerate}
\item
The function $u: x \mapsto 1-x + \ln (2x)$ is defined on $]0,+\infty[$ and we obtain
its derivative $u'$ :
\[u'(x)=-1+\frac{2}{2x}=-1+\frac{1}{x}=\frac{1-x}{x}. \]
\item
Here we calculate the limits at 0 and $+\infty$ :
\item
We have $x >0$ on $]0,+\infty[$, thus $u'(x)$ has the same sign as $1-x$.
The maximum of $u$ is $u(1)=\ln2$.
\end{enumerate}
The issue arises because of \infty[
which latexindent.pl
sees as the start of a command. The above solutions both tell latexindent.pl
that this is not the case.
Ok it works fine. I prefer the option 2 because it preserves indentation inside macros different from \infty. Thanks Chris
Great, glad it worked, happy indentation!
Please provide the following when posting an issue:
original .tex code
yaml settings
actual/given output
desired or expected output
anything else
When I eliminate the open brackets in the first interval, the problem disappears. What should I change in the defaultSettings.yaml to manage these square brackets correctly ?