Text FormattingBest space after ordinal superscript?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Best space after ordinal superscript?

Post by clemens »

Hello,

I am a beginner using Latex (XeTex) with Lyx.
I notice that when I make the pdf out of my tex/lyx file the space between an ordinal's superscript (ex. 3rd, 11th etc.) and the following word is quite big and not so nice.
I used the commad \textsuperscript for the superscript and afterwards I tried putting varoius types of space (normal, thin, half quad, custom 0.1 em, interworw space), but none proved satisfactory.
I know there is the engord package to deal with these things automatically, but being a beginner and using Lyx (I don't know many tex commands), I am not able to use it (I can barely manage preamble code and random tex commands, but my attempts haven't worked).
Thanks for any suggestion.
Cheers

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Best space after ordinal superscript?

Post by meho_r »

Hi. Did I understand well: you type some number and than using superscript for suffix, i.e.

Code: Select all

...some text 3\textsuperscript{rd} and more text...
I don't get any unusual results here, not for inserting superscript "LyX's way" (insert > formatting > superscript) or using ERT and typing above command. Please, provide minimum working example.
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Best space after ordinal superscript?

Post by clemens »

Thanks for the reply.
I missed the lyx insert superscript option, but still, even this is not exactly very nice.
I am attaching two example files (lyx changed into tex and the relative pdf). For some reason in all the cases the distance seems too much.
Cheers

P.s. I am about to post some more questions :oops: , one related to too long page headers, one related to indented footnotes and one regarding xeCJK interfering with some fonts.
Attachments
superscript space problem.pdf
(31.09 KiB) Downloaded 342 times
example space.tex
(3.74 KiB) Downloaded 284 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Best space after ordinal superscript?

Post by meho_r »

I really can't say what is the best space after ordinals, you'll have to decide that alone, but to keep all spaces the same you may define a new command and use it for ordinals. This way, if you later decide to change the space, you only have to change it once and the change will reflect on all instances.

Use ERT box to define something like this somewhere in your document or in the Preamble:

Code: Select all

\newcommand{\tss}[1]{\textsuperscript{#1}\hspace{1pt}}
You may place whatever name for the command you like instead of tss, and define the space as you like (note \hspace{1pt} command, replace 1pt with your desired space).

In your document, use the above command this way:

Code: Select all

...some text 3\tss{rd}following text...
Note that you shouldn't have a space after {rd} (in case of LyX, after ERT box).
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Best space after ordinal superscript?

Post by clemens »

Thank you very much :)
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Best space after ordinal superscript?

Post by gmedina »

Why don't you just use some of the packages designed to typeset ordinal numbers (e.g., engord or nth)?

Code: Select all

\documentclass{article}
\usepackage{engord}

\begin{document}

The \engordnumber{1} element of the list ...

The \engordnumber{1}.

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Best space after ordinal superscript?

Post by gmedina »

meho_r wrote:...
Use ERT box to define something like this somewhere in your document or in the Preamble:

Code: Select all

\newcommand{\tss}[1]{\textsuperscript{#1}\hspace{1pt}}
...
This will generate wrong spacing if the next character is a punctuation sign. This can be solved by loading the xspace package and using something like

Code: Select all

\newcommand{\tss}[1]{\textsuperscript{#1}\xspace}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
clemens
Posts: 77
Joined: Fri Jun 26, 2009 11:57 am

Re: Best space after ordinal superscript?

Post by clemens »

I didn't notice, but very good to know. Thank you.
Post Reply