我使用 对标题进行了一些修改\usepackage{caption}
。虽然我不知道如何将图形修改为 Fig. 并将表格修改为 Tab.。我这样做的方式是,两者都更改为 Fig..
这是我的代码:
\documentclass[a4paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{float}
\usepackage{framed, color}
\usepackage{adjustbox}
\usepackage{wrapfig}
\usepackage{subfig}
% LaTeX colores: https://latexcolor.com
\definecolor{darkcerulean}{rgb}{0.03, 0.27, 0.49}
% Caption
\DeclareCaptionLabelFormat{bf-parens}{\textcolor{darkcerulean}{\textbf{Fig. #2: }}}
\usepackage[margin=0pt,font={small},labelformat=bf-parens,labelsep=none,format=plain]{caption} % https://ctan.kako-dev.de/macros/latex/contrib/caption/caption-eng.pdf
\begin{document}
\begin{figure}[h!]
\centering
\includegraphics[draft]{altvenative_07}
\caption{Test figure caption.}
\end{figure}
\begin{table*}[t]
\centering
\begin{tabular}{l|cc}
1&2&3\\
4&5&6
\end{tabular}
\caption{Test table caption.}
\end{table*}
\end{document}
提前致谢,欢呼。
答案1
代码中的以下几行
\DeclareCaptionLabelFormat{bf-parens}{\textcolor{darkcerulean}{\textbf{Fig. #2: }}}
\usepackage[margin=0pt,font={small},labelformat=bf-parens,labelsep=none,format=plain]{caption}
应替换为
\DeclareCaptionFont{darkcerulean}{\color{darkcerulean}}
\usepackage[margin=0pt,font={small},labelfont={darkcerulean,bf},labelsep=colon,format=plain]{caption}
\captionsetup[figure]{name=Fig.}
\captionsetup[table]{name=Tab.}
请参阅标题包装文档。