From: Erik H. <eri...@us...> - 2021-12-30 03:56:30
|
I've attached the sample table I've used. See `tables.rst`. I did use the `--reference-label ref` option to get table numbers in the references. The attached `run.sh` shows how I've run the tools. The standard named references work fine with the `\label` after the `\end{longtable}`. When using `\ref{}` to refer to tables however, no number shows. This only seems possible when the `\label{}` is moved near the caption or inside table body. See `tables_edited.tex` for how I'v manually edited the tex file to make it work. That is, if the table has a caption it works. For some reason I haven't been able to place a `\label{}` inside a table without a caption. Haven't run the docutils test suite. I guess this whole ticket boils down to how can we get numbered tables references to work? Attachments: - [run.sh](https://sourceforge.net/p/docutils/bugs/_discuss/thread/0d2d55e26b/d622/attachment/run.sh) (96 Bytes; application/x-shellscript) - [tables.rst](https://sourceforge.net/p/docutils/bugs/_discuss/thread/0d2d55e26b/d622/attachment/tables.rst) (417 Bytes; text/x-rst) - [tables.tex](https://sourceforge.net/p/docutils/bugs/_discuss/thread/0d2d55e26b/d622/attachment/tables.tex) (1.8 kB; text/x-tex) - [tables_edited.tex](https://sourceforge.net/p/docutils/bugs/_discuss/thread/0d2d55e26b/d622/attachment/tables_edited.tex) (1.8 kB; text/x-tex) --- ** [bugs:#440] longtable labels in the wrong place** **Status:** pending-remind **Created:** Tue Dec 21, 2021 11:39 PM UTC by Erik Hansen **Last Updated:** Wed Dec 29, 2021 12:46 PM UTC **Owner:** nobody **Attachments:** - [0001-Move-longtable-labels-to-table-body.patch](https://sourceforge.net/p/docutils/bugs/440/attachment/0001-Move-longtable-labels-to-table-body.patch) (1.7 kB; text/x-patch) The latex2e writer outputs `\label{}` for tables after `\end{longtable}`. This is incorrect causing the table referencing to end up with empty reference text rather than the table number. The author of the `longtable` latex package suggest putting the `\label{}` inside the caption itself `\caption{My caption \label{mylabel}}` or inside the table body. The latter option has the added benefit of working for tables without a caption. I've attached a proposed fix. `longtable` package documentation can be found at https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/required/tools/longtable.pdf. See page 4 and 5 about the discussion on labeling. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |