Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.