2

Simply, if I have a table of the form:

    \begin{tabular}{l r r r r r l r r r r r}
    \hline
    {}&{}&{}&$n$&{}&{}&{}&{}&{}&$n$&{}&{}\\
    \cline{2-6}\cline{8-12}
    {}&1&2&3&4&5&{}&1&2&3&4&5\\
    \hline
$Q(n+0)$&1&1&2&3&3&$Q(n+100)$&48&54&54&50&60\\
$Q(n+5)$&4&5&5&6&6&$Q(n+105)$&52&54&58&60&53\\
$Q(n+10)$&6&8&8&8&10&$Q(n+110)$&60&60&52&62&66\\
$Q(n+15)$&9&10&11&11&12&$Q(n+115)$&55&62&68&62&58\\
$Q(n+20)$&12&12&12&16&14&$Q(n+120)$&72&58&61&78&57\\
$Q(n+25)$&14&16&16&16&16&$Q(n+125)$&71&68&64&63&73\\
$Q(n+30)$&20&17&17&20&21&$Q(n+130)$&63&71&72&72&80\\
$Q(n+35)$&19&20&22&21&22&$Q(n+135)$&61&71&77&65&80\\
$Q(n+40)$&23&23&24&24&24&$Q(n+140)$&71&69&77&75&73\\
$Q(n+45)$&24&24&32&24&25&$Q(n+145)$&77&79&76&80&79\\
$Q(n+50)$&30&28&26&30&30&$Q(n+150)$&75&82&77&80&80\\
$Q(n+55)$&28&32&30&32&32&$Q(n+155)$&78&83&83&78&85\\
$Q(n+60)$&32&32&40&33&31&$Q(n+160)$&82&85&84&84&88\\
$Q(n+65)$&38&35&33&39&40&$Q(n+165)$&83&87&88&87&86\\
$Q(n+70)$&37&38&40&39&40&$Q(n+170)$&90&88&87&92&90\\
$Q(n+75)$&39&42&40&41&43&$Q(n+175)$&91&92&92&94&92\\
$Q(n+80)$&44&43&43&46&44&$Q(n+180)$&93&94&94&96&94\\
$Q(n+85)$&45&47&47&46&48&$Q(n+185)$&96&96&96&96&96\\
$Q(n+90)$&48&48&48&48&48&$Q(n+190)$&96&128&72&96&115\\
$Q(n+95)$&64&41&52&54&56&$Q(n+195)$&100&84&114&110&93\\
    \hline
\end{tabular}
}

is there a way that I can automatically edit the numerical values in the syntax? I'd like to do this so I can just take a table of values in excel and basically 'copy' the values in those tables to this form so that I make all the necessary tables relatively quickly. Thanks in advance.

  • 1
    There are various ways to convert Excel tables to LaTeX source depending on your OS: see Comprehensive list of tools that simplify the generation of LaTeX tables. (Possible duplicate) – Alan Munn Jul 28 '13 at 19:09
  • @Alan Do these methods rely on default templates or would it be possible to tell it to convert values in cells A1....An B1...Bn to the respective slots in a template as above? For example, I know Gnumeric and a variety of others make a basic table for you just by transferring over but it's important in this case that this precise template can be used. – user33916 Jul 28 '13 at 19:11
  • If you really want to use a specific template, you might be better of using something like datatool and storing each table in its own CSV file. Your table format could also be simplified (and made nicer) using array and booktabs. – Alan Munn Jul 28 '13 at 19:19
  • what's the formula for Q ? – percusse Aug 28 '13 at 8:24
2

pgfplotstable supports it. To this end, you define a new column type (I chose L) as in the following example.

Note that this would also try to format empty cells. To work around this limitation, I introduced a macro \EMPTY which disables the new column type by means of \multicolumn{1}{r}{}.

Here is your example. The only difference is the column type definition and the use of \EMPTY in your header row:

\documentclass{standalone}

\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{colortbl}

\begin{document}

\newcommand\EMPTY{\multicolumn{1}{r}{}}

\newcolumntype{L}[1]
    {>{\begin{pgfplotstablecoltype}[#1]}r<{\end{pgfplotstablecoltype}}}

    \begin{tabular}{l L{fixed,fixed zerofill} L{sci,sci zerofill} r r r l r r r L{fixed,precision=1,fixed zerofill} r}
    \hline
    \EMPTY&\EMPTY&\EMPTY&$n$&\EMPTY&\EMPTY&\EMPTY&\EMPTY&\EMPTY&$n$&\EMPTY&\EMPTY\\
    \cline{2-6}\cline{8-12}
    {}&1&2&3&4&5&{}&1&2&3&4&5\\
    \hline
$Q(n+0)$&1&1&2&3&3&$Q(n+100)$&48&54&54&50&60\\
$Q(n+5)$&4&5&5&6&6&$Q(n+105)$&52&54&58&60&53\\
$Q(n+10)$&6&8&8&8&10&$Q(n+110)$&60&60&52&62&66\\
$Q(n+15)$&9&10&11&11&12&$Q(n+115)$&55&62&68&62&58\\
$Q(n+20)$&12&12&12&16&14&$Q(n+120)$&72&58&61&78&57\\
$Q(n+25)$&14&16&16&16&16&$Q(n+125)$&71&68&64&63&73\\
$Q(n+30)$&20&17&17&20&21&$Q(n+130)$&63&71&72&72&80\\
$Q(n+35)$&19&20&22&21&22&$Q(n+135)$&61&71&77&65&80\\
$Q(n+40)$&23&23&24&24&24&$Q(n+140)$&71&69&77&75&73\\
$Q(n+45)$&24&24&32&24&25&$Q(n+145)$&77&79&76&80&79\\
$Q(n+50)$&30&28&26&30&30&$Q(n+150)$&75&82&77&80&80\\
$Q(n+55)$&28&32&30&32&32&$Q(n+155)$&78&83&83&78&85\\
$Q(n+60)$&32&32&40&33&31&$Q(n+160)$&82&85&84&84&88\\
$Q(n+65)$&38&35&33&39&40&$Q(n+165)$&83&87&88&87&86\\
$Q(n+70)$&37&38&40&39&40&$Q(n+170)$&90&88&87&92&90\\
$Q(n+75)$&39&42&40&41&43&$Q(n+175)$&91&92&92&94&92\\
$Q(n+80)$&44&43&43&46&44&$Q(n+180)$&93&94&94&96&94\\
$Q(n+85)$&45&47&47&46&48&$Q(n+185)$&96&96&96&96&96\\
$Q(n+90)$&48&48&48&48&48&$Q(n+190)$&96&128&72&96&115\\
$Q(n+95)$&64&41&52&54&56&$Q(n+195)$&100&84&114&110&93\\
    \hline
\end{tabular}
\end{document}

enter image description here

  • By the way: the next version (probably 1.10) of pgfplotstable will be able to cope with empty cell values automatically in this context. – Christian Feuersänger Dec 26 '13 at 13:12
1

Gnumeric is itself powerful enough to build a template and convert it into LaTeX tabular using concatenation of strings. Check out, for example, this gnumeric-table.xml created with Gnumeric Spreadsheet 1.10.17:

<?xml version="1.0" encoding="UTF-8"?>
<gnm:Workbook xmlns:gnm="http://www.gnumeric.org/v10.dtd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gnumeric.org/v9.xsd">
  <gnm:Version Epoch="1" Major="10" Minor="17" Full="1.10.17"/>
  <gnm:Attributes>
    <gnm:Attribute>
      <gnm:type>4</gnm:type>
      <gnm:name>WorkbookView::show_horizontal_scrollbar</gnm:name>
      <gnm:value>TRUE</gnm:value>
    </gnm:Attribute>
    <gnm:Attribute>
      <gnm:type>4</gnm:type>
      <gnm:name>WorkbookView::show_vertical_scrollbar</gnm:name>
      <gnm:value>TRUE</gnm:value>
    </gnm:Attribute>
    <gnm:Attribute>
      <gnm:type>4</gnm:type>
      <gnm:name>WorkbookView::show_notebook_tabs</gnm:name>
      <gnm:value>TRUE</gnm:value>
    </gnm:Attribute>
    <gnm:Attribute>
      <gnm:type>4</gnm:type>
      <gnm:name>WorkbookView::do_auto_completion</gnm:name>
      <gnm:value>TRUE</gnm:value>
    </gnm:Attribute>
    <gnm:Attribute>
      <gnm:type>4</gnm:type>
      <gnm:name>WorkbookView::is_protected</gnm:name>
      <gnm:value>FALSE</gnm:value>
    </gnm:Attribute>
  </gnm:Attributes>
  <office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office" office:version="1.2">
    <office:meta>
      <dc:date>2013-11-26T09:02:25Z</dc:date>
      <meta:creation-date>2013-11-26T06:36:22Z</meta:creation-date>
    </office:meta>
  </office:document-meta>
  <gnm:Calculation ManualRecalc="0" EnableIteration="1" MaxIterations="100" IterationTolerance="0.001" FloatRadix="2" FloatDigits="53"/>
  <gnm:SheetNameIndex>
    <gnm:SheetName gnm:Cols="256" gnm:Rows="65536">Sheet1</gnm:SheetName>
    <gnm:SheetName gnm:Cols="256" gnm:Rows="65536">Sheet3</gnm:SheetName>
  </gnm:SheetNameIndex>
  <gnm:Geometry Width="918" Height="365"/>
  <gnm:Sheets>
    <gnm:Sheet DisplayFormulas="0" HideZero="0" HideGrid="0" HideColHeader="0" HideRowHeader="0" DisplayOutlines="1" OutlineSymbolsBelow="1" OutlineSymbolsRight="1" Visibility="GNM_SHEET_VISIBILITY_VISIBLE" GridColor="0:0:0">
      <gnm:Name>Sheet1</gnm:Name>
      <gnm:MaxCol>14</gnm:MaxCol>
      <gnm:MaxRow>12</gnm:MaxRow>
      <gnm:Zoom>1</gnm:Zoom>
      <gnm:Names>
        <gnm:Name>
          <gnm:name>Print_Area</gnm:name>
          <gnm:value>#REF!</gnm:value>
          <gnm:position>A1</gnm:position>
        </gnm:Name>
        <gnm:Name>
          <gnm:name>Sheet_Title</gnm:name>
          <gnm:value>&quot;Sheet1&quot;</gnm:value>
          <gnm:position>A1</gnm:position>
        </gnm:Name>
      </gnm:Names>
      <gnm:PrintInformation>
        <gnm:Margins>
          <gnm:top Points="120" PrefUnit="mm"/>
          <gnm:bottom Points="120" PrefUnit="mm"/>
          <gnm:left Points="72" PrefUnit="mm"/>
          <gnm:right Points="72" PrefUnit="mm"/>
          <gnm:header Points="72" PrefUnit="mm"/>
          <gnm:footer Points="72" PrefUnit="mm"/>
        </gnm:Margins>
        <gnm:Scale type="percentage" percentage="100"/>
        <gnm:vcenter value="0"/>
        <gnm:hcenter value="0"/>
        <gnm:grid value="0"/>
        <gnm:even_if_only_styles value="0"/>
        <gnm:monochrome value="0"/>
        <gnm:draft value="0"/>
        <gnm:titles value="0"/>
        <gnm:do_not_print value="0"/>
        <gnm:print_range value="0"/>
        <gnm:order>d_then_r</gnm:order>
        <gnm:orientation>portrait</gnm:orientation>
        <gnm:Header Left="" Middle="&amp;[TAB]" Right=""/>
        <gnm:Footer Left="" Middle="Page &amp;[PAGE]" Right=""/>
        <gnm:paper>na_letter</gnm:paper>
        <gnm:comments>in_place</gnm:comments>
        <gnm:errors>as_displayed</gnm:errors>
      </gnm:PrintInformation>
      <gnm:Styles>
        <gnm:StyleRegion startCol="0" startRow="0" endCol="0" endRow="15">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="0" startRow="16" endCol="15" endRow="255">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="0" startRow="256" endCol="63" endRow="65535">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="1" startRow="0" endCol="13" endRow="6">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="1" startRow="7" endCol="12" endRow="9">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Arial</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="1" startRow="10" endCol="12" endRow="15">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="13" startRow="7" endCol="13" endRow="8">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Arial</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="13" startRow="9" endCol="13" endRow="15">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="14" startRow="0" endCol="14" endRow="2">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="14" startRow="3" endCol="14" endRow="5">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Arial</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="14" startRow="6" endCol="14" endRow="6">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="14" startRow="7" endCol="14" endRow="9">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Arial</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="14" startRow="10" endCol="14" endRow="15">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="15" startRow="0" endCol="15" endRow="15">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="16" startRow="0" endCol="63" endRow="255">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
        <gnm:StyleRegion startCol="64" startRow="0" endCol="255" endRow="65535">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
      </gnm:Styles>
      <gnm:Cols DefaultSizePts="48">
        <gnm:ColInfo No="0" Unit="48" Count="2"/>
        <gnm:ColInfo No="2" Unit="15.75" Count="2"/>
        <gnm:ColInfo No="4" Unit="21.75"/>
        <gnm:ColInfo No="5" Unit="15.75"/>
        <gnm:ColInfo No="6" Unit="14.25"/>
        <gnm:ColInfo No="7" Unit="54.75"/>
        <gnm:ColInfo No="8" Unit="15.75" Count="2"/>
        <gnm:ColInfo No="10" Unit="21.75"/>
        <gnm:ColInfo No="11" Unit="15.75" Count="2"/>
        <gnm:ColInfo No="13" Unit="19.5" HardSize="1"/>
        <gnm:ColInfo No="14" Unit="267"/>
      </gnm:Cols>
      <gnm:Rows DefaultSizePts="12.75">
        <gnm:RowInfo No="0" Unit="12.75" Count="12"/>
      </gnm:Rows>
      <gnm:Selections CursorCol="12" CursorRow="13">
        <gnm:Selection startCol="12" startRow="13" endCol="12" endRow="13"/>
      </gnm:Selections>
      <gnm:Cells>
        <gnm:Cell Row="0" Col="5" ValueType="10"></gnm:Cell>
        <gnm:Cell Row="1" Col="1" ValueType="60">l</gnm:Cell>
        <gnm:Cell Row="1" Col="2" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="3" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="4" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="5" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="6" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="7" ValueType="60">l</gnm:Cell>
        <gnm:Cell Row="1" Col="8" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="9" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="10" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="11" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="12" ValueType="60">r</gnm:Cell>
        <gnm:Cell Row="1" Col="14">=&quot;\\begin{tabular}{&quot;&amp;concatenate($B$2:$M$2)&amp;&quot;}&quot;</gnm:Cell>
        <gnm:Cell Row="2" Col="14" ValueType="60">\hline</gnm:Cell>
        <gnm:Cell Row="3" Col="1" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="2" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="3" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="4" ValueType="60">$n$</gnm:Cell>
        <gnm:Cell Row="3" Col="5" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="6" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="7" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="8" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="9" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="10" ValueType="60">$n$</gnm:Cell>
        <gnm:Cell Row="3" Col="11" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="12" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="14" Rows="1" Cols="1">=B4&amp;concatenate(&quot;&amp;&quot;&amp;C4:M4)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="4" Col="14" ValueType="60"> \cline{2-6}\cline{8-12}</gnm:Cell>
        <gnm:Cell Row="5" Col="1" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="5" Col="2" ValueType="40">1</gnm:Cell>
        <gnm:Cell Row="5" Col="3" ValueType="40">2</gnm:Cell>
        <gnm:Cell Row="5" Col="4" ValueType="40">3</gnm:Cell>
        <gnm:Cell Row="5" Col="5" ValueType="40">4</gnm:Cell>
        <gnm:Cell Row="5" Col="6" ValueType="40">5</gnm:Cell>
        <gnm:Cell Row="5" Col="7" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="5" Col="8" ValueType="40">1</gnm:Cell>
        <gnm:Cell Row="5" Col="9" ValueType="40">2</gnm:Cell>
        <gnm:Cell Row="5" Col="10" ValueType="40">3</gnm:Cell>
        <gnm:Cell Row="5" Col="11" ValueType="40">4</gnm:Cell>
        <gnm:Cell Row="5" Col="12" ValueType="40">5</gnm:Cell>
        <gnm:Cell Row="5" Col="14" Rows="1" Cols="1">=B6&amp;concatenate(&quot;&amp;&quot;&amp;C6:M6)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="6" Col="14" ValueType="60">\hline</gnm:Cell>
        <gnm:Cell Row="7" Col="0" ValueType="40">0</gnm:Cell>
        <gnm:Cell Row="7" Col="1" ExprID="1">=&quot;$Q(n+&quot;&amp;A8&amp;&quot;)$&quot;</gnm:Cell>
        <gnm:Cell Row="7" Col="2" ValueType="40">1</gnm:Cell>
        <gnm:Cell Row="7" Col="3" ValueType="40">1</gnm:Cell>
        <gnm:Cell Row="7" Col="4" ValueType="40">2</gnm:Cell>
        <gnm:Cell Row="7" Col="5" ValueType="40">3</gnm:Cell>
        <gnm:Cell Row="7" Col="6" ValueType="40">3</gnm:Cell>
        <gnm:Cell Row="7" Col="7" ExprID="2">=&quot;$Q(n+&quot;&amp;A8+100&amp;&quot;)$&quot;</gnm:Cell>
        <gnm:Cell Row="7" Col="8" ValueType="40">48</gnm:Cell>
        <gnm:Cell Row="7" Col="9" ValueType="40">54</gnm:Cell>
        <gnm:Cell Row="7" Col="10" ValueType="40">54</gnm:Cell>
        <gnm:Cell Row="7" Col="11" ValueType="40">50</gnm:Cell>
        <gnm:Cell Row="7" Col="12" ValueType="40">60</gnm:Cell>
        <gnm:Cell Row="7" Col="14" Rows="1" Cols="1">=B8&amp;concatenate(&quot;&amp;&quot;&amp;C8:M8)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="8" Col="0" ExprID="3">=A8+5</gnm:Cell>
        <gnm:Cell Row="8" Col="1" ExprID="1"/>
        <gnm:Cell Row="8" Col="2" ValueType="40">4</gnm:Cell>
        <gnm:Cell Row="8" Col="3" ValueType="40">5</gnm:Cell>
        <gnm:Cell Row="8" Col="4" ValueType="40">5</gnm:Cell>
        <gnm:Cell Row="8" Col="5" ValueType="40">6</gnm:Cell>
        <gnm:Cell Row="8" Col="6" ValueType="40">6</gnm:Cell>
        <gnm:Cell Row="8" Col="7" ExprID="2"/>
        <gnm:Cell Row="8" Col="8" ValueType="40">52</gnm:Cell>
        <gnm:Cell Row="8" Col="9" ValueType="40">54</gnm:Cell>
        <gnm:Cell Row="8" Col="10" ValueType="40">58</gnm:Cell>
        <gnm:Cell Row="8" Col="11" ValueType="40">60</gnm:Cell>
        <gnm:Cell Row="8" Col="12" ValueType="40">53</gnm:Cell>
        <gnm:Cell Row="8" Col="14" Rows="1" Cols="1">=B9&amp;concatenate(&quot;&amp;&quot;&amp;C9:M9)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="9" Col="0" ExprID="3"/>
        <gnm:Cell Row="9" Col="1" ExprID="1"/>
        <gnm:Cell Row="9" Col="2" ValueType="40">6</gnm:Cell>
        <gnm:Cell Row="9" Col="3" ValueType="40">8</gnm:Cell>
        <gnm:Cell Row="9" Col="4" ValueType="40">8</gnm:Cell>
        <gnm:Cell Row="9" Col="5" ValueType="40">8</gnm:Cell>
        <gnm:Cell Row="9" Col="6" ValueType="40">10</gnm:Cell>
        <gnm:Cell Row="9" Col="7" ExprID="2"/>
        <gnm:Cell Row="9" Col="8" ValueType="40">60</gnm:Cell>
        <gnm:Cell Row="9" Col="9" ValueType="40">60</gnm:Cell>
        <gnm:Cell Row="9" Col="10" ValueType="40">52</gnm:Cell>
        <gnm:Cell Row="9" Col="11" ValueType="40">62</gnm:Cell>
        <gnm:Cell Row="9" Col="12" ValueType="40">66</gnm:Cell>
        <gnm:Cell Row="9" Col="14" Rows="1" Cols="1">=B10&amp;concatenate(&quot;&amp;&quot;&amp;C10:M10)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="11" Col="14" ValueType="60">\hline</gnm:Cell>
        <gnm:Cell Row="12" Col="14" ValueType="60">\end{tabular}</gnm:Cell>
      </gnm:Cells>
      <gnm:SheetLayout TopLeft="A1"/>
      <gnm:Solver ModelType="0" ProblemType="0" MaxTime="60" MaxIter="1000" NonNeg="1" Discr="0" AutoScale="0" ProgramR="0"/>
    </gnm:Sheet>
    <gnm:Sheet DisplayFormulas="0" HideZero="0" HideGrid="0" HideColHeader="0" HideRowHeader="0" DisplayOutlines="1" OutlineSymbolsBelow="1" OutlineSymbolsRight="1" Visibility="GNM_SHEET_VISIBILITY_VISIBLE" GridColor="0:0:0">
      <gnm:Name>Sheet3</gnm:Name>
      <gnm:MaxCol>14</gnm:MaxCol>
      <gnm:MaxRow>7</gnm:MaxRow>
      <gnm:Zoom>1</gnm:Zoom>
      <gnm:Names>
        <gnm:Name>
          <gnm:name>Print_Area</gnm:name>
          <gnm:value>#REF!</gnm:value>
          <gnm:position>A1</gnm:position>
        </gnm:Name>
        <gnm:Name>
          <gnm:name>Sheet_Title</gnm:name>
          <gnm:value>&quot;Sheet3&quot;</gnm:value>
          <gnm:position>A1</gnm:position>
        </gnm:Name>
      </gnm:Names>
      <gnm:PrintInformation>
        <gnm:Margins>
          <gnm:top Points="120" PrefUnit="mm"/>
          <gnm:bottom Points="120" PrefUnit="mm"/>
          <gnm:left Points="72" PrefUnit="mm"/>
          <gnm:right Points="72" PrefUnit="mm"/>
          <gnm:header Points="72" PrefUnit="mm"/>
          <gnm:footer Points="72" PrefUnit="mm"/>
        </gnm:Margins>
        <gnm:Scale type="percentage" percentage="100"/>
        <gnm:vcenter value="0"/>
        <gnm:hcenter value="0"/>
        <gnm:grid value="0"/>
        <gnm:even_if_only_styles value="0"/>
        <gnm:monochrome value="0"/>
        <gnm:draft value="0"/>
        <gnm:titles value="0"/>
        <gnm:do_not_print value="0"/>
        <gnm:print_range value="0"/>
        <gnm:order>d_then_r</gnm:order>
        <gnm:orientation>portrait</gnm:orientation>
        <gnm:Header Left="" Middle="&amp;[TAB]" Right=""/>
        <gnm:Footer Left="" Middle="Page &amp;[PAGE]" Right=""/>
        <gnm:paper>na_letter</gnm:paper>
        <gnm:comments>in_place</gnm:comments>
        <gnm:errors>as_displayed</gnm:errors>
      </gnm:PrintInformation>
      <gnm:Styles>
        <gnm:StyleRegion startCol="0" startRow="0" endCol="255" endRow="65535">
          <gnm:Style HAlign="1" VAlign="2" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="General">
            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
          </gnm:Style>
        </gnm:StyleRegion>
      </gnm:Styles>
      <gnm:Cols DefaultSizePts="48">
        <gnm:ColInfo No="1" Unit="48" Count="14"/>
      </gnm:Cols>
      <gnm:Rows DefaultSizePts="12.75">
        <gnm:RowInfo No="3" Unit="12.75" Count="5"/>
      </gnm:Rows>
      <gnm:Selections CursorCol="2" CursorRow="7">
        <gnm:Selection startCol="2" startRow="7" endCol="2" endRow="7"/>
      </gnm:Selections>
      <gnm:Cells>
        <gnm:Cell Row="3" Col="1" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="2" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="3" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="4" ValueType="60">$n$</gnm:Cell>
        <gnm:Cell Row="3" Col="5" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="6" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="7" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="8" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="9" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="10" ValueType="60">$n$</gnm:Cell>
        <gnm:Cell Row="3" Col="11" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="12" ValueType="60">{}</gnm:Cell>
        <gnm:Cell Row="3" Col="14" Rows="1" Cols="1">=B4&amp;concatenate(&quot;&amp;&quot;&amp;C4:M4)&amp;&quot; \\\\&quot;</gnm:Cell>
        <gnm:Cell Row="4" Col="1" ExprID="4">=A5+1</gnm:Cell>
        <gnm:Cell Row="4" Col="2" ExprID="4"/>
        <gnm:Cell Row="4" Col="3" ExprID="4"/>
        <gnm:Cell Row="4" Col="4" ExprID="4"/>
        <gnm:Cell Row="4" Col="5" ExprID="4"/>
        <gnm:Cell Row="4" Col="6" ExprID="4"/>
        <gnm:Cell Row="4" Col="7" ExprID="4"/>
        <gnm:Cell Row="4" Col="8" ExprID="4"/>
        <gnm:Cell Row="4" Col="9" ExprID="4"/>
        <gnm:Cell Row="4" Col="10" ExprID="4"/>
        <gnm:Cell Row="4" Col="11" ExprID="4"/>
        <gnm:Cell Row="4" Col="12" ExprID="4"/>
        <gnm:Cell Row="6" Col="2" Rows="1" Cols="1">=B4&amp;concatenate(&quot;&amp;&quot;&amp;C4:M4)</gnm:Cell>
        <gnm:Cell Row="7" Col="2" Rows="1" Cols="1">=B5&amp;concatenate(&quot;&amp;&quot;&amp;C5:M5)</gnm:Cell>
      </gnm:Cells>
      <gnm:SheetLayout TopLeft="A1"/>
      <gnm:Solver ModelType="0" ProblemType="0" MaxTime="60" MaxIter="1000" NonNeg="1" Discr="0" AutoScale="0" ProgramR="0"/>
    </gnm:Sheet>
  </gnm:Sheets>
  <gnm:UIData SelectedTab="0"/>
</gnm:Workbook>

Columns from B to M are used to fill with the data, columns B and H contains formulas ="$Q(n+"&A8&")$" and ="$Q(n+"&A8+100&")$", the column O contains the LaTeX tabular. To extens the table, just copy the last line down and fill it with data.

enter image description here

Complete MWE with LaTeX tabular data copied from the column O from gnumeric-table.xml :

\documentclass{article}
\usepackage{lmodern}
\begin{document}
\begin{tabular}{lrrrrrlrrrrr}
\hline
{}&{}&{}&$n$&{}&{}&{}&{}&{}&$n$&{}&{} \\
 \cline{2-6}\cline{8-12}
{}&1&2&3&4&5&{}&1&2&3&4&5 \\
\hline
$Q(n+0)$&1&1&2&3&3&$Q(n+100)$&48&54&54&50&60 \\
$Q(n+5)$&4&5&5&6&6&$Q(n+105)$&52&54&58&60&53 \\
$Q(n+10)$&6&8&8&8&10&$Q(n+110)$&60&60&52&62&66 \\

\hline
\end{tabular}
\end{document}

enter image description here

0

One option will be to use the calculator package, combined with supertabular package to split the table over multipage. Check my previous answer for an example on how to combine both of them to automate systematic and complex table generations.

0

There is actually one way to copy your whole tables from Excel and give the format you want, it's a complement called Excel2LaTeX. You can design your table and write its content inside Excel and then just select the cells you want to convert into LaTeX code. Perhaps you'll need to modify a little the code generated to fit your needs (if you use subscripts, greek letters, etc.)

You'll also need to use the booktabs package \usepackage{booktabs}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.