Several enhancements for support of the JSC style
[texmacs.git] / src / TeXmacs / progs / convert / latex / latex-texmacs-drd.scm
blobbd8abcbfd73136419d499bc578c4ea1a488bab0e
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 ;;
4 ;; MODULE      : latex-texmacs-drd.scm
5 ;; DESCRIPTION : TeXmacs extensions to LaTeX
6 ;; COPYRIGHT   : (C) 2005  Joris van der Hoeven
7 ;;
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9 ;;
10 ;; This software falls under the GNU general public license version 3 or later.
11 ;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
12 ;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16 (texmacs-module (convert latex latex-texmacs-drd))
18 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19 ;; Extra TeXmacs symbols
20 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22 (drd-table latex-texmacs-symbol%
23   ;; arrows with limits
24   (leftarrowlim "\\mathop{\\leftarrow}\\limits")
25   (rightarrowlim "\\mathop{\\rightarrow}\\limits")
26   (leftrightarrowlim "\\mathop{\\leftrightarrow}\\limits")
27   (mapstolim "\\mathop{\\mapsto}\\limits")
28   (longleftarrowlim "\\mathop{\\longleftarrow}\\limits")
29   (longrightarrowlim "\\mathop{\\longrightarrow}\\limits")
30   (longleftrightarrowlim "\\mathop{\\longleftrightarrow}\\limits")
31   (longmapstolim "\\mathop{\\longmapsto}\\limits")
32   (leftsquigarrowlim "\\mathop{\\leftsquigarrow}\\limits")
33   (rightsquigarrowlim "\\mathop{\\rightsquigarrow}\\limits")
34   (leftrightsquigarrowlim "\\mathop{\\leftrightsquigarrow}\\limits")
35   (equallim "\\mathop{=}\\limits")
36   (longequallim "\\mathop{\\longequal}\\limits")
37   (Leftarrowlim "\\mathop{\\leftarrow}\\limits")
38   (Rightarrowlim "\\mathop{\\rightarrow}\\limits")
39   (Leftrightarrowlim "\\mathop{\\leftrightarrow}\\limits")
40   (Longleftarrowlim "\\mathop{\\longleftarrow}\\limits")
41   (Longrightarrowlim "\\mathop{\\longrightarrow}\\limits")
42   (Longleftrightarrowlim "\\mathop{\\longleftrightarrow}\\limits")
43    
44   ;; asymptotic relations by Joris
45   (nasymp "\\not\\asymp")
46   (asympasymp "{\\asymp\\!\\!\\!\\!\\!\\!-}")
47   (nasympasymp "{\\not\\asymp\\!\\!\\!\\!\\!\\!-}")
48   (simsim "{\\approx\\!\\!\\!\\!\\!\\!-}")
49   (nsimsim "{\\not\\approx\\!\\!\\!\\!\\!\\!-}")
50   (npreccurlyeq "\\not\\preccurlyeq")
51   (precprec "\\prec\\!\\!\\!\\prec")
52   (precpreceq "\\preceq\\!\\!\\!\\preceq")
53   (precprecprec "\\prec\\!\\!\\!\\prec\\!\\!\\!\\prec")
54   (precprecpreceq "\\preceq\\!\\!\\!\\preceq\\!\\!\\!\\preceq")
55   (succsucc "\\succ\\!\\!\\!\\succ")
56   (succsucceq "\\succeq\\!\\!\\!\\succeq")
57   (succsuccsucc "\\succ\\!\\!\\!\\succ\\!\\!\\!\\succ")
58   (succsuccsucceq "\\succeq\\!\\!\\!\\succeq\\!\\!\\!\\succeq")
59   (lleq "\\leq\\negmedspace\\negmedspace\\leq")
60   (llleq "\\leq\\negmedspace\\negmedspace\\leq\\negmedspace\\negmedspace\\leq")
61   (ggeq "\\geq\\negmedspace\\negmedspace\\geq")
62   (gggeq "\\geq\\negmedspace\\negmedspace\\geq\\negmedspace\\negmedspace\\geq")
64   ;; extra literal symbols
65   (btimes "{\\mbox{\\rotatebox[origin=c]{90}{$\\ltimes$}}}")
66   (Backepsilon "{\\mbox{\\rotatebox[origin=c]{180}{E}}}")
67   (Mho "{\\mbox{\\rotatebox[origin=c]{180}{$\\Omega$}}}")
68   (mapmulti "{\\mbox{\\rotatebox[origin=c]{180}{$\\multimap$}}}")
69   (mathcatalan "C")
70   (mathd "\\mathrm{d}")
71   (mathe "\\mathrm{e}")
72   (matheuler "\\gamma")
73   (mathi "\\mathrm{i}")
74   (mathpi "\\pi")
75   (Alpha "\\mathrm{A}")
76   (Beta "\\mathrm{B}")
77   (Epsilon "\\mathrm{E}")
78   (Eta "\\mathrm{H}")
79   (Iota "\\mathrm{I}")
80   (Kappa "\\mathrm{K}")
81   (Mu "\\mathrm{M}")
82   (Nu "\\mathrm{N}")
83   (Omicron "\\mathrm{O}")
84   (Chi "\\mathrm{X}")
85   (Rho "\\mathrm{P}")
86   (Tau "\\mathrm{T}")
87   (Zeta "\\mathrm{Z}")
89   ;; other extra symbols
90   (Exists "\\exists")
91   (bigintwl "\\int")
92   (bigointwl "\\oint")
93   (bignone "")
94   (asterisk "*")
95   (nonesep "")
96   (nin "\\not\\in")
97   (nni "\\not\\ni")
98   (notni "\\not\\ni")
99   (nequiv "\\not\\equiv")
100   (dotamalg "\\mathaccent95{\\amalg}")
101   (dottimes "\\mathaccent95{\\times}")
102   (dotoplus "\\mathaccent95{\\oplus}")
103   (dototimes "\\mathaccent95{\\otimes}")
104   (into "\\rightarrow")
105   (longequal "{=\\!\\!=}")
106   (longhookrightarrow "{\\lhook\\joinrel\\relbar\\joinrel\\rightarrow}")
107   (longhookleftarrow "{\\leftarrow\\joinrel\\relbar\\joinrel\\rhook}")
108   (longdownarrow "\\downarrow")
109   (longuparrow "\\uparrow")
110   (triangleup "\\triangle")
111   (precdot "{\\prec\\hspace{-0.6em}\\cdot}\\;\\,")
112   (preceqdot "{\\preccurlyeq\\hspace{-0.6em}\\cdot}\\;\\,")
113   (llangle "{\\langle\\!\\langle}")
114   (rrangle "{\\rangle\\!\\rangle}")
115   (join "\\Join")
116   (um "-")
117   (upl "+")
118   (upm "\\pm")
119   (ump "\\mp")
120   (upequal "{\\mbox{\\rotatebox[origin=c]{90}{$=$}}}")
121   (assign ":=")
122   (plusassign "+\\!\\!=")
123   (minusassign "-\\!\\!=")
124   (timesassign "\times\\!\\!=")
125   (overassign "/\\!\\!=")
126   (lflux "\\ll")
127   (gflux "\\gg")
128   (colons "\\,:\\,")
129   (transtype "\\,:\\!!>")
130   (udots "{\\mathinner{\\mskip1mu\\raise1pt\\vbox{\\kern7pt\\hbox{.}}\\mskip2mu\\raise4pt\\hbox{.}\\mskip2mu\\raise7pt\\hbox{.}\\mskip1mu}}"))
132 (drd-rules
133   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-symbol% 'x 'body))
134   ((latex-texmacs-arity% 'x 0) (latex-texmacs-symbol% 'x 'body))
135   ;;;
136   ((latex-texmacs-tag% 'x) (latex-texmacs-macro% 'x 'body))
137   ((latex-arity% 'x 'arity) (latex-texmacs-arity% 'x 'arity))
138   ((latex-symbol% 'x) (latex-texmacs-symbol% 'x 'body)))
140 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
141 ;; Extra TeXmacs macros
142 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144 (drd-table latex-texmacs-0%
145   (tmunsc "\\_")
146   (emdash "---")
147   (tmat "\\symbol{\"40}")
148   (tmbsl "\\ensuremath{\\backslash}")
149   (tmdummy "$\\mbox{}$")
150   (TeXmacs "T\\kern-.1667em\\lower.5ex\\hbox{E}\\kern-.125emX\\kern-.1em\\lower.5ex\\hbox{\\textsc{m\\kern-.05ema\\kern-.125emc\\kern-.05ems}}")
151   (madebyTeXmacs (footnote (!recurse (withTeXmacstext))))
152   (withTeXmacstext
153    (!append (!translate "This document has been produced using") " "
154             (!recurse (TeXmacs)) " (" (!translate "see") " "
155             (texttt "http://www.texmacs.org") ")"))
156   (scheme "{\\sc Scheme}")
157   (pari "{\\sc Pari}"))
159 (drd-table latex-texmacs-1%
160   (tmtextrm (!group (rmfamily) (!group 1)))
161   (tmtextsf (!group (sffamily) (!group 1)))
162   (tmtexttt (!group (ttfamily) (!group 1)))
163   (tmtextmd (!group (mdseries) (!group 1)))
164   (tmtextbf (!group (bfseries) (!group 1)))
165   (tmtextup (!group (upshape) (!group 1)))
166   (tmtextsl (!group (slshape) (!group 1)))
167   (tmtextit (!group (itshape) (!group 1)))
168   (tmtextsc (!group (scshape) (!group 1)))
169   (tmmathbf (ensuremath (boldsymbol 1)))
170   (tmop (ensuremath (operatorname 1)))
171   (tmstrong (textbf 1))
172   (tmem (!group "\\em " 1 "\\/"))
173   (tmtt (texttt 1))
174   (tmname (textsc 1))
175   (tmsamp (textsf 1))
176   (tmabbr 1)
177   (tmdfn (textbf 1))
178   (tmkbd (texttt 1))
179   (tmvar (texttt 1))
180   (tmacronym (textsc 1))
181   (tmperson (textsc 1))
182   (tmscript (text (scriptsize (!math 1))))
183   (tmdef 1)
184   (dueto (textup (textbf (!append "(" 1 ") "))))
185   (op 1)
186   (email (!group (textit (!translate "Email:")) " " (texttt 1)))
187   (homepage (!group (textit (!translate "Web:")) " "(texttt 1)))
188   (keywords (!group (textbf (!translate "Keywords:")) " " 1))
189   (AMSclass (!group (textbf (!translate "A.M.S. subject classification:"))
190                     " " 1)))
192 (drd-table latex-texmacs-2%
193   (tmhlink (!group "\\color{blue} " 1))
194   (tmaction (!group "\\color{blue} " 1))
195   (subindex (index (!append 1 "!" 2))))
197 (drd-table latex-texmacs-3%
198   (subsubindex (index (!append 1 "!" 2 "!" 3)))
199   (tmref 1)
200   (glossaryentry (!append (item (!option (!append 1 (hfill)))) 2 (dotfill) 3)))
202 (drd-table latex-texmacs-4%
203   (subsubsubindex (index (!append 1 "!" 2 "!" 3 "!" 4))))
205 (drd-rules
206   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-0% 'x 'body))
207   ((latex-texmacs-arity% 'x 0) (latex-texmacs-0% 'x 'body))
208   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-1% 'x 'body))
209   ((latex-texmacs-arity% 'x 1) (latex-texmacs-1% 'x 'body))
210   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-2% 'x 'body))
211   ((latex-texmacs-arity% 'x 2) (latex-texmacs-2% 'x 'body))
212   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-3% 'x 'body))
213   ((latex-texmacs-arity% 'x 3) (latex-texmacs-3% 'x 'body))
214   ((latex-texmacs-macro% 'x 'body) (latex-texmacs-4% 'x 'body))
215   ((latex-texmacs-arity% 'x 4) (latex-texmacs-4% 'x 'body))
216   ;;;
217   ((latex-texmacs% 'x) (latex-texmacs-0% 'x 'body))
218   ((latex-texmacs% 'x) (latex-texmacs-1% 'x 'body))
219   ((latex-texmacs% 'x) (latex-texmacs-2% 'x 'body))
220   ((latex-texmacs% 'x) (latex-texmacs-3% 'x 'body))
221   ((latex-texmacs% 'x) (latex-texmacs-4% 'x 'body)))
223 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
224 ;; Extra TeXmacs environments
225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
227 (drd-table latex-texmacs-environment%
228   ("proof"
229    (!append (noindent) (textbf (!append (!translate "Proof") "\\ "))
230             ---
231             (hspace* (fill)) (!math (Box)) (medskip)))
232   ("proof*"
233    (!append (noindent) (textbf (!append 1 "\\ "))
234             ---
235             (hspace* (fill)) (!math (Box)) (medskip)))
236   ("tmparmod"
237    ((!begin "list" "" (!append "\\setlength{\\topsep}{0pt}"
238                                "\\setlength{\\leftmargin}{" 1 "}"
239                                "\\setlength{\\rightmargin}{" 2 "}"
240                                "\\setlength{\\parindent}{" 3 "}"
241                                "\\setlength{\\listparindent}{\\parindent}"
242                                "\\setlength{\\itemindent}{\\parindent}"
243                                "\\setlength{\\parsep}{\\parskip}"))
244     (!append "\\item[]"
245              ---)))
246   ("tmparsep"
247    (!append (begingroup) "\\setlength{\\parskip}{" 1 "}"
248              ---
249              (endgroup)))
250   ("tmindent"
251    ((!begin "tmparmod" "1.5em" "0pt" "0pt") ---))
252   ("elsequation" ((!begin "eqnarray") (!append --- "&&")))
253   ("elsequation*" ((!begin "eqnarray*") (!append --- "&&")))
254   ("theglossary"
255    ((!begin "list" "" (!append "\\setlength{\\labelwidth}{6.5em}"
256                                "\\setlength{\\leftmargin}{7em}"
257                                "\\small")) ---)))
259 (drd-table latex-texmacs-env-arity%
260   ("proof" 0)
261   ("proof*" 1)
262   ("tmparmod" 3)
263   ("tmparsep" 1)
264   ("tmindent" 0)
265   ("proof" 0)
266   ("elsequation" 0)
267   ("elsequation*" 0)
268   ("theglossary" 1))
270 (drd-group latex-texmacs-tag%
271   begin-proof begin-proof* begin-tmparmod begin-tmparsep begin-tmindent
272   begin-elsequation begin-elsequation* begin-theglossary)
274 (drd-group latex-environment-0%
275   begin-proof begin-tmindent begin-elsequation begin-elsequation*)
277 (drd-group latex-environment-1%
278   begin-proof* begin-theglossary)
280 (drd-group latex-environment-3%
281   begin-tmparmod begin-tmparsep)
283 (define-macro (latex-texmacs-itemize env lab)
284   (with env-sym (string->symbol (string-append "begin-" env))
285     `(begin
286        (drd-table latex-texmacs-environment%
287          (,env
288           ((!begin "itemize")
289            (!append "\\renewcommand{\\labelitemi}{" ,lab "}"
290                     "\\renewcommand{\\labelitemii}{" ,lab "}"
291                     "\\renewcommand{\\labelitemiii}{" ,lab "}"
292                     "\\renewcommand{\\labelitemiv}{" ,lab "}"
293                     ---))))
294        (drd-table latex-texmacs-env-arity% (,env 0))
295        ;;;
296        (drd-group latex-texmacs-tag% ,env-sym)
297        (drd-group latex-list% ,env-sym))))
299 (define-macro (latex-texmacs-enumerate env lab)
300   (with env-sym (string->symbol (string-append "begin-" env))
301     `(begin
302        (drd-table latex-texmacs-environment%
303          (,env ((!begin "enumerate" (!option ,lab)) ---)))
304        (drd-table latex-texmacs-env-arity% (,env 0))
305        ;;;
306        (drd-group latex-texmacs-tag% ,env-sym)
307        (drd-group latex-list% ,env-sym))))
309 (define-macro (latex-texmacs-description env)
310   (with env-sym (string->symbol (string-append "begin-" env))
311     `(begin
312        (drd-table latex-texmacs-environment%
313          (,env ((!begin "description") ---)))
314        (drd-table latex-texmacs-env-arity% (,env 0))
315        ;;;
316        (drd-group latex-texmacs-tag% ,env-sym)
317        (drd-group latex-list% ,env-sym))))
319 (latex-texmacs-itemize "itemizeminus" "$-$")
320 (latex-texmacs-itemize "itemizedot" "$\\bullet$")
321 (latex-texmacs-itemize "itemizearrow" "$\\rightarrow$")
322 (latex-texmacs-enumerate "enumeratenumeric" "1.")
323 (latex-texmacs-enumerate "enumerateroman" "i.")
324 (latex-texmacs-enumerate "enumerateromancap" "I.")
325 (latex-texmacs-enumerate "enumeratealpha" "a{\\textup{)}}")
326 (latex-texmacs-enumerate "enumeratealphacap" "A.")
327 (latex-texmacs-description "descriptioncompact")
328 (latex-texmacs-description "descriptionaligned")
329 (latex-texmacs-description "descriptiondash")
330 (latex-texmacs-description "descriptionlong")
332 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
333 ;; Extra preamble definitions which are needed to export certain macros
334 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
336 (drd-table latex-texmacs-preamble%
337   (mho
338    (!append
339     "\\renewcommand{\\mho}{\\mbox{\\rotatebox[origin=c]{180}{$\\omega$}}}"))
340   (color
341    (!append
342     "\\definecolor{grey}{rgb}{0.75,0.75,0.75}\n"
343     "\\definecolor{orange}{rgb}{1.0,0.5,0.5}\n"
344     "\\definecolor{brown}{rgb}{0.5,0.25,0.0}\n"
345     "\\definecolor{pink}{rgb}{1.0,0.5,0.5}\n"))
346   (tmfloat
347    (!append
348     "\\newcommand{\\tmfloatcontents}{}\n"
349     "\\newlength{\\tmfloatwidth}\n"
350     "\\newcommand{\\tmfloat}[5]{\n"
351     "  \\renewcommand{\\tmfloatcontents}{#4}\n"
352     "  \\setlength{\\tmfloatwidth}{\\widthof{\\tmfloatcontents}+1in}\n"
353     "  \\ifthenelse{\\equal{#2}{small}}\n"
354     "    {\\ifthenelse{\\lengthtest{\\tmfloatwidth > \\linewidth}}\n"
355     "      {\\setlength{\\tmfloatwidth}{\\linewidth}}{}}\n"
356     "    {\\setlength{\\tmfloatwidth}{\\linewidth}}\n"
357     "  \\begin{minipage}[#1]{\\tmfloatwidth}\n"
358     "    \\begin{center}\n"
359     "      \\tmfloatcontents\n"
360     "      \\captionof{#3}{#5}\n"
361     "    \\end{center}\n"
362     "  \\end{minipage}}\n")))
364 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
365 ;; Plain style theorems
366 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
368 (define-macro (latex-texmacs-thmenv prim name before after)
369   (with env-sym (string->symbol (string-append "begin-" prim))
370     `(begin
371        (drd-table latex-texmacs-env-preamble%
372          (,prim (!append ,@before (newtheorem ,prim (!translate ,name))
373                          ,@after "\n")
374                 no-amsthm-package%))
375        ;;;
376        (drd-group latex-texmacs-tag% ,env-sym)
377        (drd-group latex-environment-0% ,env-sym))))
379 (define-macro (latex-texmacs-theorem prim name)
380   `(latex-texmacs-thmenv ,prim ,name () ()))
382 (define-macro (latex-texmacs-remark prim name)
383   `(latex-texmacs-thmenv
384     ,prim ,name ("{" (!recurse (theorembodyfont "\\rmfamily"))) ("}")))
386 (define-macro (latex-texmacs-exercise prim name)
387   `(latex-texmacs-thmenv
388     ,prim ,name ("{" (!recurse (theorembodyfont "\\rmfamily\\small"))) ("}")))
390 (latex-texmacs-theorem "theorem" "Theorem")
391 (latex-texmacs-theorem "proposition" "Proposition")
392 (latex-texmacs-theorem "lemma" "Lemma")
393 (latex-texmacs-theorem "corollary" "Corollary")
394 (latex-texmacs-theorem "axiom" "Axiom")
395 (latex-texmacs-theorem "definition" "Definition")
396 (latex-texmacs-theorem "notation" "Notation")
397 (latex-texmacs-theorem "conjecture" "Conjecture")
398 (latex-texmacs-remark "remark" "Remark")
399 (latex-texmacs-remark "note" "Note")
400 (latex-texmacs-remark "example" "Example")
401 (latex-texmacs-remark "convention" "Convention")
402 (latex-texmacs-remark "warning" "Warning")
403 (latex-texmacs-exercise "exercise" "Exercise")
404 (latex-texmacs-exercise "problem" "Problem")
406 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
407 ;; AMS style theorems
408 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
410 (define-macro (ams-texmacs-theorem abbr full)
411   `(begin
412      (drd-table latex-texmacs-env-preamble%
413        (,abbr (!append "\\theoremstyle{plain}\n"
414                        (newtheorem ,abbr (!translate ,full))
415                        "\n")
416               amsthm-package%))))
418 (define-macro (ams-texmacs-remark abbr full)
419   `(begin
420      (drd-table latex-texmacs-env-preamble%
421        (,abbr (!append "\\theoremstyle{remark}\n"
422                        (newtheorem ,abbr (!translate ,full))
423                        "\n")
424               amsthm-package%))))
426 (ams-texmacs-theorem "theorem" "Theorem")
427 (ams-texmacs-theorem "proposition" "Proposition")
428 (ams-texmacs-theorem "lemma" "Lemma")
429 (ams-texmacs-theorem "corollary" "Corollary")
430 (ams-texmacs-theorem "axiom" "Axiom")
431 (ams-texmacs-theorem "definition" "Definition")
432 (ams-texmacs-theorem "notation" "Notation")
433 (ams-texmacs-theorem "conjecture" "Conjecture")
434 (ams-texmacs-remark "remark" "Remark")
435 (ams-texmacs-remark "note" "Note")
436 (ams-texmacs-remark "example" "Example")
437 (ams-texmacs-remark "convention" "Convention")
438 (ams-texmacs-remark "warning" "Warning")
439 (ams-texmacs-remark "exercise" "Exercise")
440 (ams-texmacs-remark "problem" "Problem")
442 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
443 ;; Style-dependent extra macros
444 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
446 (drd-table latex-texmacs-0%
447   (appendix "" letter-style%))
449 (define-macro (latex-texmacs-section name inside . conds)
450   `(drd-table latex-texmacs-1%
451      (,name (!append (medskip) (bigskip) "\n\n" (noindent) (textbf ,inside))
452             ,@conds)))
454 (define-macro (latex-texmacs-paragraph name inside . conds)
455   `(drd-table latex-texmacs-1%
456      (,name (!append (smallskip) "\n\n" (noindent) (textbf ,inside))
457             ,@conds)))
459 (latex-texmacs-section chapter (!append "\\huge " 1) article-style%)
460 (latex-texmacs-section chapter (!append "\\huge " 1) letter-style%)
461 (latex-texmacs-section section (!append "\\LARGE " 1) letter-style%)
462 (latex-texmacs-section subsection (!append "\\Large " 1) letter-style%)
463 (latex-texmacs-section subsubsection (!append "\\large " 1) letter-style%)
464 (latex-texmacs-paragraph paragraph 1 letter-style%)
465 (latex-texmacs-paragraph subparagraph 1 letter-style%)
467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
468 ;; Deprecated extra macros
469 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
471 (drd-table latex-texmacs-0%
472   (labeleqnum "\\addtocounter{equation}{-1}\\refstepcounter{equation}\\addtocounter{equation}{1})")
473   (eqnumber (!append "\\hfill(\\theequation" (!recurse (labeleqnum)) ")"))
474   (leqnumber (!append "(\\theequation" (!recurse (labeleqnum)) ")\\hfill"))
475   (reqnumber (!append "\\hfill(\\theequation" (!recurse (labeleqnum)) ")")))
477 (drd-table latex-texmacs-1%
478   (key (!append "\\fbox{\\rule[-2pt]{0pt}{9pt}" (texttt 1) "}"))
479   (skey (!recurse (key (!append "shift-" 1))))
480   (ckey (!recurse (key (!append "ctrl-" 1))))
481   (akey (!recurse (key (!append "alt-" 1))))
482   (mkey (!recurse (key (!append "meta-" 1))))
483   (hkey (!recurse (key (!append "hyper-" 1)))))
485 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
486 ;; Language specific preambles
487 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
489 (drd-table latex-preamble-language-def%
490   ("bulgarian"
491    "\\usepackage[cp1251]{inputenc}\n\\usepackage[bulgarian]{babel}")
492   ("czech" "\\usepackage[czech]{babel}")
493   ("danish" "\\usepackage[danish]{babel}")
494   ("dutch" "\\usepackage[dutch]{babel}")
495   ("finnish" "\\usepackage[finnish]{babel}")
496   ("french" "\\usepackage[french]{babel}")
497   ("german" "\\usepackage[german]{babel}")
498   ("hungarian" "\\usepackage[hungarian]{babel}")
499   ("italian" "\\usepackage[italian]{babel}")
500   ("polish" "\\usepackage[polish]{babel}")
501   ("portuguese" "\\usepackage[portuges]{babel}")
502   ("romanian" "\\usepackage[romanian]{babel}")
503   ("russian" "\\usepackage[cp1251]{inputenc}\n\\usepackage[russian]{babel}")
504   ("slovene" "\\usepackage[slovene]{babel}")
505   ("spanish" "\\usepackage[spanish]{babel}")
506   ("swedish" "\\usepackage[swedish]{babel}")
507   ("ukrainian"
508    "\\usepackage[cp1251]{inputenc}\n\\usepackage[ukrainian]{babel}"))
510 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
511 ;; Catcode tables
512 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
514 (drd-table corkT1-to-latex-catcodes%
515   ("\x00" "\\`{ }")
516   ("\x01" "\\'{ }")
517   ("\x02" "\\^{ }")
518   ("\x03" "\\~{ }")
519   ("\x04" "\\\"{ }")
520   ("\x05" "\\H{ }")
521   ("\x06" "\\r{ }")
522   ("\x07" "\\v{ }")
523   ("\x08" "\\u{ }")
524   ("\x09" "\\b{ }")
525 ;  ("\x0A" "\\.{ }") ; newline may still be present in strings!!!
526   ("\x0B" "\\c{ }")
527   ("\x0C" "\\k{ }")
528   ("\x0D" ",")
529   ("\x0E" "{\\guilsinglleft}")
530   ("\x0F" "{\\guilsinglright}")
531   ("\x10" "``")
532   ("\x11" "''")
533   ("\x12" ",,")
534   ("\x13" "<<")
535   ("\x14" ">>")
536   ("\x15" "--")
537   ("\x16" "---")
538   ("\x17" "{}")
539   ("\x18" "{}")
540   ("\x19" "\\i")
541   ("\x1A" "\\j")
542   ("\x1B" "ff")
543   ("\x1C" "fi")
544   ("\x1D" "fl")
545   ("\x1E" "ffi")
546   ("\x1F" "ffl")
547   ("\x80" "\\u{A}")
548   ("\x81" "\\k{A}")
549   ("\x82" "\\'C")
550   ("\x83" "\\v{C}")
551   ("\x84" "\\v{D}")
552   ("\x85" "\\v{E}")
553   ("\x86" "\\k{E}")
554   ("\x87" "\\u{G}")
555   ("\x88" "\\'L")
556   ("\x89" "\\v{L}")
557   ("\x8A" "\\L")
558   ("\x8B" "\\'N")
559   ("\x8C" "\\v{N}")
560   ("\x8D" "{\\NG}")
561   ("\x8E" "\\H{O}")
562   ("\x8F" "\\'R")
563   ("\x90" "\\v{R}")
564   ("\x91" "\\'S")
565   ("\x92" "\\v{S}")
566   ("\x93" "\\c{S}")
567   ("\x94" "\\v{T}")
568   ("\x95" "\\c{T}")
569   ("\x96" "\\H{U}")
570   ("\x97" "\\r{U}")
571   ("\x98" "\\\"Y")
572   ("\x99" "\\'Z")
573   ("\x9A" "\\v{Z}")
574   ("\x9B" "\\.Z")
575   ("\x9C" "IJ")
576   ("\x9D" "\\.I")
577   ("\x9E" "{\\dj}")
578   ("\x9F" "{\\S}")
579   ("\xA0" "\\u{a}")
580   ("\xA1" "\\k{a}")
581   ("\xA2" "\\'c")
582   ("\xA3" "\\v{c}")
583   ("\xA4" "\\v{d}")
584   ("\xA5" "\\v{e}")
585   ("\xA6" "\\k{e}")
586   ("\xA7" "\\u{g}")
587   ("\xA8" "\\'l")
588   ("\xA9" "\\v{l}")
589   ("\xAA" "{\\l}")
590   ("\xAB" "\\'n")
591   ("\xAC" "\\v{n}")
592   ("\xAD" "{\\ng}")
593   ("\xAE" "\\H{o}")
594   ("\xAF" "\\'r")
595   ("\xB0" "\\v{r}")
596   ("\xB1" "\\'s")
597   ("\xB2" "\\v{s}")
598   ("\xB3" "\\c{s}")
599   ("\xB4" "\\v{t}")
600   ("\xB5" "\\c{t}")
601   ("\xB6" "\\H{u}")
602   ("\xB7" "\\r{u}")
603   ("\xB8" "\\\"y")
604   ("\xB9" "\\'z")
605   ("\xBA" "\\v{z}")
606   ("\xBB" "\\.z")
607   ("\xBC" "ij")
608   ("\xBD" "!`")
609   ("\xBE" "?`")
610   ("\xBF" "{\\pounds}")
611   ("\xC0" "\\`A")
612   ("\xC1" "\\'A")
613   ("\xC2" "\\^A")
614   ("\xC3" "\\~A")
615   ("\xC4" "\\\"A")
616   ("\xC5" "{\\AA}")
617   ("\xC6" "{\\AE}")
618   ("\xC7" "\\c{C}")
619   ("\xC8" "\\`E")
620   ("\xC9" "\\'E")
621   ("\xCA" "\\^E")
622   ("\xCB" "\\\"E")
623   ("\xCC" "\\`I")
624   ("\xCD" "\\'I")
625   ("\xCE" "\\^I")
626   ("\xCF" "\\\"I")
627   ("\xD0" "{\\DH}")
628   ("\xD1" "\\~N")
629   ("\xD2" "\\`O")
630   ("\xD3" "\\'O")
631   ("\xD4" "\\^O")
632   ("\xD5" "\\~O")
633   ("\xD6" "\\\"O")
634   ("\xD7" "{\\OE}")
635   ("\xD8" "{\\O}")
636   ("\xD9" "\\`U")
637   ("\xDA" "\\'U")
638   ("\xDB" "\\^U")
639   ("\xDC" "\\\"U")
640   ("\xDD" "\\'Y")
641   ("\xDE" "{\\TH}")
642   ("\xDF" "{\\SS}")
643   ("\xE0" "\\`a")
644   ("\xE1" "\\'a")
645   ("\xE2" "\\^a")
646   ("\xE3" "\\~a")
647   ("\xE4" "\\\"a")
648   ("\xE5" "{\\aa}")
649   ("\xE6" "{\\ae}")
650   ("\xE7" "\\c{c}")
651   ("\xE8" "\\`e")
652   ("\xE9" "\\'e")
653   ("\xEA" "\\^e")
654   ("\xEB" "\\\"e")
655   ("\xEC" "\\`{\\i}")
656   ("\xED" "\\'{\\i}")
657   ("\xEE" "\\^{\\i}")
658   ("\xEF" "\\\"{\\i}")
659   ("\xF0" "{\\dh}")
660   ("\xF1" "\\~n")
661   ("\xF2" "\\`o")
662   ("\xF3" "\\'o")
663   ("\xF4" "\\^o")
664   ("\xF5" "\\~o")
665   ("\xF6" "\\\"o")
666   ("\xF7" "{\\oe}")
667   ("\xF8" "{\\o}")
668   ("\xF9" "\\`u")
669   ("\xFA" "\\'u")
670   ("\xFB" "\\^u")
671   ("\xFC" "\\\"u")
672   ("\xFD" "\\'y")
673   ("\xFE" "{\\th}")
674   ("\xFF" "{\\ss}"))
676 (drd-table cyrillic-catcodes%
677   ("À" "\\CYRA")
678   ("à" "\\cyra")
679   ("Á" "\\CYRB")
680   ("á" "\\cyrb")
681   ("Â" "\\CYRV")
682   ("â" "\\cyrv")
683   ("Ã" "\\CYRG")
684   ("ã" "\\cyrg")
685   ("Ä" "\\CYRD")
686   ("ä" "\\cyrd")
687   ("Å" "\\CYRE")
688   ("å" "\\cyre")
689   ("Æ" "\\CYRZH")
690   ("æ" "\\cyrzh")
691   ("Ç" "\\CYRZ")
692   ("ç" "\\cyrz")
693   ("È" "\\CYRI")
694   ("è" "\\cyri")
695   ("É" "\\CYRISHRT")
696   ("é" "\\cyrishrt")
697   ("Ê" "\\CYRK")
698   ("ê" "\\cyrk")
699   ("Ë" "\\CYRL")
700   ("ë" "\\cyrl")
701   ("Ì" "\\CYRM")
702   ("ì" "\\cyrm")
703   ("Í" "\\CYRN")
704   ("í" "\\cyrn")
705   ("Î" "\\CYRO")
706   ("î" "\\cyro")
707   ("Ï" "\\CYRP")
708   ("ï" "\\cyrp")
709   ("Ð" "\\CYRR")
710   ("ð" "\\cyrr")
711   ("Ñ" "\\CYRS")
712   ("ñ" "\\cyrs")
713   ("Ò" "\\CYRT")
714   ("ò" "\\cyrt")
715   ("Ó" "\\CYRU")
716   ("ó" "\\cyru")
717   ("Ô" "\\CYRF")
718   ("ô" "\\cyrf")
719   ("Õ" "\\CYRH")
720   ("õ" "\\cyrh")
721   ("Ö" "\\CYRC")
722   ("ö" "\\cyrc")
723   ("×" "\\CYRCH")
724   ("÷" "\\cyrch")
725   ("Ø" "\\CYRSH")
726   ("ø" "\\cyrsh")
727   ("Ù" "\\CYRSHCH")
728   ("ù" "\\cyrshch")
729   ("Ú" "\\CYRHRDSN")
730   ("ú" "\\cyrhrdsn")
731   ("Û" "\\CYRERY")
732   ("û" "\\cyrery")
733   ("Ü" "\\CYRSFTSN")
734   ("ü" "\\cyrsftsn")
735   ("Ý" "\\CYREREV")
736   ("ý" "\\cyrerev")
737   ("Þ" "\\CYRYU")
738   ("þ" "\\cyryu")
739   ("ß" "\\CYRYA")
740   ("ÿ" "\\cyrya")
741   ("œ" "\\CYRYO")
742   ("¼" "\\cyryo"))
744 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
745 ;; Page size settings
746 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
748 (drd-table latex-paper-type%
749   ("a0" "a0paper")
750   ("a1" "a1paper")
751   ("a2" "a2paper")
752   ("a3" "a3paper")
753   ("a4" "a4paper")
754   ("a5" "a5paper")
755   ("a6" "a6paper")
756   ("a7" "papersize={74mm,105mm}")
757   ("a8" "papersize={52mm,74mm")
758   ("a9" "papersize={37mm,52mm}")
759   ("b0" "b0paper")
760   ("b1" "b1paper")
761   ("b2" "b2paper")
762   ("b3" "b3paper")
763   ("b4" "b4paper")
764   ("b5" "b5paper")
765   ("b6" "b6paper")
766   ("b7" "papersize={88mm,125mm}")
767   ("b8" "papersize={62mm,88mm}")
768   ("b9" "papersize={44mm,62mm}")
769   ("legal" "legalpaper")
770   ("letter" "letterpaper")
771   ("executive" "executivepaper")
772   ("archA" "papersize={9in,12in}")
773   ("archB" "papersize={12in,18in}")
774   ("archC" "papersize={18in,24in}")
775   ("archD" "papersize={24in,36in}")
776   ("archE" "papersize={36in,48in}")
777   ("10x14" "papersize={10in,14in}")
778   ("11x17" "papersize={11in,17in}")
779   ("C5" "papersize={162mm,229mm}")
780   ("Comm10" "papersize={297pt,684pt}")
781   ("DL" "papersize={110mm,220mm}")
782   ("halfletter" "papersize={140mm,216mm}")
783   ("halfexecutive" "papersize={133mm,184mm}")
784   ("ledger" "papersize={432mm,279mm}")
785   ("Monarch" "papersize={98mm,190mm}")
786   ("csheet" "papersize={432mm,559mm}")
787   ("dsheet" "papersize={559mm,864mm}")
788   ("esheet" "papersize={864mm,1118mm}")
789   ("flsa" "papersize={216mm,330mm}")
790   ("flse" "papersize={216mm,330mm}")
791   ("folio" "papersize={216mm,330mm}")
792   ("lecture note" "papersize={15.5cm,23.5cm}")
793   ("note" "papersize={216mm,279mm}")
794   ("quarto" "papersize={215mm,275mm}")
795   ("statement" "papersize={140mm,216mm}")
796   ("tabloid" "papersize={279mm,432mm}"))