ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
529 stars 75 forks source link

Add config option to provide names for lstinline-like commands #126

Open jprotze opened 6 years ago

jprotze commented 6 years ago

This PR adds the possibility to configure customized lstinline-like commands/shortcuts. For something like: \newcommand\myJSsnippet{\lstinline[style=JavaScript,breaklines=true]} You would add this to the config: LSTINLINEENV=myJSsnippet

jprotze commented 6 years ago

If the comment changed, I have seen that in some cases the color-highlighting was added. With the first part of this replacement being in comment, the result would not compile.

I'm checking, whether L3088 is sufficient to catch all cases.

jprotze commented 6 years ago

For the restriction of lstinline to single line, I could not find something in the documentation. But my latex compiler complains with Package Listings Error: lstinline ended by EOL If I have a linebreak in the inline code. According to a test, \verb has the same limitation.

ftilmann commented 6 years ago

The full pull request patched latexdiff failed with testsuite/verbatim-{old,new}.tex so I cannot accept as is. I will look into this and isolate the actual commit causing this problem, as at least the adding of the config option should work smoothly and adds useful functionality but it will take a bit of time.

jprotze commented 6 years ago

We found that lstinline has poor performance and triples compile time for our pdf compared to verb or simply a command containing \detokenize. The latter is also compatible with \DIFdel.

Nevertheless, I could find the bug and can add the changes if this is still of interest.