After many years of reading other persons posts and 3 thesis written in latex, I finally post a question myself.
I have a document with blueprints (which are inlcluded as images or .pdf) organized in different chapters, so I have defined a custom "list of" in order to create a "Table of blueprints".
I can create the Table of Blueprints, and the blueprints themselves are included in it with no complication.
However, I´d also like to include in the Table of Blueprints the chapters under which the blueprints are, and for that purpouse I use the \addcontentsline command.
The problem is that in the Table of Bluepritns I can only get the chapter number (with \chaptername and \thechaper); I´ve tried to use \chaptermark but to no avail, as I get the following error:
Argument of \chaptermark has an extra }. ...{pln}{chapter}{\thechapter : \chaptermark}
Therefore I´ve resorted to a manual solution by typing the chapter title manually in the \addcontentsline command, but I´d like t know if there is a way to make it automatic.
These are some of the posts I´ve checked Add chapter headigns to list off... ; Include chapter headings in list of... ; automatic chapters in list of; I´ve tried following their code but I´m not certain where I have to look.
Here is my MWE:
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{titlesec,tocbibind,tocloft}
%
% List of Blueprints creation
\newcommand{\listplano}{{\huge \textbf{Table of blueprints}}}% custom list of blueprints
\newlistof{plano}{pln}{\listplano}% plano=blueprint in Spanish
\newcommand{\plano}[1]{% custom command to create a new blueprint
\refstepcounter{plano}% counter
\par\noindent\textbf{Plano \theplano. #1}% caption
\addcontentsline{pln}{plano}{\protect\numberline{\theplano}#1}\par}% add the blueprint to the list of blueprints
%
\begin{document}
%
\newpage
\tableofcontents
%
% List of blueprints
\newpage
\phantomsection
\addcontentsline{toc}{chapter}{Table of blueprints}% add an entry for the Table of blueprints to the ToC
\listofplano% print the list of blueprints
%
\chapter{Blueprints of Project X}
\addcontentsline{pln}{chapter}{\thechapter \, Blueprints of Project X}% add chapter to the list of blueprints; here is where I tried to use \chaptermark
\newpage
\plano{Project X - A}
Here I add the blueprint as an image or a pdf.
%
\chapter{Blueprints of Project Y}
\addcontentsline{pln}{chapter}{\thechapter \, Blueprints of Project Y}% add chapter to the list of blueprints
\newpage
\plano{Project Y - 1}
Here I add the blueprint as an image or a pdf.
%
\newpage
\plano{Project Y - 2}
Here I add the blueprint as an image or a pdf.
%
\end{document}
Thanks to anyone who may help. I´ve been consulting these forums for years and I´ve learned a lot from the community.