Crates.io | collclean |
lib.rs | collclean |
version | 0.4.2 |
source | src |
created_at | 2022-03-18 16:46:38.321928 |
updated_at | 2024-10-06 18:03:32.659227 |
description | Clean up collaboration commands in LaTeX files |
homepage | |
repository | https://github.com/Mountlex/collclean |
max_upload_size | |
id | 552784 |
size | 24,732 |
Consider a valid LaTeX file paper.tex
, where several parts are marked by collaborators using \alice
and \bob
:
Lorem ipsum \alice{dolor sit amet, consetetur \b \bob {sadipscing} elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.} At vero eos et accusam
et justo duo dolores et ea rebum.
\[
A = \min \{ B, \bob{C \} }
\]
% \alice{Lorem ipsum dolor sit amet
Stet clita kasd gubergren, \alice{no} sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus
est Lorem {ipsum dolor sit amet.}
To remove these commands and the corresponding brackets, run
collclean paper.tex alice bob
The file paper.tex
will then look like this:
Lorem ipsum dolor sit amet, consetetur \b sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
et justo duo dolores et ea rebum.
\[
A = \min \{ B, C \}
\]
% \alice{Lorem ipsum dolor sit amet
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus
est Lorem {ipsum dolor sit amet.}
-o output.tex
--dry
--from <line>
and --to <line>
. One-sided ranges are also supported.The command definitions (e.g. via \newcommand
) will not be removed.
Commented lines are ignored.
If the file is not valid, e.g., there are more opening brackets than closing brackets, the program stops and does not make changes.
After installing Rust, install collclean
via cargo
:
cargo install collclean