Blank lines introduced by the `commands_to_delete` option
See original GitHub issueIf a command to be deleted is on a single line in the latex source file, asking arxiv-latex-cleaner
to remove the command introduces a spurious blank line / line break / new paragraph.
Steps to reproduce:
- Create a latex document with the following content in
test/test.tex
:
\documentclass{article}
\usepackage{blindtext}
\usepackage{marginnote}
\begin{document}
\blindtext
\marginnote{Test}
\blindtext
\end{document}
- Compile
test/test.tex
(pdf1) - Run the document through
arxiv_latex_cleaner test --commands_to_delete \marginnote
- Compile
test_arXiv/test.tex
(pdf2) - Compare the results.
- pdf1 shows a single paragraph with a margin note
- pdf2 shows 2 paragraphs and no margin note.
Expected result:
- pdf2 should show a single paragraph and no margin note
Additional context
I am using “arxiv_latex_cleaner@v0.1.16” from a recent pip install
The documentation for commands_to_delete
is a bit confusing. Reding through the help message I understood the input folder argument should be placed at the end. I thus first tried calling
arxiv_latex_cleaner --commands_to_delete \marginnote test
but got an error message back
arxiv_latex_cleaner@v0.1.16: error: the following arguments are required: input_folder
For the record, in my current workflow I use the following piece of code in my latex source which works for me but is not very scalable:
% Comment out the next line if you do not want to show notes
\def\shownotes{} % set to true
\ifdefined\shownotes
\usepackage{marginnote}
\else
\newcommand{\marginnote}[1]{\ignorespaces}
\fi
Credit for the \ignorespaces
part: https://tex.stackexchange.com/a/201818
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Hi @tvercaut,
This should be fixed in v0.1.17, please reopen if you still find problems.
Best,
Updated doc in v0.1.19.