summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/substr
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-09 00:44:40 +0000
committerKarl Berry <karl@freefriends.org>2006-01-09 00:44:40 +0000
commitb4fc5f639874db951177ec539299d20908adb654 (patch)
tree52f08823ca58fffe3db6a9b075635038c567626c /Master/texmf-dist/doc/latex/substr
parentdec3d98ebe442d7ea93efbaa8dd2e2be8149a467 (diff)
doc 4
git-svn-id: svn://tug.org/texlive/trunk@80 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/substr')
-rw-r--r--Master/texmf-dist/doc/latex/substr/README36
-rw-r--r--Master/texmf-dist/doc/latex/substr/testsubstr.tex50
2 files changed, 86 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/substr/README b/Master/texmf-dist/doc/latex/substr/README
new file mode 100644
index 00000000000..c53e4ba5bf6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/substr/README
@@ -0,0 +1,36 @@
+substr.sty
+
+This package provides commands to deal with substrings in strings:
+Determine if a string contains a substring, count appearances of a
+substring in a string.
+
+
+The Description of the commands can be found in the file substr.sty.
+
+
+
+History of this package:
+
+The package arises from a posting of me in the newsgroup
+de.comp.text.tex in which I asked how to find out if a substring
+is included in a string. Heiko Oberdiek
+<oberdiek@ruf.uni-freiburg.de> posted the commands
+\IfSubStringInString and \IfCharInString and suggested to write a
+command which counts the appearances in a string. So, I wrote the
+commands \CountSubStrings and \setcountertoSubStrings.
+After I wrote this package I sent it to Heiko Oberdiek
+who improved and rewrote many parts of it.
+
+
+
+Copyright 2000 Harald Harders
+
+This program can be redistributed and/or modified under the terms
+of the LaTeX Project Public License Distributed from CTAN
+archives in directory macros/latex/base/lppl.txt; either
+version 1 of the License, or any later version.
+
+
+2000-06-15
+Harald Harders
+h.harders@tu-bs.de
diff --git a/Master/texmf-dist/doc/latex/substr/testsubstr.tex b/Master/texmf-dist/doc/latex/substr/testsubstr.tex
new file mode 100644
index 00000000000..2b9054ae045
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/substr/testsubstr.tex
@@ -0,0 +1,50 @@
+\documentclass{minimal}
+\usepackage{substr}
+\def\str{hellohello}
+\def\longstr{hellohellohellohello}
+\def\medstr{hellohellohello}
+\def\substr{ell}
+\def\subSTR{ELL}
+
+\newcounter{appearances}
+\begin{document}
+
+\bigskip{\bfseries IfSubStringInString}
+
+\IfSubStringInString{\substr}{\str}{``\subSTR'' is in ``\str''}{Error}
+
+\IfSubStringInString{\subSTR}{\str}{Error}{No ``\subSTR'' in ``\str''}
+
+
+\bigskip{\bfseries BeforeSubString and BehindSubString}
+
+Text befor ``\substr'' in ``\str'':
+\BeforeSubString{\substr}{\str}
+
+Text after ``\substr'' in ``\str'':
+\BehindSubString{\substr}{\str}
+
+\BeforeSubString{\substr}{\str}%
+\emph{\bfseries\substr}%
+\BehindSubString{\substr}{\str}
+
+
+\bigskip{\bfseries CountSubStrings}
+
+Count of ``\substr'' in ``\str'':
+\CountSubStrings{\substr}{\str}
+
+Count of ``\substr'' in ``\medstr'':
+\CountSubStrings{\substr}{\medstr}
+
+Count of ``\substr'' in ``\longstr'':
+\CountSubStrings{\substr}{\longstr}
+
+
+\bigskip{\bfseries SubStringsToCounter}
+
+\SubStringsToCounter{appearances}{\substr}{\str}%
+Count of ``\substr'' in \str'' (counter):
+\theappearances
+
+\end{document}