I have an article class with multiple sections. I would like to include more values in TOC, beside just the title of the section, in a table representation. For better understanding: it will be a song book, where the section does not have a "title", but "song title" and "interpret". The following ssce shows what I mean:
\documentclass{article}
\begin{document}
\tableofcontents
\section[FIRST VALUE - SECOND VALUE]{FIRST VALUE}{test1}
\section[FIRST - VALUE - WITH - HYPEN - STILL SECOND VALUE]{FIRST - VALUE - WITH - HYPEN}{test2}
\section[FIRST - VALUE - WITH - HYPEN - ALSO SECOND VALUE - WITH HYPEN]{FIRST - VALUE - WITH - HYPEN}{test3}
\section*{Expected TOC}{
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{1}{|c|}{\textbf{\#}} & \multicolumn{1}{c|}{\textbf{Title}} & \multicolumn{1}{c|}{\textbf{Interpret}} \\ \hline
1 & FIRST VALUE & SECOND VALUE \\ \hline
2 & FIRST - VALUE - WITH - HYPEN & STILL SECOND VALUE \\ \hline
3 & FIRST - VALUE - WITH - HYPEN & ALSO SECOND VALUE - WITH HYPEN \\ \hline
\end{tabular}
}
\end{document}
generates:
Based on the sections I try to create the result from "Expected TOC". But unfortunatly I am not able to find any help online. I assume I am using wrong buzzwords for it. Can anyone point in the right direction to look at? Since I am using leadsheet package for the chord notation I am limited to "section" usage.
Here is an example of more real scenario:
\documentclass{article}
\usepackage{leadsheets}
\usepackage{array}
\definesongtitletemplate{title}{
\ifsongmeasuring {
\section*
}{
\section[\songproperty{title}\hfill\songproperty{interpret}]{\songproperty{title}}
}
\footnotesize{\GetTranslation{leadsheets/interpret}}
}
\setleadsheets{title-template = title}
\begin{document}
\tableofcontents
\begin{song}{title={Song 1}, interpret={Author 1}}
\begin{verse}
Mary had a little lamb \\
Its fleece was white as snow, yea \\
\end{verse}
\end{song}
\begin{song}{title={Song 2}, interpret={Auth fdsa fdsa fdsa fdsafsor 2}}
\begin{verse}
Mary had a little lamb \\
Its fleece was white as snow, yea \\
\end{verse}
\end{song}
\begin{song}{title={Song fdsa fdsa fdsa fdsa fdas 3}, interpret={Author 3}}
\begin{verse}
Mary had a little lamb \\
Its fleece was white as snow, yea \\
\end{verse}
\end{song}
\end{document}
The section title contains \hfill between the values, but it makes the song title left aligned and the interpret right aligned.
leadsheets
information seems quite relevant. It's a complex package (or class) that can do a lot of things, so you may want to edit your question to show a minimal example using it rather than the one you've shown us here.tabular
template, and then simply add the relevant information you want to the\section
code. E.g.\section[\songproperty{title}\hfill\songproperty{music}]{\songproperty{title}}