latexdiff icon indicating copy to clipboard operation
latexdiff copied to clipboard

Add config option to provide names for lstinline-like commands

Open jprotze opened this issue 7 years ago • 4 comments

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 avatar Nov 10 '17 09:11 jprotze

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 avatar Nov 10 '17 12:11 jprotze

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.

jprotze avatar Nov 10 '17 12:11 jprotze

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.

ftilmann avatar Dec 04 '17 22:12 ftilmann

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.

jprotze avatar Feb 26 '18 18:02 jprotze