Page Layout ⇒ Crossing out an entire page.
-
betonkalle
- Posts: 3
- Joined: Mon Sep 07, 2009 7:10 pm
Crossing out an entire page.
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- 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
\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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
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
\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}- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Crossing out an entire page.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
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
-
betonkalle
- Posts: 3
- Joined: Mon Sep 07, 2009 7:10 pm
Re: Crossing out an entire page.
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.
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}- 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 317 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
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 Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Crossing out an entire page.
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