After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 325656 - Save as latex2e minus is converted to ?
Save as latex2e minus is converted to ?
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export HTML
git master
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-01-03 19:28 UTC by Christian Göbel
Modified: 2006-01-23 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The .gnumeric file (1.48 KB, application/x-gnumeric)
2006-01-04 10:32 UTC, Christian Göbel
Details
the converted (Save as latex2e) Book1.tex (8.26 KB, text/x-tex)
2006-01-04 10:35 UTC, Christian Göbel
Details
the .log file of a latex run (4.26 KB, text/x-log)
2006-01-04 10:36 UTC, Christian Göbel
Details
the resulting .dvi file (364 bytes, application/x-dvi)
2006-01-04 10:38 UTC, Christian Göbel
Details

Description Christian Göbel 2006-01-03 19:28:08 UTC
Using Gnumeric on Ubuntu I observed the following
bug when saving a .gnumeric document as a latex2e file.

To reproduce the bug just open Gnumeric and type
a NEGATIVE number in one of the fields e.g. -1

Than go to the File Save as Dialog and choose latex2e as
the File Type and save.

The generated document is fine with the exeption that the
minus sign "-" is converted to a question mark "?".
So the field does not show up as -1  but instead as ?1 
This can be checked by opening the Book1.tex file with
a text-editor - and is also visible if you compile the
document by using latex Book1.tex and looking at the Book1.dvi
file.

Thanks a lot for providing great Gnumeric. The Save as latex2e
is a GREAT feature and saves me a lot of time in my work.

Best regards
Christian
Comment 1 Morten Welinder 2006-01-03 21:47:04 UTC
Confirmed.

Actually, "?" is what you get in ISO-8859-1 mode.  In UTF-8 mode you get
the unicode minus.
Comment 2 Morten Welinder 2006-01-03 21:54:29 UTC
...and the cause is that latex.c uses cell_get_rendered_text.  Crazy wrong.

Changing to HTML component which, perhaps surprisingly, covers latex.
Comment 3 Andreas J. Guelzow 2006-01-04 06:25:07 UTC
Well, I cannot replicate this. The latex code shows:

       \usepackage[utf8]{inputenc}

...

       \gnumericPB{\raggedleft}\gnumbox[r]{â\210'1}

which should typeset -1 and does for me. Do you have the required package inputenc.sty available?

Morten, what do you mean with "in ISO-8859-1 mode". THe latex file uses utf8 encoding as specified. And why is cell_get_rendered_text inappropriate? We want to have exactly the output as rendered on screen in gnumeric.

Comment 4 Andreas J. Guelzow 2006-01-04 06:26:33 UTC
Could somebody who thinks they can replicate this please attach their latex log file from a compile run of the created latex file.

Thanks
Comment 5 Christian Göbel 2006-01-04 10:32:32 UTC
Created attachment 56762 [details]
The .gnumeric file

A simple .gnumeric file with negative values.
Comment 6 Christian Göbel 2006-01-04 10:35:23 UTC
Created attachment 56763 [details]
the converted (Save as latex2e)  Book1.tex 

The file like it is saved by the Save as Dialog if latex2e is choosen as a file type. When I open this file with gedit the minus shows up as question marks already in this file.
Comment 7 Christian Göbel 2006-01-04 10:36:57 UTC
Created attachment 56764 [details]
the .log file of a latex run

Here is the .log file when I compile the document with latex (no further options used): latex Book1.tex
Comment 8 Christian Göbel 2006-01-04 10:38:06 UTC
Created attachment 56765 [details]
the resulting .dvi file

This is the resulting .dvi file. As reported the minus sign shows up as a question mark.
Comment 9 Andreas J. Guelzow 2006-01-04 14:03:13 UTC
Ah I see, I was not able to replicate the problem because my preference is set to "use utf8 in latex export" (in preferende dialog under "Files"). The problem occurs only with latin1.

Christian, to work around this bug please change your preference setting.
Comment 10 Andreas J. Guelzow 2006-01-04 14:11:32 UTC
well,  glib's g_convert_with_fallback () does not know how to convert a utf8 minus sign to latin1. 
Comment 11 Christian Göbel 2006-01-04 14:32:47 UTC
Thanks a lot.
Indeed setting the option "Use UTF-8 in LaTeX Export" in the preference dialogue generates a document which works well.
However than we have to use UTF-8 to compile with latex and as a consequence I couldn't compile without installing the ucs package (latex-ucs for Debian users)
which is not included in the standard installation of tetex.

Is there a way to use the UTF-setting for the tables when including 
the tables via a \input{} command in a otherwise latin-encoded
document? Sorry this is probably a question for a latex power user mailing list.
Comment 12 Andreas J. Guelzow 2006-01-04 15:01:50 UTC
this should do the job for you:

\inputencoding{utf8}
\input{...}
\inputencoding{latin1}
Comment 13 Christian Göbel 2006-01-05 19:47:43 UTC
This might be slightly offtopic - but perhaps I am not the only one who has this problem: Howto include a table generated by gnumeric with utf8 ecoding into a otherwise latin encoded document? To make the task more difficult enable the use of German fonts and use fonts which look also good in .pdf files.

In the header of the latex file type:
\documentclass[11pt,english,figtopcap,latin1,utf8]{article}
\usepackage{palatino}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
%%\usepackage[utf8]{inputenc}

At the place you want to put the table:
\inputencoding{utf8}
\input{yourtable.tex}
\inputencoding{latin1}

At least this worked for me.
Comment 14 Andreas J. Guelzow 2006-01-16 01:17:58 UTC
I have committed a small temporary fix to this issue, by just marking all untranslated unicode characters by "-" rather than "?". Clearly we should translate all unicode minus signs to hyphens and keep the "?" for all otehr characters.
Comment 15 Andreas J. Guelzow 2006-01-23 17:09:50 UTC
fixed in cvs