问题:
无法创建包含 Font-Awesome 图标作为frametitle
使用默认图标的通用解决方案mdframed
。
最小工作示例(MWE):
\documentclass{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage[medfamily,textosf,mathlf,mnsy,amsbb,mixedgreek,minionint,openg,footnotefigures]{MinionPro}
\usepackage{MnSymbol,pifont}
\usepackage[onlytext,medfamily,osf]{MyriadPro}
\usepackage[cmyk]{xcolor}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{fontawesome}
\linespread{1.25}
\definecolor{spotcolor}{cmyk}{1,0,0,0}
\newcommand{\colfancyhead}{spotcolor!40}
\newcommand{\colfancybox}{spotcolor!5}
\newcommand{\mdneedspace}{5\baselineskip}
\mdfdefinestyle{mddefinitionstyle}{%
linewidth=0pt,%
roundcorner=0pt,%
frametitlerule=false,%
apptotikzsetting={%
\tikzset{mdfframetitlebackground/.append style={fill=\colfancyhead}}%
\tikzset{mdfbackground/.append style={fill=\colfancybox}}%
},%
frametitlefont={\sffamily\bfseries\small\strut},%
theoremtitlefont={\sffamily\small},%
frametitleaboveskip=3pt plus 1pt,%
frametitlebelowskip=2pt plus 1pt,%
innertopmargin=7pt plus 1pt minus 1pt,%
innerbottommargin=8pt plus 1pt minus 1pt,%
outermargin = 0pt,%
innermargin = 0pt,%
splitbottomskip=10pt,%
splittopskip=14pt,%
needspace=\mdneedspace,%
skipabove=14pt plus 2pt minus 6pt,%
skipbelow=14pt plus 2pt minus 6pt%
}
\newmdenv[style=mddefinitionstyle]{fancybox}
\begin{document}
\begin{fancybox}[frametitle=\faExclamationCircle \nobreakspace\nobreakspace Note]
Lorem ipsum
\end{fancybox}
\end{document}
期望的结果:
每个 fancybox 的 frametitle 中默认包含一个图标。
提前感谢您对解决该问题的指导。