Opened 3 months ago
Closed 3 months ago
#35754 closed Bug (fixed)
PDF documentation renders curly quotes as full-width
Reported by: | A. Rafey Khan | Owned by: | A. Rafey Khan |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | sphinx, latex |
Cc: | A. Rafey Khan, Mariusz Felisiak, David Smith | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
Hi,
In the pdf documentation builds, there is a noticeable amount of unnecessary gap after quote marks especially the apostrophes.
I'll be referring to Django 5.1.x (https://media.readthedocs.org/pdf/django/5.1.x/django.pdf) at the time of writing.
For example on page 26, there are near a dozen occurrences where the contractions such as isn't
are rendered like isn' t
.
The issue has been presumably since this PR was merged: https://github.com/django/django/pull/15079. It is inherently due to the combination of smart quote feature of Sphinx
and ctex
latex package which we use to enable support for Chinese character set in the pdf documentation which appears to be rendering curly/smart quotes as full-width. The issue was previously raised and discussed in the ctex
source repository: https://github.com/CTeX-org/ctex-kit/issues/389, However, the maintainers do not appear interested in merging any related changes into the package, the main reason being that the package is specifically tailored for Chinese typesetting and additionally using ctex
, the recommended method for producing smart quotes in latex (e.g., `quoted text") still functions as expected.
I can propose two solutions:
- We can add the rules in the preamble to convert from full-width quotes back to half-width as suggested in the mentioned thread.
- As it appears that our documentation text is mainly in English and Chinese is used just once merely as an example to demonstrate Unicode-related functionality (Page 2061). So alternatively, it is also possible to use Unicode characters other than Chinese and get rid of the
ctex
dependency. Note that this change won't affect any pdf builds where language is defined as Chinese asxeCJK/ctex
would be implicitly imported in that case.
If we agree on either of the change, I can submit the PR accordingly.
Attachments (1)
Change History (6)
by , 3 months ago
Attachment: | sample_bug.PNG added |
---|
comment:1 by , 3 months ago
Cc: | added |
---|---|
Easy pickings: | unset |
Has patch: | unset |
Triage Stage: | Unreviewed → Accepted |
Version: | → dev |
comment:2 by , 3 months ago
Has patch: | set |
---|
comment:3 by , 3 months ago
comment:4 by , 3 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
PR: https://github.com/django/django/pull/18577