-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Render book as PDF in publish.yml
workflow
#1572
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @max-heller, thanks for creating the PR!
Yeah, I hate that too 😄 Could I get you to enable running the workflows in your fork? That should allow us to see the effect of this PR in your fork (you probably need to merge the
Good point! From looking through the PDF at I don't immediately spot any bad effects of this — the little crab seems to have been ignored and disappeared. I'm thinking of removing the emoji from the course since it's tedious to type... As for a font, it's a bit ironic that Computer Modern doesn't feel super modern to me any longer. I guess I should experiment a bit with finding a more crisp (sans-serif?) font... perhaps slightly smaller margins would be nice too as well as some color to the hyperlinks. Do you know of a way to exclude/include content in the PDF? As an example, 1.2. Keyboard Shortcuts should not be shown in the PDF. Similarly, the "In this segment" texts (as seen in 12. Pattern Matching) should also go away. It would also be great if we could apply the formatting in 67. Glossary — it's done via a stylesheet in the HTML, but that is of course lost in the PDF. |
Now that I've tried this locally, I see that there are a bunch of other places where emojis cause problems:
plus the line drawing characters in the notes of 26.2. Filesystem Hierarchy. |
5f0f141
to
e05daaa
Compare
Running (rendered English book) The translated books are built, but some are very broken because of missing fonts.
There's no builtin way to accomplish this that I can tell. Some options:
Not sure how to accomplish this with LaTeX unfortunately |
One option might be to format the glossary with <dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl> passed to \begin{description}
\tightlist
\item[Coffee]
Black hot drink
\item[Milk]
White cold drink
\end{description} which renders as |
Yay, great to see that it works!
Uh, yeah that looks pretty rough 😄 I did a bunch of testing here and found that I can get nice output for the Chinese translations, Korean, Japanese and the Russian translation by
So my [output.pandoc.profile.pdf.variables]
mainfont = "Noto Serif"
sansfont = "Noto Sans"
monofont = "Noto Sans Mono"
CJKmainfont = "Noto Serif CJK SC"
CJKsansfont = "Noto Sans CJK SC"
CJKmonofont = "Noto Sans Mono CJK SC" There are other fonts for the other CJK languages. The I've played around quite a bit here, so I guess the packages to install can be trimmed down a lot, but this should be a good starting point.
Right, if we can include HTML, then things should be easier — however, I very much want to avoid HTML since it is hard to edit in the English version and it looks weird and complicated for the translators. I think we can ignore the glossary formatting for now. |
Renders the book as a PDF and includes it in the published HTML bundle as
comprehensive-rust.pdf
.Unfinished business:
It would also be great if we could apply the formatting in 67. Glossary — it's done via a stylesheet in the HTML, but that is of course lost in the PDF.Closes #1543
Rendered