From: Erik H. <eri...@us...> - 2021-12-21 23:39:08
|
--- ** [bugs:#440] longtable labels in the wrong place** **Status:** open **Created:** Tue Dec 21, 2021 11:39 PM UTC by Erik Hansen **Last Updated:** Tue Dec 21, 2021 11:39 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. |
From: Erik H. <eri...@us...> - 2021-12-22 04:10:45
|
Btw, I'm a beginner when it comes to Latex. Even though the proposed patch works for my test case, please double check it to ensure it produces valid Latex. --- ** [bugs:#440] longtable labels in the wrong place** **Status:** open **Created:** Tue Dec 21, 2021 11:39 PM UTC by Erik Hansen **Last Updated:** Tue Dec 21, 2021 11:39 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. |
From: Günter M. <mi...@us...> - 2021-12-29 12:46:13
|
- **status**: open --> pending-remind - **Comment**: Thank you for the report and patch. The warning in the source (introduced 2010-02-05 in [r6255]) other places (beginning, caption) result in LaTeX errors. makes me hesitating to change the current behaviour. OTOH, it may be outdated. Currently standard Docutils does not write `\ref` macros. How do you get a table number in the document? Can you provide your test file (and info about how it is converted)? Did you try your patch with the Docutils test suite? Here, I get `FAILED (failures=4, errors=21, skipped=1)` and a lot of additional (spurious) labels **after** longtables. --- ** [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 22, 2021 04:10 AM 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. |
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. |
From: Günter M. <mi...@us...> - 2023-05-25 12:16:26
|
Thank you for the additional info, it helped to reproduce the problem. Mind, that for references to section numbers with `reference-label: ref`, you need to activate section numbering by LaTeX (`sectnum-xform: False`), Docutils-generated section numbers do not show up (cf. the documentation fixes in [r9395] With at least one LaTeX-numbered section in the document, a `\ref` to a table with title/caption (and hence Table number) also works with the `\label` placed after the table, so setting [sectnum-xform](https://docutils.sourceforge.io/docs/user/config.html#sectnum-xform) to `False` for the LaTeX writer (or using the somewhat misleading command line option `--no-section-numbering`) might provide a fast workaround. Does the attached patch (against [r9395]) solve the problem? Attachments: - [0001-LaTeX-writer-fix-placement-of-hyperlink-target-label-for-tables.patch](https://sourceforge.net/p/docutils/bugs/_discuss/thread/0d2d55e26b/0adc/attachment/0001-LaTeX-writer-fix-placement-of-hyperlink-target-label-for-tables.patch) (8.2 kB; text/x-patch) --- **[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:** Thu Dec 30, 2021 03:56 AM 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. |
From: Günter M. <mi...@us...> - 2023-06-22 16:38:27
|
- **status**: pending-remind --> open-fixed - **Comment**: Fixed in [r9401]. Thank you for reporting. --- **[bugs:#440] longtable labels in the wrong place** **Status:** open-fixed **Created:** Tue Dec 21, 2021 11:39 PM UTC by Erik Hansen **Last Updated:** Thu May 25, 2023 12:16 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. |