Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX: :rst:dir:versionchanged with contents being a list will cause error during pdf build #9330

Closed
jfbu opened this issue Jun 13, 2021 · 3 comments

Comments

@jfbu
Copy link
Contributor

jfbu commented Jun 13, 2021

Describe the bug
A clear and concise description of what the bug is.

When trying to build Sphinx pdf doc on 4.x

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.26992 ...ged}{Changed in version 4.0.0: }\item {
                                                  }

(line number may not be right because actually got this on a branch adding extra text to latex.rst)

Your project

Sphinx own doc

It is caused by

   .. versionchanged:: 4.0.0

      - The font substitution commands added at ``2.0`` have been moved
        to the ``'fontsubstitution'`` key, as their presence here made
        it complicated for user to customize the value of ``'fontpkg'``.
      - The default font setting has changed: it still uses Times and
        Helvetica clones for serif and sans serif, but via better, more
        complete TeX fonts and associated LaTeX packages.  The
        monospace font has been changed to better match the Times clone.

i.e. a list after versionchanged in latex.rst

Not sure if actually allowed to use a display after versionchanged?

html output fine

@jfbu
Copy link
Contributor Author

jfbu commented Jun 13, 2021

Edit: html output is not fine:

Capture d’écran 2021-06-13 à 14 18 19

@jfbu
Copy link
Contributor Author

jfbu commented Jun 13, 2021

I don't know if feature or bug of domains.changeset.VersionChange() but adding the bug tag anyhow

@jfbu jfbu added this to the 4.1.0 milestone Jun 13, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jun 13, 2021
The versionchanged directive breaks doctree if its contents start with
non-paragraph element (ex. lists, tables, and so on).  It causes build
error in LaTeX.

This inserts a paragraph if the first child of the contents is not a
paragraph not to break doctree.
@tk0miya
Copy link
Member

tk0miya commented Jun 13, 2021

I found the reason of this bug and post a fix as #9333 now.

@tk0miya tk0miya added the domain label Jun 13, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jun 13, 2021
The versionchanged directive breaks doctree if its contents start with
non-paragraph element (ex. lists, tables, and so on).  It causes build
error in LaTeX.

This inserts a paragraph if the first child of the contents is not a
paragraph not to break doctree.
@tk0miya tk0miya modified the milestones: 4.1.0, 4.0.3 Jun 13, 2021
tk0miya added a commit that referenced this issue Jun 13, 2021
Fix #9330: versionchanged causes error during pdf build
@tk0miya tk0miya closed this as completed Jun 13, 2021
marxin pushed a commit to marxin/sphinx that referenced this issue Jun 17, 2021
The versionchanged directive breaks doctree if its contents start with
non-paragraph element (ex. lists, tables, and so on).  It causes build
error in LaTeX.

This inserts a paragraph if the first child of the contents is not a
paragraph not to break doctree.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants