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'm using the \caption command inside \begin{table} command and in the output I'm getting:

Table 4.1 - Caption
    Table Content

Is it possible to change that style to something like this?

                    *Table 4.1*
    **Caption**
   Table Content 

The word "Table" and its number should be at the right side of page and in italic, the caption should be centered and bold.

PS

\usepackage{caption}
\DeclareCaptionFormat{hfillstart}{\hfill#1#2#3\par}
\captionsetup[table]{format=hfillstart,labelsep=newline,justification=centering}

\usepackage{floatrow}
\floatsetup[table]{capposition=top}

I have used this code from link below. How to change it to make Table italic, and caption bold?

share|improve this question
1  
Welcome to TeX.SX! –  egreg Nov 5 '12 at 10:52
    
See the caption2 package for such customisations. –  Andrew Swann Nov 5 '12 at 11:12
    
Have a look at tex.stackexchange.com/questions/78774/… –  lockstep Nov 5 '12 at 12:07
1  
@AndrewSwann The caption2 package is obsolete. One should use caption or floatrow; the latter builds upon the former. –  egreg Nov 5 '12 at 12:09
    
@egreg You are perfectly right - a few years ago it used to be the other way around... –  Andrew Swann Nov 5 '12 at 12:22

2 Answers 2

up vote 2 down vote accepted

You're almost there:

\usepackage{caption}
\DeclareCaptionFormat{hfillstart}{\hfill#1#2#3\par}
\DeclareCaptionFont{mdit}{\mdseries\itshape}
\captionsetup[table]{
  format=hfillstart,
  labelsep=newline,
  justification=centering,
  font=bf,
  labelfont=mdit,
}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}

I'm not too much convinced about boldface captions, though.

share|improve this answer
    
It's not necessary to declare a new mdit font; simply use the labelfont and textfont keys. –  lockstep Nov 5 '12 at 15:01
    
@lockstep Right, but it may be useful to have also this possibility, so the two parts can share some setting. –  egreg Nov 5 '12 at 15:03

It's not clear to me whether your "Table italic" refers to the "Table XXX" label in the table's caption or to the body of the table:

  • In the first case, add labelfont=it,textfont=bf to the argument of \captionsetup.

  • In the second case, add font=bf to the argument of \captionsetup and font=it to the argument of \floatsetup.

See section 2.3 of the caption manual and section 3.1.2 of the floatrow manual for details.

share|improve this answer

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.