5

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

enter image description here

and for figures to be

enter image description here

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 enter image description here

and figure is here

enter image description here

1 Answer 1

4

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}

enter image description here

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.

5
  • 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
    Commented Sep 11, 2012 at 18:54
  • I put caption package in folder of elsarticle.lyx , I think this is right?
    – mero
    Commented Sep 11, 2012 at 18:55
  • @mero please explain exactly what size do you want and for what parts (the label, the label and the caption text)? Commented Sep 11, 2012 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=footnotesize]{caption} \captionsetup[figure]{name=Fig,labelsep=period} \captionsetup[table]{labelsep=newline}
    – mero
    Commented Sep 11, 2012 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.)
    – user2574
    Commented Jan 9, 2013 at 21:52

You must log in to answer this question.

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