Re: SImboli logici

#84850
Up
0
Down
::

samiel” post=84632C’è qualcosa che continua a sfuggirmi. Il problema non è \tag, bensì \label.
Prendiamo questo esempio:
`\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage[math-style=upright]{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\setmathfont{Asana Math}
\usepackage{polyglossia}
\setmainlanguage{italian}
\usepackage{microtype}

%\newcommand\ap[1]{\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}
%\newcommand\ped[1]{\textormath{\textsubscript{#1}}{_{\mathrm{#1}}}}

\providecommand*\ap[1]{\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}
\providecommand*\ped[1]{\textormath{\textsubscript{#1}}{_{\mathrm{#1}}}}
`
E qualsiasi stringa io inserisca in \label per il pedice, mi dà errore

Più propriamente
`\providerobustcmd*\ap[1]{\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}
\providerobustcmd*\ped[1]{\textormath{\textsubscript{#1}}{_{\mathrm{#1}}}}`
oppure, ancora più semplicemente,
`\providerobustcmd\ap{\ifmmode^\expandafter\mathrm\else\expandafter\textsuperscript\fi}
\providerobustcmd\ped{\ifmmode^\expandafter\mathrm\else\expandafter\textsubscript\fi}`
Naturalmente occorre definire [tt]\textsubscript[/tt] (lo fa fixltx2e); [tt]\providerobustcmd[/tt] è di etoolbox caricato da polyglossia.

Lascio agli amanti dell’esegesi la spiegazione del codice più semplice. 😉

Ciao
Enrico

Go to top