链接中的此警告图标:如何打印警告标志(带有感叹号的三角形)?
这个最小代码:
\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\usepackage{xcolor}
\newcommand\dangersign[1][2ex]{%
\renewcommand\stacktype{L}%
\scaleto{\stackon[1.3pt]{\color{red}$\triangle$}{\tiny !}}{#1}%
}
\begin{document}
This is a danger sign 5ex tall: \dangersign[5ex]\par
Here is the default (2ex) size: \dangersign
\end{document}
!可以是黑色或白色请帮忙。提前谢谢
答案1
\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\usepackage{xcolor,amssymb}
\newcommand\dangersignb[1][2ex]{%
\scaleto{\stackengine{0.3pt}{\scalebox{1.1}[.9]{%
\color{red}$\blacktriangle$}}{\tiny\bfseries !}{O}{c}{F}{F}{L}}{#1}%
}
\newcommand\dangersignw[1][2ex]{%
\scaleto{\stackengine{0.3pt}{\scalebox{1.1}[.9]{%
\color{red}$\blacktriangle$}}{\color{white}\tiny\bfseries !}{O}{c}{F}{F}{L}}{#1}%
}
\begin{document}
This is a (black) danger sign 5ex tall: \dangersignb[5ex]\par
Here is the default (2ex) size: \dangersignb
This is a (white) danger sign 5ex tall: \dangersignw[5ex]\par
Here is the default (2ex) size: \dangersignw
\end{document}