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:

  1. We can add the rules in the preamble to convert from full-width quotes back to half-width as suggested in the mentioned thread.
  1. 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 as xeCJK/ctex would be implicitly imported in that case.

If we agree on either of the change, I can submit the PR accordingly.

Attachments (1)

sample_bug.PNG (28.6 KB ) - added by A. Rafey Khan 3 months ago.

Download all attachments as: .zip

Change History (6)

by A. Rafey Khan, 3 months ago

Attachment: sample_bug.PNG added

comment:1 by Sarah Boyce, 3 months ago

Cc: Mariusz Felisiak David Smith added
Easy pickings: unset
Has patch: unset
Triage Stage: UnreviewedAccepted
Version: dev

comment:2 by A. Rafey Khan, 3 months ago

Has patch: set

comment:4 by Sarah Boyce, 3 months ago

Triage Stage: AcceptedReady for checkin

comment:5 by Sarah Boyce <42296566+sarahboyce@…>, 3 months ago

Resolution: fixed
Status: assignedclosed

In 1f3f0cd:

Fixed #35754 -- Mapped full-width characters in latex to half-width.

Note: See TracTickets for help on using tickets.
Back to Top