插入 Unicode“增量”字符

插入 Unicode“增量”字符

我正在嘗試將 Unicode“增量”Δ 插入到我的文檔中,因為我正在描述兩個字元被誤用的問題。

我的 MWE 不起作用,因為我無法找出第二個\DeclareUnicodeCharacter輸入參數。 「inputenc」的文檔完全沒有資訊。我以為我分配了自己的巨集名稱,但它似乎值得注意。

我的大學論文格式的 .sty 文件包含以下幾行:

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{ecsthesis}[2003/25/04 v1.6 LaTeX document class]
\def\baseclass{book}

所以我假設我正在使用基於該類別的字體(在螢幕上,正文副本字體看起來喜歡12 磅泰晤士羅馬字體)

這是我的(非工作)MWE。如何定義 Unicle +2206 字元?

微量元素:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
% fix use of delta character
\DeclareUnicodeCharacter{0394}{$\Delta$}
% fix use of increment character
\DeclareUnicodeCharacter{2206}{\Increment}

\begin{document}
The Capital Delta `$\Delta$' character (Unicode +0394) looks like, 
but is not the same as, the Increment `\increment' character (Unicode +2206).
\end{document}

答案1

stix 字型有一個 \increment 符號。 \DeclareUnicodeCommand 並不是真正必要的,\increment沒有它也能運作。\DeclareUnicodeCommand只允許您直接在來源中插入 Δ:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{stix}

% fix use of increment character
\DeclareUnicodeCharacter{2206}{\increment}

\begin{document}
The Capital Delta `$\Delta$' character (Unicode +0394) looks like,
but is not the same as, the Increment $\increment ∆ $ character (Unicode +2206).
\end{document}

在此輸入影像描述

答案2

您使用的 pdflatex (或 Latex)僅限於 256 個字元編碼,因此一般情況下 Unicode 代碼不會在輸出中表示,因此您應該將 U+0394 和 U+2206 對應到\Delta(實際上是OT1 編碼中的字元1)羅馬字體)

如果您將unicode-math套件與 Unicode TeX 一起使用,則這是一個單獨的字元並定義為\increment

相關內容