## LaTeX forum ⇒ Text Formatting ⇒ Pagenumbering in textblock Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
hirscsil
Posts: 2
Joined: Sun Jan 07, 2018 12:42 pm

### Pagenumbering in textblock

Dear Members

As this is my first post in this forum, I don't know if I post it in the correct category. So if not, I'm sorry

Right now I'm writing summaries for the final exams in latex, and since I have three columns and almost no margin, I can't and don't want to use headers or footers.
Because of that I wanted to print the pagenumber in a textblock which works actually quite nice. But the problem is, that the page always starts at page 2 with number one, but of course in the table of content the fist page is actually the one where also the table of content is contained.

I tried many things like putting
\setcounter{page}{1}
on different places but it still didn't work.

This is the code I use right now (shortened). I include my single chapters with the
\input{document}
command, but the error is also visible with the blinddocument.

What i actually want: starting the pagenumbering at the very first page, that the pagenumbers in the table of content are consistant with the pages containing the section.

\documentclass[landscape,a4paper,fontsize=8pt]{scrartcl}\usepackage[dvipsnames]{xcolor}\usepackage[ngerman]{babel} \usepackage{amsmath,color}\usepackage{amssymb}\usepackage{helvet}\usepackage{fancyhdr}\usepackage{blindtext} % To generate the box with the pagenumter\usepackage{atbegshi}\usepackage[absolute,overlay]{textpos}  \usepackage[a4paper, left=0.5cm, right=0.5cm, top=0.3cm, bottom=0.3cm]{geometry}\usepackage{flowfram}  % Three columns\Ncolumninarea{3}{\textwidth}{\textheight}{0pt}{0pt}\insertvrule{flow}{1}{flow}{2}\insertvrule{flow}{2}{flow}{3}  % Generate the textblock with the pagenumber\TPGrid{8}{11}\AtBeginShipout{	\begin{textblock}{3}(7.85,10.7)		\footnotesize		\texttt{\colorbox{Salmon}{\textbf{\thepage}}}	\end{textblock}%} \begin{document} 	\fontsize{8pt}{3pt}\selectfont	\begin{center}		\noindent		{\scshape\Large Topic  \\}		{\scshape\large Name, Class  \\}	\end{center} 	\tableofcontents 	%\input{doc1}	%\input{doc2}	%\input{doc3} 	\Blinddocument \end{document}

Kind regards and thank you in advance
hirscsil

Tags:

Stefan Kottwitz
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm
Hi hirscsil,

welcome to the forum!

Quick fix:

\AtBeginShipout{%  \begin{textblock}{3}(7.85,10.7)%    \footnotesize\stepcounter{page}%    \texttt{\colorbox{Salmon}{\textbf{\thepage}}}%    \addtocounter{page}{-1}%  \end{textblock}%}

I guess at "begin shipout time" the page counter was not yet incremented.

Stefan

hirscsil
Posts: 2
Joined: Sun Jan 07, 2018 12:42 pm
Stefan Kottwitz wrote:Hi hirscsil,

welcome to the forum!

Quick fix:

\AtBeginShipout{%  \begin{textblock}{3}(7.85,10.7)%    \footnotesize\stepcounter{page}%    \texttt{\colorbox{Salmon}{\textbf{\thepage}}}%    \addtocounter{page}{-1}%  \end{textblock}%}

I guess at "begin shipout time" the page counter was not yet incremented.

Stefan

Hi Stefan

Oh wow, that was a quick response and works perfectly. Thank you very much.

hirscsil