eddelbuettel / tint Goto Github PK
View Code? Open in Web Editor NEWTint is not Tufte
Tint is not Tufte
Hello Dirk,
I am working on a PDF using tint
using lots of margin notes for figures and text. This is the link to the Rmd
file, if you are interested in seeing it.: https://github.com/f0nzie/transcript_interview_john_hopfield_by_lex_fridman/blob/master/John_Hopfield-Physics_View_of_the_Mind_and_Neurobiology-AI_Podcast_76_with_Lex_Fridman-tint.Rmd
What I noticed is that these sidenotes have a small vertical spacing between them. This is an example of one of the pages:
I have been exploring ways to add more vertical space but I have not been successful even when adding a custom .tex
template; I am able to modify the section titles but could not find a way to make changes to the sidenotes.
Any thoughts?
There are instances where I would need to integrate this output into latex, and it would be valuable to have an option like
output: tint::tintPdf:
keep_tex: true
However, it is not supported, and returns:
Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: mapping values are not allowed in this context at line 5, column 22
Calls: ... parse_yaml_front_matter -> yaml_load ->
Execution halted
If a workaround exists, I can't figure it out.
Tint is awesome, thanks for the package.
Is there a way of printing a tufte-book version of tint? Better yet, is there support for bookdown?
Thank you,
I would like the ability to add side notes from within tables and blockquotes. If I figure out a method that works for either of these options, I'll add it to this request.
I did ask the question, regarding the table and side note on Stack Overflow, but didn't get any answers from the community. I ended up taking the footer out of the table and used inline styling to adjust the margin and line height, so it would look as if it were a part of the table. You can read the question I posed with images of the issue here: https://stackoverflow.com/questions/67310557/table-footer-with-linked-margin-note-creating-large-break-in-text/67317471#67317471
Using blockquotes with a side note created a side note shifted to the left, no longer in line with the other side notes. I tried both the pdf and HTML templates and a lot of different styling methods to make these elements work without success. I ended up using an independent margin note, instead of linking the text to the side note.
The syntax for either of these issues was almost as 'vanilla' as you can get. The SO question depicts coding an image, as it occurs with the table. Below I've provided coding to demonstrate what happens when you use a side note with a block quote.
---
title: "Tint Is Not Tufte"
subtitle: "An example of a blockquote with and without a side note"
date: "`r Sys.Date()`"
output: tint::tintHtml
bibliography: skeleton.bib
link-citations: yes
---
library(tint)
# invalidate cache when the package version changes
knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tint'))
options(htmltools.dir.version = FALSE)
This is traditional text.
>"Now I really want to blockquote myself to demonstrate what happens with a side note.[^1]
[^1]: Check out this awesome side note.
Now I really want to demonstrate the difference with a p tagged text element with a side note.[^2]
[^2]: The side notes don't align.
Thanks!
I love tint, just started using it for a wide variety of documents. However, when I try to insert a figure inside a marginfigure, the html output gets shifted to the right far beyond the remaining margin content. I know the advice is to keep the margingfigure content as simple as possible, but does that necessarily include not adding figures?
My code:
{marginfigure}
![](bulldog.jpg)
`
The output:
I'd like to see tint made compatible with rmarkdown pages and their floating TOC, website header, and other features. I wonder if this would be possible? I'm willing to work on this myself but thought I'd check to see if it's already being considered (or whether there are any known major hurdles).
When reporting to clients, they tend not to care (nor wish) to see the code. This means it's common to set knitr options such that echo=FALSE. With this option set, arbitrary marginfigure chunk content is not shown and this fact is not otherwise documented. However, it's easily fixed by add echo=TRUE to the marginfigure chunk option. I do not know if this effects the LaTeX version, as I don't use latex.
I submitted a PR to rstudio/tufte for this, not sure if your repo will pick it up automatically or not:
Hi @eddelbuettel. The README mentions "release 0.2.0" under PDF Font Variants – introduced on 22 November 2018; I'm guessing this is a typo? Should it say 0.1.1?
Also, I noticed that the CRAN badge hasn't updated to show v0.1.1
and I wonder if this is something you can trigger on your end.
Thanks for the nice package!
Hello -
Here is a screenshot of the pdf output with contents included. Thanks.
---
title: "Tint Is Not Tufte"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire, Yihui Xie, Dirk Eddelbuettel"
date: "`r Sys.Date()`"
output:
tint::tintPdf :
toc: yes
---
```{r setup, include=FALSE}
library(tint)
# invalidate cache when the tufte version changes
knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tint'))
options(htmltools.dir.version = FALSE)
# Section I
# Section II
## Subsection A
# Section III
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
an option to select a serif font is essential for any application that will have large text blocks. Especially if the hardwired font is so heavy on the page. Also, the text runs off the bottom of the page sometimes.
Like the overall simplification, tho'
Re-running an earlier pdf document revealed
! Undefined control sequence.
<argument> @{} >{\raggedright \arraybackslash
}p{(\columnwidth - 4\tabcolsep...
l.329 ...mnwidth - 4\tabcolsep) * \real{0.30}}@{}}
?
which can be fixed via \usepackage{array}
which we should probably add.
Hello,
I noticed that the subtitle is not show if the output is pdf. I tried it with the template provided when I open a new tint pdf rmarkdown document. Is this a known issue?
Thank you,
Claudio
This code is a suitable test harness:
https://riptutorial.com/r/example/25031/inline-references
It correctly uses inline references in the yaml to generate citations and a bibliography using tufte handout. However, changing the output to tint::tintPdf results in ? in place of the citations, and no bibliography.
Hi,
I couldn't find a way to change the default font for both the PDF and html outputs. Is there a way to do this from the Markdown document (YAML header)?
I've tried:
header-includes:
but I get an error when trying to load the "fontspec" package. I get the following error:
"Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX."
Any ideas?
Thank you!
The tufte-book
class made the tintBook
pdf variant possible.
There is nothing (yet) for html that is really comparable. The gitbook
default for bookdown
has a tufte variant but I find it lacking. The navigation bar is pretty awful.
We would need some proper js / css / html help, and it may be a fair amount of work. In the meantime, the pdf variant is functional.
When I build the template example of tint (Date: 2018-04-08) under Windows and tinytex/texlive, I get
I couldn't open database file skeleton.bib.bib
---line 121 of file aaa.aux
: \bibdata{skeleton.bib
:
Solution: Use bibliography: ./skeleton.bib
in YAML
Is there a way to control header text on pdf handouts?
Updated to new version 0.1.2 of tint
and the pdf header is now lower case instead of small caps as in previous versions.
Love the theme. But it looks like sidenotes:
Any use of a footnote will automatically be converted to a sidenote. ^[This is a sidenote that was entered using a footnote.]
don't seem to work. The sidenote number is printed -- but the note itself isn't.
In your demo, none of the sidenotes are printed: https://eddelbuettel.github.io/tint/tintHTML.html#fn1
Probably not directly a tint
problem/feature, but is it possible to re-use a citation? Right now I'm rendering an Rmd which uses tintPdf as the output. When I cite something a second time, it gets a new number and the full reference is repeated in the margin. Is there a way to get tint
to re-use the citation numbers when appropriate? Seems like I need something in the Rmd, maybe the yaml, that tint
will pass through to other processors. Thanks for any hints.
When I try using number_sections: true
in my header to add section numbering and knit I get an error from yaml. Is this because numbered sections aren't allowed in tint, and if so is it possible to override that?
I know it is not implemented in tufte, but I would like to use side references in PDF output as it is in HTML.
Is it at all possible?
I know this is a feature request and not an issue, and I am not even sure this is the place to make a request. If it is not, I will close it right away, just notify me.
I really like the look of tint::tintHtml
. Is it possible to use cross references for figures and tables like in ?bookdown::tufte_html2
with \@ref(fig:chunk_name)
?
Hello,
I wanted to use the pdf output format from tint and i cant't figure why pdflatex is failing to generate the pdf.
I tried the default template from the tint 0.0.2 package and hitted the knit button in rstudio (same thing happen when i use rmarkdown::render() ) and got this output :
/usr/lib/rstudio-server/bin/pandoc/pandoc +RTS -K512m -RTS tint_test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output tint_test.pdf --template /usr/local/lib/R/site-library/tint/rmarkdown/templates/pdf/resources/tintPdf-template.tex --highlight-style pygments --latex-engine pdflatex --variable 'documentclass:tufte-handout' --bibliography skeleton.bib --filter /usr/lib/rstudio-server/bin/pandoc/pandoc-citeproc
output file: tint_test.knit.md
! Undefined control sequence.
\maketitle ...p \thispagestyle {plain}\tuftebreak
\@afterindentfalse \@after...
l.165 \maketitle
pandoc: Error producing PDF from TeX source
Erreur : pandoc document conversion failed with error 43
Exécution arrêtée
The tufte version works (but has horrible font :p ).
I really like the tintBook setup so far.
It would be great to add the ability to reference tables and figures using the book down syntax \@ref(<type>:<name>) — where <type> is something like fig or tab, and <name> is the R code chunk name — within tintBook.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.