이미지의 캡션 형식을 어떻게 변경할 수 있나요?

이미지의 캡션 형식을 어떻게 변경할 수 있나요?

내 문서에 그림을 붙여넣습니다. 기본적으로 캡션 정렬(그림 3)은 중앙에 있으며 캡션 앞에 콜론이 있습니다.

레이블을 왼쪽 정렬로 만들고 형식을 Fig. 3:on 에서 변경하려면 어떻게 해야 합니까 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}

여기에 이미지 설명을 입력하세요

관련 정보