
ドキュメントに画像を貼り付けます。デフォルトでは、キャプションの配置 (図 3) は中央揃えになり、キャプションの前にコロンが付きます。
ラベルを左揃えにして、フォーマットをFig. 3:
オンに変更するにはどうすればよいですかFig. 3
?
私のコード:
\setcounter{figure}{2}
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{75_02-45.jpeg}\caption{}
\label{fig}
\end{figure}
答え1
それは大丈夫ですか?
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\makeatletter
\renewcommand{\fnum@figure}{Fig. \thefigure} % Changing the prefix to 'Fig.'
\makeatother
\begin{document}
Example:
\setcounter{figure}{2}
\begin{figure}[ht]
\centering
\includegraphics[width=0.5\linewidth]{frog.jpg}
\captionsetup{justification=raggedright,singlelinecheck=false} % Left align the label
\caption{}
\label{fig}
\end{figure}
\end{document}
出力:
答え2
と
\captionsetup[figure]{
justification=raggedright,
singlelinecheck=false, % <<< raggadright also when the caption is shorterthan a single line
name={Fig.}
}
完全なコード
\documentclass{article}
\usepackage{showframe}% comment in the final document
\usepackage{graphicx}
\usepackage{caption}
\captionsetup[figure]{
justification=raggedright,
singlelinecheck=false, % <<< raggadright also when the caption is shorterthan a single line
name={Fig.}
}
\begin{document}
%\noindent
Example:
\setcounter{figure}{2}
\begin{figure}[ht]
\centering
\includegraphics[width=0.5\linewidth]{example-image-duck}
\caption{}
\label{fig}
\end{figure}
\end{document}