Generating LaTeX labels separately from captions used in List of Tables/Figures

dudido's Avatar

dudido

11 Jul, 2020 01:36 PM

Hi,

is there a way to assign a cutom label to a table separately from the caption to be used in the list of tables?

Following is an MultiMarkdown MWE:

| Header 1   | Header 2                |
| -------------- | -------------------------- |
| Cell 1        | Cell 2                 |
[Title][label]

This produces the following LaTeX code:

\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\caption[label]{Title}
\label{label}
\begin{tabulary}{\textwidth}{@{}ll@{}} \toprule
 Header 1 & Header 2    \\
\midrule

 Cell 1  & Cell 2     \\
\bottomrule

\end{tabulary}
\end{minipage}
\end{table}

The label get correctly set (\label{label}), however at the same time the caption for use in the list of tables is automatically set to the same (\caption[label]{Title}). It is very useful to be able to specify the caption in for use in lists, however in most cases I don't want it to be the same as the label. Is there a way to pass only the label or specify the label separately from the captions in list? The same applies to labels specified for figures.

I'm quite sure this must've been changed in MMD6, since I used to compile the same table earlier using Scrivener 2 and MMD5 and it did produce a label as intended here (but not a separate caption for use in the List of Tables), but I couldn't find any inormationon the changed syntax in the documentation.

Thanks for the support.

  1. Support Staff 1 Posted by fletcher on 11 Jul, 2020 05:43 PM

    fletcher's Avatar

    You would have to use manually generated LaTeX to do this.

    Alternatively, why not just use your desired caption for the list of tables as the label? If I remember correctly, it is not used anywhere else that is visible in the document.

  2. 2 Posted by dudido on 11 Jul, 2020 07:21 PM

    dudido's Avatar

    Thanks for the reply. But there was a change in the specification regarding this - right?

    Well if I have complex captions and titles they get filtered by MMD for compatibility with LaTeX, e.g. [Special Signs and Conventions][List of \emph{Special Signs} and Conventions~Rules] would produce

    \caption[List of \emph{Special Signs} and Conventions~Rules]{Special Signs and Conventions}
    \label{listofemphspecialsignsandconventionsrules}
    
    So it is usually easier to copy the generated labels from the compiled document rather than to predict them. That is why I used to set-up shorthand labels for cross-referencing figures and tables and would just label it 'specsigns' for example. But having all these show up in the List of Tables/Figures leads to confusion.
  3. Support Staff 3 Posted by fletcher on 11 Jul, 2020 11:54 PM

    fletcher's Avatar

    Yes. This is one of the things that changed, since placing the full caption in the list of tables didn't make sense.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Articles