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 611633 - In LaTeX export multirow cells are not hyphenated
In LaTeX export multirow cells are not hyphenated
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export other
1.9.x
Other FreeBSD
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-03-02 19:53 UTC by Susanne Wunsch
Modified: 2010-03-04 07:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Gnumeric file with multirow cell (1.90 KB, application/octet-stream)
2010-03-02 19:53 UTC, Susanne Wunsch
Details
Adjusted LaTeX export sample file (9.26 KB, text/plain)
2010-03-03 06:58 UTC, Andreas J. Guelzow
Details
Gnumeric file with multirow cell, hyphenation failes in A2 (1.90 KB, application/octet-stream)
2010-03-03 13:44 UTC, Susanne Wunsch
Details

Description Susanne Wunsch 2010-03-02 19:53:12 UTC
Created attachment 155062 [details]
Gnumeric file with multirow cell

I attach a gnumeric file with the multirow cell A2.

Export file as (full) LaTeX

After compiling the file, cell A2 appears on the output shifted to the right
and that might explain why the lines are split.

Using smaller columns, though they fit into the LaTeX text width,
it works perfectly: cell A2 appears like cell A1.

The inner tabular environment (inside the \multirow command) could use @{} at the beginning and the end of its declaration for removing tabcolsep space.

<snip from generated file>
         \multirow{2}[1]*{\begin{tabular}{@{}p{    \gnumericColA+%
        0pt}@{}}\gnumericPB{\raggedright}aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aa
<snip>

Unfortunately, that's only one part of the problem.

With this correction, cell A2 moves to the left, but nevertheless breaks wrong. Looks like wrong column width.
Comment 1 Andreas J. Guelzow 2010-03-02 22:03:21 UTC
I don't see a problem. 

We do not export the font information. In LaTeX you are likely intending to use better fonts. So the cells that are setup to wrap automatically will of course break at different places. 

The slight shift for A2 comes from the need to insert a tabular environment. I don't know why that column is narrower considering that we specify in the LaTeX file that that cell should have the same width as the coulumn.

columns:

\begin{longtable}[c]{%
	b{\gnumericColA}%
	b{\gnumericColB}%
	}

this row:
	 \multirow{2}[1]*{\begin{tabular}{|p{	\gnumericColA+%
	0pt}|}\gnumericPB{\raggedright}aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa \end{tabular}}
	&\gnumericPB{\raggedright}bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb 

If you think that we should be creating different LaTeX code please tell us, what you would expect to see!
Comment 2 Andreas J. Guelzow 2010-03-02 22:32:36 UTC
Oh yeah:

the obvious way of writing the second row would be:

\multirow{2}{\gnumericColA}{\gnumericPB{\raggedright}aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa }
	&\gnumericPB{\raggedright}bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb 

but for some reason unkown to me, that doesn't work.
Comment 3 Susanne Wunsch 2010-03-02 22:40:59 UTC
Cell A1 and A2 contain the same content. I would expect, that they wrap identical, if there are no font changes in between.

Gnumeric does so with its font. 
LaTeX does so with its font, if both columns are smaller.

LaTeX breaks at another point than Gnumeric, of course.

But the LaTeX export from the attached file shows different behaviour: Cell A1 is wrapped at another point than A2.

The tabular environment is a fine idea. But a tabular has small inner-column-spaces (\tabcolsep), as default.

In global calculating column widths, you subtract their influence for fitting into the LaTeX text width.

With the intention of using the same column width inside the multirow-cell, you have to remove this inner-column-spaces.

That is done with @{} at the beginning and the end of the tabular definition, like shown in my previous description.

Implementing the two occurances of @{}, you get a different output.

But nevertheless, it doesn't solves the problem, why cell A2 is wrapped at another point than A1. 

It seems to be smaller, but which code is responsible for it? Why does it work with smaller columns, that fit into text width?

Do you need the compiled PDF, showing the problem?
Comment 4 Andreas J. Guelzow 2010-03-03 00:09:53 UTC
I have no doub tthat there are differnces between a PDF file created from Gnumeric and one created via LaTeX. It there weren't ther would be no point in this LaTeX output. So seeing a pdf file is pointless. 

Adding those @{} would be simple but as you point out they stil don't fix your issue. So the real question is, how would you like to see the LaTeX code change. As far as I can tell, the cell and the column both have column widths of \gnumericColA.
Comment 5 Andreas J. Guelzow 2010-03-03 06:58:23 UTC
Created attachment 155102 [details]
Adjusted LaTeX export sample file

This file shows the adjusted export of a file (similar to the provided gnumeric file but with an additional empty multirow cell).
Comment 6 Andreas J. Guelzow 2010-03-03 06:58:37 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 7 Susanne Wunsch 2010-03-03 13:40:12 UTC
Thank you for this quick fix. Your changed file works fine.

I applied the patch to my current gnumeric (1.9.18).

Unfortunately, multirow cells of my original document, which is more complex, now aren't wrapped using hyphenations.

I again attach a gnumeric file, which shows the difference between cell A1 (wrapping with hyphenation) and cell A2 (wrapping without hyphenation), when compiling the LaTeX export with pdflatex (or similar).

Maybe, it could be fixed, re-introducing the tabular environment inside the \multirow command:

	 \multirow{2}[1]{\gnumericMultiRowLength}{%
         \begin{tabular}{@{}p{\gnumericMultiRowLength}@{}}
	 \gnumericPB{\raggedright}tabulator tabulator/tabulator/environmental/tabular\end{tabular}}
	&\gnumericPB{\raggedright}bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb 
\\
Comment 8 Susanne Wunsch 2010-03-03 13:44:03 UTC
Created attachment 155133 [details]
Gnumeric file with multirow cell, hyphenation failes in A2

Sorry, comment #7 came without attachment.
Comment 9 Andreas J. Guelzow 2010-03-03 14:24:12 UTC
hmm I think there must be a more reasonable way to tell LaTeX to hyphenate then to wrap each multirow into a tabular environment.
Comment 10 Andreas J. Guelzow 2010-03-03 15:50:46 UTC
I suspect that it may suffice to add a 
\renewcommand{\multirowsetup}{}
in the preamble of the document. I will test later.
Comment 11 Andreas J. Guelzow 2010-03-03 18:22:29 UTC
\renewcommand{\multirowsetup}{} does not work. So we need to wrap the content, but wrapping in parbox is simpler.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 12 Susanne Wunsch 2010-03-04 06:40:28 UTC
Thank you. All works fine now. It is a pretty nice function.
Comment 13 Andreas J. Guelzow 2010-03-04 07:30:43 UTC
You are welcome. We aim to please.