# elsarticle table and figure caption

I want to change the caption of elsarticle in LyX for table to be

and for figures to be

Mine is the following:

I use the caption package in document preamble

\usepackage[labelfont=bf,labelsep=newline,justification=raggedright,singlelinecheck=false,font=small]{caption}


but I get large word Table in bold

and figure not fig. as required and also after figure there is a new line which is not required

here is mine

and figure is here

-

You can use \captionsetup to provide different options for table and figure:

\documentclass{elsarticle}
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period}
\captionsetup[table]{labelsep=newline,font=footnotesize}

\begin{document}

\begin{table}[!ht]
\caption{A test table caption}
\end{table}

\begin{figure}[!ht]
\caption{A test figure caption}
\end{figure}

\end{document}


You should take into account the warning you get from using caption with elsarticle class:

Package caption Warning: Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended. See the caption package documentation for explanation.

-
I still have small problem , i want to minimize the font of word Table 1 and Fig. 1. to be like caption, at my pdf caption has smaller size than Table and Fig –  mero Sep 11 '12 at 18:54
I put caption package in folder of elsarticle.lyx , I think this is right? –  mero Sep 11 '12 at 18:55
@mero please explain exactly what size do you want and for what parts (the label, the label and the caption text)? –  Gonzalo Medina Sep 11 '12 at 18:59
i found it thanks so much , i've this problem from weeks , thanks again and again :) \usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false,font=fo‌​otnotesize]{caption} \captionsetup[figure]{name=Fig,labelsep=period} \captionsetup[table]{labelsep=newline} –  mero Sep 11 '12 at 19:09
Just a short note that the warning will go away when updating to the current version 3.3 of the caption package (which I just have released and which is adapted to the elsarticle document class now.) –  Axel Sommerfeldt Jan 9 '13 at 21:52