3

With \usepackage[sups]{XCharter}, when I have two references separated by a comma after the same word, I can't typeset the comma in the same style as the reference marks: \textsuperscrip{,} places it too high, while \textsu{} only works for numbers. I've tried to dig XCharter.sty to find a definition of \textsu and change it but I haven't found anything (at least not anything that seemed to give some sort of vertical spacing instruction. I'm not good at code digging, though...)


MWE:

\documentclass{article}
\usepackage[sups]{XCharter}
\begin{document}
\noindent
Some text\footnote{First}\textsuperscript{,}\footnote{Second}\\
Some text\footnote{Third}\textsu{,}\footnote{Fourth}
\end{document}

Spits out

enter image description here


[EDIT]

I've decided to raise the numbers typeset by \textsu instead of lowering those set by \textsuperscript, but keeping the nice superscript figures provided by XCharter. I need this to work with

1) \textsu itself; I've settled for

\usepackage{letltxmacro}
\LetLtxMacro\vecchiotextsu\textsu% see tex.stackexchange.com/questions/88001/when-to-use-letltxmacro
\renewcommand{\textsu}[1]
    {\vecchiotextsu{\raisebox{0.28ex}{#1}}}

2) endnote

\renewcommand{\makeenmark}{\textsu{\theenmark}}

3) \footnote

\makeatletter
    \renewcommand{\@makefnmark}
        {\raisebox{0.28ex}{\sufigures \@thefnmark}}
\makeatother

So this basically answers my question.

Arch Stanton
  • 1,497

1 Answers1

3

The font selected when \textsu is called has only the digits as superscripts and no other character.

Here's my proposal:

\documentclass{article}
\usepackage[sups]{XCharter}

\newcommand{\commasup}{%
  \textsuperscript{\kern-0.11111em \raisebox{-\height}{,}}%
}


\begin{document}

Some text\footnote{First}\commasup\footnote{Second}

\end{document}

enter image description here

Using a command has the advantage that, if you decide to use a different font, the definition can be easily adjusted and the document needs no other change.

egreg
  • 1,121,712
  • Thanks again :-) I don't understand, in -\height, it is minus what height? Anyway, I resolved to shift up the numbers instead... I overcomplicate for exercise, I'm going to try by myself first. I'll update in the comments. – Arch Stanton Oct 08 '15 at 12:56
  • @ArchStanton \height refers to the height of the material to be raised. – egreg Oct 08 '15 at 13:12
  • I'm not sure I got this right. \height assumes the value of the height (above the baseline of the superscripts) of the glyph inside the braces, so you basically remove that space moving it back to the baseline. Is it correct? – Arch Stanton Oct 08 '15 at 13:50
  • @ArchStanton \height refers to the height of the comma in scriptsize (because the font size has already been chosen); it has nothing to do with the fact we're in a superscript, that will be done later. The raising of lowering is done with respect to the baseline of the superscript. – egreg Oct 08 '15 at 15:00
  • Hi egreg, I've edited the question, have you got any suggestions? (Well that's a question that sounds silly, asked to you.) The recursive redefinition is farina del tuo sacco, I admit I don't understand it at all but I'm going to read the tutorial and remedy asap. Thanks for all the help, not only when answering directly to me of course :-) – Arch Stanton Oct 09 '15 at 10:05
  • @ArchStanton I don't understand why doing that. And an explicit 1.25pt is surely bad, as it will not work in other font sizes. – egreg Oct 09 '15 at 10:22
  • You're right about the 1.25pts, I'll redefine it, thanks. I'm doing it because I think it looks better, but mostly to learn something in the process. – Arch Stanton Oct 09 '15 at 10:34
  • Sorry, but I don't understand why raising the superscript figures just to get a worse result. Anyway, you get much better code with \DeclareRobustCommand{\textsu}[1]{\begingroup\sufigures\raisebox{0.26ex}{#1}\endgroup} – egreg Oct 09 '15 at 10:48
  • Those defined by XCharter in my opinion are too low, they get too much in the way. Thanks for the code! – Arch Stanton Oct 09 '15 at 10:53
  • I've found a way to shift the endnotes marks. Now I think it looks better... Not worth it for the aesthetics alone, sure thing. Your robust definition doesn't work (or I use it wrongly. I've placed it right after \usepackage[sups]{XCharter}): I get a undefined control sequence error. Why robust? I know something about robust vs fragile, I don't understand why you define it as robust. – Arch Stanton Oct 10 '15 at 17:32
  • Found: "With \DeclareTextFontCommand you get a robust command that will remain untouched when found in a moving argument such as a section title or a caption." http://tex.stackexchange.com/q/47259/35903 – Arch Stanton Oct 10 '15 at 17:39
  • @ArchStanton It's not really likely that \textsu ends up in some moving argument, but consistency is better. Since the default definition is robust, it's better to keep it such. – egreg Oct 10 '15 at 17:53
  • \DeclareRobustCommand{\textsu}[1]{{\sufigures\raisebox{0.26ex}{#1}}} works. I tried to use it in a section heading and I get a ! TeX capacity exceeded, sorry [input stack size=5000] error. Not an issue, just another "Why?!" for the collection. – Arch Stanton Oct 10 '15 at 20:33
  • I've tried \LetLtxMacro for the redefinition of \textsu. It works on section headings with the optional toc entry so.. I think it's good. – Arch Stanton Oct 11 '15 at 17:12