1

This question already has an answer here:

I want to set the caption font for all tables in the document (so I want to do it in the preamble, and not have to specify it in each table) to use uppercase letter (not sc, the small case already provided by the caption package). I have tried declaring the caption font with "\uppercase", "\MakeUppercase", "\MakeTextUppercase" but to no success (also all combinations with {} at the end as shown in preamble below). Any suggestions?

Here is my preamble:

\documentclass[a4paper, 11pt]{article}

\usepackage{textcase}
\usepackage[]{caption}
\def\tablename{TABLE}
\DeclareCaptionFont{up}{\MakeTextUppercase{}}
\captionsetup[table]{
    labelsep=period,
    justification=centering,
    font=up,
}

\begin{document}

Many thanks :)

marked as duplicate by Axel Sommerfeldt, egreg fonts Dec 2 '15 at 10:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Don't do this. On the technical side it is fragile and difficult to uppercase longer text with unknown content, on the typografical side it will look horrible. Should your caption shout at people? – Ulrike Fischer Dec 2 '15 at 9:56
  • I agree, but unfortunately I am following a style guide which wants it this way.... Luckily the table titles aren't very long :) – Citylime Dec 2 '15 at 11:33
5

You could either use \DeclareCaptionFormat or \DeclareCaptionTextFormat for that purpose, e.g.:

\documentclass[a4paper, 11pt]{article}

\usepackage{textcase}
\usepackage[tablename=TABLE]{caption}
\DeclareCaptionTextFormat{up}{\MakeTextUppercase{#1}}
\captionsetup[table]{
    labelsep=period,
    justification=centering,
    textformat=up,
}

\begin{document}

\begin{table}
  \caption{Hello World!}
\end{table}

\end{document}

BTW: I second Ulrikes "Don't do this".

  • I have a problem while capitizing the table caption. I have subscript in my cation text, which I want it to remain small letter. But, with the above solution, even the subscript got capitized, Eg. TABLE 1 : COMPARISON WHEN N_b=5. I want b to remain as small letter. Please help. – roshni Mar 11 '18 at 14:44
  • I need to have not the caption itself in uppercase, but also "TABLE 1" instead of "Table 1". I experimented with "format" instead of "textformat" in your above code, but to no avail. How can this be done? – Marie. P. Apr 28 '18 at 11:36

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