Quantcast
Channel: How to make all the fontawesome5 icons in a document small? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by egreg for How to make all the fontawesome5 icons in a document small?

$
0
0

In my opinion, fontawesome5 should have a scale option.Here's what you get normally

enter image description here

Unfortunately, the other given answer is not really good (see at the end for a comparison).

The idea can work, but in a different way. Here the scaling is 80% than the default size in all font sizes. You may want to experiment with the factor.

\RequirePackage{fix-cm}% if you use Computer Modern fonts\documentclass{article}\usepackage{fontawesome5}\makeatletter\AddToHook{cmd/faIcon/before}{%  \begingroup\fontsize{\fpeval{\f@size*0.8}}{0}\selectfont}\AddToHook{cmd/faIcon/after}{\endgroup}\makeatother\begin{document}{\Huge X\faIcon{youtube}Y\par}some text before \faIcon{youtube} some text after...\end{document}

enter image description here

Comparison with the other answer

\documentclass{article}\usepackage{fontawesome5}\AddToHook{cmd/faIcon/before}{\begingroup\small}\AddToHook{cmd/faIcon/after}{\endgroup}\begin{document}{\Huge X\faIcon{youtube}Y\par}some text before \faIcon{youtube} some text after...\end{document}

enter image description here

With \Huge it's exaggerated, but you'd get similar bad result in every font size.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>