LATEXREVISE(1)
π 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:latexreviseonly pays attention to the\DIFaddbegin,\DIFaddend,\DIFdelbegin, and\DIFdelendtokens and the correspondingFLvarieties. all\DIFaddand\DIFdelcommands (but not their contents) are simply deleted. the commands thatlatexdiffadds 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\DIFdelbeginand\DIFdelend). bye bye old text π¨-d,--declineβ run in DECLINE mode (delete all blocks marked by\DIFaddbeginand\DIFaddend). bye bye new text π¨-s,--simplifyβ run in SIMPLIFY mode (keep all\DIFaddbegin,\DIFaddend,\DIFdelbegin,\DIFdelendtokens, but remove all otherlatexdiffmarkup 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 π
-ccmd,--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. π)-eenvir,--comment-environment=envir β remove explicit annotation environments from the text, i.e. remove these blocks:
\begin{envir}
...
\end{envir}
-mcmd,--markup=cmd β remove the markup command\cmdbut leave its argument, i.e. turn\cmd{abc}intoabc. the wrapper goes, the gift stays π-nenvir,--markup-environment=envir β similarly, remove\begin{envir}and\end{envir}commands but leave the content of the environment in the text.-rcmd,--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}intoabc. 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:latexrevisegets 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
- alpine 3.24: texmf-dist-binextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms