Re: Scrivere in apice “sopra” il testo (testo soprascr

#44701
Up
0
Down
::

Per esercizio ho provato a preparare questo:
`\documentclass{minimal}

\newcommand{\sopra}[2]{\ooalign{\hfil\hbox{#1}\hfil\cr\hfil\raise1.5ex\hbox{\makebox[0pt]{#2}}\hfil}}
\newcommand{\sotto}[2]{\ooalign{\hfil\hbox{#1}\hfil\cr\hfil\raise-1.5ex\hbox{\makebox[0pt]{#2}}\hfil}}

\begin{document}

testo testo testo testo testo testo testo testo testo testo testo testo testo testo testo testo

testo testo testo \sopra{sotto}{sopra} testo testo \sotto{sopra}{sotto} testo testo testo testo testo testo testo testo testo

testo testo testo testo testo testo testo testo testo testo testo testo testo testo testo testo
\end{document}`
Il vantaggio è che non va ad interferire con l’interlinea, lo svantaggio è che non va ad interferire con l’interlinea!

Pertanto devi fare attenzione all’argomento dei due “\raisebox” per non collidere con le linee precedenti e seguenti.

🙂
LuCa

`\newcommand{\sopra}[2]{%
\vbox{\offinterlineskip\ialign{\hfil\strut##\hfil\cr#2\cr\noalign{\kern-3pt}#1\cr}}}
\newcommand{\sotto}[2]{%
\vtop{\offinterlineskip\ialign{\hfil\strut##\hfil\cr#1\cr\noalign{\kern-3pt}#2\cr}}}`
Ciao
Enrico

Go to top