Fonts & Character SetsFont Size in Headings, Abstract, Thanks and other Parts

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
farnaz
Posts: 9
Joined: Tue Nov 08, 2011 7:00 am

Font Size in Headings, Abstract, Thanks and other Parts

Post by farnaz »

Hi,
I want to set font size in pt unit (not Large and ...) for heading, section, subsection, abstract.
However, I have 2 problem with them:
1-\fontsize is not working.
2- some of them have not optional part for setting font size.
can anyone help me?

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Font Size in Headings, Abstract, Thanks and other Parts

Post by Stefan Kottwitz »

Hi Farnaz,
farnaz wrote: 1-\fontsize is not working.
perhaps you don't use it in the right way. How do you use it, how is your code?
farnaz wrote: 2- some of them have not optional part for setting font size
Use \fontsize and \selectfont afterward to change the font. This change has effect until the end of the environment or group or another font size changing command. \normalsize returns to the standard size too.

Stefan
LaTeX.org admin
farnaz
Posts: 9
Joined: Tue Nov 08, 2011 7:00 am

Font Size in Headings, Abstract, Thanks and other Parts

Post by farnaz »

For example in author:

Code: Select all

\author{\fontsize{11}{13}...
The command \fontsize does not change font anyway.
Or in \section command, I put font size in optional part. However, it does not work:

Code: Select all

\section[12pt]{Kinematic Mode;}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Font Size in Headings, Abstract, Thanks and other Parts

Post by Stefan Kottwitz »

As I mentioned, always use \selectfont after \fontsize.

This works:

Code: Select all

\author{\fontsize{11}{13}\selectfont Author}
The optional argument of \section is not for font settings, it can be used to put a version of the section title into the table of contents and into the headers, such as

Code: Select all

\section[short title]{long title in heading in text}
So this would work:

Code: Select all

\section[Kinematic Mode]{\fontsize{12}{13}\selectfont Kinematic Mode}
However, I would not change font sizes or shape in the text or its headings. Instead, I would define a command such as

Code: Select all

\newcommand{\sectionsize}{\fontsize{12}{13}\selectfont}
and use this command later in the text. This way you have the size definition once in the preamble, not many times in the text, which makes adjustments easier. The same for other settings.

And I would go further, redefining the \section command or a related macro instead of using a size command in argument, the heading text, using the titlesec package or redefining macros of the document class.

Stefan
LaTeX.org admin
farnaz
Posts: 9
Joined: Tue Nov 08, 2011 7:00 am

Re: Font Size in Headings, Abstract, Thanks and other Parts

Post by farnaz »

Thanks for your practical and useful answer.
I will try it soon.
Post Reply