如何在文本模式下同时提供上标和下标,但同时压缩条目?我发现以下方法首先在文本模式下获得上标和下标:文本模式下的上标和下标一起
\documentclass{article}
\makeatletter
\DeclareRobustCommand{\textsupsub}[2]{{%
\m@th\ensuremath{%
^{\mbox{\fontsize\sf@size\z@#1}}%
_{\mbox{\fontsize\sf@size\z@#2}}%
}%
}}
\makeatother
\begin{document}
X\textsupsub{ab}{c}X\textsupsub{c}{ab}X
\end{document}
是否有人知道该做什么或添加什么才能获得与普通下标或上标相关的类似结果?
我现在添加了一个 MWE:
%Definition des Dokumentes
\documentclass[12pt,a4paper,twoside,openright]{report}
%Schriftart Arial - ACHTUNG: Compile with XeLaTeX (not PDFLaTeX)!
\usepackage{fontspec}
\defaultfontfeatures{Scale = MatchLowercase}
\setmainfont{Arial}[Scale = 1.0]
%Deutsche Umlaute, Englisch
\usepackage[main = ngerman, english]{babel}
%Mathematische Symbole und Zeichen
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
% Sonstige Makros
% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
\makeatletter
\DeclareRobustCommand{\textsupsub}[2]{{%
\m@th\ensuremath{%
^{\mbox{\fontsize\sf@size\z@#1}}%
_{\mbox{\fontsize\sf@size\z@#2}}%
}%
}}
\makeatother
% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%
%
% Anfang von Dokumententext
%
%
% = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
\begin{document}
R\textsubscript{GT, b}
R\textsuperscript{*}
R\textsupsub{*}{GT, b}
\end{document}
它给出以下输出:
我希望将前两者混合起来,但它会生成太大的索引。
答案1
对于面临同样问题的人:我终于在这里找到了一个可行的答案:https://tex.stackexchange.com/a/8256/188437