按照代码解决后这个问题我正在努力让标题的第二行保持居中。通常,第一行文本始终居中,但一旦有两行或更多行,文本就会切换到“对齐”对齐(块文本)。我尝试将和都放在\begin{center}
小\centering
页面中,但对标题没有任何影响,也没有产生任何错误。
这是我的代码。虽然我检查了所有软件包和命令,并且认为它们不会造成干扰,但我还是会添加它们,以防有人发现问题。
\documentclass{article}
\usepackage[margin=0.75in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{gensymb}
\usepackage{float}
\usepackage{biblatex}
\usepackage{mwe}
\usepackage{natbib}
\usepackage{graphicx}
\renewcommand\thesection{\Alph{section}}
\newcommand{\HRule}[1]{\rule{\linewidth}{#1}}
\begin{document}
\begin{figure}[H]
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{log-hhcf.png}
\caption{Logarithmic graph for HHCF gold sample.}
\label{log-hhcf}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{hhcf.png}
\caption{HHCF for gold sample with all the relevant fitted lines and functions.}
\label{hhcf}
\end{minipage}
\end{figure}
\end{document}
我明白了:
有人知道另一种方法文本我的图表上的标题是什么?
答案1
不太清楚您希望如何格式化您的标题,因此有两种猜测:
\documentclass{article}
\usepackage[margin=0.75in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\textbf{first example}:
\begin{figure}[htb]
\captionsetup{justification=centering}
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Logarithmic graph for HHCF gold sample.}
\label{log-hhcf}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{HHCF for gold sample with all the relevant fitted lines and functions.}
\label{hhcf}
\end{minipage}
\end{figure}
\textbf{second example}:
\begin{figure}[htb]
\captionsetup{justification=centerlast}
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Logarithmic graph for HHCF gold sample.}
\label{log-hhcf}
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\caption{HHCF for gold sample with all the relevant fitted lines and functions.}
\label{hhcf}
\end{minipage}
\end{figure}