-
Notifications
You must be signed in to change notification settings - Fork 27
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
commands with optional arguments do not get parsed correctly #108
Comments
Of course, not everything given in square brackets after a command is actually an optional argument (this is especially true in math mode). Perhaps it would be reasonable to square brackets as arguments if they are followed by a mandatory argument in curly braces? This should cover most uses of optional commands, without interfering (too much) with other uses of square brackets. |
Not sure if this is the same issue, but this code: \begin{lstlisting}[language=Python]
aaa
\end{lstlisting} parses as follows:
In particular, notice that the |
Even though often in math mode there can be Thus, in my opinion the best result would be to always recognize square bracket group behind a command name as its argument. Thoughts? |
If a command has no optional arguments, then an arbitrary number of arguments given in curly braces will be treated as children of the command.
However, if the command has optional arguments (in
[]
), then these, as well as any other arguments that come after, are not considered children of the command.This appears to be because the rule for
generic_command
does not allow for optional arguments.The text was updated successfully, but these errors were encountered: