sphinxtr icon indicating copy to clipboard operation
sphinxtr copied to clipboard

big tables - whats the deal ?

Open pellekrogholt opened this issue 11 years ago • 9 comments

Hi,

First off all thx for sphinxtr its really useful - I have come across a challenge when using big tables. then its hard to tame them. perhaps because my latex skills are low and / or I don't fully understand the :spec: within the figtable directive.

I have tried with to version a one thats goes many columns horizontal and another one doing it vertical (because I read that long tables over multiple pages seems to be supported https://github.com/jterrace/sphinxtr/blob/master/tex/preamble._tex)

i have done it in a branch "Big tables":

https://github.com/pellekrogholt/sphinxtr/blob/big_tables/ch-figs/index.rst

thx

//

pelle

pellekrogholt avatar Nov 19 '13 15:11 pellekrogholt

I'm confused - what's the question? Is the table not coming out correctly in latex?

jterrace avatar Nov 19 '13 16:11 jterrace

fair enough - sorry - should have added some screen shoots from thesis.pdf right away ->

fig-big-table - p. 20:

image

fig-big-table-vertical p. 21 - one page only doesn't span over multiple pages:

image

pellekrogholt avatar Nov 19 '13 17:11 pellekrogholt

It looks like you have to use \begin{longtable} instead of \begin{table} to get long tables to work.

Just like we added a :nofig: option, how about adding a :longtable: option that would switch to using the longtable name?

It should be pretty easy to add: search for nofig in extensions/figtable.py

jterrace avatar Nov 19 '13 17:11 jterrace

hi jterrace

thx for your feedbacks and patience !

i gave it a shoot 1 to 1 per your nice instructions: https://github.com/pellekrogholt/sphinxtr/commit/79a9d9b56ab06e056c3410db8ce5c83c91551cde

when building i get

./thesis.tex:1253: LaTeX Error: Something's wrong--perhaps a missing \item.
./thesis.tex:1835: Misplaced \noalign.\caption ->\noalign 
        \bgroup \@ifnextchar [{\egroup \LT@c@ption \@firstofone ...
l.1835 \caption
       [A big table vertical]{A big table vertical}\phantomsection\l...
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
./thesis.tex:1835: Misplaced \noalign.\caption@LT@make #1->\noalign 
              {\caption@LT@config }\expandafter \LT@mcol \ex...
l.1835 ...ig table vertical]{A big table vertical}
                          \phantomsection\label{ch-f...
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
./thesis.tex:1835: Misplaced \omit.\multispan ->\omit 
           \@multispan 
l.1835 ...ig table vertical]{A big table vertical}
                          \phantomsection\label{ch-f...
I expect to see \omit only after tab marks or the \cr of
an alignment. Proceed, and I'll ignore this case.
./thesis.tex:1836: LaTeX Error: Something's wrong--perhaps a missing \item.
./thesis.tex:1836: LaTeX Error: Something's wrong--perhaps a missing \item.
./thesis.tex:1836: LaTeX Error: Something's wrong--perhaps a missing \item.
make[1]: *** [thesis.pdf] Error 1
make: *** [latexpdf] Error 2

when i look into line 1835 its not crystal clear to me why - but again probably related to my limited latex knowledge - thesis.tex looks like this in full: http://pastebin.com/w9Cuvhng

and the specific line 1835:

\caption[A big table vertical]{A big table vertical}\phantomsection\label{ch-figs/index:fig-big-table-vertical}

pellekrogholt avatar Nov 19 '13 21:11 pellekrogholt

Could you paste that thesis.tex as a gist or pastebin instead? Can't see line numbers on here

jterrace avatar Nov 19 '13 21:11 jterrace

sure done ^^ i naively thought github kong fu did some numbering...

pellekrogholt avatar Nov 19 '13 21:11 pellekrogholt

It looks like you need to change actually \begin{tabular} to \begin{longtable} and then remove the old \begin{table}. See http://tex.stackexchange.com/a/23299

jterrace avatar Nov 19 '13 21:11 jterrace

ok i was actually looking at that post earlier but not sure how to deal with in within sphinxtr

thx for your additional instructions - i'm not sure i fully understand a raw one here - i will of course clean it up and remove :longtable: ...

https://github.com/pellekrogholt/sphinxtr/commit/8f1490b52892d945fa6504f9666af143d8d7a398

on build raises:

Makefile:2556: thesis.d: No such file or directory
= thesis.tex --> thesis.d thesis.pdf.1st.make (0-1) =
= refs.bib thesis.aux --> thesis.bbl =
./thesis.tex:824: Package caption Error: \caption outside float.
./thesis.tex:1233: Package caption Error: \caption outside float.
./thesis.tex:1814: Package caption Error: \caption outside float.
make[1]: *** [thesis.pdf] Error 1
make: *** [latexpdf] Error 2

thesis.tex: http://pastebin.com/uW6ytpnc

pellekrogholt avatar Nov 19 '13 21:11 pellekrogholt

hi terrace,

sorry for the noise ^^ and thanks for your hints....

i'll get back to at some time... and then be back with a clear solution proposal or disposal if I can't get it to work...

//

pelle

pellekrogholt avatar Nov 28 '13 08:11 pellekrogholt