Simple example for longtable?

624 views
Skip to first unread message

stefa...@gmail.com

unread,
Oct 1, 2014, 12:45:19 PM10/1/14
to sphinx...@googlegroups.com
Hello everyone,

can anybody give me a simple example for a longtable in sphinx? I have searched for quite a while for this but could not find a simple example for that. The release notes of sphinx 0.62 say "Tables now can have a “longtable” class, in order to get correctly broken into pages in LaTeX output." but I do not have the faintest idea how my tables can have a class of a certain type.

TIA,

--
Stefan

Jan Ulrich Hasecke

unread,
Oct 3, 2014, 6:42:38 PM10/3/14
to sphinx...@googlegroups.com
Hi Stefan,
Sphinx creates longtables by default. So just create a table in your
source and Sphinx will make it a longtable in LaTeX.

juh

--
Software-Dokumentation mit Sphinx
http://www.amazon.de/dp/1497448689/
Paperback: 224 Seiten

shirou

unread,
Oct 5, 2014, 8:30:58 AM10/5/14
to sphinx...@googlegroups.com
Hi,

Accutually, the default table class is `tabulary`.

However, if a table has over 30 rows, it becomes `longtable`.

(the source code is here:
https://bitbucket.org/birkenfeld/sphinx/src/2bb807ed9ade11c07052638e1e0287d11034913b/sphinx/writers/latex.py?at=default#cl-679)

or if you specify the `class` option to longtable like

.. table:: This is the table
:class: longtable

+------------------------+------------+----------+
| Header row, column 1 | Header 2 | Header 3 |
| (header rows optional) | | |
+========================+============+==========+
| body row 1, column 1 | column 2 | column 3 |
+------------------------+------------+----------+
| body row 2 | ... | ... |
+------------------------+------------+----------+

(note the indentation as usual)

Regards,
WAKAYAMA Shirou
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To post to this group, send email to sphinx...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages