The LaTeX file format is a text file format with markup in the LaTeX 2ε derivative of the TeX family of languages.
Gnumeric generates LaTeX files to allow the export of tables of numeric values for use in the LaTeX document processing system. LaTeX is a derived format of the TeX system. The files generated by Gnumeric are designed to be used by a LaTeX processor, such as latex or pdflatex, to generate files in viewable formats such as Device Independent (DVI), Postscript (PS) or Portable Document Format (PDF).
The generated files can either be processed directly or can be included in other LaTeX files.
| Name: | LaTeX |
| Extensions: | .tex |
| Compatible Programs: | latex, pdflatex |
| Open / Save: | Save only |
Gnumeric generates a LaTeX longtable structure which contains only the contents of the cells in the worksheet displayed in the view at the time the file was created.
Font coloring is supported. Thin cell borders are translated into single lines and thick cell borders are translated into double lines. Cell background colors are ignored.
Supported by the 'HTML & TeX' plugin.
The generated file includes extensive documentation in TeX comment fields, to explain how to use and alter the file. Lines in the file which are comments begin and end with double percent symbols (%%). Lines which are designed as user options begin with a single percent symbol (%) which can be deleted to make the LaTeX command on that line take effect.
The LaTeX files generated by Gnumeric can either be processed directly by a LaTeX processor or can be included as tables in other files. The files can be included by reference as explained below or can be pasted into other files at the appropriate location. The file can also be altered to change certain parameters. These alterations are explained as comments within the file itself and are presented below.
The file created by Gnumeric can be run directly through a LaTeX processor without any modifications. For example, if the file were saved as Book1.tex, the following command
pdflatex Book1.tex
The file can also be included within another LaTeX file to provide a single table. This requires, first, ensuring that all the packages which will be needed are included, and second, defining a LaTeX variable which is used as a dummy tag to exclude the preamble used to process the file on its own. The LaTeX file generated by Gnumeric requires using the following lines in the preamble
\usepackage{ucs}
\usepackage{utf8}{inputenc}
\usepackage{color}
\usepackage{array}
\usepackage{longtable}
\usepackage{calc}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{ifthen}
\usepackage{lscape}
\def\inputGnumericTable{}
\input{mygnumericfile.tex}
An option is provided in the file allows the table to be presented in landscape mode which allows wider tables to be included. For files which are to be processed independently, the option can be changed in the document class definition
\documentclass[12pt%
%,landscape%
]{report}
\def\gnumericTableEnd{\end{landscape}}
\begin{landscape}
An option is provided to change the widths of the columns of the file generated by Gnumeric. By default, the file attempts to maintain the proportions between the columns in the Gnumeric worksheet, yet scale the resulting table for the width of the paper defined in LaTeX. To change the column widths, look for the section in the LaTeX file with lines that look like
\def\gnumericColA{107pt*\gnumericScale}
\def\gnumericColB{89pt*\gnumericScale}
\def\gnumericColC{98pt*\gnumericScale}
\def\gnumericColD{89pt*\gnumericScale}
\def\gnumericColE{89pt*\gnumericScale}
\def\gnumericColA{107pt*\gnumericScale}
\def\gnumericColB{0.75in}
\def\gnumericColC{98pt*\gnumericScale}
\def\gnumericColD{89pt*\gnumericScale}
\def\gnumericColE{89pt*\gnumericScale}
An option to change the headers and footers of the table is provided as well. The file itself contains comments on how to alter these but the choices will require seeing the documentation of the longtable LaTeX package. See that documentation and the contents of the file generated by Gnumeric for details.