7

I am using this command, but it centers the figure caption. How can I left-align this? Please help me.

\documentclass[conference]{IEEEtran}
\usepackage{authblk}

\begin{document}

\begin{figure}[!h]
\centering
\includegraphics[scale=0.28]{fig1}
\caption{Generation of Digital Signature}
\label{fig_sim}
\end{figure}

\end{document}
3
  • 2
    Welcome to TeX.SE. Please provide a minimal example of your code, beginning on \documentclass and ending in \end{document.
    – Jan
    Commented Jan 2, 2017 at 9:55
  • 2
    Welcome to TeX SX! Do you want to have the caption at the left corner of the figure, or at the left corner of the page?
    – Bernard
    Commented Jan 2, 2017 at 9:56
  • 1
    I recommend to use e.g. \includegraphics[width=Xcm]{example-image}. This uses an example image provided by latex. Then you don't need to upload your image for the MWE.
    – nox
    Commented Jan 2, 2017 at 10:27

2 Answers 2

12

You can load the caption package and choose the option singlelinecheck=off, and the measuredfigure environment from threeparttable:

\documentclass[conference]{IEEEtran}
\usepackage[utf8]{inputenc} %
\usepackage{graphicx, caption} %
\usepackage{threeparttable}%
\usepackage{lipsum}

\begin{document}

\lipsum[1]
\begin{figure}[!htb]
  \captionsetup{singlelinecheck = false, format= hang, justification=raggedright, font=footnotesize, labelsep=space}
  \centering
  \begin{measuredfigure} % \begin{measuredfigure}
    \includegraphics{Pepe-le-Pew2}
    \caption{Chuck Jones – Pepe Le Pew in action}
  \end{measuredfigure}
  \label{PlP}
\end{figure}
\lipsum[2]

\end{document} 

enter image description here

9
  • Thanks. Its work for me. But can you help me more by changing the caption Fig. 1 instead of FIGURE 1: Chunck.....
    – Royal
    Commented Jan 2, 2017 at 11:12
  • 1
    Your wish is my command… Please see my modified answer.
    – Bernard
    Commented Jan 2, 2017 at 11:25
  • Sorry to say , it did not work. note: I am using \documentclass[conference]{IEEEtran} ( caption aligned to left successfully)
    – Royal
    Commented Jan 2, 2017 at 11:40
  • Just changing the document class in my code works, without having to redefine \figurename: Fig. is the default in this class. There must be something else in your code.
    – Bernard
    Commented Jan 2, 2017 at 12:03
  • Thanks, finally it works.... You are just awesome.........
    – Royal
    Commented Jan 2, 2017 at 12:13
1

As suggested in this answer on the LaTeX Community forum (LaTeX.org), it's quite easy to achieve the left alignment by loading the package caption with the options singlelinecheck=false and justification=justified:

\usepackage[singlelinecheck=false,justification=justified]{caption}

If you're interested in the details, you can read more about this in the caption package documentation in Sections 2.2 (pp. 9-10).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .