单词起始下标符号前的空格太小(仅限 LuaLaTeX)

单词起始下标符号前的空格太小(仅限 LuaLaTeX)

\textsuperscript在单词开头使用,我注意到,如下图所示,前一个单词和上标符号之间的空格,如果收缩,与其他空间相比变得太小了。

\raisebox如果使用而不是 ,也会出现问题\textsuperscript

编辑 quark67指出该问题仅发生在LuaLaTeX,而不发生在XeLaTeX

 \documentclass{article}
 \usepackage[lmargin=2.5cm,rmargin=2.5cm,bmargin=2.5cm,tmargin=3.5cm]{geometry}
 \usepackage{fontspec}
 \usepackage{graphicx}
 
 \setmainfont{Times New Roman}
 \newfontfamily\djvs[BoldFont={* Bold}]{DejaVu Sans}
 
    
 \newcommand{\tech}{\textbf{\textsuperscript{\scalebox{0.85}{\djvs\char"2318}}}}
    
 \NewDocumentCommand{\techlexAUX}{mmm}{\tech\textit{#1}\IfNoValueF{#2}{\textup{\textsubscript{\textsc{#2}}}}\IfNoValueF{#3}{ `#3'}}
 \NewDocumentCommand{\techlex}{>{\SplitArgument{2}{,}}m}{\techlexAUX#1}
 
 \begin{document}
    I'm trying \techlex{arbre,n,tree}.\vspace{1ex}
    
    Similarly, if \techlex{attirement,n,attracting} is essentially found under the affective sense, it nonetheless allows writers to play with the ambiguity between a literal and a figurative interpretation, implying here again a neutral primary meaning inherited from the verb, waiting for further interpretation.
 \end{document}

在此处输入图片描述

现在有了 XeLaTeX(没问题): 在此处输入图片描述

比字母大得多的符号F和负 \hspace (返回 Lua)

\newfontfamily\symbola{Symbola}[FakeBold=0.5]
\newcommand{\book}{\textsuperscript{\scalebox{1.2}{\symbola\char"1F4D6}}}

在此处输入图片描述

使用 XeLaTeX,书籍符号仍然存在间距问题。

在此处输入图片描述

使用 LuaLaTeX:

在此处输入图片描述

答案1

\textsuperscript命令与问题无关。Times New Roman 中的字母“f”在其边界框的右侧突出很多:

在此处输入图片描述

TeX Gyre Termes 的图片如下

在此处输入图片描述

不幸的是,没有提供斜体校正(也许可以使用 LuaLaTeX 添加,这样\hspace{...}您就可以键入 而不是命令\/)。

\documentclass{article}
\usepackage[lmargin=2.5cm,rmargin=2.5cm,bmargin=2.5cm,tmargin=3.5cm]{geometry}
\usepackage{fontspec}
\usepackage{graphicx}

\setmainfont{Times New Roman}[
  SmallCapsFont=TeX Gyre Termes,
  SmallCapsFeatures={Letters=SmallCaps},
]
\newfontfamily\djvs[BoldFont={* Bold}]{DejaVu Sans}

\newcommand{\tech}{%
  \textsuperscript{%
    \scalebox{0.85}{%
      \djvs\bfseries\symbol{"2318}%
    }%
  }%
}
    
\NewDocumentCommand{\techlexAUX}{mmm}{%
  \tech\hspace{-0.1em}%
  \textit{#1}%
  \IfNoValueF{#2}{\textsubscript{\upshape\scshape #2}}%
  \IfNoValueF{#3}{ `#3'}%
}
\NewDocumentCommand{\techlex}{>{\SplitArgument{2}{,}}m}{\techlexAUX#1}
 
\begin{document}

I'm trying \techlex{arbre,n,tree}.

\bigskip
    
Similarly, if \techlex{attirement,n,attracting} 

Similarly, if\hspace{0.1em} \techlex{attirement,n,attracting} 

\end{document}

笔记

  1. 我简化了命令。
  2. \kern的定义中的似乎\tech没有必要。
  3. 该符号应该靠近后面的斜体单词,而不是远离。
  4. 我添加了对小型大写字母的支持,因为我的 Times New Roman 版本没有它们。
  5. 我改成graphicsgraphicx你不想要1993年的版本,是吗?

在此处输入图片描述

答案2

我被告知不要对最初的问题进行过多的编辑,因此这里只是简要回顾一下。egreg不过,不会比所说的多太多。

为了弥补糟糕的斜体校正或较大的符号,最好在命令里面添加一个空格,像这样:

\documentclass{article}

 \usepackage[lmargin=2.5cm,rmargin=2.5cm,bmargin=2.5cm,tmargin=3.5cm]{geometry}
 \usepackage{fontspec}
 \usepackage{graphicx}
 
 \newfontfamily\symbola{Symbola}[FakeBold=0.5]
 \newcommand{\book}{\textsuperscript{\scalebox{1.2}{\symbola\char"1F4D6}}}
 
 \setmainfont{Times New Roman}
 \newfontfamily\djvs[BoldFont={* Bold}]{DejaVu Sans}
 
    
\newcommand{\tech}{\textbf{\textsuperscript{\scalebox{0.85}{\djvs\char"2318}}}}
    
\NewDocumentCommand{\techlexAUX}{mmm}{\hspace{0.05em}\tech\textit{#1}\IfNoValueF{#2}{\textup{\textsubscript{\textsc{#2}}}}\IfNoValueF{#3}{ `#3'}}
\NewDocumentCommand{\techlex}{>{\SplitArgument{2}{,}}m}{\techlexAUX#1}
 
\NewDocumentCommand{\booklexAUX}{mmm}{\hspace{0.05em}\book\textit{#1}\IfNoValueF{#2}{\textup{\textsubscript{\textsc{#2}}}}\IfNoValueF{#3}{ `#3'}}

\NewDocumentCommand{\booklex}{>{\SplitArgument{2}{,}}m}{\booklexAUX#1}
 
\begin{document}
    
Similarly, iz \techlex{attirement,n,attracting} is essentially found under the affective sense, it nonetheless allows writers to play with the ambiguity between a literal and a figurative interpretation, implying here again a neutral primary meaning inherited from the verb, waiting for further interpretation.
    
Similarly, if \techlex{attirement,n,attracting} is essentially found under the affective sense, it nonetheless allows writers to play with the ambiguity between a literal and a figurative interpretation, implying here again a neutral primary meaning inherited from the verb, waiting for further interpretation.
    
        
Similarly, iz \hspace{0.1em}\booklex{attirement,n,attracting} is essentially found under the affective sense, it nonetheless allows writers to play with the ambiguity between a literal and a figurative interpretation, implying here again a neutral primary meaning inherited from the verb, waiting for further interpretation.
        
Similarly, if \hspace{0.1em}\booklex{attirement,n,attracting} is essentially found under the affective sense, it nonetheless allows writers to play with the ambiguity between a literal and a figurative interpretation, implying here again a neutral primary meaning inherited from the verb, waiting for further interpretation.

\end{document}

在此处输入图片描述

相关内容