TransWikia.com

How I can use the FiraSans font for only one word?

TeX - LaTeX Asked by RIXS on February 26, 2021

I have a .tex file and I want to use a particular font for a single word.
So since I’m new to latex, what I’m doing is adding in the preample this

usepackage[T1]{fontenc}
usepackage[scaled=.85]{FiraSans}
usepackage{newtxsf}

but clearly then it is applied to all the pdf document.
How can I use this font for only a single word ?
Thank you.
(I’m using texmaker)

2 Answers

A solution without loading the full font package:

documentclass{article}

usepackage[T1]{fontenc}
% usepackage{newtxsf}  % from the question, not needed here.

makeatletter
newcommand*{FiraSans@scale}{.85}
makeatother

newcommand*{FiraSans}{%
  fontfamily{FiraSans-LF}%
  selectfont
}
DeclareTextFontCommand{textFiraSans}{FiraSans}

begin{document}
The single textFiraSans{word} inside a sentence.
end{document}

enter image description here

Remarks:

  • The font package FiraSans.sty supports the traditional Type 1 fonts and the newer OpenType fonts of XeTeX/LuaTeX. Since the file in the question uses usepackage[T1]{fontenc}, the test file uses Type 1 fonts.

  • LF in the family name means "lining figures"; use "OsF" for "old-style figures".

  • Not relevant for a single word: a T at the end of the family name means that figures are intended to be used in tables and are therefore mono-spaced.

Correct answer by Heiko Oberdiek on February 26, 2021

Hope this meets your requirement:

documentclass{book}
usepackage[T1]{fontenc}
usepackage[scaled=.85]{FiraSans}
usepackage{newtxsf}

begin{document}
textsf{FiraSans}
end{document}

Output

enter image description here

Answered by MadyYuvi on February 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP