summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/AkkTeX/akkstring.sty
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-17 20:51:29 +0000
committerNorbert Preining <preining@logic.at>2007-11-17 20:51:29 +0000
commit56012c4c0dc3ceaff82d5e972f1ba8fce01fe19c (patch)
treeb6751807da50ae9d95961384adfb22c25ac19dc8 /Master/texmf-dist/tex/latex/AkkTeX/akkstring.sty
parentf1e7cb488db35805dc683e0f4c40afebd559d88a (diff)
new package AkkTeX (->latexextra)
git-svn-id: svn://tug.org/texlive/trunk@5484 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