## Latex output bugs?

Messages in english

XcasEngGuy
Messages : 78
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.
\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.
\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 ? ! Missing } inserted. <inserted text> } l.103 ? 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

?
! Missing } inserted.
<inserted text>
}
l.107

?

Underfull \hbox (badness 10000) in paragraph at lines 107--109

! Missing { inserted.
\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 ? ! Missing } inserted. <inserted text> } l.111 ? 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

?
! Missing } inserted.
<inserted text>
}
l.119

?

Underfull \hbox (badness 10000) in paragraph at lines 119--121

! Missing { inserted.
\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

?
! Missing } inserted.
<inserted text>
}
l.123

?

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é 22 fois

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

### Re: Latex output bugs?

Can you send the xws file? It will make easy to reproduce the bug.

XcasEngGuy
Messages : 78
Inscription : mer. janv. 13, 2010 3:20 pm

### Re: Latex output bugs?

No problem.

Thanks
Pièces jointes
tex_latex_files.zip
I think this is everything
(11.58 Kio) Téléchargé 20 fois

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

### 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...

XcasEngGuy
Messages : 78
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
Pièces jointes
fix01.jpg (5.24 Kio) Consulté 917 fois
error_clip.jpg (44.67 Kio) Consulté 917 fois

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

### Re: Latex output bugs?

Yes, that should be fixed. And \_ will be infixed.

XcasEngGuy
Messages : 78
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

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

### 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.
Pièces jointes
test.zip
(114.44 Kio) Téléchargé 22 fois

XcasEngGuy
Messages : 78
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

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

### 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).

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

### Re: Latex output bugs?

The unstable bzip2 source file is synchronized.
https://www-fourier.univ-grenoble-alpes ... .0.tar.bz2

XcasEngGuy
Messages : 78
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?

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

### Re: Latex output bugs?

XcasEngGuy a écrit :
lun. oct. 26, 2020 8:38 pm
I noticed the xcas64inst.exe was updated 24-Oct-2020. Does it include your code?
As it appears, it is compiled with the old version...

XcasEngGuy
Messages : 78
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

parisse
Messages : 5346
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

### 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

Code : Tout sélectionner

make -f Makefile.win64
`
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.