答案1
我成功做到了!感谢这个答案。
\documentclass{article}
\usepackage{fontspec}
\usepackage{accsupp}
\usepackage{tikz}
\usepackage{stringenc}
\usepackage{pdfescape}
\usetikzlibrary{calc}
\makeatletter
\newcommand{\BeginAccSuppUnicode}[1]{%
\EdefSanitize\asu@str{#1}%
\edef\asu@str{%
\expandafter\expandafter\expandafter\asu@ToSpaceOther
\expandafter\asu@str\space\@nil
}%
\expandafter\let\expandafter\asu@str\expandafter\@empty
\expandafter\asu@ToHexUC\asu@str\relax
\EdefUnescapeHex{\asu@str}{\asu@str}%
\StringEncodingConvert{\asu@str}{\asu@str}{utf32be}{utf16be}%
\EdefEscapeHex{\asu@str}{\asu@str}%
\BeginAccSupp{%
unicode,%
method=hex,%
ActualText=\asu@str
}%
}
\begingroup
\lccode`\9=`\ %
\lowercase{\endgroup
\def\asu@SpaceOther{9}%
}
\def\asu@ToSpaceOther#1 #2\@nil{%
#1%
\ifx\\#2\\%
\expandafter\@gobble
\else
\asu@SpaceOther
\expandafter\@firstofone
\fi
{\asu@ToSpaceOther#2\@nil}%
}
\def\asu@ToHexUC#1{%
\ifx#1\relax
\else
\pgfmathHex{\the\numexpr`#1+"10000000\relax}%
\edef\asu@str{%
\asu@str
0\expandafter\@gobble\pgfmathresult
}%
\expandafter\asu@ToHexUC
\fi
}
\makeatother
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\node[text opacity=0]at ($(current page.north west)+(70.5ex,-37ex)$){
\BeginAccSuppUnicode{∫₃⁵ (x/(1-x²)) d}
\scalebox{14}[7.2]{x\rule{1pt}{0pt}}
\EndAccSupp{}
\hspace{-23pt}\scalebox{0.1}[7.2]{x}
};
\end{tikzpicture}
\[ \int_3^5\frac{x}{1-x^2}\,dx \]
\end{document}
编辑
又找到了一个解决方案工作原理相同。虽然它需要您手动将所有符号转换为 unicode,但它更紧凑。
\documentclass{article}
\usepackage{accsupp}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\node[text opacity=0]at ($(current page.north west)+(70.5ex,-37ex)$){
\BeginAccSupp{method=hex,unicode,ActualText=222b20832075 00280078002f00280031002d007800b200290029 0064}
\scalebox{14}[7.2]{x\rule{1pt}{0pt}}
\EndAccSupp{}
\hspace{-23pt}\scalebox{0.1}[7.2]{x}
};
\end{tikzpicture}