Text FormattingChange font type for part of document

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
pawhan11
Posts: 9
Joined: Mon Sep 22, 2014 10:27 am

Change font type for part of document

Post by pawhan11 »

Hello.

I need to use different font for only few words in my document.
Font that I need to use is that one or Arial Black (I think they are the same):
http://www.tug.dk/FontCatalogue/grotesk/


Example of what I mean:

Code: Select all

\documentclass[9pt,a4paper]{article}

\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{helvet} 
\renewcommand{\familydefault}{\sfdefault}
\normalfont

\begin{document}

this is in helvet. This needs to be ingrotesk. This is in helvet .

\end{document}
Thanks for help :)
Last edited by Stefan Kottwitz on Fri Oct 10, 2014 2:32 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Change font type for part of document

Post by Stefan Kottwitz »

Hello,

for example:

Code: Select all

this is in helvet. {\fontfamily{ugq}\selectfont This needs to be ingrotesk.}
This is in helmet.
The braces group, i.e. they keep changes local. Another way, changing the font like said on that page you linked:

Code: Select all

this is in helvet.
{\renewcommand*{\sfdefault}{ugq}\normalfont This needs to be ingrotesk.}
\normalfont This is in helvet.
The last \normalfont could be omitted, I inserted it to show that the font is really the normal font again, after that change.

Stefan
LaTeX.org admin
pawhan11
Posts: 9
Joined: Mon Sep 22, 2014 10:27 am

Re: Change font type for part of document

Post by pawhan11 »

Thanks. Exactly what I needed.

Problem solved
Post Reply