-
Notifications
You must be signed in to change notification settings - Fork 81
Question about indentation inside braces #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you tried noAdditionalIndentGlobal:
UnNamedGroupingBracesBrackets: 1 |
\documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\section{first section}
\[ f(x) = \sqrt{e^x} = \left(e^{x}\right)^{\dfrac{1}{2}} = e^{\dfrac{1}{2}x} \]
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\( x_0 \)
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
hello world
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\subsection{subsection}
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\section{Other section}
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\end{document} A bit better compared to the previous result, but still some odd formatting |
Can you make sure this is as minimal and clear as possible please? One specific example at a time. |
sorry for the delay. Here's a minimal defaultIndent: "\t"
noAdditionalIndentGlobal:
UnNamedGroupingBracesBrackets: 1 input tex file: \documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\( x_0 \)
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\end{document} desired output: \documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\( x_0 \)
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\end{document} actual output: \documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\( x_0 \)
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\end{document} As you can see, the |
Thanks for this. Using the following gives your desired output defaultIndent: "\t"
noAdditionalIndent:
always-un-named:
body: 1
mandatoryArguments: 1
optionalArguments: 1 This is sort of mentioned in https://latexindentpl.readthedocs.io/en/latest/sec-default-user-local.html#unnamedgroupingbracesbrackets but I don't think it has enough details. I'll update the documentation to cover this, so please leave this issue open :) |
Hey, thanks for the answer :) unfortunately, it looks like that those configs "only" fixes 1/4 cases. Here are the remaining cases, that (with the above formatter settings) still have some indenation \documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
hello world
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\subsection{subsection}
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\section{Other section}
{ \small
\begin{align*}
f(x) & = e^{\dfrac{1}{2} x} & & \Rightarrow f(0) = e^0 = 1 \\
\end{align*}
}
\end{document} |
The following gives your desired output: defaultIndent: "\t"
noAdditionalIndentGlobal:
mandatoryArguments: 1
namedGroupingBracesBrackets: 1
indentRules:
section: '' |
Uh oh!
There was an error while loading. Please reload this page.
example file
yaml settings
actual/given output
desired or expected output
anything else
Hey,
I played around with some line wrapping options and I experienced that after a
\[ \]
there is no indentation inside the{}
, after asubsection
there is one tab indentation and after asection
there is 1/2 tab indentation.Is there an option to make this consistent e.g. never indent the code inside
{}
like after the\[ \]
?Thanks for looking into this.
EDIT: some additional examples
The text was updated successfully, but these errors were encountered: