Page LayoutCrossing out an entire page.

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
betonkalle
Posts: 3
Joined: Mon Sep 07, 2009 7:10 pm

Crossing out an entire page.

Post by betonkalle »

Hallo @ all,


I'm currently facing the following problem: I want to submit a 35-page document, out of which ~ 15 pages, i.e. one entire chapter, will be irrelevant. But instead of deleting the text, I prefer to mark it as irrelevant. My first thought was to cross out every page/paragraph with a thin diagonal line. Does anyone know how to do this? Neither google nor the forum search engine were helpful.

If that is not possible, does anyone have a suggestion how I could mark the text?

Greetings

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Crossing out an entire page.

Post by localghost »

betonkalle wrote:[...] If that is not possible, does anyone have a suggestion how I could mark the text? [...]
At the moment I have no idea how to mark pages as desired. As an alternative you could change the text color to let the text appear faded. The following example may be a first approach.

Code: Select all

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{xcolor} 
\usepackage{blindtext}

\begin{document}
  \blinddocument
  \textcolor{gray!15}
  \blinddocument
  \normalcolor
  \blinddocument
\end{document}
I will search a little bit for a solution that comes closer to your wishes. But that may take some time.


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Crossing out an entire page.

Post by Stefan Kottwitz »

Hi,
betonkalle wrote:But instead of deleting the text, I prefer to mark it as irrelevant. My first thought was to cross out every page/paragraph with a thin diagonal line.
this could be done using TikZ and the current page node, here's a compilable example:

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{tikz}
\begin{document}
\blindtext[5]
\clearpage
\begin{tikzpicture}[remember picture, overlay]
  \color{gray}
  \draw[line width=1ex] (current page.north west) --
                        (current page.south east);
  \draw[line width=1ex] (current page.north east) --
                        (current page.south west);
\end{tikzpicture}
\blindtext[8]
\end{document}
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Crossing out an entire page.

Post by localghost »

With his post Stefan ended my research as I would have offered the same alternative. It should be remarked that his solution works best with A4 paper size. On letter paper the lines appear shifted vertically.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Crossing out an entire page.

Post by Stefan Kottwitz »

Hi Thorsten,
localghost wrote:On letter paper the lines appear shifted vertically.
interesting. Could you show that by an example? I've just tested it with letterpaper but did not notice a shifting.

Stefan
LaTeX.org admin
betonkalle
Posts: 3
Joined: Mon Sep 07, 2009 7:10 pm

Re: Crossing out an entire page.

Post by betonkalle »

Thanks for the code localghost!

Your code works, but I would have to enter it for every single page. While that would certainly be feasible, I would be easier to draw a line across every page with a simple pdf editor. I guess my unfulfilled hope was to find some code which would fit neatly into the fancy pagestyle environment, so that I don't have to care about the actual placement of the text.

The easiest solution seems to be to use a different color.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Crossing out an entire page.

Post by gmedina »

Using the titlesec package you can easily define a page style to be used for the pages that need a special treatment; here's an example using this package and a modified version of the code provided by Stefan_K:

Code: Select all

\documentclass{article}
\usepackage[pagestyles]{titlesec}
\usepackage{tikz}
\usepackage{lipsum}% just to automatically generate some text

\newpagestyle{mypage}{\sethead{}
  {\begin{tikzpicture}[remember picture,overlay]
      \node [rotate=60,scale=8,text opacity=0.2]
      at (current page.center) {Ignore this page};
    \end{tikzpicture}}{}}

\begin{document}

\lipsum[1-6]
\clearpage
{\pagestyle{mypage}
\lipsum[1-20]}
\clearpage
\lipsum[1-6]

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Crossing out an entire page.

Post by localghost »

Stefan_K wrote:[...] Could you show that by an example? I've just tested it with letterpaper but did not notice a shifting. [...]
I should stop relying on on-line compilers that seem not to be up-to-date with their installation. Compiling on my system the code works properly. See the attached file for the improper output.
Attachments
olatex_121426.pdf
Improper output with pgf/tikZ version 1.18 from an on-line compiler.
(17.08 KiB) Downloaded 299 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Crossing out an entire page.

Post by Stefan Kottwitz »

Here's an extension of my code above using fancyhdr and introducing a macro causing a crossed-out page style. Once called it could cross out a complete chapter, here 14 pages out of 30:

Code: Select all

\documentclass{book}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{fancyhdr}
\newcommand*\CrossedOutPagestyle{%
  \chead{\begin{tikzpicture}[remember picture, overlay]
    \color{gray}
    \draw[line width=1ex] (current page.north west) --
                          (current page.south east);
    \draw[line width=1ex] (current page.north east) --
                          (current page.south west);
  \end{tikzpicture}}}
\newcommand*\NormalPagestyle{%
  \chead{}}
\fancyhf{}
\renewcommand*\headrulewidth{0pt}
\pagestyle{fancy}
\fancypagestyle{plain}{}
\begin{document}
\blindtext[7]
\clearpage
\CrossedOutPagestyle
\Blinddocument
\clearpage
\NormalPagestyle
\Blinddocument
\end{document}
Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Crossing out an entire page.

Post by Stefan Kottwitz »

Hi Thorsten,
localghost wrote: See the attached file for the improper output.
of course I believed that it could happen, I was just interested in finding the reason why. But an online compiler could hardly be examined.

Stefan
LaTeX.org admin
Post Reply