Skip to content
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

Use mdbook-pandoc to generate a PDF of the Players' Manual #1428

Open
ctm opened this issue May 28, 2024 · 4 comments
Open

Use mdbook-pandoc to generate a PDF of the Players' Manual #1428

ctm opened this issue May 28, 2024 · 4 comments
Assignees
Labels
chore Maintenance or other non-bug, non-feature documentation Improvements or additions to documentation

Comments

@ctm
Copy link
Owner

ctm commented May 28, 2024

Update mb2-doc's configuration to use the mdbook-pandoc plugin.

Do this as a proof-of-concept to help @ts4z evaluate mdbook as a useful tool for a new edition of the BARGE Rule Book.

@ctm ctm added documentation Improvements or additions to documentation chore Maintenance or other non-bug, non-feature high priority Should be done fairly soon easy Trivial to do (even when tired!) and semi-worthwhile request Something explicitly asked for labels May 28, 2024
@ctm ctm self-assigned this May 28, 2024
@ctm
Copy link
Owner Author

ctm commented May 28, 2024

FWIW, I'm doing it on MacOS, using brew, which won't directly help @ts4z, but it may indirectly help. So far, I've

  • added three lines of configuration to book.toml
  • brew install pandoc
  • brew install basictex
  • found out that basictex doesn't include soul.sty
  • brew uninstall basictex
    and now I'm running brew install mactex, which is a big download and I have slow DSL.

@ctm
Copy link
Owner Author

ctm commented May 28, 2024

With mactex installed, the soul.sty problem went away, but now I get:

Error producing PDF.
! LaTeX Error: Unicode character ☕ (U+2615)
               not set up for use with LaTeX.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.394 ...ur nickname (e.g., \texttt{☕\ deadhead}

This issue appears to be discussed on StackExchange. Looks like luatex might help, but this is starting to become a time sink. FWIW, luatex is installed as part of mactex, but I don't yet know if I can use it instead of pdftex.

I'll poke around a little more, but I might need to move on with other things before too long. FWIW, the BARGE Rule Book might not need unicode support, or perhaps could use a different plugin to generate the PDF.

@ctm
Copy link
Owner Author

ctm commented May 28, 2024

Adding

pdf-engine = "lualatex" # engine to use to produce PDF output

to book.toml allows mdbook build to complete, albeit with a bunch of warnings:

[WARNING] Missing character: There is no ☕ (U+2615) (U+2615) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no 🎤 (U+1F3A4) (U+1F3A4) in font [lmroman10-regular]:+tlig;
...

So all the emojis are omitted in the PDF output.

It looks like there's a lualatex solution on stackexchange, but I don't yet know if it's possible to embed TeX commands into the markdown needed by mdbook. I spent a bunch of time web searching and didn't find anything.

Since I don't actually need this functionality, I'm going to put my .toml changes into a pandoc-1428 branch, then try out mdbook-pdf and look at the output it creates.

@ctm
Copy link
Owner Author

ctm commented May 28, 2024

The output that mdbook-pdf created was too large and not as nice (IMO) as the output mdbook-pandoc produced, so I looked to see if I could integrate the lualatex solution (that I mention in my previous comment) into the mdbook. The technique can indeed be used to get a nice coffee mug emoji inserted, but at a pretty big cost. I couldn't make inline substitution work, so the entire block that contains an emoji has to be formatted with TeX, and that formatting screws up the HTML build.

The technique can be seen in my commit that I won't be merging.

@ctm ctm removed high priority Should be done fairly soon easy Trivial to do (even when tired!) and semi-worthwhile request Something explicitly asked for labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance or other non-bug, non-feature documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant