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

Indentation in tabular* #526

Closed
Pberg22 opened this issue Mar 18, 2024 · 3 comments
Closed

Indentation in tabular* #526

Pberg22 opened this issue Mar 18, 2024 · 3 comments
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims answered question has been answered question user-centred question about behaviour of latexindent.pl

Comments

@Pberg22
Copy link

Pberg22 commented Mar 18, 2024

Please provide the following when posting an issue:

original .tex code

Please paste your .tex code here. Please note in answering your issue, I may add the code you provide to the test-cases directory. Please detail explicitly if you would prefer me not to do so..

\documentclass{article}
\begin{document}
\begin{center}
  \begin{tabular*}{\linewidth}{ll}
    1&2\\
    32 &4\\
  \end{tabular*}
\end{center}
\end{document}

yaml settings

Please paste your YAML settings (if any) here

actual/given output

Please paste the output you receive here

\begin{center}
  \begin{tabular*}{\linewidth}{ll}
    1&2\\
    32 &4\\
  \end{tabular*}
\end{center}

desired or expected output

Please paste your desired/expected output here; that is, what do you want the output to look like

\begin{center}
  \begin{tabular*}{\linewidth}{ll}
    1  & 2 \\
    32 & 4 \\
  \end{tabular*}
\end{center}

anything else

Please put any comments or anything else here :)

I'm using the LaTeX Workshop extension for Visual Studio Code.
The formatting of my .tex text seem to work fine in all cases, except when I'm using tabular* environment, where nothing happens when I try to format the text. I'm new to both LaTeX and posting issues on GitHub - just tell me if I missed anything.

@cmhughes cmhughes added align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims question user-centred question about behaviour of latexindent.pl labels Mar 18, 2024
@cmhughes
Copy link
Owner

Thanks for this. Can you try the following settings

latexindent.yaml

lookForAlignDelims:
        tabular*: 1

You call it with

latexindent.pl -l my file.tex

@cmhughes cmhughes added the answered question has been answered label Mar 18, 2024
@Pberg22
Copy link
Author

Pberg22 commented Mar 19, 2024

Ohh now it works!
I was missing the line tabular*: 1 in my defaultSettings.yaml file.
Adding it directly after the options of tabular: fixed it when using the workshop short Ctrl K + Ctrl F

@Pberg22 Pberg22 closed this as completed Mar 19, 2024
@cmhughes
Copy link
Owner

cmhughes commented Mar 19, 2024 via email

cmhughes added a commit that referenced this issue Mar 19, 2024
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 answered question has been answered question user-centred question about behaviour of latexindent.pl
Projects
None yet
Development

No branches or pull requests

2 participants