Document Classesfont size in caption package

Information and discussion about specific document classes and how to create your own document classes.
adhikarig
Posts: 12
Joined: Mon Apr 28, 2008 12:34 am

font size in caption package

Post by adhikarig »

Hi

I am using caption package in my class file. the problem is it works perfectly with all options except font size. it always remain normal font size of my thesis. is there any option to change that? I paste part of code.

\RequirePackage{caption}
\captionsetup{
format = hang,
labelformat = simple,
labelsep = period,
textformat = simple,
justification = justified,
singlelinecheck = true,
font = {footnotesize,up,singlespacing},
width = \textwidth,
skip = 1ex,
listformat = simple,
figurewithin = chapter,
tablewithin = chapter,
}

\begin{figure}[!htbp]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{gmcom}
\caption{Comparison of ground motion}
\label{FigGm}
\end{center}
\end{figure}

thanks

gopal

Recommended reading 2024:

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

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

adhikarig
Posts: 12
Joined: Mon Apr 28, 2008 12:34 am

Re: font size in caption package

Post by adhikarig »

by the way i am using font urw-garamond...
\RequirePackage[T1]{fontenc}
\RequirePackage[urw-garamond]{mathdesign}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

font size in caption package

Post by localghost »

I'm not sure, but perhaps your problem is solved when omitting the textformat option.


Best regards
Thorsten¹
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

font size in caption package

Post by Stefan Kottwitz »

Hi gopal,

do you get a warning? Check your logfile for a warning starting with Package caption Warning.
Maybe its working if you load caption after the other packages (not after hyperref) and perhaps even without compatibility:

Code: Select all

\usepackage[compatibility=false]{caption}
or

Code: Select all

\RequirePackage[compatibility=false]{caption}
of course. But probably we could help better if you give us more information, I'm just guessing now.

Stefan
LaTeX.org admin
adhikarig
Posts: 12
Joined: Mon Apr 28, 2008 12:34 am

Re: font size in caption package

Post by adhikarig »

Hi Stefan

thanks for your earlier reply. I checked the log file and paste the relevant portion here. I also attached the log file.
as I told you I am using font urw-garamond.


LaTeX Font Info: Font shape `T1/mdugm/bx/n' in size <9> not available
(Font) Font shape `T1/mdugm/b/n' tried instead on input line 83.

thanks
gopal
Attachments
main.log
(28.25 KiB) Downloaded 555 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

font size in caption package

Post by Stefan Kottwitz »

Hi gopal,

it seems that those mdugm fonts (mathdesign urw garamond) are just not available in the right size and the right shape, as you noticed. For instance LaTeX is substituting b (bold) for bx (bold extended or sth. like that). You could try different size (or a different font ...) One idea could be to test it without microtype.
I don't find more with that logfile. Maybe I (and somebody else) could try something else if you provide a minimal working example.

Stefan
LaTeX.org admin
adhikarig
Posts: 12
Joined: Mon Apr 28, 2008 12:34 am

Re: font size in caption package

Post by adhikarig »

hi Stefan

it is working now. the correct syntax would be..

\RequirePackage{caption}
\captionsetup{
format = hang, % caption format
labelformat = simple, % caption label : name and number
labelsep = period, % separation between label and text
textformat = simple, % caption text as it is
justification = justified, % caption text justified
singlelinecheck = true, % for single line caption text is centered
font = {bf,up,singlespacing}, % defines caption (label & text) font
labelfont = footnotesize,
textfont = footnotesize,
width = \textwidth, % define width of the caption text
skip = 1ex, % skip the space between float and caption
listformat = simple, % in the list of floats, label + caption
figurewithin = chapter, % gives chapter dependent figure label
tablewithin = chapter, % gives chapter dependent figure label
}

the label and text font size have to be defined separately...

thanks for your help..
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: font size in caption package

Post by Stefan Kottwitz »

Hi gopal,

that's interesting!
By the way, I will move the topic from LaTeX/ General to LaTeX/ Packages & Document Classes because it's just concerning the caption package.

Stefan
LaTeX.org admin
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

font size in caption package

Post by sommerfee »

adhikarig wrote: labelfont = footnotesize,
textfont = footnotesize,
But it should work with "font={footnotesize,...}", too. So I assume that \captionfont will be re-defined at some place in your document class or document. But without having an example I can only guess...
zelrik
Posts: 1
Joined: Tue Feb 02, 2010 8:20 pm

Re: font size in caption package

Post by zelrik »

Hello there,

Maybe this is the wrong place to post this but I have problems with the caption package, a lot of options are not recognized by my compiler.

What works so far :

\RequirePackage{caption}
\captionsetup{
format = hang, % caption format
labelformat = simple, % caption label : name and number
labelsep = period, % separation between label and text
justification = justified, % caption text justified
singlelinecheck = true, % for single line caption text is centered
labelfont = footnotesize,
textfont = footnotesize,
width = \textwidth, % define width of the caption text
skip = 1ex, % skip the space between float and caption
}
Post Reply