I need some custom decorator symbols, like \tilde
in math mode.
The package MnSymbol has some neat symbols so I figured I would import these as suggested here:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{accents}
\usepackage{bm}
% import certain symbols from MnSymbol,
% https://tex.stackexchange.com/questions/450691/create-diamond-with-a-dash-in-it/450703#450703
\def\ImportFromMnSymbol#1{%
\DeclareFontFamily{U} {MnSymbol#1}{}
\DeclareFontShape{U}{MnSymbol#1}{m}{n}{ <-6> MnSymbol#15 <6-7> MnSymbol#16 <7-8> MnSymbol#17 <8-9> MnSymbol#18 <9-10> MnSymbol#19 <10-12> MnSymbol#110 <12-> MnSymbol#112 }{}
\DeclareFontShape{U}{MnSymbol#1}{b}{n}{ <-6> MnSymbol#1-Bold5 <6-7> MnSymbol#1-Bold6 <7-8> MnSymbol#1-Bold7 <8-9> MnSymbol#1-Bold8 <9-10> MnSymbol#1-Bold9 <10-12> MnSymbol#1-Bold10 <12-> MnSymbol#1-Bold12 }{}
\DeclareSymbolFont{MnSy#1} {U} {MnSymbol#1}{m}{n} }
\newcommand\DeclareMnSymbol[4]{\DeclareMathSymbol{#1}{#2}{MnSy#3}{#4}}
\ImportFromMnSymbol{C}
\DeclareMnSymbol{\smalltriangleup}{\mathbin}{C}{73}
\begin{document}
$
\tilde{f}
\quad \tilde{\bm{f}}
\quad \overset{\smalltriangleup}{f}
\quad \stackrel{\smalltriangleup}{f}
$
\end{document}
My issue is that I'm clueless how to get the symbol positioned correctly:
The last attempt is in the right direction visually, but the method does not seem to be right, because when highlighting and copying the text from the pdf one gets a triangle symbol followed by an f, instead of a plain f.
So how is it done properly? It is nice that Amsmath figures out how to position the tilde symbol pleasingly, is there a way to take advantage of that?
I remember the accents
package being recommended, but with that package loaded not even the tilde is properly positioned any more: