My university lecturer requires Times New Roman font, with 14 pt text size for section, and 13 pt for subsection. I changed major font for 12(teacher request ) but I can't obtain right font size in sections. I read that it is possible to do with other font type, but I can use Times New Roman only. I strove to do that, but It is really hard for me, because, I'm neewbie.
[Tex/LaTex] How to determinate section font size 14pt, and subsection 13pt
fontsfontsize
Related Solutions
With sectsty
it's difficult to change the spacings; with titlesec
one has to rebuild all headings. Probably copying the definitions from article.cls
and modifying them is the easiest way:
\documentclass{article}
\makeatletter
\renewcommand\section{%
\@startsection{section}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\fontsize{10.95}{13.6}\bfseries}% 11pt
}
\renewcommand\subsection{%
\@startsection{subsection}{2}
{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1sp}% No space after subsections
{\normalfont\normalsize\bfseries}% normal size, boldface
}
\renewcommand\subsubsection{%
\@startsection{subsubsection}{3}
{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1sp}% No space after subsubsections
{\normalfont\normalsize}% normal size, medium
}
\makeatother
\usepackage{lipsum} % to provide mock text
\begin{document}
\section{This is large boldface}
\lipsum[2]
\subsection{This is normal size boldface}
\lipsum[2]
\subsubsection{This is normal size medium}
\lipsum[2]
\end{document}
The 1sp
for getting zero space is just a trick: if we put 0pt
, the heading would be in line (an optimization trick used by LaTeX not to increase the number of arguments). But 1sp is just indistinguishable from zero.
It sounds like you might just want to change the font of the entire document, as others have suggested.
But if you only want to change the font of the section and subsection headings, the memoir
class gives you easy access to format the headings. You can use the fontspec
package to create a font-switching command that you then apply to the headings using memoir
's built-in style commands. (Memoir's excellent manual is accessible by entering "texdoc memoir" at the terminal.)
This solution only works with LuaLaTeX
or XeTeX
.
This example contrasts the Times headings with dummy paragraph text, set in the default Computer/Latin Modern font.
\documentclass{memoir}
% Create a command to switch the font to Times for headings
\usepackage{fontspec}
\newfontfamily{\headingfont}{Times New Roman}
% Create headings that use this command
\makeheadstyles{myheadings}{%
\setsecheadstyle{\headingfont\bfseries}
\setsubsecheadstyle{\headingfont\itshape}
}
% \bfseries and \itshape are just examples;
% you could add any style or font commands here,
% as described in the memoir handbook
% Select your custom headings for the document
\headstyles{myheadings}
% Dummy paragraph text which will be displayed in default Computer Modern
\usepackage{lipsum}
%***************
\begin{document}
\section{Section Heading in Times}
\lipsum[1]
\subsection{Subsection Also in Times}
\lipsum[2]
\end{document}
Best Answer
To use Times New Roman as the main text font, you will likely need to compile your document with either XeLaTeX or LuaLaTeX. Under pdfLaTeX, several font packages provide clones of Times Roman, but not of Times New Roman.
The following code compiles under pdfLaTeX, XeLaTeX, and LuaLaTeX. It employs the
sectsty
package to modify the font settings for section- and subsection-level headers.