2

I am using the caption and subcaption packages to create subtables and to caption them. I use the caption package to change caption style for all floats. I used the subcaption package to create subtables. I use the booktabs package to help make my table look good. Here is my MWE:

\documentclass{article}
\usepackage[labelsep=quad,labelfont=sc]{caption}
\usepackage[subrefformat=parens]{subcaption}
\usepackage{booktabs}

\begin{document}

\begin{table}
%  \centering
  \begin{subtable}{\textwidth}
    \centering
    \caption{First table}\label{tab:mytable:first}
    \begin{tabular}{ll}
      \toprule
      A & B\\
      \midrule
      1 & 2\\
      \bottomrule
    \end{tabular}
  \end{subtable}

  \vspace*{16pt}
  
  \begin{subtable}{\textwidth}
    \caption{Second table}\label{tab:mytable:second}
    \centering
    \begin{tabular}{ll}
      \toprule
      C & D\\
      \midrule
      3 & 4\\
      \bottomrule
    \end{tabular}
  \end{subtable}
  \caption{My caption referring to \subref{tab:mytable:first}~first table
and \subref{tab:mytable:second}~second table.}\label{tab:mytable}
\end{table}

\end{document}

... which gives this output:

output

How do I make the subtable labels lowercase ((a) instead of (A), (b) instead of (B), ...) without changing any other styles, placement, etc?

If possible, I would like this formatting to occur locally -- either local to tables in my thesis or local to this particular table in my thesis.

2 Answers 2

3

Between \begin{subtable}{\textwidth} and \caption..., add the line

\renewcommand\captionlabelfont{}

The change is local to the particular table. Notice the difference between the first subtable (changed) and the second one (unchanged).

enter image description here

\documentclass{article}
\usepackage[labelsep=quad,labelfont=sc]{caption}
\usepackage[subrefformat=parens]{subcaption}
\usepackage{booktabs}

\begin{document}

\begin{table}
%  \centering
  \begin{subtable}{\textwidth}
    \renewcommand\captionlabelfont{}% <<< HERE <<< HERE <<< HERE
    \centering
    \caption{First table}\label{tab:mytable:first}
    \begin{tabular}{ll}
      \toprule
      A & B\\
      \midrule
      1 & 2\\
      \bottomrule
    \end{tabular}
  \end{subtable}

  \vspace*{16pt}
  
  \begin{subtable}{\textwidth}
    \tracingmacros=2
    \caption{Second table}\label{tab:mytable:second}
    \tracingmacros=0
    \centering
    \begin{tabular}{ll}
      \toprule
      C & D\\
      \midrule
      3 & 4\\
      \bottomrule
    \end{tabular}
  \end{subtable}
  \caption{My caption referring to \subref{tab:mytable:first}~first table
and \subref{tab:mytable:second}~second table.}\label{tab:mytable}
\end{table}

\end{document}
3

Simply use in your preamble

\usepackage[subrefformat=parens, labelfont=up]{subcaption}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .