- Notifications
You must be signed in to change notification settings - Fork25
Proposed changes for flexible styling in tintPdf and tintBook#30
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…k color, and LaTeX engine.Users can also override the default Pandoc LaTeX template for PDF output.
Trusty has an out-of-date pandoc (1.12.2.1) that does not work with the current rmarkdown/knitr (which requires >= 1.12.3), so update the travis.yml to use the xenial distribution (officially available on travis as of 2018-11-08).
eddelbuettel commentedNov 21, 2018
This is pretty long but quickly:
|
eddelbuettel commentedNov 22, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The changes look good in general. I will test later. This is a lovely feature extension. Stylistic nagging:
Feel free to harp back if you feel very strongly about any of these points. But as we have the means to code review here, I feel somewhat strongly that it makes packages better if we actually do it. |
eddelbuettel commentedNov 22, 2018
One other thing: Best way to showcase the use of the new fonts? Screenshots on the README.md? Extra (shorter) vignettes? |
jonathan-g commentedNov 22, 2018
|
jonathan-g commentedNov 22, 2018
I will make the requested style changes in ChangeLog and DESCRIPTION. You're the creator/maintainer and it's right for me to follow your style. I'll work on making short vignettes to illustrate the new font options. |
jonathan-g commentedNov 22, 2018
It should be easy to move the extra help material from separate files to a new section under |
eddelbuettel commentedNov 22, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Awesome, and sorry for the waterfall. Just got home. Am surprised that Travis bonked now -- I guess I didn't trigger a run since R-release checks fine; R-devel just got a local hangup here as my R-devel installation did not have |
eddelbuettel commentedNov 22, 2018
I am on the fence on the where the help should go. No need to rush. Sometimes I like having it in one file. Sometimes I like it being more explicit. How about if we mix and match? Maybe consider sticking all Rd content into one, but be explicit about the options, choices, effects, ... in another (possibly static with pre-rendered screenshots) vignette? It's very powerful stuff and folks will want to see the effects so an added vignette would be nice. We can cook that up the next few days. R-devel checked cleanly here too. Nice work! |
jonathan-g commentedNov 22, 2018
I like your thoughts about the vignettes. The mix and match for the help sounds good. I won't rush on that, but it's easy enough to move the text around. |
eddelbuettel commentedNov 22, 2018
I can also merge now and did the itty pitty clean up on my side. We'll have follow-up commits anway, eg another PR for another (short) vignette? |
eddelbuettel commentedNov 22, 2018
Argument in favour of keeping new manual pages (and to maybe look into the section or grouping the others have): We already had a bunch. Some of them are short but I don't think it matters greatly. Can leave as is. I'll just merge, do some tinkering here and either commit back later or early tomorrow. |
eddelbuettel commentedNov 22, 2018
And I made you a collaborator so you have push access too. Still best to mutually review so I'll make my touchups a PR, ok? |
jonathan-g commentedNov 22, 2018
Sounds good. It's very nice to collaborate with you. |

Here are my proposed changes for adding the following capabilities to tintPdf and tintBook:
latex_engineparameter to the YAMLoutputblock to allow users to select xelatex or lualatex instead of pdflatex.latexfontsparameter.linkcolorYAML parameter.The PR looks big, with almost 400 lines of changes, but the vast majority of these are documentation (120 lines of new Roxygen comments in pdf.R, a dozen or so lines of Roxygen comments in html.R, and two new Rd files produced from these comments by Roxygen). The actual changes to R code and LaTeX templates is around 20 lines of R and 16 lines of LaTeX in each of the template files.
Right now, this is more geared toward a power user because selecting fonts requires knowing which LaTeX packages to include and which options they need, but if people have a solid LaTeX installation, they should be able to just copy and paste from the usage examples in the LaTeX font catalogue athttp://www.tug.dk/FontCatalogue/
Here are some example YAML headers that can be substituted into the example tintPdf.Rmd file:
To use EB Garamond for the main font, with matching maths and Nimbus Mono Narrow for the typewriter font:
To use Lato sans-serif for the main font with Fira Mono for the typewriter font, change the link color, and use luaLaTeX for the engine:
To substitute a different Pandoc LaTeX template, you would use the
templateparameter in the YAMLoutputblock. This is a character string, which can be either a path to the template file or a string that parses to a function call that will return the path to the template file:or
Longer term, it would be good to think about how to make these options more user-friendly for people who aren't used to dealing with LaTeX.
I've tested this out and it passes
R CMD check --as-cranon Windows and Ubuntu with no errors and no warnings, but some minor notes (one for the high version component .9000 which I stuck in DESCRIPTION to follow Hadley's convention for development versions and one for a spurious URL under Ubuntu due to a 404 fromhttp://edwardtufte.com/tufte/books_be (the URL is good, but the server is probably configured to block automated requests)