Add LaTeX environments for custom Scribble tags (fixes #231) #232

Merged
otherjoel merged 5 commits from scribble-fix-latex into master 4 years ago
otherjoel commented 4 years ago (Migrated from github.com)

Doing raco setup --doc-pdf x pollen no longer fails, and it produces a PDF file that is…of normal quality for Scribble documents.

Besides becoming CSS classes, the names of custom Scribble styles are also reused as names of LaTeX macros. The only legal characters in LaTeX macro names are letters; no numbers or punctuation allowed. So I had to change some of the names, and change the CSS to match.

That 🎸 emoji: pdflatex is famously bad at Unicode, and chokes on the 🎸 used in setup.scrbl. The most common advice is to use a newer engine like xelatex instead (not on the table here). Failing that, it is supposed to be possible to substitute a vector graphic for particular characters, like so:

\DeclareUnicodeCharacter{1F3B8}{\includegraphics{unicode1febb.eps}}

But pdflatex (running from inside raco setup) always complained of not being able to find the .eps file I supplied (same with SVG, and PDF). So instead I substitute ∇ (\nabla) for 🎸 in the PDF.

Doing `raco setup --doc-pdf x pollen` no longer fails, and it produces a PDF file that is…of normal quality for Scribble documents. Besides becoming CSS classes, the names of custom Scribble styles are also reused as names of LaTeX macros. The only legal characters in LaTeX macro names are letters; no numbers or punctuation allowed. So I had to change some of the names, and change the CSS to match. **That 🎸 emoji:** `pdflatex` is famously bad at Unicode, and chokes on the 🎸 used in `setup.scrbl`. The most common advice is to use a newer engine like `xelatex` instead (not on the table here). Failing that, it is supposed to be possible to substitute a vector graphic for particular characters, like so: ```latex \DeclareUnicodeCharacter{1F3B8}{\includegraphics{unicode1febb.eps}} ``` But `pdflatex` (running from inside `raco setup`) always complained of not being able to find the `.eps` file I supplied (same with SVG, and PDF). So instead I substitute ∇ (`\nabla`) for 🎸 in the PDF.
mbutterick commented 4 years ago (Migrated from github.com)

Thanks @otherjoel. This would’ve hopeless for me.

Thanks @otherjoel. This would’ve hopeless for me.
The pull request has been merged as 88c354cb5f.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b scribble-fix-latex master
git pull origin scribble-fix-latex

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff scribble-fix-latex
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#232
Loading…
There is no content yet.