Latex output bugs?
Modérateur : xcasadmin
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Latex output bugs?
I have been using the latex output for elegant printouts of work and when I started to use units in the calculations I think I noticed a few bugs.
Please find attached a diff printout of the tex file produced by Xcas with the modifications I needed to do to prevent errrors when creating a PDF. When I ran: latex <my original tex file> in cygwin I got the following errors:
! Missing { inserted.
<to be read again>
\left
l.96 \mathrm{Rl}=(_\left
(1,\mathrm{\_ft}\right)) \\
?
! Missing } inserted.
<inserted text>
}
l.96 ...hrm{Rl}=(_\left(1,\mathrm{\_ft}\right)) \\
?
Underfull \hbox (badness 10000) in paragraph at lines 99--101
[2]
! Missing { inserted.
<to be read again>
\left
l.102 \mathrm{Dl}=(_\left
(0.785398163397,\mathrm{\_ft}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.103 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.103 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 103--105
! Missing { inserted.
<to be read again>
\left
l.106 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}^{2}\cdot \mathrm...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.107 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.107 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 107--109
! Missing { inserted.
<to be read again>
\left
l.110 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}}{\mathrm{\_s}^{2...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.111 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.111 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 111--113
Underfull \hbox (badness 10000) in paragraph at lines 111--113
Underfull \hbox (badness 10000) in paragraph at lines 115--117
! Missing { inserted.
<to be read again>
\left
l.118 \mathrm{Fl}=(_\left
(512.065886703,\frac{\mathrm{\_ft}\cdot \mathrm{\_l...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.119 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.119 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 119--121
! Missing { inserted.
<to be read again>
\left
l.122 \mathrm{Fl}=(_\left
(15.9119171679,\mathrm{\_lbf}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.123 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.123 \end{equation}
?
I also attached the PDF produced by the "repaired" tex file.
The following is a bash script that I use as a work around right now to "fix" the tex file.
sed '
s/_\\left/\\left/g
s/,\\/\\/g
/(\\/{/))$/{s/(\\/\\/; s/))$/)/}}
/(\\/{/))[ \]*$/{s/(\\/\\/; s/))\([ \]*\)$/)\1/}}
' $1
Please find attached a diff printout of the tex file produced by Xcas with the modifications I needed to do to prevent errrors when creating a PDF. When I ran: latex <my original tex file> in cygwin I got the following errors:
! Missing { inserted.
<to be read again>
\left
l.96 \mathrm{Rl}=(_\left
(1,\mathrm{\_ft}\right)) \\
?
! Missing } inserted.
<inserted text>
}
l.96 ...hrm{Rl}=(_\left(1,\mathrm{\_ft}\right)) \\
?
Underfull \hbox (badness 10000) in paragraph at lines 99--101
[2]
! Missing { inserted.
<to be read again>
\left
l.102 \mathrm{Dl}=(_\left
(0.785398163397,\mathrm{\_ft}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.103 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.103 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 103--105
! Missing { inserted.
<to be read again>
\left
l.106 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}^{2}\cdot \mathrm...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.107 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.107 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 107--109
! Missing { inserted.
<to be read again>
\left
l.110 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}}{\mathrm{\_s}^{2...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.111 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.111 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 111--113
Underfull \hbox (badness 10000) in paragraph at lines 111--113
Underfull \hbox (badness 10000) in paragraph at lines 115--117
! Missing { inserted.
<to be read again>
\left
l.118 \mathrm{Fl}=(_\left
(512.065886703,\frac{\mathrm{\_ft}\cdot \mathrm{\_l...
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.119 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.119 \end{equation}
?
Underfull \hbox (badness 10000) in paragraph at lines 119--121
! Missing { inserted.
<to be read again>
\left
l.122 \mathrm{Fl}=(_\left
(15.9119171679,\mathrm{\_lbf}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.123 \end{equation}
?
! Missing } inserted.
<inserted text>
}
l.123 \end{equation}
?
I also attached the PDF produced by the "repaired" tex file.
The following is a bash script that I use as a work around right now to "fix" the tex file.
sed '
s/_\\left/\\left/g
s/,\\/\\/g
/(\\/{/))$/{s/(\\/\\/; s/))$/)/}}
/(\\/{/))[ \]*$/{s/(\\/\\/; s/))\([ \]*\)$/)\1/}}
' $1
- Pièces jointes
-
- attachments.zip
- PDFs inside
- (71.83 Kio) Téléchargé 119 fois
Re: Latex output bugs?
Can you send the xws file? It will make easy to reproduce the bug.
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
No problem.
Thanks
Thanks
- Pièces jointes
-
- tex_latex_files.zip
- I think this is everything
- (11.58 Kio) Téléchargé 121 fois
Re: Latex output bugs?
It's not that straightforward to fix, because under linux, the translation is handled by markup.cc, not by my code anymore.
I have fixed units printing in my code: now latex(_g_) will return "1\_\mathrm{\_g\_}". I hope this will be sufficient...
I have fixed units printing in my code: now latex(_g_) will return "1\_\mathrm{\_g\_}". I hope this will be sufficient...
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
Thanks. I think the most troublesome error is caused by the underscore after the = sign, before \left (see attached image)
Matt
Matt
- Pièces jointes
-
- fix01.jpg (5.24 Kio) Consulté 5085 fois
-
- error_clip.jpg (44.67 Kio) Consulté 5085 fois
Re: Latex output bugs?
Yes, that should be fixed. And \_ will be infixed.
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
I just updated to 1.6.0. Works great.
Thank you very much,
Matt
Thank you very much,
Matt
Re: Latex output bugs?
Hello,
thank you Matt for reporting bugs, I made several fixes in markup.cc regarding typesetting of physical constants. I also improved deciding on whether multiplication should be explicit or not (now it is explicit also when multi-character symbols are involved).
I compiled the stable version 1.6.0 with the above fixes and everything works as expected. In particular, test.xws is typeset properly. I attached the output files below.
Note that latex export supports identifiers with subscripts: if you name a variable as e.g. "name_sub", everthing after underscore (_) will be typeset as subscript in latex output.
thank you Matt for reporting bugs, I made several fixes in markup.cc regarding typesetting of physical constants. I also improved deciding on whether multiplication should be explicit or not (now it is explicit also when multi-character symbols are involved).
I compiled the stable version 1.6.0 with the above fixes and everything works as expected. In particular, test.xws is typeset properly. I attached the output files below.
Note that latex export supports identifiers with subscripts: if you name a variable as e.g. "name_sub", everthing after underscore (_) will be typeset as subscript in latex output.
- Pièces jointes
-
- test.zip
- (114.44 Kio) Téléchargé 123 fois
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
This appears to be exactly what I'm looking for. Is there a way for me to get a copy of this update?
Matt
Matt
Re: Latex output bugs?
It would be possible as soon as Bernard synchronizes the source. I'm maintaining markup.cc in a separate repository. You can get the new version from here: https://github.com/marohnicluka/giac and compile it yourself (replace the file in the latest stable source tarball).
Re: Latex output bugs?
The unstable bzip2 source file is synchronized.
https://www-fourier.univ-grenoble-alpes ... .0.tar.bz2
https://www-fourier.univ-grenoble-alpes ... .0.tar.bz2
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
I noticed the xcas64inst.exe was updated 24-Oct-2020. Does it include your code?
Re: Latex output bugs?
As it appears, it is compiled with the old version...XcasEngGuy a écrit : ↑lun. oct. 26, 2020 8:38 pmI noticed the xcas64inst.exe was updated 24-Oct-2020. Does it include your code?
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex output bugs?
I am trying to compile the unstable bzip2 source file under cygwin. I am getting missing include file errors. I downloaded the source tarballs for GMP, GNU readline, FLTK, MPFR, gsl, NTL (there is a windows version also, don't know which one to use), CoCoA, and PARI. Unfortunately, I don't know how to load them into cygwin so gcc can find everything.
I know you must be busy, but could you point me to a little more detail in how to successfully compile Xcas?
Matt
I know you must be busy, but could you point me to a little more detail in how to successfully compile Xcas?
Matt
Re: Latex output bugs?
Most packages are already available in cygwin, so you don't need to compile them. Make sure you have installed the dev version (with headers). After that
should do the job. Maybe you will have to edit Makefile.win64 and remove a library that you did not compile. The only mandatory library is GMP.
BTW, I have compiled a new version for windows.
Code : Tout sélectionner
make -f Makefile.win64
BTW, I have compiled a new version for windows.