Skip to main content

New answers tagged

1 vote

Removing comments in a block of text whilst editing

I had the same problem and wrote a small javascript to simplify the workflow. It splits the LaTeX into lines, removes trailing whitespaces and checks if the line (without trailing whitespaces) begins ...
lifezbeautiful's user avatar
2 votes

Command for ignoring all upcoming lines in tex

Not sure if this is what you want, but you can enclose any portion of code between \iffalse and \fi to ignore. \documentclass{article} \begin{document} para1 para2 \iffalse para3 para4 \fi ...
Sandy G's user avatar
  • 46.5k
3 votes

Command for ignoring all upcoming lines in tex

This seems to work; stops after the third paragraph: \documentclass{article} % define the paragraph after which to stop \newcommand\stopAfterPar{3} \newcount\myParCnt \def\forcedEnd{\fi\end{document}...
AlexG's user avatar
  • 55.2k
6 votes
Accepted

Why the % symbol comments also the leading spaces after the newline?

Assuming normal catcodes and \endlinechar, an end of line is a space, and spaces at the beginning of a line are always ignored whether or not there is a comment on the previous line. Consider \...
David Carlisle's user avatar
0 votes

Why the % symbol comments also the leading spaces after the newline?

As to your main question: leading spaces and multiple spaces are ignored by TeX, regardless of preceding comments. In other words: having one, many or no spaces before "bar" on a new line ...
Jonas Zaugg's user avatar

Top 50 recent answers are included