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

Double backslash regex does not match decimals #564

Open
danrr opened this issue Sep 23, 2024 · 1 comment
Open

Double backslash regex does not match decimals #564

danrr opened this issue Sep 23, 2024 · 1 comment
Labels
align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims enhancement enhancement which might be to an existing feature or the development of a new feature

Comments

@danrr
Copy link

danrr commented Sep 23, 2024

Please provide the following when posting an issue:

original .tex code

\begin{pmatrix}
1 & 2 \\[0.2cm] 3 & 4
\end{pmatrix}

yaml settings

modifyLineBreaks:
    environments:
        DBSFinishesWithLineBreak: 1

actual/given output

\begin{pmatrix}
	1         & 2 \\
	[0.2cm] 3 & 4
\end{pmatrix}

desired or expected output

\begin{pmatrix}
	1         & 2 \\[0.2cm]
        3 & 4
\end{pmatrix}

anything else

The regex for doubleBackSlash does not pick up decimals

doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?
. See https://regex101.com/r/KkFe4h/1.

Something like \\\\(?:\h*\[\h*(?:\d+\.)?\d+\h*[a-zA-Z]+\h*\]) seems to work better. See https://regex101.com/r/Wq1fZw/1.

@cmhughes
Copy link
Owner

Great, thanks! You can adjust fine tuning in your local yaml.

If you'd like to submit a pull request, feel free!

@cmhughes cmhughes added enhancement enhancement which might be to an existing feature or the development of a new feature align-at-ampersand-routine the align at ampersand; documented in lookForAlignDelims labels Sep 24, 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 enhancement enhancement which might be to an existing feature or the development of a new feature
Projects
None yet
Development

No branches or pull requests

2 participants