0

I declared custom font size at 45pt via the command

\font\myfont=cmr12 at 45pt

I'm writing an article with title in the first page. I want my title font size to be 45pt as defined above. So, I wrote in the preamble:

\title{ \textsc{ \textbf{\myfont Modules All Of Whose Right Submodules Are $C4$- 
       Modules}} } 

Everything works fine except that the $C4$, the part written in math mode is too smaller in font size that other letters in the title. How can I overcome this problem?

Thanks in advance.

3
  • you should not use \font in latex, that is a low level font command that cuts out all of the latex font machinary so the math will not see the size change and your \textsc and \textbf commands are doing nothing useful as \myfont will ignore them and use medium weight roman Feb 21, 2022 at 15:41
  • 1
    It is good practice to avoid all formatting commands in \title (the formatting should be specified in the \maketitle setup) but for a one-off title forced to 45pt use \fontsize{45pt}{50pt}\selectfont Feb 21, 2022 at 15:42
  • Can you provide please the full code of the \title and \maketitle after your modifications?. @DavidCarlisle Feb 21, 2022 at 15:51

1 Answer 1

1

you should not use \font in latex, that is a low level font command that cuts out all of the latex font machinery so the math will not see the size change and your \textsc and \textbf commands are doing nothing useful as \myfont will ignore them and use medium weight roman

enter image description here

\documentclass{article}

\usepackage{fix-cm}
\usepackage[T1]{fontenc}

\makeatletter
\def\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {
% old \LARGE
\scshape\bfseries\fontsize{45pt}{48pt}\selectfont 
\@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}

\makeatother

\begin{document}

\section*{Wrong}

\font\myfont=cmr12 at 45pt

Not bold, not small caps, not T1 encoded and math wrong size. Set on the wrong linespacing

\textsc{\textbf{\myfont Modules All Of Whose Right Submodules Are $C4$-Modules}}

\clearpage
\section*{Less Wrong}


Not bold 45pt small caps,  T1 encoded  and math.set on 48pt line spacing

{\fontsize{45pt}{48pt}\selectfont\textsc{\textbf{ Modules All Of Whose Right Submodules Are $C4$-Modules}}\par}

\clearpage
\section*{More right}

Formatting separated from the document markup.

\title{Modules All Of Whose Right Submodules Are $C4$-Modules}

\maketitle

\end{document}
7
  • It works but the title is not centered in the page!! Feb 21, 2022 at 17:33
  • @HusseinEid the title is centred in the last example so I don't understand your comment. If you mean you don't want it centred start from your current definition and just add the font. I started from the definition in article class as you had given no example or information. Feb 21, 2022 at 17:42
  • I mean that I want the title to be centered vertically. Indeed, the title is centered horizontally. I'm using article class as well. I apologize if I disturb you. Feb 21, 2022 at 17:54
  • @HusseinEid well that is a completely different question than the one you asked, as your original code would not have made a vertically centered title. However put \vspace*{\fill} at the start and end of the definition of the title. Feb 21, 2022 at 17:56
  • Thanks alot David ♥ . Feb 21, 2022 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .