Xetex 和组合 Unicode 字符

Xetex 和组合 Unicode 字符

我决定使用类似以下字符中的组合箭头:Ω⃗、M⃗、B⃗、Ω⃡、E⃡。

我已经在使用 xelatex,因为我需要其他类型字符的 unicode 支持。

然而,\newunicodechar{}{}事实证明这有点棘手,我所能做的就是在要组合的字符右侧放置一个向右或向左向右的箭头。

我希望有一种命令:

  1. 正确显示了像 Ω⃡ 这样的字符,即使我必须为单独的字符(如 Ω、B、M 等)进行编程...

  2. 字符后不留空格。例如,Ω⃗₀ 不应显示空格,如“Ω⃗ ₀”。

关于 pdf latex 也有人问过类似的问题,但我希望有更好的选择,因为我正在使用 xelatex,而且我不介意为单个字符进行编程。

理想情况下该命令允许我输入类似 Ω⃗ 之类的内容并自行处理显示。

编辑:感谢 daleif 的输入,这是一个最简单的例子:

\documentclass{book}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{blindtext, hyperref, verbatim, minted, graphicx, amssymb, textcomp, enumerate, tcolorbox, newunicodechar, textgreek, wasysym, tipa, eso-pic, lipsum, bbold, dsfont}
\usepackage[margin=1.3in]{geometry}

\usepackage{newunicodechar}
\usepackage{amsthm}

\newunicodechar{∂}{$\partial$}

\newunicodechar{×}{$\times$}
\newunicodechar{→}{$\rightarrow$}
\newunicodechar{⟨}{$\langle$}
\newunicodechar{⟩}{$\rangle$}
\newunicodechar{↦}{$->sto$}
\newunicodechar{∧}{$\wedge$}
\newunicodechar{∨}{$\vee$}
\newunicodechar{∃}{$\exists$}
\newunicodechar{∀}{$\forall$}
\newunicodechar{¬}{$\neg$}

\begin{document}

%LEAN: 
\begin{center}
\begin{tcolorbox}[width=5in,colback={white},title={\begin{center}\texttt{Lean \thelcounter} \addtocounter{lcounter}{1}  \end{center}},colbacktitle=Blue,coltitle=black]
\begin{minted}[breaklines, escapeinside=||||]{lean}

-- THIS HAS TO WORK: ∂⃗
def equal_arguments {X : Type} {Y : Type} {a : X} {b : X} (f : X → Y) (p : a = b) : f a = f b := congrArg f p

def equal_functions {X : Type} {Y : Type} {f₁ : X → Y} {f₂ : X → Y} (p : f₁ = f₂) (x : X) : f₁ x = f₂ x := congrFun p x

def pairwise {A : Type} {B : Type} (a₁ : A) (a₂ : A) (b₁ : B) (b₂ : B) (p : a₁ = a₂) (q : b₁ = b₂) : (a₁,b₁)=(a₂,b₂) := (congr ((congrArg Prod.mk) p) q)

\end{minted}
\end{tcolorbox}
\end{center}

\end{document}

相关内容