texlive[54252] Master: nth own package, from genmisc

commits+karl at tug.org commits+karl at tug.org
Thu Mar 12 17:59:45 CET 2020


Revision: 54252
          http://tug.org/svn/texlive?view=revision&revision=54252
Author:   karl
Date:     2020-03-12 17:59:44 +0100 (Thu, 12 Mar 2020)
Log Message:
-----------
nth own package, from genmisc

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/generic/nth/
    trunk/Master/texmf-dist/tex/generic/nth/nth.sty
    trunk/Master/tlpkg/tlpsrc/nth.tlpsrc

Added: trunk/Master/texmf-dist/tex/generic/nth/nth.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/nth/nth.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/nth/nth.sty	2020-03-12 16:59:44 UTC (rev 54252)
@@ -0,0 +1,56 @@
+% nth.sty  version 2002/27/02 Donald Arseneau
+% Ordinal numbering style, 1st 2nd 3rd 4th 5th... 12th... 101st 102nd...
+%
+% (Public domain: take, include, extract, whatever)
+%
+% In LaTeX: 
+%           \usepackage[super,negative]{nth}
+% where option [super] gives superscript `th'
+% and option [negative] allows ``st, nd, rd'' suffixes on negative numbers.
+%
+% example:  \renewcommand{\thesection}{\ordinal{section}}
+% or        \renewcommand{\thesection}{\@ordinal\c at section}
+% or        \renewcommand{\thesection}{\nth\c at section}
+%   
+% In plain TeX: 
+%           \input nth.sty
+% use:      \nth{<number>}.
+% Change formatting by redefining \nthscript and \nthtest
+
+\def\nth#1{% First print number:
+  \expandafter\nthM \number #1\relax
+  \nthscript{%
+  \ifnum#1\nthtest0 th\else % negatives are all ``th'' (depending on \nthtest)
+  \expandafter \nthSuff \expandafter 0\number\ifnum #1<0-\fi#1\delimiter
+  \fi
+ }}
+
+% Minus sign using math mode:
+\def\nthM#1{\if -#1\ifmmode-\else$-$\fi\else #1\fi}
+
+% Print suffix depending on last two digits:
+\def\nthSuff#1#2#3{%
+ \ifx \delimiter#3% #1#2 are last two digits
+   \ifnum #1=1 th%  teens are always ``th''
+   \else % use appropriate suffix
+     \ifcase #2 th\or st\or nd\or rd\else th\fi
+   \fi
+ \else % continue scanning for last two digits
+   \expandafter \nthSuff \expandafter #2\expandafter #3%
+ \fi}
+
+% Formatting hook for ordinals (\let\nthscript\textsuperscript)
+\def\nthscript#1{#1}% alternate: \def\nthscript#1{$\rm^{#1}$}
+
+% Formatting hook for all negative numbers giving ``th''
+\def\nthtest{<}  % alternate: \def\nthtest{=}
+
+\ifx\Alph\undefined\else
+ \def\ordinal#1{\expandafter\@ordinal\csname c@#1\endcsname}
+ \let\@ordinal\nth
+ \ProvidesPackage{nth}[2002/02/27]
+ \DeclareOption{super}{\def\nthscript{\textsuperscript}}
+ \DeclareOption{negative}{\def\nthtest{=}}
+ \ProcessOptions
+\fi
+


Property changes on: trunk/Master/texmf-dist/tex/generic/nth/nth.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-03-12 16:57:44 UTC (rev 54251)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-03-12 16:59:44 UTC (rev 54252)
@@ -520,7 +520,7 @@
     nomencl nomentbl nonfloat nonumonpart nopageno norasi-c90 normalcolor
     nostarch notes notes2bib notespages notestex
     notex-bst noto noto-emoji notoccite novel nowidow nox npp-for-context
-    nrc ntgclass ntheorem ntheorem-vn nuc nucleardata
+    nrc ntgclass nth ntheorem ntheorem-vn nuc nucleardata
     numberedblock numberpt
     numericplots numname numnameru numprint numspell nwejm
   oberdiek objectz obnov

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2020-03-12 16:57:44 UTC (rev 54251)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2020-03-12 16:59:44 UTC (rev 54252)
@@ -1644,6 +1644,7 @@
  'midnight',    'generic',
  'mkpattern',   'plain',
  'musixtnt',	'generic',
+ 'nth',		'generic',
  'oberdiek',    'generic',
  'ocherokee',   'lambda',
  'ofs',         'generic',
@@ -1956,6 +1957,7 @@
  'noindentafter',       "noindentafter\.sty",
  'nomencl',	'\.sty',		# not .cfg
  'notes',       '[^s]\.(eps|pdf|png)|' . $standardtex,  # not notes.pdf
+ 'nth',		'\.sty',
  'ntheorem',    '\.sty|\.std',
  'nucleardata',	'\.(csv|hd|pytxcode)|' . $standardtex,
  'nwejm',	'[^c]\.cfg$|\.(.bx|sty|cls)$',	# not ltxdoc.cfg

Modified: trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc	2020-03-12 16:57:44 UTC (rev 54251)
+++ trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc	2020-03-12 16:59:44 UTC (rev 54252)
@@ -61,6 +61,7 @@
 depend multido
 depend navigator
 depend newsletr
+depend nth
 depend ofs
 depend olsak-misc
 depend path

Added: trunk/Master/tlpkg/tlpsrc/nth.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.