For example, I've written a text, and in the somewhere of there I wanna use different font size, font type, color etc. Or in another way, hown can I change my font temporarily within the text ?
-
1Duplicate of How do I use a particular font for a small section of my document.– Alan MunnMar 2, 2013 at 16:25
1 Answer
I've edited to correct problem with simple solution. Here's how I generally do it if the quantity of text is small enough to be done inline:
\documentclass[12pt]{article}
\newcommand\finline[3][]{\begin{myfont}[#1]{#2}#3\end{myfont}}%
% ENVIRONMENT FOR NEW FONT
\newenvironment{myfont}[2][]{\csname#2\endcsname[#1]}{}
\newcommand{\Alpine}[1][]{\fontfamily{Alpine}#1\selectfont}
\begin{document}
Original Font \finline[\fontsize{30}{36}]{Alpine}{Text in New Font}
returned to original font
\end{document}
Sorry I can't on this old-old computer turn my PDF into a jpg to show you. Will edit when I can. Obviously Alpine is a font installed on my computer. You will have to pick a font that is on your computer
-
1Thank you for this example. I was able to use it combined with another one to solve my issue regarding the tufte-book class and using Vietnamese: tex.stackexchange.com/questions/631157/…– StevenJan 31 at 8:41