Closed atrosinenko closed 7 months ago
There turned out to be a known issue with expressing underscores in PDFs produced by pdflatex (for example, this question).
Considering possible regressions, this unofficial documentation for fontenc
package mentions that switching font encoding may force pdflatex to use raster fonts (are they always Type 3 fonts?). Additionally, in this PR fontenc
is loaded as early as possible, but it may be required to load some font-related packages before it. I am not sure if this is the case for inconsolata
package - I visually compared a few pages of "old" and "new" version and it looks like the monospaced font have changed (at least the underscore characters) but moving \usepackage{inconsolata}
just before the \usepackage[T1]{fontenc}
line (in addition to this patch) seems to change nothing.
The PDF documents generated with this patch applied look visually correct and can be searched for identifier names containing underscore characters (though, the layout changed a bit). No new Type 3 fonts are listed in the output of pdffonts
, but in the "new" version less fonts are listed.
Just in case, here is the output of pdffonts
utility for the generated documents:
Another relevant link: https://tex.stackexchange.com/questions/345866/when-should-package-fontenc-be-used-with-pdflatex
Hi, thanks for your Pull Request. We aim to review it as soon as possible.
LGTM. Thanks for the analysis and the fix!
@all-contributors please add @atrosinenko for code.
@vhscampos
I've put up a pull request to add @atrosinenko! :tada:
In the existing setup, the *.md source files are converted to PDF by pandoc that invokes pdflatex internally. With the default font encoding, underscore characters inside paragraphs of text look like whitespace (or absent) in the produced PDF documents w.r.t. copy-pasting text from PDF viewer or searching. This may confuse users as it makes
__ARM_FEATURE_name
andlong_function_name
strings invisible to the "Search ..." function of a viewer, but only if they are not inside a standalone block of code.One of the solutions is to use T1 font encoding and ensure that Type 1 fonts are available (i.e. pdflatex does not have to use rasterized Type 3 fonts).
Fixes #282.
name: Pull request about: Technical issues, document format problems, bugs in scripts or feature proposal.
Thank you for submitting a pull request!
If this PR is about a bugfix:
Please use the bugfix label and make sure to go through the checklist below.
If this PR is about a proposal:
We are looking forward to evaluate your proposal, and if possible to make it part of the Arm C Language Extension (ACLE) specifications.
We would like to encourage you reading through the contribution guidelines, in particular the section on submitting a proposal.
Please use the proposal label.
As for any pull request, please make sure to go through the below checklist.
Checklist: (mark with
X
those which apply)SPDX-FileCopyrightText
lines on top of any file I have edited. Format isSPDX-FileCopyrightText: Copyright {year} {entity or name} <{contact informations}>
(Please update existing copyright lines if applicable. You can specify year ranges with hyphen , as in2017-2019
, and use commas to separate gaps, as in2018-2020, 2022
).Copyright
section of the sources of the specification I have edited (this will show up in the text rendered in the PDF and other output format supported). The format is the same described in the previous item.draftversion
is set totrue
in the YAML header of the sources of the specifications I have modified.