LATEXREVISE(1)

๐Ÿ’– LATEXREVISE(1) โ€” the manual page, but make it cute โœจ

okay so bestie, welcome to latexrevise, section 1 of the manual pages. it's giving "quietly powerful little cleanup tool" and honestly? we're obsessed. ๐Ÿซถ


โœจ NAME โœจ

latexrevise โ€” selectively remove markup and text from latexdiff output. no cap, that's the whole job description. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

like. that's it. that's the whole vibe. ๐Ÿ˜Œ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so latexrevise reads a file called diff.tex (which is the output of latexdiff, obviously, the whole family tree iykyk) and it removes the markup commands. if you don't hand it a filename, it just reads from standard input instead. lowkey flexible of it. ๐Ÿ’

the command can run in ACCEPT mode, DECLINE mode, or SIMPLIFY mode โ€” or it can be used to remove user-defined latex commands from the input (peep -c, -e, -m, and -n below, bestie, don't skip them).

  • ACCEPT mode โ€” all appended text fragments (or preamble lines) are kept, and all discarded text fragments (or preamble lines) get deleted. bye. ๐Ÿ’€
  • DECLINE mode โ€” flip it: all discarded text fragments are kept, and all appended text fragments are deleted. ๐Ÿชฆ

now, if you want to keep some changes, you gotta edit the diff.tex file in advance and manually remove those tokens which would otherwise be deleted. it does not read your mind, bestie. ๐Ÿ˜ญ

heads up: latexrevise only pays attention to the "\DIFaddbegin", "\DIFaddend", "\DIFdelbegin", and "\DIFdelend" tokens and the corresponding FL varieties. that's the whole guest list.

all "\DIFadd" and "\DIFdel" commands (but not their contents) are simply deleted. the commands that latexdiff added to the preamble are also removed. ๐Ÿงนโœจ

in SIMPLIFY mode, the "\DIFaddbegin, \DIFaddend, \DIFdelbegin, \DIFdelend" tokens and their corresponding "FL" varieties are kept but all other markup (e.g. "DIFadd" and <\DIFdel>) is removed. fair warning: the result will not in general be valid latex-code โ€” but it will be easier to read and edit while you get ready for a subsequent run in ACCEPT or DECLINE mode. it's giving โœจrough draft energyโœจ.

in SIMPLIFY mode the preamble is left unmodified. untouched. pristine. we respect her boundaries. ๐Ÿ™ˆ

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -a or --accept โ€” run in ACCEPT mode (delete all blocks marked by "\DIFdelbegin" and "\DIFdelend"). ๐Ÿ—‘๏ธ
  • -d or --decline โ€” run in DECLINE mode (delete all blocks marked by "\DIFaddbegin" and "\DIFaddend"). ๐Ÿ—‘๏ธ
  • -s or --simplify โ€” run in SIMPLIFY mode (keep all "\DIFaddbegin", "\DIFaddend", "\DIFdelbegin", "\DIFdelend" tokens, but remove all other latexdiff markup from body). ๐Ÿงผ
ok so the three mode options are mutually exclusive, bestie. pick ONE. you cannot have all three. that's not how this works. ๐Ÿ’€

if no mode option is given, latexrevise simply removes user annotations and markup according to the following four options. and honestly? these functions can be very useful outside the latexdiff context, too. they're not just side characters, they're main characters. ๐Ÿ‘‘

  • -c cmd or --comment=cmd โ€” remove "\cmd{...}" sequences. "cmd" is supposed to mark some explicit annotations which should be removed from the file before release. so like, the notes you left for yourself that absolutely cannot go out into the world. ๐Ÿซฃ
  • -e envir or --comment-environment=envir โ€” remove explicit annotation environments from the text, i.e. remove these blocks:
\begin{envir}
...
\end{envir}

whole thing. gone. ๐Ÿงš

  • -m cmd or --markup=cmd โ€” remove the markup command "\cmd" but leave its argument, i.e. turn "\cmd{abc}" into "abc". the wrapper leaves, the filling stays. iconic behaviour tbh. ๐Ÿ“
  • -n envir or --markup-environment=envir โ€” similarly, remove "\begin{envir}" and "\end{envir}" commands but leave content of the environment in the text. same energy, different costume. ๐ŸŽ€
  • -r cmd or --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". one argument survives. the other one... didn't make it. ๐Ÿ˜ญ
  • -V or --verbose โ€” verbose output. she will talk. ๐Ÿ—ฃ๏ธ
  • -q or --no-warnings โ€” do not warn users about "\DIDadd{..}" or "\DIFdel{..}" statements which should have been removed already. (yes, DIDadd, that's exactly how it's spelled in the manual, don't come for me, i'm just the messenger ๐Ÿ’€)

๐Ÿ’€ BUGS ๐Ÿ’€

ngl bestie, 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. she's doing her best but she's been through a lot. ๐Ÿ˜ญ

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). ๐Ÿ“ฎ

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. yes, we need the receipts. all of them. ๐Ÿงพ

โš ๏ธ also note: latexrevise gets confused by commented "\begin{document}" or "\end{document}" statements. so. don't do that. or do, but know she's gonna spiral. ๐Ÿ™ˆ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

latexdiff

(that's it. that's the whole list. the origin story. the mothership. ๐Ÿ›ธ)


๐Ÿงš 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, no "but have you installed..." โ€” she's self-sufficient. ๐Ÿ’…


๐Ÿ‘‘ 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. slay, legally. ๐Ÿ“œโœจ


and that's the whole page, bestie!! ๐ŸŽ€ this was perl v5.34.0, dated 2021-12-27, and you've been reading LATEXREVISE(1). go forth and revise your latex. periodt. ๐Ÿ’–๐Ÿฆ‹๐ŸŒธ

๐Ÿ“ฆ where this page comes from