On Tue, Nov 4, 2008 at 1:55 AM, Martin Rubey wrote:
>
> Waldek Hebisch writes:
>
>> I have put version from NAG open source cdrom at:
>>
>> http://www.math.uni.wroc.pl/~hebisch/fricas/texbreak.c
>
> Thank you!  Unfortunately, this also contains the patch to
> look for \[ \] instead of $$ $$.
>

The change to revert \[ to $$ is trivial. Here it is:

-----

[EMAIL PROTECTED]:~$ diff -au texbreak.c.orig texbreak.c.new
--- texbreak.c.orig     2008-11-04 02:11:24.000000000 -0500
+++ texbreak.c.new      2008-11-04 02:37:22.000000000 -0500
@@ -42,12 +42,14 @@
  *
  * 01/19/92   RSS   Change to use \[ \] instead of $$ $$
  *
+ * 11/04/2008 WSP   Reversed this change for Martin Rubey
+ *
  * 09/01/92   RSS   Format and fix =-.
  *
  * Operation:
  *
  * This program reads standard input and writes to standard output.
Display mat     h
- * mode starts with \[ at the beginning of a line and ends with \]. All lines
+ * mode starts with $$ at the beginning of a line and ends with $$. All lines
  * not in display math mode are simply printed on standard output.  The
  * expressions in display math mode are broken so that they fit on a page
  * better (line breaking).
@@ -56,7 +58,7 @@
  *
  * Restrictions:
  *
- * 1.  Assume \[ and \] start in column 1 and are the only things on the lines.
+ * 1.  Assume $$ and $$ start in column 1 and are the only things on the lines.
  *
  * 2.  Comments in display math mode are not preserved.
  *
@@ -231,14 +233,14 @@
     initCharTable();

     /*
-     * Read stdin line by line. When we come to a line that starts with \[,
+     * Read stdin line by line. When we come to a line that starts with $$,
      * go into math mode.
      */

     while (gets(line) != NULL) {
         lineLen = strlen(line);
-        if ((lineLen > 1) && ('\\' == line[0]) && ('[' == line[1])) {
-            puts("\\[");
+        if ((lineLen > 1) && ('$' == line[0]) && ('$' == line[1])) {
+            puts("$$");
             outLineNum++;

             mathLinesRead = bufferMathLines();
@@ -263,7 +265,7 @@
                 }
                 freeMathList(mathList);
             }
-            puts("\\]");
+            puts("$$");
         }
         else
             puts(line);
@@ -1148,7 +1150,7 @@

     /*
      * Returns number of lines read. Returns negative this number if
-     * end-of-file was reached before final \].
+     * end-of-file was reached before final $$.
      */

     char curChar, lastChar, *eq;
@@ -1161,7 +1163,7 @@
     while (gets(line) != NULL) {
         lineLen = strlen(line);

-        if (('\\' == line[0]) && (']' == line[1]))
+        if (('$' == line[0]) && ('$' == line[1]))
             return linesRead;
         else {
             linesRead++;

-----

>
> b) make texbreaker work on $$ again.  I guess that's the easiest solution.
>

Indeed. See above. You also need to download

  $ wget http://zwiki.newsynthesis.org/plugins/mathaction/useproto.h

Then just compile the file:

  $ gcc texbreak.c -o texbreak

Use it like this:

[EMAIL PROTECTED]:~$ cat test.tex
Here is some stuff

$$
{{1 \over {11}} \  {x \sp {11}}}+{x \sp {10}}+{5 \  {x \sp 9}}+{{15} \  {x
\sp 8}}+{{30} \  {x \sp 7}}+{{42} \  {x \sp 6}}+{{42} \  {x \sp 5}}+{{30} \
{x \sp 4}}+{{15} \  {x \sp 3}}+{5 \  {x \sp 2}}+x
\leqno(5)
$$

and this is the end.

---

[EMAIL PROTECTED]:~$ ./texbreak < test.tex 2>/dev/null
Here is some stuff

$$
[EMAIL PROTECTED]
\displaystyle
{{1 \over{11}}\ {x^{11}}}+{x^{10}}+{5 \ {x^9}}+{{15}\ {x^8}}+
{{30}\ {x^7}}+{{42}\ {x^6}}+{{42}\ {x^5}}+{{30}\ {x^4}}+
\\
\\
\displaystyle
{{15}\ {x^3}}+{5 \ {x^2}}+ x \leqno (5)
\end{array}
$$

and this is the end.

---

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to