I use relsize
to create a pretty version of the string "C++". This produces warnings when put into footnote
s or small
environments, because the result would be "too small". How can I prevent this without having to resort to a different macro for those situations?
This is a MWE:
\documentclass{scrbook}
\usepackage{xspace}
\usepackage{relsize}
\usepackage{hyperref}
\def\cpp{\texorpdfstring{\protect C\nobreak\hspace{-.05em}\raisebox{.4ex}{\relsize{-3}\textbf{++}\xspace}}{C++}}
\usepackage{scrhack}
\begin{document}
\chapter{one}
\cpp\ works
foobar\footnote{\cpp\ produces warning}
\chapter{two \cpp}
\end{document}
The warning produced is:
Package relsize Warning: Font size 5.20834pt is too small.
(relsize) Using 6.0pt instead on input line 18.
I have tried using \scalebox{.5}{\textbf{++}}
instead of relsize
. This works nicely for the footnote, but then the command cannot be used as part of a chapter-title anymore.