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

A potential display bug with the LaTeX generation step in Sphinx #8055

Closed
schoi32 opened this issue Aug 4, 2020 · 7 comments · Fixed by #8851
Closed

A potential display bug with the LaTeX generation step in Sphinx #8055

schoi32 opened this issue Aug 4, 2020 · 7 comments · Fixed by #8851

Comments

@schoi32
Copy link

schoi32 commented Aug 4, 2020

Describe the bug
Sphinx-generated PDF file with an Index section having long lines overlapping each other

To Reproduce
Steps to reproduce the behavior:

<Paste your command-line here which cause the problem>

$ conda create --name qmcpy python=3.6
$ conda activate qmcpy
$ git clone https://github.com/QMCSoftware/QMCSoftware.git
$ cd QMCSoftware
$ git checkout develop
$ pip install -r requirements/dev.txt
$ pip install -e ./
$ make qrng
$ pip install -r requirements/dev_docs.txt
$ make doc_pdf

Expected behavior
Remove overlap or make one-column Index pages in the last few pages in the PDF (URL below)

Your project
https://readthedocs.org/projects/qmcpy/

Screenshots
Please see the last few pages of the PDF at https://qmcpy.readthedocs.io/_/downloads/en/develop/pdf

Environment info

  • OS: Linux/Mac
  • Python version: [e.g. 3.6]
  • Sphinx version: <2
  • Sphinx extensions: sphinx.ext.autodoc, recommonmark
  • Extra tools: gcc, pdflatex

Additional context

@tk0miya
Copy link
Member

tk0miya commented Aug 5, 2020

Screenshots:
スクリーンショット 2020-08-05 20 31 27

@rscohn2
Copy link
Contributor

rscohn2 commented Oct 26, 2020

You may be able to avoid this problem by making the index text smaller. See printindex in the docs: https://www.sphinx-doc.org/en/master/latex.html for directions. For especially long text, you may want to make your index single column. See printindex in this unmerged PR #8328

@schoi32
Copy link
Author

schoi32 commented Oct 27, 2020 via email

@rscohn2
Copy link
Contributor

rscohn2 commented Oct 27, 2020

Thanks for sharing. That is a better solution. I will use it.

@jfbu
Copy link
Contributor

jfbu commented Jan 30, 2021

@tk0miya we already require package makeidx as used in linked approach from #8055 (comment)
but not package idxlayout. Perhaps we would add this to the documentation of latex_elements?

BTW, I don't understand that our docs says that 'makeindex' key is set by other options and should not be modified. I see nothing actually that changes it (be it on builder or writer side).

@jfbu jfbu added the type:docs label Jan 30, 2021
@tk0miya
Copy link
Member

tk0miya commented Jan 31, 2021

I'm thinking it's really worthy if we'll add a new configuration (for example, latex_index_page_style = 'onecolumn' | 'twocolumn'), and generate the LaTeX document using idxlayout automatically.

@jfbu
Copy link
Contributor

jfbu commented Feb 8, 2021

Here is a no-package approach. It works with our standard 'manual' and 'howto' classes:

latex_elements = {
    'printindex': r'\def\twocolumn[#1]{#1}\printindex',
}

This is trick to workaround inflexible hardcoded definitions of theindex environment by vanilla standard classes of LaTeX (article, book). Not tested with Japanese classes.

As per idxlayout, it is probably good solution as it seems to know about memoir and KOMA classes. Not tested with Japanese. It requires etoolbox package (as well as multicol and ragged2e but those should be in any base latex distribution) which one would have to check if always in Linux distros.

@tk0miya I am tempted by simply extending our documentation of \printindex to indicate above possibility and the idxlayout approach, but not add configuration variable and not change anything to our default.

@jfbu jfbu added this to the 3.5.0 milestone Feb 8, 2021
jfbu added a commit to jfbu/sphinx that referenced this issue Feb 8, 2021
@jfbu jfbu closed this as completed in #8851 Feb 9, 2021
@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

Successfully merging a pull request may close this issue.

4 participants