灵魂的下划线命令不适用于希伯来语

灵魂的下划线命令不适用于希伯来语

我正在尝试使用soul在希伯来语文档中划线的单词:

% !TEX TS-program = xelatex
\documentclass{beamer}
\usepackage{xcolor,soul}
\setul{0.2ex}{0.1ex}
\setulcolor{red}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\englishfontsf{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Arial}[Script=Hebrew]
\newfontfamily\opensansH{Open Sans Hebrew}[Script=Hebrew]

\begin{document}
\begin{frame}{הקדמה}
קו \ul{תחתון}.
\end{frame}
\end{document}

我收到“缺少字符”错误:

Missing character: There is no ת ("5EA) in font ectt1000!
Missing character: There is no ח ("5D7) in font ectt1000!
...

命令中的每个字母ul

这是为什么?

如果不可能的话,我可能会放弃它并使用斜体而不是下划线,但我想确保这是不可能的。

答案1

取决于您对“不可能”的定义:

交换到 lualatex 并使用lua-ul包。

卢阿

平均能量损失

% !TEX TS-program = lualatex
\documentclass{beamer}
%\usepackage{xcolor,soul}
%\setul{0.2ex}{0.1ex}
%\setulcolor{red}
\usepackage{xcolor,luacolor}
\usepackage[soul]{lua-ul}
\LuaULSetHighLightColor{red!12}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\englishfontsf{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Arial}[Script=Hebrew]
\newfontfamily\opensansH{Noto Sans Hebrew}[Script=Hebrew]

\begin{document}
\begin{frame}{הקדמה}
קו \ul{תחתון}.

קו \highLight{תחתון}.

\end{frame}
\end{document}

我必须阅读文档才能了解如何获得红色下划线。


试图:

使用\newunderlinetype,但目前我对贝塞尔曲线了解不够。

红色下划线

平均能量损失

% !TEX TS-program = lualatex
\documentclass{beamer}
%\usepackage{xcolor,soul}
%\setul{0.2ex}{0.1ex}
%\setulcolor{red}
\usepackage{xcolor,luacolor}
\usepackage[soul]{lua-ul}
\LuaULSetHighLightColor{red!12}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\englishfontsf{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Arial}[Script=Hebrew]
\newfontfamily\opensansH{Noto Sans Hebrew}[Script=Hebrew]

\newunderlinetype\myunderlinered{\cleaders\hbox{%
    \setlength\unitlength{.2ex}%
    \begin{picture}(5,0)(0,1)
      \thicklines
      \color{red}%
      \qbezier(0,0)(0,0)(5,0)%(0,0)(0.5,0)(1,0)
    \end{picture}%
}}

\newcommand\underLineR[1]{{\myunderlinered{#1}}}




\begin{document}
\begin{frame}{הקדמה}
קו \ul{תחתון}.

קו \highLight{תחתון}.

קו \underLineR{תחתון}.

\selectlanguage{english}
xxx\underLineR{abc}xxx yyy\underLineR{fghp}yyy zzz\underLineR{xyzqj}zzz

\underLineR{b} \underLineR{bb} \underLineR{bbb} \underLineR{bbbb}

\end{frame}
\end{document}

根据评论添加

图示\rule方法:

规则下划线

平均能量损失

% !TEX TS-program = lualatex
\documentclass{beamer}
\usepackage{xcolor,luacolor}
\usepackage[soul]{lua-ul}
\LuaULSetHighLightColor{red!12}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\englishfontsf{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\englishfont{Latin Modern Roman}[Script=Latin,Language=English]
\newfontfamily\hebrewfont{Arial}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Arial}[Script=Hebrew]
\newfontfamily\opensansH{Noto Sans Hebrew}[Script=Hebrew]
\newfontface\fsym{Noto Sans Symbols}
%
\newunderlinetype\myunderlinered{\cleaders\hbox{%
    \setlength\unitlength{.2ex}%
    \begin{picture}(5,0)(0,1)
      \thicklines
      \color{red}%
      \qbezier(0,0)(0,0)(5,0)%(0,0)(0.5,0)(1,0)
    \end{picture}%
}}
\newcommand\underLineR[1]{{\myunderlinered{#1}}}
%
\newunderlinetype\myunderlineredb{\color{red}\leaders \vrule height -.65ex depth .75ex}
\newcommand\underLineRb[1]{{\myunderlineredb{#1}}}
%
%\newcommand\underLineRc[1]{\underLine[color=red]{#1}}
\newcommand\underLineRc[1]{{\myunderlineredb{#1}}}


% ⚙ = 9881
%adapted from unisugar package:
%make ⚙ an escape character
\catcode`⚙=11%catcode for letter (unisugar package assigns a unicode char here)
\edef\⚙{⚙}
\catcode`⚙=0%escape character and control sequence

%◇ 9671 begin group
%◈ 9672 end group

\catcode`◇=1% 9671 begin group
\catcode`◈=2% 9672 end group



% underline
% לָשִׂים דָגֵשׁ
%
\newcommand⚙לש{\underLineRc}

\begin{document}
\begin{frame}{הקדמה}
קו \ul{תחתון}.

קו \highLight{תחתון}.

קו \underLineR{תחתון}.
\textenglish{cleaders of picture containing bezier curve}

קו \underLineRb{תחתון}.
\textenglish{leaders of vrule}


קו ⚙לש{תחתון}.

קו ⚙לש◇תחתון◈.
\textenglish{{\fsym \⚙} as escape for \texthebrew{{\fsym \⚙}לש} command}




\end{frame}
\end{document}

对于输入,定义一个方向中性的控制序列转义字符(这里是)、开始组()和结束组( ),以及一个执行的命令会更容易⚙לש

\newcommand⚙לש{\underLineRc}

和类型קו ⚙לש◇תחתון◈.,而不是像双向材料

קו \underLineRb{תחתון}.

(TeXWorks 中的代码没有问题;浏览器正在对 RTL 进行自己的解释。)

相关内容