我正在使用以下代码将表格标题设为大写。但是,我想将单位(例如 mm)设为小写。我该如何更改它
\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{This is table with unit mm}
\end{table}
\end{document}
答案1
你为什么不\MakeTextLowercase
和单位一起使用?
\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{This is table with unit \MakeTextLowercase{mm}}
\end{table}
\end{document}
答案2
也可以通过包来设置单位siunitx
:
\documentclass[a4paper, 11pt]{article}
\usepackage{textcase}
\usepackage[tablename=TABLE]{caption}
\DeclareCaptionTextFormat{up}{\MakeTextUppercase{#1}}
\captionsetup[table]{
labelsep=period,
justification=centering,
textformat=up,
}
\usepackage{siunitx}
\begin{document}
\begin{table}
\caption{This is table with unit~\si{\milli\meter}}
\end{table}
\end{document}
但是,大写的标题并不符合我的口味,因为它会降低可读性,而且不必要地“哭泣”。