更改换行后的字幕位置

更改换行后的字幕位置
\documentclass[a4paper,11pt,oneside,openany,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting

\usepackage[labelfont=bf]{caption}

\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[!htb] \centering
\begin{minipage}{0.35\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_schematic.pdf}}
\vspace{-6mm}
\captionof{figure}[Schematic sketch of the p-i-n sample structure for two opposing contacts]{\small Schematic sketch of the p-i-n sample structure for two opposing contacts.}
\label{p-i-n_structure_schematic.pdf}
\end{minipage} \hfill
\begin{minipage}{0.60\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_CCD(edited).png}}
\vspace{-6mm}
\captionof{figure}[CCD image of the p-i-n sample as seen on the CRT monitor]{\small CCD image of the p-i-n sample as seen on the CRT monitor.}
\label{p-i-n_structure_CCD(edited).png}
\end{minipage} 
\end{figure}

\end{document}

我希望左侧图像标题文本的第二行/第三行/等等从标签“图 0.1”的字母 F 正下方开始,但右侧图像则不从那里开始。如何实现?

答案1

\captionsetup您可以在使用之前添加适当的选项来设置任何图形的特定标题\caption

在此处输入图片描述

\documentclass{scrbook}

\usepackage[labelfont=bf,font=small]{caption}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htb]
  \captionsetup{format=plain}
  \begin{minipage}{0.35\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-a}
    \captionof{figure}{Schematic sketch of the p-i-n sample structure for two opposing contacts.}
  \end{minipage} \hfill
  \captionsetup{format=hang}%
  \begin{minipage}{0.60\textwidth}
    \centering
    \includegraphics[width=\linewidth]{example-image-b}
    \captionof{figure}{CCD image of the p-i-n sample as seen on the CRT monitor.}
  \end{minipage} 
\end{figure}

\end{document}

答案2

使用 KOMA-Script,您可以使用\setcapindent{1em}来对表格或图形的第二个及后续标题行进行 1 em 的缩进。在您的例子中,使用0em

KOMA-Script 有自己的字幕机制,如果您调用包,caption其中一些功能将无法工作。

要使用粗体标题标签,例如使用 KOMA-Script\setkomafont{captionlabel}{\sffamily\bfseries}来获取粗体 ( \bfseries) 无衬线 ( \sffamily) 标签。在​​您给出的示例中,您没有更改标签的字体。\sffamily如果您不想要它,请忽略。

MWE(查看<=======我的修改):

\documentclass[a4paper,11pt,oneside,openany,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting

%\usepackage[labelfont=bf]{caption}
\setcapindent{0em}%<====================================================
\setkomafont{captionlabel}{\sffamily\bfseries}% <=======================

\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[!htb] \centering
\begin{minipage}{0.35\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_schematic.pdf}}
\vspace{-6mm}
\captionof{figure}[Schematic sketch of the p-i-n sample structure for two opposing contacts]{\small Schematic sketch of the p-i-n sample structure for two opposing contacts.}
\label{p-i-n_structure_schematic.pdf}
\end{minipage} \hfill
\begin{minipage}{0.60\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_CCD(edited).png}}
\vspace{-6mm}
\captionof{figure}[CCD image of the p-i-n sample as seen on the CRT monitor]{\small CCD image of the p-i-n sample as seen on the CRT monitor.}
\label{p-i-n_structure_CCD(edited).png}
\end{minipage} 
\end{figure}

\end{document}

结果:

在此处输入图片描述

对第一个 MWE 进行少许更改,您可以将第一个图缩进 0 em,第二个图将照常挂起。

更改了 MWE(请参阅<==============更改内容):

\documentclass[a4paper,11pt,oneside,openany,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting

%\usepackage[labelfont=bf]{caption}
%\setcapindent{0em}%<====================================================
\setkomafont{captionlabel}{\sffamily\bfseries}% <=======================

\usepackage[demo]{graphicx}

\begin{document}

\begin{figure}[!htb] \centering
{\setcapindent{0em}% <====================================================
\begin{minipage}{0.35\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_schematic.pdf}}
\vspace{-6mm}
\captionof{figure}[Schematic sketch of the p-i-n sample structure for two opposing contacts]{\small Schematic sketch of the p-i-n sample structure for two opposing contacts.}
\label{p-i-n_structure_schematic.pdf}
\end{minipage}%
} \hfill% <====================================================
\begin{minipage}{0.60\textwidth} \centering \resizebox{1.00\textwidth}{!}{%
\includegraphics[scale=0.50]{Figures/p-i-n_structure_CCD(edited).png}}
\vspace{-6mm}
\captionof{figure}[CCD image of the p-i-n sample as seen on the CRT monitor]{\small CCD image of the p-i-n sample as seen on the CRT monitor.}
\label{p-i-n_structure_CCD(edited).png}
\end{minipage} 
\end{figure}

\end{document}

结果:

在此处输入图片描述

相关内容