The following posts provides a solution for adding a full stop at the end of hanging captions, but I'm encountering issues when applying this in the context of xltabular.

Can I extend this functionality to also work for captions in xltabular? I would love to get help!

Below is a minimal working example (MWE). It demonstrates the successful implementation of adding a full stop to hanging captions but also illustrates the issue with xltabular table captions where the full stop is not being added.


\usepackage{amsthm} % Adds a full stop at the end of each caption automatically (if there is none)
\usepackage{caption}   % Use 'caption' Package
\usepackage{xltabular} % Load 'xltabular' package

% Custom caption format based on the original hang format with "ABC" appended
       The option `labelsep=\caption@labelsep@name' does not work\MessageBreak
       with `format=customhang'}}%




    DEMO \\
    \caption{Samle with xltabular} % Here a full stop should be added, but currently is not being added!

% Just to ensure that the new solution also works with normal captions inside figures:
    \caption{This is an example caption}
    \caption{Another sample with a very long caption and we hope that it will properly break into the next line with proper hanging...}

  • Should the desired fixed apply only to "hanging" captions in your document, or should it apply to all captions? Please clarify.
    – Mico
    Nov 23, 2023 at 5:34
  • 2
    I've taken the liberty of adding the instruction \usepackage{xltabular} in the preamble to make the sample compilable. Feel free to revert.
    – Mico
    Nov 23, 2023 at 5:42
  • 2
    I'm definitely just using hanging captions - so if it makes things easier, then it's sufficient to work only with hanging captions. And thanks for the edit!
    – Highnoon
    Nov 23, 2023 at 18:17
  • Would you be ok with a LuaLaTeX-based solution? Or do you have to use pdfLaTeX to compile your documents?
    – Mico
    Nov 23, 2023 at 20:37
  • Sadly I have to use pdfLaTeX :/
    – Highnoon
    Nov 23, 2023 at 21:09


You must log in to answer this question.

Browse other questions tagged .