# /Update/ How could I make the caption of table upright?

I would like to make the caption of my table upright, rather than italic. Here is what I am coding now:

• Update: Add preamble (only including some packages related to this question) and remove some redundant information.

\documentclass{apa6}
\usepackage{stfloats}
\usepackage{sectsty}
\usepackage{booktabs}
\usepackage{multirow}
\begin{document}

\begin{table*}[bp]
\centering
\vspace*{2em}
\begin{threeparttable}
\captionsetup{font=up, labelfont=bf, labelsep=newline}
\caption[font={up}]{Behavioural performance during the perceptual judgement functional magnetic resonance imaging task}
\label{tab:Beh}
\begin{tabular}{*{7}{l}}  \toprule
\multirow{2}*{} & \multicolumn{3}{l}{Young} & \multicolumn{3}{l}{Old} \\
\cmidrule(lr){2-4}\cmidrule(lr){5-7} & Rep 1 & Rep 2 & Rep 3 & Rep 1 & Rep 2 & Rep3 \\
\midrule
Proportion correct & 0.90 (0.09) & 0.94 (0.07) & 0.94 (0.05) & 0.88 (0.10) & 0.90     (0.08) & 0.91 (0.09) \\
RT (ms) & 783 (68) & 669 (53) & 662 (81) & 938 (113) & 830 (121) & 811 (107) \\
\bottomrule
\end{tabular}
\smallskip

\begin{tablenotes}
{\small
Accuracy and reaction time (RT) means (standard deviation) for stimuli presented the first time (Rep 1), second time (Rep 2), and third time (Rep 3) in the perceptual judgement task.
}
\end{tablenotes}
\end{threeparttable}
\end{table*}

\end{document}


And here is what is going on:

I would like to make 'Behavioural performance during the perceptual judgement functional magnetic resonance imaging task' into upright form not italic. I've tried to use package 'caption' and set \captionsetup{font=up}but it didn't work.

• Welcome to TeX.SE! Please make your code snippet -- as usual here -- compilable! – Mensch Dec 26 '18 at 9:19
• The usual default is upright text. So if you get italics, there must be something in your code that causes that. There are a great many direct and indirect ways to obtain italics in the caption, so we can only help you properly if you show us not only a code snippet for the table in question, but also your preamble in a short, but complete compilable example document (an MWE: tex.meta.stackexchange.com/q/228/35864). Your screenshot reminds me of APA style and it may well be that you use one of the document classes that implements it: It is crucial that we know which class you use. – moewe Dec 26 '18 at 11:35
• unrelated but by default latex doesn't support b on table* \begin{table*}[bp] – David Carlisle Dec 26 '18 at 11:55
• Please tell us which document class you employ. – Mico Dec 26 '18 at 14:12
• Is there a particular reason for using the apa6 class, which is notorious for its low standards of typesetting? If you've been ordered to use it, I see no reason for trying to modify the output. – egreg Dec 26 '18 at 22:29

Well, if you check the code of class apa6.cls you can find the following code:

\ifapamode{% man
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}\raggedright#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\raggedright\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\raggedright\textit{#1}}
}{% jou
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent
}\textit{#1}} % <===========================================================
}{% doc
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\textit{#1}}
}


I marked the relevant place with <=========: there it is defined that the title should be italic. To get rid of that change \textit{ to \textup{ (mentioned in comment of @mico):

ifapamode{% man
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}\raggedright#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\raggedright\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\raggedright\textit{#1}}
}{% jou
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent
}\textup{#1}} % <================================================================
}{% doc
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\textit{#1}}
}


With the following complete code

\documentclass{apa6} %

\ifapamode{% man
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}\raggedright#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\raggedright\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\raggedright\textit{#1}}
}{% jou
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent
}\textup{#1}} % <================================================================
}{% doc
\DeclareCaptionLabelFormat{tablelabel}{\hspace{-\parindent}#1 #2}
\DeclareCaptionLabelFormat{figurelabel}{\hspace{-\parindent}\textit{#1 #2}}
\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\textit{#1}}
}

\usepackage{multirow}

\begin{document}

\begin{table*}[bp]
\centering
\vspace*{2em}
\begin{threeparttable}
\captionsetup{font=up, labelfont=bf, labelsep=newline}
\caption[font={up}]{Behavioural performance during the perceptual judgement functional magnetic resonance imaging task}
\label{tab:Beh}
\begin{tabular}{*{7}{l}}  \toprule
\multirow{2}*{} & \multicolumn{3}{l}{Young} & \multicolumn{3}{l}{Old} \\
\cmidrule(lr){2-4}\cmidrule(lr){5-7} & Rep 1 & Rep 2 & Rep 3 & Rep 1 & Rep 2 & Rep3 \\
\midrule
Proportion correct & 0.90 (0.09) & 0.94 (0.07) & 0.94 (0.05) & 0.88 (0.10) & 0.90     (0.08) & 0.91 (0.09) \\
RT (ms) & 783 (68) & 669 (53) & 662 (81) & 938 (113) & 830 (121) & 811 (107) \\
\bottomrule
\end{tabular}
\smallskip

\begin{tablenotes}
{\small
Accuracy and reaction time (RT) means (standard deviation) for stimuli presented the first time (Rep 1), second time (Rep 2), and third time (Rep 3) in the perceptual judgement task.
}
\end{tablenotes}
\end{threeparttable}
\end{table*}

\end{document}


you get the result:

But be warned: Do not change the style of apa6 like this if you have to submit a paper. The journal then wants the title to be in italic letters ...

• +1. Just in case LaTeX is in italic mode when the table environment is entered, it might be a good idea to replace \textit{#1} with \textup{#1}, not just #1. – Mico Dec 26 '18 at 23:23
• Thank you for all your answers and suggestions. I will mind the rules here next time. Thank you so much again. – Zhilin Su Dec 31 '18 at 9:46
• The default behavior is upright text in the caption of a table afaik.
• I attached a small example to show what I mean.
• I assume that somewhere in your preamble there is the package caption included.
• Do you see something like textfont = it in your preamble as an option to the caption-package?
• Update: In your code, I see \captionsetup{font=up, labelfont=bf, labelsep=newline}, so I assume you are aware of the caption package. Without further information from your side, it's hard to help.

\documentclass{article}
\usepackage{threeparttable}

\begin{document}

% Example taken from https://tex.stackexchange.com/questions/118743 and modified
\begin{table}
\caption{Some very informative caption}
\begin{threeparttable}
\begin{tabular}{lll}
TextText\tnote{1} & TextText & TextText \\
TextText & TextText\tnote{2} & TextText \\
\end{tabular}
\begin{tablenotes}
\item[1] Some remark. \item[2] Another remark.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}


Unrelated, maybe make yourself familiar with the "rules" around here, e. g. https://stackoverflow.com/help/how-to-ask and I've just been asked to write a minimal example, what is that?.

As pointed out in this answer, the apa6 document class automatically loads the caption package and the format of the text part of a table-related caption is set via the directive

\DeclareCaptionTextFormat{tabletext}{\hspace{-\parindent}\textit{#1}}


To redefine this, simply run

\DeclareCaptionTextFormat{tabletext}{\textup{#1}}


Aside: As @egreg has noted in a separate comment, the quality of the LaTeX code in the file apa6.cls is not exactly great. To wit, the directive \hspace{-\parindent} in the original form of \DeclareCaptionTextFormat does nothing useful because the \parindent length parameter is set to 0 inside table and figure environments automatically; hence, \hspace{-\parindent} does nothing and should be omitted.