2

I don't know if this is a stupid question but is it possible to force every font to be a normal or an \mdseries font? I've searched for an hour for solutions but only found how to force a normal font within, say, an italic font; but this is not what I wanted.

Below is my MWE.

\documentclass{article}

\begin{document}
{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}
\end{document}

So how do you make the outcome to be 'summa cum laude' instead of 'summa cum ʟᴀᴜᴅᴇ'?

5
  • 1
    \renewcommand{\itshape}{\normalfont} \renewcommand{\bfseries}{\normalfont} \renewcommand{\scshape}{\normalfont}
    – user31729
    Commented Feb 5, 2017 at 9:58
  • 1
    Simplest approach seems to be to not use font comands instead of applying them and then breaking them.
    – Johannes_B
    Commented Feb 5, 2017 at 10:01
  • @Johannes_B: Yes, but can be tedious.
    – user31729
    Commented Feb 5, 2017 at 10:02
  • 3
    May I ask what's the use case for this? Why do you want the font attribute commands to be ignored?
    – siracusa
    Commented Feb 5, 2017 at 10:02
  • @siracusa: I think there's a bunch of existing .tex documents and it is too much work to replace everything perhaps over and over again.
    – user31729
    Commented Feb 5, 2017 at 10:33

3 Answers 3

5

Some version with a switch from one 'style' to another 'style'

I've used the version without \text... commands just for comparison.

\documentclass{article}

\let\textscorig\textsc
\let\textbforig\textbf
\let\textitorig\textit


\newcommand{\MakeAllLookTheSameAndBoring}{%
  \renewcommand{\textsc}[1]{##1}%
  \renewcommand{\textbf}[1]{##1}%
  \renewcommand{\textit}[1]{##1}%
}

\newcommand{\MakeAllLookDifferent}{%
  \let\textsc\textscorig
  \let\textbf\textbforig
  \let\textit\textitorig
}


\begin{document}

\MakeAllLookTheSameAndBoring

{\mdseries summa cum laude}

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

\MakeAllLookDifferent

{\mdseries summa cum laude}

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

\end{document}

enter image description here

2

There is no really simple solution, so here an MWE with an extended version of Christian Hupfer's comment. Your normal font is then defined by \rmfamily, \mdseries and \upshape.

\documentclass{article}

\let\sffamily\rmfamily
\let\ttfamily\rmfamily
\let\bfseries\mdseries
\let\scshape\upshape
\let\slshape\upshape
\let\itshape\upshape
\let\em\upshape

\begin{document}
{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}
\end{document}
1

Redefine \selectfont to always issue \fontseries{m} and \fontshape{n}:

\usepackage{xpatch}
\xpretocmd\selectfont{\fontshape{n}\fontseries{m}}{}{}

If you want a version where the font is only locally uniformized,

\documentclass{article}
\usepackage{xpatch}
\usepackage{letltxmacro}

\LetLtxMacro\standardselectfont\selectfont
\LetLtxMacro\boringselectfont\selectfont
\xpretocmd\boringselectfont{\fontshape{n}\fontseries{m}}{}{}
\def\BORINGFONTS{\LetLtxMacro\selectfont\boringselectfont}
\def\VARIEDFONTS{\LetLtxMacro\selectfont\standardselectfont}

\begin{document}

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

\BORINGFONTS

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

\VARIEDFONTS

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

{\BORINGFONTS{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}}

{\mdseries \textbf{summa} \textit{cum} \textsc{laude}}

\end{document}

enter image description here

You must log in to answer this question.

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