Graphics, Figures & TablesCaption package justification not working

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
seanmurray
Posts: 2
Joined: Sun Aug 15, 2010 12:48 pm

Caption package justification not working

Post by seanmurray »

Hi,

I'm using the caption with Lyx 1.6.7. I've declared the use of the package in the document setting with this line of code:

Code: Select all

\usepackage[format=plain, justification=raggedright, font=scriptsize]{caption}
The fonts size is being correctly set but for some reason the justification option is not working.

Here is a portion of the latex code generated using Export in Lyx

Code: Select all

\begin{table}
\noindent \begin{raggedright}
\begin{tabular}{|c|cccccc|}
\cline{2-7} 
\multicolumn{1}{c|}{} & \multicolumn{6}{c|}{\textbf{\small words having disparity of}}\tabularnewline
\hline
\textbf{\small m+1} & \textbf{\small 0} & \textbf{\small +2} & \textbf{\small +4} & \textbf{\small +6} & \textbf{\small +8} & \textbf{\small +10}\tabularnewline
\hline
\textbf{\small 2} & {\small 2} & {\small 1} &  &  &  & \tabularnewline
\textbf{\small 4} & {\small 6} & {\small 4} & {\small 1} &  &  & \tabularnewline
\textbf{\small 6} & {\small 20} & {\small 15} & {\small 6} & {\small 1} &  & \tabularnewline
\textbf{\small 8} & {\small 70} & {\small 56} & {\small 28} & {\small 8} & {\small 1} & \tabularnewline
\textbf{\small 10} & {\small 252} & {\small 210} & {\small 120} & {\small 45} & {\small 10} & {\small 1}\tabularnewline
\hline
\end{tabular}
\par\end{raggedright}

\label{Flo:Disp}\caption{Number of code words with various disparities}
\end{table}
Can anyone help?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Caption package justification not working

Post by sommerfee »

seanmurray wrote:\caption{Number of code words with various disparities}
Since this is a caption which will fit into a single line, it will be centered. If you don't like this behavior you can switch it off by using the caption package option "singlelinecheck=off". (See caption package documentation for details.)
seanmurray
Posts: 2
Joined: Sun Aug 15, 2010 12:48 pm

Re: Caption package justification not working

Post by seanmurray »

Problem solved.

Thank you very much.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Caption package justification not working

Post by localghost »

Now that the problem is solved, please mark the topic exactly as described in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply