0

For my second volume of thesis, I added a mark on the odd pages to facilitate consultations in the volume.

I am not a great specialist in latex or tikz but initially I made boxes of 5.94 cm (297 cm / 5 part) which descends each of 5.94 cm to have part thumb that do not overlap.

However, for printing, I have to add printing marks and bleed. So I used the crop package to add these marks.

However, I encounter two problems which are probably linked

  • The north-east coordinate used by tikz takes into account the new page defined by the crop package. Suddenly, the box is not completely in the north east corner;
  • The box defined by tikz does not protrude above to have a bleed. At first I thought I would use yshift, but this poses a problem for the size of my boxes which are no longer equal…

Do you have a solution for these two problems? I hope to have been clear, Thank you,

    \documentclass[a4paper,twoside,12pt,]{book}         

\usepackage{geometry}
\geometry{
    top=2.50cm,             
    bottom=2.50cm,              
    inner=2.50cm,               
    outer=2.50cm,               
    headheight=15pt
}

\usepackage{lipsum}         

\RequirePackage{polyglossia}
\setdefaultlanguage{french}

\newcommand*\parttitle{}
\let\origpart\part
\renewcommand*{\part}[2][]{%
    \ifx\\#1\\% optional argument not present?
    \origpart{#2}%
    \renewcommand*\parttitle{#2}%
    \else
    \origpart[#1]{#2}%
    \renewcommand*\parttitle{#1}%
    \fi
}

%%% Paramètre des entêtes
\RequirePackage{fancyhdr} 
\pagestyle{fancy} 
% Ces lignes permettent de mettre en minuscule. A placer avant les style
\renewcommand{\chaptermark}[1]{%
    \markboth{\chaptername 
        \ifnum\value{chapter}>0 %si chapitre* alors apparaît quand même a conditer de mettre \addcontentsline{toc}{chapter}{titre}\markboth{titre}{} apres le titre
        \ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.{}\ #1}}

% auxiliary counter
\newcounter{partshift}
\addtocounter{partshift}{-1}
\newcommand{\maxpart}{5}

\usepackage{tikzpagenodes}

%permet de mettre les parties dans le cartouche
\RequirePackage{tikz}
\usetikzlibrary{tikzmark,calc,arrows,shapes,decorations.pathreplacing,pgfplots.groupplots, matrix}
\tikzset{every picture/.style={remember picture}}

%paramètre des entêtes du corps du texte
\fancypagestyle{stylevol2}{%
    \fancyhf{}%on vide l'en-tête
    \fancyhead[EC]{\nouppercase{\emph\leftmark}}
    \fancyhead[OC]{\nouppercase{\emph\rightmark}}
    \fancyfoot[LE,RO]{\emph{\textendash\space\thepage\space\textendash}} %met le numéro de page en bas 
    \fancyhead[RO]{%permet de mettre les parties dans le cartouche
        \begin{tikzpicture}[overlay, remember picture]%
        \node[
        fill=gray, 
        minimum height=5.94cm,
        text width=5.94cm,
        outer sep=-1mm,
        text width=1.85cm,
        align=left,
        anchor=north east,
        minimum height=5.94cm,
        ]
        at ($(current page.north east) + (0  mm, -5.94*\thepartshift cm) $)
        {\rotatebox{90}{\parbox{5.94cm}{%
                    \centering\textcolor{white}{\large\bfseries\thepart\space\textendash\space\parttitle}}}};
        \end{tikzpicture}
        \renewcommand{\headrulewidth}{0.5pt}
        \renewcommand{\footrulewidth}{0pt}
        \addtolength{\headheight}{0.5pt} 
}}

\addto\captionsfrench{\renewcommand{\partname}{Partie}}
%permet de mettre chiffre romain pour partie 
\setmainlanguage{french}
\addto\captionsfrench{\renewcommand*{\thepart}{\Roman{part}}}

\renewcommand\thepart{\Roman{part}}

\usepackage[
a4,
width=224mm, 
height=311mm,
noinfo,
cam,
cross,
center,
]{crop}


\begin{document}
    \pagestyle{stylevol2}
    \part{The First Part}
    \stepcounter{partshift} 
    \lipsum
    \lipsum
    
    \part{The Second Part}
    \stepcounter{partshift}
    \lipsum
    \lipsum
    
    \part{The Third Part}
    \stepcounter{partshift}
    \lipsum
    \lipsum
    
    \part{The Fourth Part}
    \stepcounter{partshift}
    \lipsum
    \lipsum
    
    \part{The Last Part}
    \stepcounter{partshift}
    \lipsum
    \lipsum
    
    
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.