I want to hide something in a article. Hidden contents may be large enough to span muli-line multi-paragrph, and even muli-page.
I find a solution by mathspasha from How to replace a large block of text by an empty block of the same size? as the following code showes. It's simple and I like the idea(global switch and put hidden content to far left).
It works all fine except that text post \show begins a new paragraph. I wonder if something can be done to improve this solution to achieve a in-line phantom, I mean when hidden part finished, no new paragraph is created. Anyone can help me? Thanks.
CODE:
\documentclass{article}
\usepackage{lipsum}
\long\def\hide#1\show{%
\leavevmode\par
\hspace*{-10000pt}\vbox\bgroup#1\egroup
\par
}
\def\show{}
\begin{document}
Mark A
\hide
\lipsum[1-2]
\show
Mark B
And I hope the folowing two paragraphs have the same shape whet typeset.
|some text some text some text some text some text some text some text some text some text some text some text some text some text|
|some text \hide some text some text some text some text some text some text some text some text some text some text some \show text some text|
\end{document}
\par, so you have a new paragraph. However, also changing this will never work across pages. – campa Jun 15 '21 at 13:58\par. Then the code failed to work. So, how to improve it to phantom matters in-line and support multi-lines and multi-pages? – lyl Jun 15 '21 at 14:02\\\, or\linebreak) in hidden text. Any method to solve it? – lyl Jun 17 '21 at 12:20ulempackage instead ofcensor). Or as an alternaitve solution you can choose to not use\newlineat all and use\par(or empty lines) instead. – Marijn Jun 17 '21 at 12:49\par\noindentcreates a new paragraph without indentation. – Marijn Jun 18 '21 at 17:32\newlineand\par\noindent. And seems that this can not work withulinefrom packageulem. Any better way for this? – lyl Jun 19 '21 at 03:34