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

Exclude align, align*, split, split* and circuitikz #158

Open
mfbehrens opened this issue Jan 21, 2021 · 6 comments
Open

Exclude align, align*, split, split* and circuitikz #158

mfbehrens opened this issue Jan 21, 2021 · 6 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@mfbehrens
Copy link
Contributor

mfbehrens commented Jan 21, 2021

In my LaTeX file I have the following lines:

\begin{circuitikz}
	\ctikzset{voltage/bump b/.initial=0} % defines arrow's curvature
	\draw (0,3) to[short,o-*] (1,3) -- (1,3.5) to[R,l=$R$] (4,3.5) to[L=$L$] (7,3.5) -- (7,3) to[short,i=$I_{Last}$,*-] (9,3)
	to[R,l=$R_{Last}$] (9,0) to[short,-o] (0,0);
	\draw (1,3) -- (1,2.5) to[C,l_=$C$] (7,2.5) -- (7,3);
	\draw (0,3) to[open,v=$U_e$] (0,0);
\end{circuitikz}

Since this is describing an electronic circuit this should not be checked for grammar and spelling.

The same is true for align and split sections, which are holding mathematical expressions like $$xyz$$

Would be great if sections like these could be excluded from spellchecking.

@matze-dd matze-dd added the enhancement New feature or request label Jan 22, 2021
@matze-dd
Copy link
Collaborator

Thank you for spotting this!

I'll add an extension module for LaTeX package circuitikz. It will ignore the environment. Are you aware of other important environments or macros that should be included?

Environment align(*) is handled by extension module amsmath. This should be loaded unless you pass option --packages with a package list not containing amsmath.
If this is not the case, could you please provide a minimum LaTeX example together with the arguments passed to yalafi.shell?

And yes, environment split(*) is missing. I'll add it.

@mfbehrens
Copy link
Contributor Author

Okay thank you, I didn't even know about the packages. However, I tried it again with the amsmath package.
python -m yalafi.shell --language=de-DE --server=my --packages=amsmath "C:\Users\mfbeh\aufg1.tex" --output html >> te.html
However I'm still getting many error messages:
image

@matze-dd matze-dd added the bug Something isn't working label Jan 23, 2021
@matze-dd
Copy link
Collaborator

The first three should be due to missing commas, see here, especially under this point. You can turn this parsing off with option --simple-equations.

The problems around double ampersands && seem to reveal a bug. I did not think of this case. Option --simple-equations will turn this off, too.

A question: Normally, amsmath should be loaded if you do not specify a --packages option; by default, then all modules are activated. Doesn't this work for you?

matze-dd added a commit that referenced this issue Jan 25, 2021
matze-dd added a commit that referenced this issue Jan 25, 2021
New package circuitikz; addresses #158
@matze-dd
Copy link
Collaborator

Package circuitikz has been added with PR #166.

Environment split(*) is only accepted by LaTeX inside of a displayed equation. It is therefore unnecessary to add it to package amsmath.

The problem with double ampersands && in displayed equations seems to be rather hard. I cannot promise to fix it very soon. As a work-around, you can use option --simple-equations or hide the ampersands to the filter with \LTskip{&&}.

@mfbehrens
Copy link
Contributor Author

Package circuitikz has been added with PR #166.

Thank you. This works for me!

Environment split(*) is only accepted by LaTeX inside of a displayed equation. It is therefore unnecessary to add it to package amsmath.

So do you mean that I have to put $$ around align and split. I looked at some tutorials on the internet and I didn't see many results where people were putting dollar signs around their align. Moreover, Greek letters which usually don't work without $$ are working inside split and align.

The problem with double ampersands && in displayed equations seems to be rather hard. I cannot promise to fix it very soon. As a work-around, you can use option --simple-equations or hide the ampersands to the filter with \LTskip{&&}.

Would be great if you could fix it, but we will see...

@matze-dd
Copy link
Collaborator

matze-dd commented Feb 3, 2021

Thank you. This works for me!

Excellent!

So do you mean that I have to put $$ around align and split.

No. This only concerns split. On my system, I get something like "split doesn't work here", if it is not in a displayed equation. The examples in the amsmath manual also surround split that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants