Page Layout ⇒ Crossing out an entire page.
-
- Posts: 3
- Joined: Mon Sep 07, 2009 7:10 pm
Crossing out an entire page.
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
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
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Crossing out an entire page.
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.betonkalle wrote:[...] If that is not possible, does anyone have a suggestion how I could mark the text? [...]
Code: Select all
Code, edit and compile here:
\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}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
Hi,
Stefan
this could be done using TikZ and the current page node, here's a compilable example: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.
Code: Select all
Code, edit and compile here:
\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}
LaTeX.org admin
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Crossing out an entire page.
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.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
Hi Thorsten,
Stefan
interesting. Could you show that by an example? I've just tested it with letterpaper but did not notice a shifting.localghost wrote:On letter paper the lines appear shifted vertically.
Stefan
LaTeX.org admin
-
- Posts: 3
- Joined: Mon Sep 07, 2009 7:10 pm
Re: Crossing out an entire page.
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.
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.
Crossing out an entire page.
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
Code, edit and compile here:
\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,...
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Crossing out an entire page.
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.Stefan_K wrote:[...] Could you show that by an example? I've just tested it with letterpaper but did not notice a shifting. [...]
- Attachments
-
- olatex_121426.pdf
- Improper output with pgf/tikZ version 1.18 from an on-line compiler.
- (17.08 KiB) Downloaded 302 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
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:
Stefan
Code: Select all
Code, edit and compile here:
\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}
LaTeX.org admin
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
Hi Thorsten,
Stefan
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.localghost wrote: See the attached file for the improper output.
Stefan
LaTeX.org admin