1

I have a problem with \listoftables command.

\listoftables gets data from \captions and displays it in the table list. Is it possible for \listoftables to retrieve text from another command?

Example:

\documentclass[a4paper,12pt, twoside]{article}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{table}
\caption{Very long caption.} \label{tab:sometab}
\centering
\begin{tabular}{|c|c|}
\hline
Hi & I \\
Need & Help \\
\hline
\end{tabular}
\end{table}

\end{document}

In \listoftables I don't want "Very long caption" but I want to have something else, for example: "Short caption".

  • Because I write my master thesis and very long caption in \listoftables looks very ugly and I want to shorten it but i don't want interfere in caption in table. – Wierszokleta Mar 17 at 16:42
  • 1
    Have you tried \caption[short caption]{Very long caption.}? – Mensch Mar 17 at 16:42
  • It's working. Thanks. But do you know how can I remove subcaption from \listoftables? – Wierszokleta Mar 17 at 16:46
  • 1
    Please ask a new question about subcaption and add an MWE showing the issue you get ant want to solve. – Mensch Mar 17 at 16:50
  • One can also add text to the LOT using \addtocontents{lot}{text}. This is used, for example, to add extra space between chapters. – John Kormylo Mar 18 at 16:42
1

Just add option [short caption] to your used \caption command.

Complete MWE

\documentclass[a4paper,12pt, twoside]{article}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\listoftables % <=======================================================

\begin{table}
\caption[short caption]{Very long caption.} \label{tab:sometab} % <=====
\centering
\begin{tabular}{|c|c|}
\hline
Hi & I \\
Need & Help \\
\hline
\end{tabular}
\end{table}

\end{document}

and the result:

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.