I want to create a dashed line for the complete document that should begin after the margin (in my example I set it 3cm towards the left edge of the paper). I found this post and tried to use it for my code by replacing the rule with dashrule, but he tells me that there is the following error including it:
Missing number, treated as zero. \lipsum[1-10]
Missing number, treated as zero. \lettergroup{\begin{turn}{270} B \end{turn}}
Missing number, treated as zero. \lettergroup{C}
Missing number, treated as zero. \lettergroup{D}
Missing number, treated as zero. \lettergroup{E}
Missing number, treated as zero. \lettergroup{F}
Missing number, treated as zero. \lettergroup{G}
Missing number, treated as zero. \end{document}
usage of obsolete package!(scrpage2) Package `scrpage2' is obsolete.
seems you are using a constant headheight.
Font shape `OT1/cmss/bx/sl' undefined(Font) using `OT1/cmss/bx/n' instead
Some font shapes were not available, defaults substituted.
Label(s) may have changed. Rerun to get cross-references right.
Sadly I have no idea what TeX tries to tell me with that error.
This is what I inserted (when it starts failing):
% everypage
\usepackage{everypage}
\usepackage[absolute]{textpos}
\usepackage{dashrule}
% for some blindtext
\usepackage{lipsum}
\begin{document}
\AddEverypageHook{
\ifnum\thepage>1
\begin{textblock}{1,21}(3.5,7)
\hdashrule[0.5ex]{0.2pt}{\pageheigth}
\end{textblock}
\fi
}
%This part usually works but fails as I insert the code above
\lettergroup{\begin{turn}{270} A \end{turn}}
\section{A}
\lipsum[1-10]
The complete code:
\documentclass[a4paper]{article}
\usepackage[
%bindingoffset=0.2in,%
left=3cm,right=3cm,top=3cm,bottom=3cm,%
footskip=.25in]{geometry}
% load TikZ to draw the boxes
\usepackage{tikz}
\usetikzlibrary{calc}
% use scrpage2 or whatever you want to add
% the boxes to the header to make them appear
% on every page
\usepackage{scrpage2}
\pagestyle{scrheadings}
% rotation of letters for some cool styles
\usepackage{rotating}
% format colors
\usepackage{xcolor}
\definecolor{biffyellow}{RGB}{255,230,0}
\definecolor{pagebackground}{RGB}{243, 244, 239}%243, 239, 244}
%format page-background
\pagecolor{pagebackground}
% new counter to hold the current number of the
% letter to determine the vertical position
\newcounter{letternum}
% newcounter to set the number of thumbs fitting vertical
% and setting the height of a boxes
\newcounter{letterdiv}
\setcounter{letterdiv}{6}
% some margin settings
\newlength{\thumbtopmargin}
\setlength{\thumbtopmargin}{0.5cm}
\newlength{\thumbbottommargin}
\setlength{\thumbbottommargin}{0.5cm}
% calculate the box height by dividing the page height
\newlength{\thumbheight}
\pgfmathsetlength{\thumbheight}{%
(\paperheight-\thumbtopmargin-\thumbbottommargin)%
/%
\value{letterdiv}
}
% box width
\newlength{\thumbwidth}
\setlength{\thumbwidth}{1cm}
% style the boxes
\tikzset{
thumb/.style={
fill=biffyellow,
text=black,
minimum height=\thumbheight,
text width=\thumbwidth,
outer sep=0pt,
font=\sffamily\bfseries\Huge,
inner xsep=1.5em,
}
}
% create two new commands to make the thumbs
% that makes it easy to use them im different header elements,
% like in the plain and normal page style etc.
\newcommand{\evenpageletterthumb}[1]{%
% see pgfmanual.pdf for more information about this part
\begin{tikzpicture}[remember picture, overlay]
\node [thumb,align=left,anchor=north west,] at ($%
(current page.north west)-%
(0,{\thumbtopmargin+(\value{letternum}-1)*\thumbheight})%
$) {#1};
\end{tikzpicture}
}
\newcommand{\oddpageletterthumb}[1]{%
\begin{tikzpicture}[remember picture, overlay]
\node [thumb,align=right,anchor=north east,] at ($%
(current page.north east)-%
(0,{\thumbtopmargin+(\value{letternum}-1)*\thumbheight})%
$) {#1};
\end{tikzpicture}
}
% create a new command to set a new lettergroup
\newcommand{\lettergroup}[1]{%
% but I recommend to start a new page
\clearpage
% set a title (optional)
%{\Huge\bfseries\sffamily #1}\par\bigskip
% check if we reached the last vertical position and reset it
\ifnum\value{letternum}=\value{letterdiv}\relax
\setcounter{letternum}{0}%
\fi
% check if we reached the last vertical position and reset it
\ifnum\value{letternum}=\value{letterdiv}\relax
\setcounter{letternum}{0}%
\fi
\stepcounter{letternum}%
% use one head or foot element to put in the box
% it doesn't matter which you use since the box
% is positioned on the page absolutely
\lohead[\oddpageletterthumb{#1}]{\oddpageletterthumb{#1}}%
\lehead[\evenpageletterthumb{#1}]{\evenpageletterthumb{#1}}%
}
% customize sections format
\usepackage{titlesec}
\titleformat{\section}
{\Huge\bfseries\sffamily}
{\thesection}{1em}{}
%suppress page numbering
\pagenumbering{gobble}
%
%
% My routine starts here
%
%
% everypage
\usepackage{everypage}
\usepackage[absolute]{textpos}
\usepackage{dashrule}
% for some blindtext
\usepackage{lipsum}
\begin{document}
\AddEverypageHook{
\ifnum\thepage>1
\begin{textblock}{1,21}(3.5,7)
\hdashrule[0.5ex]{0.2pt}{\pageheigth}
\end{textblock}
\fi
}
\lettergroup{\begin{turn}{270} A \end{turn}}
\section{A}
\lipsum[1-10]
\lettergroup{\begin{turn}{270} B \end{turn}}
\lipsum[1]
\lettergroup{C}
\lipsum[1]
\lettergroup{D}
\lipsum[1]
\lettergroup{E}
\lipsum[1]
\lettergroup{F}
\lipsum[1]
\lettergroup{G}
\lipsum[1]
\end{document}

\hdashrulecommand which takes 3 mandatory arguments - not 2. And what is supposed to define\pageheight, once the spelling is corrected? And if you 'gobble' te page numbers, how do you expect TeX to evaluate a conditional which depends on the page number? – cfr Jul 01 '18 at 23:59textblockis wrong: first mandatory argument should be a dimension. – cfr Jul 02 '18 at 00:16