Custom font sizes in LaTeX

When you’re preparing a report in LaTeX (What is LaTeX ?) and want to change the font size of the title and headings to custom font sizes, add the code given below in your preamble. If you are using LyX, go to Documents->Settings->LaTeX preamble and add the code below. (given below for chapter number font size 18, title font 18, center aligned, section font size 16 and subsection font size 14):

\usepackage{sectsty}
\chapternumberfont{\fontsize{18}{22}\selectfont}
\chaptertitlefont{\centering\fontsize{18}{22}\selectfont}
\sectionfont{\fontsize{16}{20}\selectfont}
\subsectionfont{\fontsize{14}{16}\selectfont}

Note that you need to have the package sectsty (see here or here) installed.

For boxed margins, use the fancybox package in LaTeX. Below is an example for box with rounded edges:

\usepackage{fancybox}
\fancyput(3.25in,-4.5in){%
\setlength{\unitlength}{1in}\fancyoval(7,10.0)}

Add the above in the preamble, and you’re done!

If you want to change the font size of text anywhere else in your report, use the following command (given below for font size 18):

\fontsize{18}{20}\selectfont Your text here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s