34

I am co-authoring a piece of text, and I would like to indicate that in my opinion certain parts should be removed, by drawing a big red cross through that specific section. I have tried to work with tikz, but this usually ends up in procrastinating by exploring the awesomeness of Tikz.

What I need is being able to just add a line before and after the section needed to be discussed, such as:

\begin{cross}
    This text should be removed or discussed
\end{cross}

Is there a package that enables this?

Andra
  • 817
  • 7
  • 14
  • 1
    Have you seen changes package? A simple example is http://tex.stackexchange.com/questions/65453/track-changes-in-latex/65466#65466 – percusse Sep 27 '13 at 10:52
  • 4
    For American readers... the request means to draw a big red X through the specified text. – LarsH Sep 27 '13 at 15:36

5 Answers5

52

Here is a solution which allows page breaks:

\documentclass{article}
\usepackage{lipsum}
\usepackage[many]{tcolorbox}

\newtcolorbox{cross}{blank,breakable,parbox=false,
  overlay={\draw[red,line width=5pt] (interior.south west)--(interior.north east);
    \draw[red,line width=5pt] (interior.north west)--(interior.south east);}}

\begin{document}

\begin{cross}
\lipsum[1]
\end{cross}

\par\bigskip
Now a part that continues to the next page:
\par\bigskip

\begin{cross}
\lipsum[2-9]
\end{cross}

\end{document}

enter image description here

12

This will work only in a page.

\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\newcommand\tikzmark[1]{%
  \tikz[remember picture,overlay]\coordinate (#1) {};}
\newenvironment{cross}{%
\noindent\tikzmark{lbegin}\hfill \tikzmark{rbegin}
}{%
\par\noindent\tikzmark{lend}\hfill \tikzmark{rend}
\begin{tikzpicture}[overlay, remember picture]
    \draw[red,thick] (lbegin) -- (rend);
    \draw[red,thick] (rbegin) -- (lend);    
\end{tikzpicture}\par
}

\begin{document}
\lipsum[1]
%
\begin{cross}
    \lipsum[2]
\end{cross}

%
\lipsum[3-4]
\end{document}

enter image description here

5

Check out the changes package. Simply crossing out the text you want removed might be too little functionality. What if you have comments on why to remove certain text passages?

An example of how to use this package

Dohn Joe
  • 1,912
  • changes is great but, by default, it has problems with multi-paragraph text and equations. In principle it can be configured to use this solution if it can detect it is needed. For example, to make changes work on math mode, I have this code in my preamble \newcommand{\stkout}[1]{\ifmmode\cancel{#1}\else\sout{#1}\fi}. – alfC Dec 08 '18 at 03:40
5

With PSTricks.

\documentclass{article}

\usepackage{pst-node,lipsum}

\newsavebox\IBox
\newenvironment{criscross}{%
    \begin{lrbox}{\IBox}
    \begin{minipage}{\linewidth}
    \parindent=\xxx\relax
    \ignorespaces
}{%
    \end{minipage}
    \end{lrbox}
    \noindent
    \psDefBoxNodes{N}{\usebox\IBox}%
    \psline[linecolor=red](N:tl)(N:br)%
    \psline[linecolor=red](N:bl)(N:tr)%
    \ignorespacesafterend
}

\AtBeginDocument{\newlength\xxx\xxx=\parindent}

\begin{document}
\textcolor{red}{Don't be lukewarm! If you cannot be the best, be the worst!}
\lipsum[1]

\begin{criscross}
\lipsum[2-3]
\end{criscross}

\lipsum[4]
\end{document}

enter image description here

4

A big red cross might be a bit awkward-looking. Through a squarish paragraph it would look OK (as in Harish Kumar's answer, but what if the block spans a page break? Or is only 1 long line?

The ulem package provides \sout{} like strikethrough and \xout{} where a slash is overlaid on each character. Coloured versions can easily be created, according to the manual.

Chris H
  • 8,705