question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blank lines introduced by the `commands_to_delete` option

See original GitHub issue

If 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:

  1. 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}
  1. Compile test/test.tex (pdf1)
  2. Run the document through arxiv_latex_cleaner test --commands_to_delete \marginnote
  3. Compile test_arXiv/test.tex (pdf2)
  4. 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jponttusetcommented, Mar 30, 2021

Hi @tvercaut,

This should be fixed in v0.1.17, please reopen if you still find problems.

Best,

0reactions
jponttusetcommented, Mar 30, 2021

Updated doc in v0.1.19.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove blank rows in Microsoft Excel in 7 easy steps
How to remove blank rows in Excel · 1. Click the Home tab in the top menu bar of Excel. · 2. Click...
Read more >
How to remove blank lines in a file in Linux
Delete blank lines using the grep command​​ When used with the -v option, the grep command helps to remove blank lines.
Read more >
How to remove empty/blank lines from a file in Unix (including ...
Simple solution is by using grep (GNU or BSD) command as below. Remove blank lines (not including lines with spaces). grep . file.txt....
Read more >
9 Ways to Delete Blank Rows in Excel
We can select them all by pressing Ctrl + A. Then we can close the Find menu by pressing the Close button. Now...
Read more >
How to Remove Blank Lines Within Cells in Excel - YouTube
In this Excel tutorial for beginners, we'll learn to remove blank lines within cells in Excel. Line breaks are points where the line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found