0

How can I afford both superscript and subscript in textmode, but with compressed incides? I have found the following approach to frist of all get both superscript and subscript in textmode: Superscript and subscript together in text mode

\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}

This works fine, but the indices are oddly big: enter image description here

Whereas when I just use subscript for instance, the indices are kind of compressed to fit in the text around: enter image description here

Does anyone know what to do or add to obtain a similar result regarding the incides to plain subscript oder superscript?


I have now added a 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}

It gives the following output:

enter image description here

I would like to have a mixture of the first two, but it generates too big indices.

3
  • 3
    I can't reproduce the output in your first picture. Are you sure this needs \textsupsub? This looks like math to me.
    – egreg
    Commented Feb 24, 2020 at 22:12
  • 2
    please edit your question so the image you show is generated by the posted code. Commented Feb 24, 2020 at 22:29
  • @egreg @David Carlisle I have added a MWE, hope it clarifies things. I use \textsupsub because I have to use Arial in my text and I didn't find a way to do so in equations hence math too. At least in the text I intend to use Arial for variables used in following equations.
    – TeXlearner
    Commented Mar 6, 2020 at 16:00

1 Answer 1

0

For anyone who is facing the same problem: I finally found a working answer here: https://tex.stackexchange.com/a/8256/188437

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .