[Tex/LaTex] Correct diameter symbol needed without stix package (pdflatex)

pdftexstixsymbolsunicode

I have drawn a custom diameter symbol in TikZ and now I need the correct unicode glyph (U+2300 ) in my document (pdftex) to provide the right copy-paste text in the pdf. I've found that the \diameter symbol from the stix package produces the right glyph (testable at fileformat.info, it should say "DIAMETER SIGN" as the only result), but in my document stix produces many errors (Too many symbol fonts declared. ...ont{arrows2} {LS1}{stixsf} {m}{it}) for which I wasn't able to find a fix.

So, how can I get the needed unicode glyph in my document with pdftex without using stix? No other symbol package I've tested produces the right glyph.

edit: I've looked into stix.sty and tried to use the definition from there, but this creates the wrong symbol …

\documentclass{standalone}
\DeclareMathSymbol{\diam}{\mathord}{symbols}{"60}
\begin{document}
\(\diam\) % should always produce U+2300 
\end{document}

enter image description here

This answer might apply here, but I couldn't get it to work for me.

Best Answer

You don't need to set up a math font for just one symbol.

\documentclass{standalone}
\usepackage{amsmath}

\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareRobustCommand{\diameter}{%
  \text{\usefont{LS1}{stixscr}{m}{n}\symbol{"60}}%
}

\begin{document}
\(\diameter\) % something producing the U+2300 glyph
\end{document}

enter image description here

If I copy from the PDF and paste it in http://r12a.github.io/apps/conversion/ I get

enter image description here

Related Question