# How to align caption to the left of a figure?

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}

• Welcome to TeX.SE. Please provide a minimal example of your code, beginning on \documentclass and ending in \end{document. – Jan Jan 2 '17 at 9:55
• 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 Jan 2 '17 at 9:56
• 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 Jan 2 '17 at 10:27

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}


• Thanks. Its work for me. But can you help me more by changing the caption Fig. 1 instead of FIGURE 1: Chunck..... – Royal Jan 2 '17 at 11:12
• Your wish is my command… Please see my modified answer. – Bernard Jan 2 '17 at 11:25
• Sorry to say , it did not work. note: I am using \documentclass[conference]{IEEEtran} ( caption aligned to left successfully) – Royal Jan 2 '17 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 Jan 2 '17 at 12:03
• Thanks, finally it works.... You are just awesome......... – Royal Jan 2 '17 at 12:13