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

Fix #3356 and #3394 latex text layout for Japanese document #3387

Merged
merged 7 commits into from
Feb 6, 2017

Conversation

jfbu
Copy link
Contributor

@jfbu jfbu commented Feb 3, 2017

This commit moves the location of geometry package to after
sphinx package is loaded; it adds new keys for 'sphinxsetup'
allowing to easily configure the page margins, by-passing the legacy 1in
for all margins applied by Sphinx. For Japanese documents, the specified
margins are slightly modified in order for text width to be an integer
multiple of the zw dimension unit, and for text height to have an
integer number of baselines. It is always possible to use directly
'geometry' key to latex_elements for complete control, if
desired.

Subject:

Feature and Bugfix

This PR will slightly alter page layout, the most important change being that the text height for manual docclass gains 2 baselines. (only for Japanese documents...)

Purpose

  • straighten out some issues with Japanese text layout and pick this opportunity to make text layout generally speaking more easily customizable.
  • the Japanese howto and manual docclass are now handled a bit more similarly.
  • the non-Japanese documents gain the ability to specify from conf.py separate margins for left, right, top, bottom, using geometry package syntax (the interface for Japanese documents is more restricted as left and right must be equal and top and bottom too.)

Relates

…se documents

- make text width integer multiple of zenkaku width

- fix incompatibility of ``geometry`` package with ``jsbook`` LaTeX
  class (``'manual'`` docclass)

- fix issue with shortened text area height in ``'manual'`` docclass
@jfbu jfbu changed the title Fix #3356 (latex) and make text width integer multiple of zenkaku width Fix #3356 and #3394 latex text layout for Japanese document Feb 5, 2017
@jfbu
Copy link
Contributor Author

jfbu commented Feb 5, 2017

squashed and rebase and now also fixes #3394 issue

doc/config.rst Outdated
``'\\usepackage[margin=1in,marginparwidth=0.5in]{geometry}'``.
``'\\usepackage{geometry}'`` (with ``[dvipdfm]`` for Japanese documents)

and :file:`sphinx.sty` executes a ``\PassOptionsToPackages`` with
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here ...Package

@jfbu
Copy link
Contributor Author

jfbu commented Feb 5, 2017

the truedimen option passed to geometry may be located as package option after all, not necessarily as a document class option.

Note: this PR adds the feature of customizability of the document margins. I have also included the width for margin annotations, but perhaps this should be kept undocumented because there is anyhow no reST interface for putting contents in the margins ?

@jfbu jfbu requested a review from tk0miya February 6, 2017 13:49
@tk0miya
Copy link
Member

tk0miya commented Feb 6, 2017

Sorry for late. LGTM!
(my time was stolen by nintendo...)

@jfbu
Copy link
Contributor Author

jfbu commented Feb 6, 2017

my time was stolen by colleagues ;-) coincidentally I came back seconds after you completed the review, thanks !

I hesitate a slight bit about the marginpar : should it be documented as as new key to 'sphinxsetup' as I did ? because there is no syntax in reST for margin notes. Admittedly some user may hack LaTeX footnotes to render as margin notes; or some extension of Sphinx could use margin notes for extra annotations. Anyway I will merge it and if you feel it is better to not document the possibility to adjust the width of margin notes, it can always be removed later. Also I will add a note to CHANGES to indicate paper margins are customizable for PDF output.

@jfbu jfbu merged commit c7f4489 into sphinx-doc:stable Feb 6, 2017
@jfbu jfbu deleted the japanesetextlayout branch February 6, 2017 17:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants