You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use remove-macros on the siunitx package commands (\SI and \si) because textidote rules sh:d:002 and sh:d:003 shouldn't apply here.
Here's my MWE:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{siunitx}
\begin{document}
\title{My Paper}
\maketitle
My units are units as \SI{1.7e16}{m^{-2}.s^{-1}}.
My other units are \SI{1.2e4}{m^2.s^{-1}}
\end{document}
I run the following command on the latest release v0.8.2:
java -jar textidote.jar --remove-macros SI --output html main.tex > report.html
The SI macro should be ignored right?
Here's the result:
Here's the command-line output:
TeXtidote v0.8.2 - A linter for LaTeX documents and others
(C) 2018-2021 Sylvain Hallé - All rights reserved
Found 2 warning(s)
Total analysis time: 0 second(s)
←[1;33m* L10C22-L10C45←[0m←[39m←[49m There should be a space after a period. If you are writing a
URL or a filename, use the \url{} or \verb markup. ←[2;33m[sh:d:002] ←[0m←[39m←[49m
←[1;37m My units are units as \SI{1.7e16}{m^{-2}.s^{-1}}.
←[1;31m^^^^^^^^^^^^^^^^^^^^^^^^←[0m←[39m←[49m
←[1;33m* L10C22-L10C43←[0m←[39m←[49m There should not be a space before the period at the end of a
sentence. ←[2;33m[sh:d:003] ←[0m←[39m←[49m
←[1;37m My units are units as \SI{1.7e16}{m^{-2}.s^{-1}}.
←[1;31m^^^^^^^^^^^^^^^^^^^^^^←[0m←[39m←[49m
Is this a bug?
The text was updated successfully, but these errors were encountered:
It is a "bug" or a "feature", depending on how you see it. ;-)
There are two issues here:
The \SI macro takes two arguments: \SI{foo}{bar}. TeXtidote has no way of knowing how many arguments are defined for a macro, and only removes the first, leaving {bar}.
Arguments contain nested pairs of curly brackets: \SI{foo{baz}}{b{a}r}. TeXidote cannot process sequences of TeX code that require finding matching brackets.
Which explains why the cleaned version of the text still contains parts of your macro call, resulting in the error message.
Fixing the issue would be a case of #56, so unfortunately I have to mark this (actual) bug as #wontfix.
Hi @sylvainhalle thanks for that great tool!
I would like to use remove-macros on the siunitx package commands (\SI and \si) because textidote rules sh:d:002 and sh:d:003 shouldn't apply here.
Here's my MWE:
I run the following command on the latest release v0.8.2:
java -jar textidote.jar --remove-macros SI --output html main.tex > report.html
The SI macro should be ignored right?
Here's the result:

Here's the command-line output:
Is this a bug?
The text was updated successfully, but these errors were encountered: