Closed dpo closed 1 year ago
Thanks for this :)
Have you seen https://latexindentpl.readthedocs.io/en/latest/sec-the-m-switch.html#poly-switches-for-double-back-slash
It appears I did not because I was searching for "backslash" in the documentation, but it's spelled "back slash" in two words in some places and in one word in others. Perhaps that could be straightened out?
Sorry for the basic questions. I'm finding the documentation to be rather daunting, though it's clear that you've put a lot of effort into it and tried to make it didactic.
Another point is that I was under the impression that defaultSettings.yaml
contained all possible settings. I installed latexindent
with Homebrew and
grep DBS /opt/homebrew/Cellar/latexindent/3.19.1/libexec/bin/defaultSettings.yaml
returns nothing. Is that expected?
Many thanks, glad that helped.
It appears I did not because I was searching for "backslash" in the documentation, but it's spelled "back slash" in two words in some places and in one word in others. Perhaps that could be straightened out?
Yes, I'll get that fixed.
Is that expected?
Yes. I don't think that there's a natural place for the dbs switches in defaultSettings.yaml, as they can be applied to many of the different code blocks : environments, mandatory /optional arguments, special. Unless I put copies in for all of these code blocks, but then they would not be activated most of the time.
If you have any tips on how to make the documentation less daunting, while still being comprehensive, let me know :) don't forget there is a quick start section!
As of https://github.com/cmhughes/latexindent.pl/commit/b2257d5df6303c9508251fe3414fa0798b115750 back slash
has been replaced with backslash
in the documentation.
It'll be part of the next release.
Many thanks. As a follow-up question, is DBSStartsOnOwnLine: 1
compatible with aligning ampersands? I have
lookForAlignDelims:
cases: 1
but latexindent
does this:
\begin{cases}
- +\infty & \text{if } x \leq 0 \\
- \phi_{k,i}(x) & \text{if } 0 < x < 1 \\
- 0 & \text{if } x \geq 1,
+ +\infty & \text{if } x \leq 0
+ \\ \phi_{k,i}(x) & \text{if } 0 < x < 1
+ \\ 0 & \text{if } x \geq 1,
\end{cases}
Yes it should all be OK.
On Sat, 17 Dec 2022, 03:19 Dominique, @.***> wrote:
Many thanks. As a follow-up question, is DBSStartsOnOwnLine: 1 compatible with aligning ampersands? I have
lookForAlignDelims: cases: 1
but latexindent does this:
\begin{cases}- +\infty & \text{if } x \leq 0 \\- \phi_{k,i}(x) & \text{if } 0 < x < 1 \\- 0 & \text{if } x \geq 1,+ +\infty & \text{if } x \leq 0+ \\ \phi_{k,i}(x) & \text{if } 0 < x < 1+ \\ 0 & \text{if } x \geq 1, \end{cases}
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/393#issuecomment-1355991962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYF57452YOFIKN3QONDWNUWMLANCNFSM6AAAAAAS7IJFII . You are receiving this because you commented.Message ID: @.***>
But the diff above shows that the &
are not aligned...
Understood.
This hasn't come up before, and it hadn't occurred to me that anyone would want to align anything after the \\
.
So, I think we need a new key, something like alignContentAfterDBS
which can be 0
or 1
.
I hope to look at this soon.
Thank you. As a side note, why not enable discussions on this repo? I often have questions rather than issues, and other users may be able to help you answer them.
What are 'discussions', is it another tab in the repository....?
On Sun, 18 Dec 2022, 17:09 Dominique, @.***> wrote:
Thank you. As a side note, why not enable discussions on this repo? I often have questions rather than issues, and other users may be able to help you answer them.
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/393#issuecomment-1356838682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYBGIXS5DOXRDHMBW4LWN5ALJANCNFSM6AAAAAAS7IJFII . You are receiving this because you commented.Message ID: @.***>
I've been looking at discussions. I think the template feature would need to be implemented before opening them https://github.com/community/community/discussions/2838
Ok. I think of them as more "free form", but as you wish.
Understood.
This hasn't come up before, and it hadn't occurred to me that anyone would want to align anything after the
\\
.So, I think we need a new key, something like
alignContentAfterDBS
which can be0
or1
.I hope to look at this soon.
Hi Chris, I have a related request. Is it possible to set DBSFinishesWithLineBreak
for some environments for which I don't want to set lookForAlignDelims
equal to 1? The current documentation says Note that for these poly-switches to take effect, the name of the code block must necessarily be specified within lookForAlignDelims
. Is it possible to separate the two routines? In particular, I do not want the script to change formatting of lines in align environments but ensure that all DBS end with a new line.
Thanks!
@ankitp94 great, thanks. Your feature request is detailed in https://github.com/cmhughes/latexindent.pl/issues/402
For reference, https://github.com/cmhughes/latexindent.pl/issues/402 has been implemented.
I'm working on the feature request detailed in this issue as a next priority.
Apologies for the delay on this.
As of https://github.com/cmhughes/latexindent.pl/commit/f0f3b00f6c23aac0ee0b39e0cc5682bec6a2c030 a new feature is implemented: alignContentAfterDoubleBackSlash
.
Starting with
\begin{cases}
+\infty & \text{if } x \leq 0 \\
\phi_{k,i}(x) & \text{if } 0 < x < 1 \\
0 & \text{if } x \geq 1,
\end{cases}
and using
lookForAlignDelims:
cases:
alignContentAfterDoubleBackSlash: 1 #<!---- NEW BIT
modifyLineBreaks:
environments:
DBSStartsOnOwnLine: 1
DBSFinishesWithLineBreak: -1
gives
\begin{cases}
+\infty & \text{if } x \leq 0
\\ \phi_{k,i}(x) & \text{if } 0 < x < 1
\\ 0 & \text{if } x \geq 1,
\end{cases}
Released at https://github.com/cmhughes/latexindent.pl/releases/tag/V3.21, uploaded to ctan.
Looks great. Many thanks! I will test.
original .tex code
yaml settings
All defaults.
actual/given output
desired or expected output
or even better,
Sorry if this is another basic question, but how can I automatically insert a newline after (or before) a double backslash in an
align*
environment? Thanks in advance!