Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR, arguments for unknown commands are preserved. This fixes #9.
Now inputs such as
\unknown{param}
yield the output\unknown{param}
where previously it produced\unknownparam
. The implementation treats all blocks that directly follow a unknown command as arguments to this command (e.g.\unknown{param}{param}
but\unknown{param} {not a param}
because of the space). This leads to false positives if in reality the unknown command excepts less arguments. For example, if\$
is not known to latex2unicode, then\${abc}
would still produce\${abc}
although in this case it would probably better to produce\$ abc
. I went for this implementation due to the following reasons:\command{block}{block}
in most cases mean that the command is invoked with two arguments. In latex, you almost never need to use brackets to group things. The only common exception are style commands like{\bf text}
- but since\bf
and co are deprecated and are supported by latex2unicode, this shouldn't be a big problem.\unknownparam
leads to confusion, while\unknown{param}
still lets the user infer the original meaning).