Wie kann ich das Beschriftungsformat eines Bildes ändern?

Wie kann ich das Beschriftungsformat eines Bildes ändern?

Ich füge ein Bild in mein Dokument ein. Standardmäßig ist die Bildunterschrift zentriert (Abb. 3) und vor der Bildunterschrift steht ein Doppelpunkt.

Wie kann ich die Beschriftung linksbündig ausrichten und das Format von Fig. 3:auf ändern Fig. 3?

Mein Code:

\setcounter{figure}{2}
\begin{figure}
    \centering
    \includegraphics[width=1\linewidth]{75_02-45.jpeg}\caption{}
    \label{fig}
\end{figure}

Antwort1

Ist das in Ordnung?


\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}

Ausgabe:

Bildbeschreibung hier eingeben

Antwort2

Mit

\captionsetup[figure]{
  justification=raggedright,
  singlelinecheck=false, % <<< raggadright also when the caption is shorterthan a single line
  name={Fig.}
  }

Der komplette Code

\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}

Bildbeschreibung hier eingeben

verwandte Informationen