summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/xindy/modules/base/tex.xdy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/xindy/modules/base/tex.xdy')
-rw-r--r--Master/texmf-dist/xindy/modules/base/tex.xdy74
1 files changed, 74 insertions, 0 deletions
diff --git a/Master/texmf-dist/xindy/modules/base/tex.xdy b/Master/texmf-dist/xindy/modules/base/tex.xdy
new file mode 100644
index 00000000000..197dba1b455
--- /dev/null
+++ b/Master/texmf-dist/xindy/modules/base/tex.xdy
@@ -0,0 +1,74 @@
+;; $Id: tex.xdy,v 1.3 2010/06/11 11:01:46 jschrod Exp $
+;;------------------------------------------------------------
+
+;;;
+;;; TeX conventions
+;;;
+
+;; Discard leading and trailing white space. Collapse multiple white
+;; space characters to blank.
+;;
+;; FIXME: How do I specify tabs in that regexp? [ \t] does *not* work,
+;; it is taken as blank and t.
+;;
+;; FIXME: Definition of these rules should be postponed until we start
+;; with the actual work. Then they should be only issued if module
+;; keep-blanks is not loaded. Module keep-blanks would set a flag, and
+;; this code would check for it. We will need a hook in the kernel, to
+;; achieve that goal.
+
+(merge-rule "^ +" "" :eregexp)
+(merge-rule " +$" "" :eregexp)
+(merge-rule " +" " " :eregexp)
+
+
+;;
+;; Handle TeX markup
+;;
+
+
+;; First, some markup that produces output and that we want to keep.
+;; If this module is required, similar merge-rules for other markup
+;; that shall be kept must be defined first. Otherwise it will be
+;; discarded, by the default rule below.
+
+(merge-rule "\\([{}$%&#])" "\1" :eregexp)
+(merge-rule "~~" " ")
+(merge-rule "---?" "-")
+(merge-rule "\\TeX *" "TeX" :eregexp :again)
+(merge-rule "\\LaTeX *" "LaTeX" :eregexp :again)
+(merge-rule "\\MF *" "METAFONT" :eregexp :again)
+(merge-rule "\\MP *" "METAPOST" :eregexp :again)
+
+;; Ignore TeX commands by default. Some macros are known to be written
+;; to index files where the arguments must be ignored as well. Our
+;; argument parsing code is optimistic -- it will be possible to break
+;; it. Let's wait for an error report and repair it then... ;-)
+
+(merge-rule "\\discretionary *\{[^}]*\}\{[^}]*\}" "" :eregexp)
+(merge-rule "\\kern *[-\.0-9a-z]* ?" "" :eregexp)
+
+(merge-rule "\\[a-zA-Z@]+ *" "" :eregexp)
+(merge-rule "\\[^a-zA-Z@]" "" :eregexp)
+(merge-rule "[{}$]" "" :eregexp)
+
+
+
+;;======================================================================
+;;
+;; $Log: tex.xdy,v $
+;; Revision 1.3 2010/06/11 11:01:46 jschrod
+;; New 2.4 ordrules supports regexps with start-anchored matches.
+;; Thus we can activate the leading blank processing rule. The
+;; parenthesis-discard rule must trigger everywhere, not just at the
+;; start of the index key.
+;; The blank suppression clause got optimized, it now triggers only
+;; if there are multiple blanks and not for each appearing blank.
+;;
+;; Revision 1.2 2005/05/09 20:21:11 jschrod
+;; Support handling of some common macros for logos; ignore all other
+;; TeX commands.
+;;
+;; Revision 1.1 2004/05/24 21:53:27 jschrod
+;; Standard modules, introduced in "LaTeX Companion Release".
+;;