Skip to content
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

Misaligned “\\" after "\verb|...|" in tabular environments #251

Closed
rudolf-adamkovic opened this issue Mar 6, 2021 · 3 comments
Closed
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims duplicate duplication of another issue implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix

Comments

@rudolf-adamkovic
Copy link

.tex code

\begin{tabular}{ll}
  Testing & Line 1                        \\
  Testing & Line 2                        \\
  Testing & Line 3 \verb|X| \\
  Testing & Line 4                        \\
\end{tabular}

yaml settings

salutis@Workstation ~ % cat ~/.indentconfig.yaml
paths:
- /Users/salutis/.indentconfig.yaml

# The following value should match |tabstop| in |~/.vimrc|.
defaultIndent: "  "

Desired or expected output

I expect all the \\ to line up vertically, including the one after \verb|X|.

@rudolf-adamkovic rudolf-adamkovic changed the title Misaligned “\\" after \verb|| in tabular environment Misaligned “\\" after "\verb|...|" in tabular environment Mar 6, 2021
@rudolf-adamkovic rudolf-adamkovic changed the title Misaligned “\\" after "\verb|...|" in tabular environment Misaligned “\\" after "\verb|...|" in tabular environments Mar 6, 2021
@cmhughes
Copy link
Owner

cmhughes commented Mar 6, 2021

Thanks.

Yes, this output is expected, and I appreciate that it is not ideal.

The reasoning is that the \verb|X| command will be replaced with a token, the indentation and alignment is done, and then the verbatim token will be replaced with its value. The unfortunate thing is that the token used is longer than the string that it represents.

This is a known issue, and this behaviour is expected. I would say that this issue is a duplicate of #85

I'm exploring a new approach which I hope might assist with this behaviour. Details will follow as and when I have them.

For the moment, I will reference this issue within #85 so that I have it for reference.

Thanks again.

@cmhughes cmhughes closed this as completed Mar 6, 2021
cmhughes added a commit that referenced this issue Jul 23, 2021
This represents significant enhancements to the AlignAtAmpersand
routine; it was motivated by
#85
#212
#251
#162
@cmhughes
Copy link
Owner

Update! see #85 :) release to follow soon :)

@cmhughes cmhughes added implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix duplicate duplication of another issue align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims labels Jul 23, 2021
@cmhughes
Copy link
Owner

Released as of https://github.com/cmhughes/latexindent.pl/releases/tag/V3.10.1, uploaded to ctan, you should be able to get it using your TeX distribution manager within about 24 hours, ctan allowing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims duplicate duplication of another issue implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix
Projects
None yet
Development

No branches or pull requests

2 participants