summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/genmisc/compare.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/genmisc/compare.tex')
-rw-r--r--Master/texmf-dist/tex/generic/genmisc/compare.tex12
1 files changed, 12 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/genmisc/compare.tex b/Master/texmf-dist/tex/generic/genmisc/compare.tex
new file mode 100644
index 00000000000..05976cbe865
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/genmisc/compare.tex
@@ -0,0 +1,12 @@
+% compare.tex - macro to compare two strings
+% By \'Eamonn McManus. This file is not copyrighted.
+
+\def\compare#1#2{\compcont#1\ \\#2\ \\}
+\def\compcont#1#2\\#3#4\\{%
+ \csname comp%
+ \if #1#3\if #1\ same\else cont\fi
+ \else \ifnum `#1<`#3less\else greater\fi \fi
+ \endcsname #2\\#4\\}
+\def\compsame#1\\#2\\{0}
+\def\compless#1\\#2\\{-1}
+\def\compgreater#1\\#2\\{1}