4

after years of reading TeX.SX, I registered to ask my first question :-)).

I’m a teacher, and I want to leave an almost blank page after each page of a document, for my students to take notes. I’ve read related questions such as : Add blank/empty page after every page automatically or inserting an image after every page, but I have two particular needs :

  1. the « blank » page that I want is not really blank, as I want a vertical line in the middle (I’m in landscape format) ;
  2. I don’t want such a « blank » page after the very first page of the document, as it is only the title and table of contents.

Until now, I used to compile without those pages, and afterwards to use a pdf utility (such as pdfsam) to insert my « blank » pages, but it took me a few minutes each time, making it uneasy to correct later a few things. I’d like to be able to insert the pages automatically during the compiling process, only I haven’t been able to do it so far — I’m a little confused with the atbegshi package, I think I don’t really understand some of the commands, what do I have the right to do or not.

After a few hours of struggling (and reading TeX.SX…), below is what I’ve been able to do — but all my attempts for centering the line, horizontally and vertically, have failed… I suppose it isn’t that hard, but I don’t know how to do it. (Also, I haven’t been able to use xsavebox as recommanded in How to make a tikz picture appear on every page of document — I get an error when I try to compile the example…)

If anyone have a suggestion… that would be great!

Benjamin

p.-s. : I use the paracol package, I don’t know if it’s disturbing atbegshi or not.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt,a4paper,oneside,landscape,xetex]{book}

\usepackage{fontspec,xunicode,xltxtra}
\usepackage{paracol}
\usepackage{titletoc}
\usepackage{geometry}

\geometry{a4paper,landscape,%
        vmarginratio=1:2, hmarginratio=1:1, %
        body={630pt,450pt},%
        foot=4\baselineskip,%
        %nofoot,
        headheight=22pt%
    }
\setlength\columnsep {70 pt}

\usepackage{atbegshi}
\usepackage{tikz}
\usepackage{kantlipsum}

\begin{document}

\chapter{Logique, ensemble, raisonnements}

\bigskip

\startcontents
\printcontents{}{1}{}
\thispagestyle{empty}

\newpage

\AtBeginShipout{%
  \begingroup
    \let\protect\noexpand
    \AtBeginShipoutOriginalShipout
    \box\AtBeginShipoutBox
    \AtBeginShipoutOriginalShipout
    \hbox{
      \begin{tikzpicture}
  \node [line, fill, minimum width=1pt, minimum height=19cm] (box) {};
      \end{tikzpicture}
    }
  \endgroup
  \AtBeginShipoutDiscard
}


\section{Logique propositionnelle}

\begin{paracol}{2}

\switchcolumn[0]*[\subsection{propositions}]

\kant[1-3]

\switchcolumn[1]

\kant[4-5]

\end{paracol}

\stopcontents

\end{document}

1 Answers1

1

This is a version using TeX primitives to draw the line:

The primary idea: The width and height of the page is availale as \paperwidth, \paperheight. You have to use these to make your box large enough, then you can use \vfil/\hfil for centering. Also the shipout box starts at coordinates 1in/1in, so if you want to fill the entire page you have to counteract this displacement.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt,a4paper,oneside,landscape,xetex]{book}

\usepackage{fontspec,xunicode,xltxtra}
\usepackage{paracol}
\usepackage{titletoc}
\usepackage{geometry}

\geometry{a4paper,landscape,%
        vmarginratio=1:2, hmarginratio=1:1, %
        body={630pt,450pt},%
        foot=4\baselineskip,%
        %nofoot,
        headheight=22pt%
    }
\setlength\columnsep {70 pt}

\usepackage{atbegshi}
\usepackage{tikz}
\usepackage{kantlipsum}

\begin{document}

\chapter{Logique, ensemble, raisonnements}

\bigskip

\startcontents
\printcontents{}{1}{}
\thispagestyle{empty}

\newpage

\AtBeginShipout{%
  \begingroup
    \let\protect\noexpand
    \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
    \AtBeginShipoutOriginalShipout\vbox{
      \vskip-1in
      \moveleft1in\hbox to\paperwidth{\hfil\vrule width 1pt height\paperheight\hfil}
    }
  \endgroup
  \AtBeginShipoutDiscard
}


\section{Logique propositionnelle}

\begin{paracol}{2}

\switchcolumn[0]*[\subsection{propositions}]

\kant[1-3]

\switchcolumn[1]

\kant[4-5]

\end{paracol}

\stopcontents

\end{document}

enter image description here