導入字型、直積分符號

導入字型、直積分符號

我嘗試了很多(2天)並試圖找到一種方法來擴展答案

將 XITS 與 pdflatex 結合使用

但我無法理解這裡的方法。如何擴展上述答案以包括垂直閉積分,例如“\ oint”

到目前為止,我一直在使用直垂直積分符號,現在我需要閉積分。我怎麼做

在此輸入影像描述

答案1

基於連結答案你奉獻了自己,我想這就是你所尋找的。

\documentclass{article}
\usepackage{amsmath}

\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}

\DeclareSymbolFont{integrals}{LS2}{stixcal}{m}{n}
\DeclareMathSymbol{\ointupop}{\mathop}{integrals}{"B2}

\makeatletter
\renewcommand*{\oint}{\DOTSI\ointupop\ilimits@}
\makeatother


\begin{document}
\[
  \oint
\]
\end{document}

您可以找到字元代碼點的定義(例如, B2for \oint) 在tex/latex/stix/stix.sty你的 LaTeX 發行版中。

答案2

簡單的方法

正如egreg 所寫,簡單的答案是\usepackage[upint]{stix}。 XITS 是 STIX 字體的一個分支。

\documentclass{article}
\usepackage[upint]{stix}

\begin{document}
\[ \int \oint \oiint \iint \iiint \]
\end{document}

STIX 升級樣本

複雜的方法

如果您想以傳統方式新增單一符號,您需要尋找包文件它們位於哪種字體的哪個插槽中stix-mathcalstix.sty

由於該符號有兩個版本,一個顯示樣式的版本位於插槽“E8”,另一個較小的版本位於“B2”,因此您實際上需要使用 來在它們之間進行選擇\mathchoice

\documentclass{article}

\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}

\DeclareSymbolFont{integrals}{LS2}{stixcal}{m}{n}

\DeclareMathSymbol{\ointupbig}{\mathop}{integrals}{"E8}
\DeclareMathSymbol{\ointupsmall}{\mathop}{integrals}{"B2}

\DeclareRobustCommand{\ointup}{\mathchoice{\ointupbig}{\ointupsmall}{\ointupsmall}{\ointupsmall}}

\begin{document}
\( \displaystyle
   \oint_{\oint_{\oint}} \quad
   \ointup_{\ointup_{\ointup}} \)

\( \oint \quad
   \ointup \)
\end{document}

同一文檔中的傾斜和直立 <code>\oint</code>

我不建議這樣做,因為它依賴於stix包的繁瑣的小實現細節,遇到了遺留數學字母的限制,並且有其他怪癖。

但是,我想這就是你問的問題,怎麼辦?

現代方式

您也可以使用 來執行此操作unicode-math,我建議除非您被迫提交到尚不支援 LuaLaTeX 或 XeLaTeX 的網站。

如果您想使用 XITS Math 作為數學字體,您可以使用以下命令加載它

\setmathfont[StylisticSet=8]{XITS Math}

如果你想將XITS直立積分與其他字體一起使用,可以加入指令

\setmathfont[range={"222B-"2233,"2A0B-"2A1C},StylisticSet=8]{XITS Math}

載入 main 後\setmathfont。這也適用於 STIX Two Math。如果您要混合具有不同高度的不同數學字體,您可能需要新增Scale=MatchUppercase字體選項。

答案3

wasysym.sty是最簡單的方法之一,MWE(因為您沒有提供任何MWE,所以我根據標準模板給出了建議)是:

\documentclass{book}
\usepackage[integrals]{wasysym}
\begin{document}

\[
\int
\]

\end{document}

相關內容