## Saturday, November 26, 2011

### Editing caption options in LaTeX using the caption package

So I am submitting some of my work to a journal, and the journal has certain stipulations for their format style.  On example is the caption labels had to have subfloat lables left justified instead of the default centered and the caption label needs to be FIGURE 1. instead of Figure 1:

First initialize the caption package in the preamble:

\usepackage{caption}

See the CTAN link for the pdf and more information on the caption package.

http://ctan.org/tex-archive/macros/latex/contrib/caption/

In order to left justify the subfloat label "a)" use the command:

singlelinecheck=false


(I forgot where I found this).

In order to use this per figure, place the following command in the float like:

\captionsetup[subfloat]{singlelinecheck=false}

In order to change the colon to a period use:

labelsep=period

and in order to change to the small caps format use:

labelfont=sc

and within the figure place:

\captionsetup{labelsep=period, labelfont=sc}

You can also place the options in the preamble so that all figures take the changes:

\usepackage[labelsep=period, labelfont=sc]{caption}

Although I don't know how to implement the subfloat changes like this in the preamble.

Here is the code and image examples:

\begin{figure}
\centering
\subfloat[]{\label{fig:fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1.png}}
\subfloat[]{\label{fig:fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1.png}}
\caption{Axial velocity distribution shown at several axial positions and divergence angles of (a) $30^{\circ}$ and (b) $45^{\circ}$.} \label{fig:fig_10_axial_vel}
\end{figure}

\begin{figure}

\centering

\captionsetup[subfloat]{singlelinecheck=false}

\subfloat[]{\label{fig:fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10a_axial_velocity_for_alpha_30_at_4_z_loc_w_1_over_1.png}}

\subfloat[]{\label{fig:fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1} \includegraphics[scale = 0.8]{fig_10b_axial_velocity_for_alpha_45_at_4_z_loc_w_1_over_1.png}}

\captionsetup{labelsep=period, labelfont=sc}


\caption{Axial velocity distribution shown at several axial positions and divergence angles of (a) $30^{\circ}$ and (b) $45^{\circ}$.} \label{fig:fig_10_axial_vel}

\end{figure}