LATEXREVISE(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ’… latexrevise (section 1) β€” the manual page, but make it make sense

okay bestie so you've got a latexdiff output file and it's giving chaos β€” markup everywhere, red and blue ghosts of every edit β€” and you just want it clean. that's what latexrevise is for. and hi, this is the latexrevise(1) page, section 1 of the manual, being retold with love πŸ’–


✨ NAME ✨

latexrevise β€” selectively remove markup and text from latexdiff output. that's it. that's the whole vibe. she removes things. on purpose. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

latexrevise [ OPTIONS ] [ diff.tex ] > revised.tex

🌸 DESCRIPTION 🌸

so latexrevise reads a file called diff.tex (which is the output of latexdiff, iykyk), and it removes the markup commands. if you don't give it a filename, it just reads from standard input β€” no pressure, no demands, she's flexible like that. πŸ’…

she can run in ACCEPT mode, DECLINE mode, or SIMPLIFY mode, or she can just remove your own user-defined latex commands from the input (see -c, -e, -m, and -n down below πŸ”½).

  • ACCEPT mode β€” all the appended text fragments (or preamble lines) are kept, and all the discarded text fragments (or preamble lines) get deleted. aka: keep the new stuff, yeet the old. βœ…
  • DECLINE mode β€” the opposite, periodt. all the discarded text fragments get kept, all the appended text fragments get deleted. πŸ—‘οΈ

now listen 🫢 β€” if you want to keep some changes, edit the diff.tex file in advance and manually remove those tokens that would otherwise get deleted. she's not a mind reader, she's a perl script.

key detail, don't skip this one: latexrevise only pays attention to the \DIFaddbegin, \DIFaddend, \DIFdelbegin, and \DIFdelend tokens and the corresponding FL varieties. all \DIFadd and \DIFdel commands (but not their contents) are simply deleted. the commands that latexdiff adds to the preamble are removed as well.

in SIMPLIFY mode, the \DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend tokens and their corresponding FL varieties are kept, but all other markup (like DIFadd and <\DIFdel>) is removed. heads up though 😭 β€” the result will not in general be valid latex-code, but it'll be way easier to read and edit in preparation for a later run in ACCEPT or DECLINE mode. in SIMPLIFY mode the preamble is left unmodified. lowkey iconic, honestly.


🧚 OPTIONS 🧚

  • -a, --accept β€” run in ACCEPT mode (delete all blocks marked by \DIFdelbegin and \DIFdelend). bye bye old text πŸ’¨
  • -d, --decline β€” run in DECLINE mode (delete all blocks marked by \DIFaddbegin and \DIFaddend). bye bye new text πŸ’¨
  • -s, --simplify β€” run in SIMPLIFY mode (keep all \DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend tokens, but remove all other latexdiff markup from the body). the ✨aesthetic✨ mode.
⚠️ not me reminding you: the three mode options are mutually exclusive. pick one. just one. please. πŸ™ˆ

if no mode option is given, latexrevise simply removes user annotations and markup according to these next four options. and ngl, these functions can be very useful outside the latexdiff context too πŸ‘‘

  • -c cmd, --comment=cmd β€” remove \cmd{...} sequences. cmd is supposed to mark some explicit annotations which should be removed from the file before release. (yes, your "TODO: fix this before submitting" notes. we see them. πŸ’€)
  • -e envir, --comment-environment=envir β€” remove explicit annotation environments from the text, i.e. remove these blocks:
\begin{envir}
...
\end{envir}
  • -m cmd, --markup=cmd β€” remove the markup command \cmd but leave its argument, i.e. turn \cmd{abc} into abc. the wrapper goes, the gift stays 🎁
  • -n envir, --markup-environment=envir β€” similarly, remove \begin{envir} and \end{envir} commands but leave the content of the environment in the text.
  • -r cmd, --replace=cmd β€” for constructions \\cmd{..}{..}, remove the command, leave the content of the first argument, and delete the second argument, i.e. turn \cmd{abc}{def} into abc. first arg is the main character, second arg didn't make the cut 🫢
  • -V, --verbose β€” verbose output. she'll narrate. πŸ—£οΈ
  • -q, --no-warnings β€” do not warn users about \DIDadd{..} or \DIFdel{..} statements which should have been removed already. shhh. silence. 🀫

πŸ’€ BUGS πŸ’€

okay so real talk. the current version is a beta version which has not yet been extensively tested. it has not been actively maintained so it might not process output of newer versions of latexdiff entirely correctly. no cap, that's literally what it says. 😭

please submit bug reports using the issue tracker of the github repository page https://github.com/ftilmann/latexdiff.git, or send them to tilmann -- AT -- gfz-potsdam.de. include the serial number of latexrevise (Option --version). πŸ›

and if you come across latexdiff output which is not processed correctly by latexrevise, please include the problem file as well as the old and new files on which it is based β€” ideally edited to only contain the offending passage, as long as that still reproduces the problem. basically: minimum reproducible example, bestie, we're begging πŸ™

also heads up: latexrevise gets confused by commented \begin{document} or \end{document} statements. yeah. she's confused. aren't we all πŸ’…

🌈 SEE ALSO 🌈

latexdiff β€” the one who started all of this.


⭐ PORTABILITY ⭐

latexrevise does not make use of external commands and thus should run on any platform supporting PERL v5 or higher. no dependencies, no drama, she just works ✨


πŸ‘‘ AUTHOR πŸ‘‘

Copyright (C) 2004 Frederik Tilmann

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 🫢


and that's the whole page, bestie!! go forth and revise your latex πŸ’– xoxo, latexrevise β€” brought to you by perl v5.38.2, dated 2024-11-17, dropping out of the LATEXREVISE(1) section like the icon she is πŸŽ€

πŸ“¦ where this page comes from