summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/akktex/akkstring.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-19 18:01:32 +0000
committerKarl Berry <karl@freefriends.org>2012-04-19 18:01:32 +0000
commitbf4db43a7562e7e1c14012c133867620f2da3da6 (patch)
treeff92d433d0f52c57771e0a40451f7b217cfccad0 /Master/texmf-dist/tex/latex/akktex/akkstring.sty
parente206c9762da30438bee956fb796e43f39a6e987c (diff)
akktex from AkkTeX
git-svn-id: svn://tug.org/texlive/trunk@26055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/akktex/akkstring.sty')
-rw-r--r--Master/texmf-dist/tex/latex/akktex/akkstring.sty54
1 files changed, 54 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/akktex/akkstring.sty b/Master/texmf-dist/tex/latex/akktex/akkstring.sty
new file mode 100644
index 00000000000..28fcbdfa405
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/akktex/akkstring.sty
@@ -0,0 +1,54 @@
+%=====================================================================================================================================
+% Package akkstring by Igor Akkerman (c) 2004, 2005
+% Package providing string operation utilities.
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License (latest version).
+%
+% The latest version of this license can be found at
+% http://www.latex-project.org/lppl.txt
+%
+% This file may only be distributed together with the full 'AkkTeX' bundle.
+%=====================================================================================================================================
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{akkstring}[2005/04/30 1.2.2 by Igor Akkerman (c) 2004, 2005 Package providing string operation utilities.]
+%=====================================================================================================================================
+
+\RequirePackage{ifthen}
+
+\makeatletter
+
+\newcommand \ignore[1] {}
+\newcommand \ign[1] {}
+
+\newcommand \centerln[1] {\hspace*{\fill}{#1}\hspace*{\fill}}
+
+\newcommand \firstchar[1] {%
+ \def\@firstof##1##2!!!{##1}%
+ \expandafter\@firstof#1!!!%
+}
+
+\newcommand \removefirstchar[1] {%
+ \def\@restof##1##2!!!{##2}%
+ \expandafter\@restof#1!!!%
+}
+
+% \extractleadingnumber {<string>} {<countername>}
+\newcommand \extractleadingnumber[2] {%
+ \setbox0=\hbox{\global\csname c@#2\endcsname 0#1\relax}%
+}
+
+% \extractnumber {<string>} {<countername>}
+\newcommand \extractnumber[2] {%
+ \def\@restof##1##2!!!{##2}%
+ \def\@remblank##1##2!!!{##1##2}%
+ \edef\@string{#1}%
+ \extractleadingnumber\@string{#2}%
+ \whiledo{\(\not \equal{\@string}{}\) \and \value{#2} = 0} {%
+ \edef\@string{\expandafter\@restof\@string!!!}%
+ \edef\@string{\expandafter\@remblank\@string!!!}%
+ \extractleadingnumber\@string{#2}%
+ }%
+}
+
+\makeatother