TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have downloaded the icon font "Font Awesome" to use unicode icons to illustrate my documents.

Using XeTeX, I was able to declare a new font family like this:


This works. Now, if I want to use an icon from the font, for example the floppy disk icon, I do the following:


I would however like to have a shorter way to use this icon. I would much prefer something like ... Some text \floppy more text... to avoid to manually have to reset the font after using the icon. I came across \DeclareUnicodeCharacter{f0c7}{\floppy}, but it seems like this wouldn't work with XeTeX.

Any ideas on how to "shortcut" this icon in a similar way?

share|improve this question
What's wrong with \newcommand*\floppy{{\fontawesome{}}} or similar? – Joseph Wright Aug 4 '14 at 8:14
@JosephWright Nothing :-) I guess that answers my question. – mritz_p Aug 4 '14 at 8:26
up vote 2 down vote accepted

You don't want a Unicode char here, you want a new command that inserts jsut the appropriate symbol.


I've used an extra pair of braces to group the font change so there is no need for \normalfont. Note that in the usual TeX way you will need to allow for the space-skipping which occurs after the command, e.g. \floppy{} more text not \floppy more text.

share|improve this answer
\setmainfont{Linux Libertine O}

Some awesome icons:
\faSave\   %%% loads automatically  the awesome icons


enter image description here

share|improve this answer
Thanks for your answer. I was not aware that there was a package for "Font Awesome". I do prefer the answer by @JosephWright though, since it does not require additional packages and works with other fonts too. – mritz_p Aug 4 '14 at 9:08
package fontawesome does nothing else than defining the font family and the macros \fa<name>. It doesn't touch any local font setting! – Herbert Aug 4 '14 at 9:11
I am aware of that. But the other method makes it very easy for me, to use other Icon Fonts, like the ones featured here fontsquirrel.com/fonts/list/classification/dingbat, without hesitation. – mritz_p Aug 5 '14 at 6:46
fontawesome itself defines the font family \FA. You can define any other icon font. It is overkill to use \newfontfamily for fontawesome! – Herbert Aug 5 '14 at 6:52
Thank you. Perhaps you misunderstood, I am not using the fontawesome package. – mritz_p Aug 5 '14 at 7:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.