How to print a warning sign (triangle with exclamation point)?

The fourier package provides \danger:

\documentclass{article}

\usepackage{fourier}

\begin{document}

\danger

\end{document}

I sometimes find that some of the fourier commands conflict with other packages I use, so if I only want this symbol I do:

\documentclass{article}

\begin{document}

{\fontencoding{U}\fontfamily{futs}\selectfont\char 66\relax}

\end{document}

which is essentially what \danger does. This requires the futs font family which is provided with the fourier package, so the package must still be installed even though it's not actually being loaded.

If the futs font isn't available, the transcript will show the message:

LaTeX Font Warning: Font shape `U/futs/m/n' undefined
(Font)              using `U/cmr/m/n' instead on input line 5.

This means that the cmr font is being used instead, which has the letter B in the \char 66 slot.


A \warning symbol (previously \danger) is provided by the fourier package (see The Comprehensive LATEX Symbol List, table 475, page 177).

If you don't have the need for the complete fourier package, but you want to use that symbol, you can extract it and use in your document:

\newcommand*{\TakeFourierOrnament}[1]{{%
\fontencoding{U}\fontfamily{futs}\selectfont\char#1}}
\newcommand*{\danger}{\TakeFourierOrnament{66}}

MWE

\documentclass{article}

\newcommand*{\TakeFourierOrnament}[1]{{%
\fontencoding{U}\fontfamily{futs}\selectfont\char#1}}
\newcommand*{\danger}{\TakeFourierOrnament{66}}

\begin{document}

\danger

\end{document}

Output

enter image description here


A simple build assigned to the unicode symbol, so you can use or \Warning:

mWE

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{newunicodechar}

\newcommand\Warning{%
 \makebox[1.4em][c]{%
 \makebox[0pt][c]{\raisebox{.1em}{\small!}}%
 \makebox[0pt][c]{\color{red}\Large$\bigtriangleup$}}}%

\newunicodechar{⚠}{\Warning}

\begin{document}

    Do⚠not⚠put your finger

    on the power plug.

\end{document}