1

I'm making an aicraft checklist, it is a way for me to discover some Latex Functions.

So, the checklist is printed on an A4 sheet splitted in two columns thanks mulitcols package. The document is splitted in different chapter (normal checklist, emergency checklist,...). So, this seems to have a good beahavior.

Each column as a dedicated number (replace the page number) and this number is printed in the header of each columns. (Here too, I have the expected result, may be not by the best way)

I would like to do a dedicated TOC for each chapter: First page of the Normal Checklist will list the normal checklist procedure. The emergency chapter will have a list of the emergency procedures,... The Toc shall present the data like this: Checklist Name.......{col number}

But, unfortunately, after several tries with the tocloft packages, I didn't reuss to get what I want. The column number is not retrieved and displayed as expected (it starts from 0 instead of 3,... ) and the data are not well displayed. Furthermore, I don't know how to avoid the display of the Emergency checklist in the normal checklist ToC....

So, if you know how I can do it.

My code is on overleaf: https://www.overleaf.com/read/vjvjpfrryzvh

The \addcontentsline is defined row 236, in my checklist environment (I need to work on it in order to simplify the content and increase code readibility):

%add counter for each checklist created (not used, but in case...)
\refstepcounter{checklist}
%prepare the print of the TOC 
%TODO: correct the implantation in order to have 
%Cheklist name ...... colnumber
\phantomsection
\addcontentsline{cll}{figure}{\protect\numberline{\thecolumn}#1}\par
%Check list are printed as Table
\setlength{\tabcolsep}{0.5em} % for the horizontal padding
\begin{tabular}{p{\dimexpr \linewidth-2\tabcolsep}}
    \toprule
        \multicolumn{1}{c}{\textbf{\uppercase{#1}}}\\
    \midrule

The definition / computation of the column number is done in the \AddEverypageHook definition, row 76. I use this to generate the headers.

%3rd - add header above each pages.
%Even if not mandatory, we provide if for odd and even pages
\AddEverypageHook{\ifdim\columnwidth<\textwidth
  \ifodd\value{page}\rlap{\hspace{\oddsidemargin}%
      \raisebox{\dimexpr-\topmargin-\headheight}[0pt][0pt]%
      {\begin{minipage}[t]{\dimexpr2\linewidth+\columnsep }
        \begin{multicols*}{2}
        \begin{tabularx}{\linewidth}{|c|>{\setlength\hsize{1.8\hsize}}X|>{\setlength\hsize{0.2\hsize}}X|}
        \hline
        \large JA4032 & \centering \large \textbf{\leftmark} &  \large \stepcounter{column}\thecolumn \\
        \hline
        &   \multicolumn{1}{|c|}{\today} & \\ \hline
        \end{tabularx}
        \begin{tabularx}{\linewidth}{|c|>{\setlength\hsize{1.8\hsize}}X|>{\setlength\hsize{0.2\hsize}}X|}
        \hline
        \large JA4032 & \centering \large \textbf{\leftmark} & \large \stepcounter{column}\thecolumn \\
        \hline
        &   \multicolumn{1}{|c|}{\today} & \\
        \hline
        \end{tabularx}
        \end{multicols*}
        \end{minipage}}
        }
  \else\rlap{\hspace{\evensidemargin}%
      \raisebox{\dimexpr-\topmargin-\headheight}[0pt][0pt]%
      {\begin{minipage}[t]{\dimexpr2\linewidth+\columnsep }
        \begin{multicols*}{2}
        \begin{tabularx}{\linewidth}{|c|>{\setlength\hsize{1.8\hsize}}X|>{\setlength\hsize{0.2\hsize}}X|}
        \hline
        \large JA4032 & \centering \large \textbf{\leftmark} & \large \stepcounter{column}\thecolumn \\
        \hline
        &  \multicolumn{1}{|c|}{\today} & \\
        \hline
        \end{tabularx}
        \begin{tabularx}{\linewidth}{|c|>{\setlength\hsize{1.8\hsize}}X|>{\setlength\hsize{0.2\hsize}}X|}
       \hline
       \large JA4032 & \centering \large \textbf{\leftmark} & \large \stepcounter{column}\thecolumn \\
       \hline
       &   \multicolumn{1}{|c|}{\today} & \\
       \hline
       \end{tabularx}
       \end{multicols*}
       \end{minipage}}
       }
  \fi%
\fi}

And I define and use the tocloft package row 128.

%------------------------------------------------------
%Definition for the Table of contents
%TOC is printed in the first pages of a chapter (Normal Checlist, Emergency...
%TOC presents the name of the checklist and the column number where is set the checklist
%TODO: Correct the column number: printed column number is not the good one. 

%TODO: customize to print only the checklist items set in the current chapter
\usepackage{tocloft}
\newcommand{\listechecklistname}{Normal Checklist}
\newlistof{checklist}{cll}{\listechecklistname}

PS: Maybe the link to the overleaf project is not very efficient.. but it has the advantage to present the data in context..

Many thanks for the support

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.