Hello, I'm using gnumeric and enjoy the well structured design.
I'm very happy about the nice LaTeX export function. Nevertheless it fails for me for special documents, wider than text width. I use a multirow cell. The generated LateX code uses the \multirow command. But, unfortunately, it is wrong sized. If I use smaller columns, though they fit into the LaTeX text width, it works perfectly. What goes wrong in defining the multirow cell or calculating column widths? For analysing, I attach a gnumeric file and the corresponding LaTeX file. If needed, I'll send the corresponding PDF for showing the missized cell. I use gnumeric 1.9.18 Thanks for any hints. Read you... Susanne
gnumeric-multirow.gnumeric
Description: application/gnumeric
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% This is the header of a LaTeX2e file exported from Gnumeric. %%
%% %%
%% This file can be compiled as it stands or included in another %%
%% LaTeX document. The table is based on the longtable package so %%
%% the longtable options (headers, footers...) can be set in the %%
%% preamble section below (see PRAMBLE). %%
%% %%
%% To include the file in another, the following two lines must be %%
%% in the including file: %%
%% \def\inputGnumericTable{} %%
%% at the beginning of the file and: %%
%% \input{name-of-this-file.tex} %%
%% where the table is to be placed. Note also that the including %%
%% file must use the following packages for the table to be %%
%% rendered correctly: %%
%% \usepackage{ucs} %%
%% \usepackage[utf8x]{inputenc} %%
%% \usepackage{color} %%
%% \usepackage{array} %%
%% \usepackage{longtable} %%
%% \usepackage{calc} %%
%% \usepackage{multirow} %%
%% \usepackage{hhline} %%
%% \usepackage{ifthen} %%
%% optionally (for landscape tables embedded in another document): %%
%% \usepackage{lscape} %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This section checks if we are begin input into another file or %%
%% the file will be compiled alone. First use a macro taken from %%
%% the TeXbook ex 7.7 (suggestion of Han-Wen Nienhuys). %%
\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
%% Check for the \def token for inputed files. If it is not %%
%% defined, the file will be processed as a standalone and the %%
%% preamble will be used. %%
\ifundefined{inputGnumericTable}
%% We must be able to close or not the document at the end. %%
\def\gnumericTableEnd{\end{document}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% This is the PREAMBLE. Change these values to get the right %%
%% paper size and other niceties. Uncomment the landscape option %%
%% to the documentclass defintion for standalone documents. %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt%
%,landscape%
]{report}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{fullpage}
\usepackage{color}
\usepackage{array}
\usepackage{longtable}
\usepackage{calc}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{ifthen}
\begin{document}
%% End of the preamble for the standalone. The next section is for %%
%% documents which are included into other LaTeX2e files. %%
\else
%% We are not a stand alone document. For a regular table, we will %%
%% have no preamble and only define the closing to mean nothing. %%
\def\gnumericTableEnd{}
%% If we want landscape mode in an embedded document, comment out %%
%% the line above and uncomment the two below. The table will %%
%% begin on a new page and run in landscape mode. %%
% \def\gnumericTableEnd{\end{landscape}}
% \begin{landscape}
%% End of the else clause for this file being \input. %%
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% The rest is the gnumeric table, except for the closing %%
%% statement. Changes below will alter the table's appearance. %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\providecommand{\gnumericmathit}[1]{#1}
%% Uncomment the next line if you would like your numbers to be in %%
%% italics if they are italizised in the gnumeric table. %%
%\renewcommand{\gnumericmathit}[1]{\mathit{#1}}
\providecommand{\gnumericPB}[1]%
{\let\gnumericTemp=\\#1\let\\=\gnumericTemp\hspace{0pt}}
\ifundefined{gnumericTableWidthDefined}
\newlength{\gnumericTableWidth}
\newlength{\gnumericTableWidthComplete}
\global\def\gnumericTableWidthDefined{}
\fi
%% The default table format retains the relative column widths of %%
%% gnumeric. They can easily be changed to c, r or l. In that case %%
%% you may want to comment out the next line and uncomment the one %%
%% thereafter %%
\providecommand\gnumbox{\makebox[0pt]}
%%\providecommand\gnumbox[1][]{\makebox}
%% to adjust positions in multirow situations %%
\setlength{\bigstrutjot}{\jot}
\setlength{\extrarowheight}{\doublerulesep}
%% The \setlongtables command keeps column widths the same across %%
%% pages. Simply comment out next line for varying column widths. %%
\setlongtables
\setlength\gnumericTableWidth{%
269pt+%
269pt+%
0pt}
\def\gumericNumCols{2}
\setlength\gnumericTableWidthComplete{\gnumericTableWidth+%
\tabcolsep*\gumericNumCols*2+\arrayrulewidth*\gumericNumCols}
\ifthenelse{\lengthtest{\gnumericTableWidthComplete > \linewidth}}%
{\def\gnumericScale{\ratio{\linewidth-%
\tabcolsep*\gumericNumCols*2-%
\arrayrulewidth*\gumericNumCols}%
{\gnumericTableWidth}}}%
{\def\gnumericScale{1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% The following are the widths of the various columns. We are %%
%% defining them here because then they are easier to change. %%
%% Depending on the cell formats we may use them more than once. %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\gnumericColA{269pt*\gnumericScale}
\def\gnumericColB{269pt*\gnumericScale}
\begin{longtable}[c]{%
b{\gnumericColA}%
b{\gnumericColB}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The longtable options. (Caption, headers... see Goosens, p.124) %%
% \caption{The Table Caption.} \\ %
% \hline % Across the top of the table.
%% The rest of these options are table rows which are placed on %%
%% the first, last or every page. Use \multicolumn if you want. %%
%% Header for the first page. %%
% \multicolumn{2}{c}{The First Header} \\ \hline
% \multicolumn{1}{c}{colTag} %Column 1
% &\multicolumn{1}{c}{colTag} \\ \hline %Last column
% \endfirsthead
%% The running header definition. %%
% \hline
% \multicolumn{2}{l}{\ldots\small\slshape continued} \\ \hline
% \multicolumn{1}{c}{colTag} %Column 1
% &\multicolumn{1}{c}{colTag} \\ \hline %Last column
% \endhead
%% The running footer definition. %%
% \hline
% \multicolumn{2}{r}{\small\slshape continued\ldots} \\
% \endfoot
%% The ending footer definition. %%
% \multicolumn{2}{c}{That's all folks} \\ \hline
% \endlastfoot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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
\\
\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
\\
&\gnumericPB{\raggedright}bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb bbb
\\
\end{longtable}
\gnumericTableEnd
_______________________________________________ gnumeric-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnumeric-list
