
答案1
您可以考慮用 包裹 & 符號\textnormal
,然後將內部字體變更為等寬字體,以防止同一範圍內其他字體命令的干擾。這可確保 & 符號始終排版為中等粗細、直立和等寬字體。
\documentclass{article}
\newcommand*{\ttand}{\mathord{\textnormal{\ttfamily\&}}}
\begin{document}
\itshape $\ttand$ % shape
\bfseries$\ttand$ % weight
\sffamily$\ttand$ % family
\sffamily\scshape\bfseries$\ttand$ % or even all three!
\end{document}
答案2
我會用\mathtt
.
\documentclass{article}
\newcommand*\ttand{\mathtt{\mathchar\inteval{"7000+`\&}}}
\begin{document}
text $\ttand$ text
\textit{text $\ttand$ text}
\end{document}
解釋:我們想要得到一個尊重目前數學組的符號,因此它的數學代碼應該是"70xx
,其中"xx
是 的 ASCII 代碼&
。由於我懶得找後者,所以我使用簡單的算術。