[LON-CAPA-cvs] cvs: loncom /cgi/mimeTeX commands loncapanewcommands.h
foxr
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 15 Jul 2008 10:49:04 -0000
foxr Tue Jul 15 06:49:04 2008 EDT
Added files:
/loncom/cgi/mimeTeX loncapanewcommands.h
Modified files:
/loncom/cgi/mimeTeX commands
Log:
bz5632 - add support to render the following tex constructs in mimetex:
\xleftarrow{x} - x on top of a left arrow.
\xrightarrow{x} - x on top of a left arrow.
\xleftrightharpoons{x} - X on top of left/right harpoons.
\autorightleftharpoons{x}{y} x on top, y below left right harpoons.
This has been done by using a supported mimetex extension for defining
latex macros and using the constructs suggested by Ray Batchelor in the
original request. Therefore
- New file: loncapanewcommands.h
- Modified commands to define NEWCOMMANDS such that loncapanewcommands.h
is included by mimetex in its macro definition sections.
No changes to mimetex.c were required... this is a supported way to add
extensions to mimetex.
Index: loncom/cgi/mimeTeX/commands
diff -u loncom/cgi/mimeTeX/commands:1.1 loncom/cgi/mimeTeX/commands:1.2
--- loncom/cgi/mimeTeX/commands:1.1 Mon Feb 28 14:08:11 2005
+++ loncom/cgi/mimeTeX/commands Tue Jul 15 06:49:02 2008
@@ -1,3 +1,4 @@
#!/bin/sh
-cc -DAA -DCACHEPATH=\"mimetexcache/\" mimetex.c gifsave.c -lm -o mimetex.cgi
+cc -DAA -DCACHEPATH=\"mimetexcache/\" -DNEWCOMMANDS="\"loncapanewcommands.h\"" \
+ mimetex.c gifsave.c -lm -o mimetex.cgi
Index: loncom/cgi/mimeTeX/loncapanewcommands.h
+++ loncom/cgi/mimeTeX/loncapanewcommands.h
/* macro argcnt substitution */
{ "\\xleftarrow", "1", "{\\overset{#1}{\\leftarrow}}" },
{ "\\xrightarrow", "1", "{\\overset{#1}{\\rightarrow}}" },
{ "\\xrightleftharpoons", "1", "{\\overset{#1}{\\rightleftharpoons}}"},
{ "\\autorightleftharpoons", "2", "{\\overset{#1}{\\underset{#2}{\\rightleftharpoons}}}"},