Document Classes ⇒ font size in caption package
font size in caption package
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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: font size in caption package
\RequirePackage[T1]{fontenc}
\RequirePackage[urw-garamond]{mathdesign}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
font size in caption package
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
font size in caption package
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}
Code: Select all
\RequirePackage[compatibility=false]{caption}
Stefan
Re: font size in caption package
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
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
font size in caption package
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
Re: font size in caption package
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..
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: font size in caption package
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
font size in caption package
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...adhikarig wrote: labelfont = footnotesize,
textfont = footnotesize,
Re: font size in caption package
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
}