将标题中的字体大小限制为 10pt

将标题中的字体大小限制为 10pt

我们学院的风格指南规定,图表下方的注释必须采用 10pt 字体大小。

我跳过了各种帖子,但没有一个回答具体的 10pt 解决方案——只给出了小或超小的解决方案。

我的文档如下所示:

\documentclass[a4paper,12pt]{article}
\usepackage{fancyhdr}
\usepackage[hmargin=2.5cm, vmargin=2cm]{geometry}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage[]{graphicx}
\usepackage{float}
\usepackage{eurosym}
\usepackage{amsmath} % for equations over multiple lines
\usepackage[hang,bottom]{footmisc} % Fußzeile bleibt am Boden %
\usepackage{natbib}  % havard style citation
\usepackage{grffile}
\usepackage{bbm}
\usepackage{longtable} % table over two pages
\usepackage{graphicx}
\usepackage{caption}
\usepackage{adjustbox}
\usepackage{subcaption}

\usepackage[flushleft]{threeparttable} %note below table

\usepackage{url}
\makeatletter
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\makeatother


\newtheorem{theorem}{Definition}[section]




\setlength{\parindent}{0pt}
\setlength{\footnotemargin}{0.8em}

\usepackage[titletoc,title]{appendix}
\usepackage[nottoc,notlot,notlof]{tocbibind}

\usepackage{setspace}
\setstretch{1.25} % don't modify the low-level parameter \linespread directly
\usepackage{hyperref}

\floatstyle{plaintop}
\restylefloat{table}


\begin{document}

\begin{figure}[H]
\centering
\caption{Title:This should be in normal 12pt text size}
  \includegraphics[width=\linewidth]{example-image-a}
\caption*{Note: This comment should be in  10pt text size}
\end{figure}



\begin{table}[H]
\centering
\caption{This should be in normal 12pt text size}
 \begin{threeparttable}
\begin{tabular}{lrr}
\hline\hline
\multicolumn{1}{c}{XXX}&\multicolumn{1}{c}{XXX}&\multicolumn{1}{c}{XXX (in \%)}\tabularnewline
\hline
A&$1$&$100$\tabularnewline
\text{\quad B}&$  4$&$4.37$\tabularnewline
\text{\quad \quad C}&$   24$&$0.37$\tabularnewline
\hline
\end{tabular}
\begin{tablenotes}
 \item[]Note: This comment should be in  10pt text size

\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

答案1

由于您使用的article文档类的主文档字体大小为12pt,因此发出该指令\footnotesize将生成10pt大小为 的文本。而且,由于您还加载了字幕包,你应该写

...
\begin{table} % or: \begin{figure}
\captionsetup{font=footnotesize}
\caption{...} \label{...}
...
\end{table} & or: \end{figure}
...

生成排版于的字幕,你猜对了,10pt。请注意,由于该\captionsetup指令是在table(或figure) 环境中发出的,因此该指令的范围仅限于table(或figure)。

如果你想改变字幕大小全球你应该10pt发出指令

\captionsetup{font=footnotesize}

在序言中。

答案2

以下内容在 MWE 中将表格注释和图形下方的注释全局设置为 10pt,同时将图形和表格的实际标题保留为 12pt 大小。

\documentclass[a4paper,12pt]{article}
\usepackage[]{graphicx}
\usepackage{float}
\usepackage{caption}
\usepackage[flushleft]{threeparttable} %note below table

\makeatletter 
\g@addto@macro\TPT@defaults{\footnotesize} 
\makeatother
\newcommand\fnote[1]{\captionsetup{font=footnotesize}\caption*{#1}}

\begin{document}

\begin{figure}[H]
\centering
\caption{Title:This should be in normal 12pt text size}
  \includegraphics[width=\linewidth]{example-image-a}
\fnote{ Note: This comment should be in  10pt text size}
\end{figure}


\begin{table}[H]
\centering
\caption{This should be in normal 12pt text size}
 \begin{threeparttable}
\begin{tabular}{lrr}
\hline\hline
\multicolumn{1}{c}{XXX}&\multicolumn{1}{c}{XXX}&\multicolumn{1}{c}{XXX (in \%)}\tabularnewline
\hline
A&1&100\tabularnewline
\quad B&  4&4.37\tabularnewline
\quad \quad C&   24&0.37\tabularnewline
\hline
\end{tabular}
\begin{tablenotes}
 \item[]Note: This comment should be in  10pt text size

\end{tablenotes}
\end{threeparttable}
\end{table}


\end{document}

相关内容