Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I look for a TeX package that could do the following, or anything close. I image the simpler use case as giving two text files of any kind as parameters :


and this command would compute a diff over these files and include into the produced document a visual rendering like:

diff example

with maybe the line number or any other useful information about it.

Does anyone know if such a TeX package exists?

share|improve this question
The simplest way would be to run diff on the files and use listings to include the result. You would have to define your own syntax highlighting scheme. –  Andrey Vihrov Sep 15 '11 at 11:15
Certainly the simplest if nothing else exists... not the most convenient to use though :-( –  Stéphane Péchard Sep 15 '11 at 12:59
The question title is misleading in a way that the question seems to be off topic. You might want to rephrase it so that your intent becomes more clear (somewhat in the direction of "Are there any LaTeX packages to compute/typeset the diff between two files?") –  Daniel Sep 15 '11 at 13:16
@Daniel: just did it, thanks for the suggestion –  Stéphane Péchard Sep 15 '11 at 13:25
Coding a diff tool in TeX would be overkill and not required. The only thing you could expect is a formatting package for the result of a diff output. Even for this an external tool might be better suited. –  Martin Scharrer Sep 15 '11 at 14:30
add comment

1 Answer

I would recommend external tools and implement them using shortcuts, scripts ... You can use Winmerge for it on windows. Similar tools exist for linux/unix.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.