tufte | Tufte Styles for R Markdown Documents | Development Tools library
kandi X-RAY | tufte Summary
kandi X-RAY | tufte Summary
This R package provides a few R Markdown output formats that use the Tufte style. See for a comprehensive example. To install the development version of this package from Github, you may use devtools::install_github('rstudio/tufte'). You can also install it from CRAN (install.packages('tufte')).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tufte
tufte Key Features
tufte Examples and Code Snippets
Community Discussions
Trending Discussions on tufte
QUESTION
I'm trying to keep the uppercase part of the title in the page-headers; it shows ok in the title page, so I'm looking for a way to pass text as it is from the yaml header to the page headers, I've seen examples with plain latex where passing strings as they are is the default behavior, so I guess it is somewhere in the chain yaml-rmarkdown-tufte; my yaml header is the following, it renders "guatemala", so I'd like to have the capital G here.
...ANSWER
Answered 2022-Mar-08 at 21:30Install the soul
latex package
The tufte class does not use the usual small caps from latex, but redefines them. To do this, it normally uses the soul
package.
However the soul package is only an optional dependency of the tufte class. If it is installed, it will be used, if it is not installed, you can still compile the document, you just don't get all the features.
Now the unfortunate series of events continues. You are using tinytex, which by default is missing nearly all packages -- amongst the missing packages is the soul package. And because the soul package is only an optional dependency, tinytex's automatic installation of missing packages does not kick in.
To solve this, either manually install soul
or (better) use a complete texlive installation instead of tinytex, so you'll never again have problems with missing packages.
QUESTION
I have an rmarkdown PDF Tufte handout with a horizontal rule on one line, where someone is supposed to sign the document. I would like the rule to be left justified with no indent, but \noindent
isn't working. Reading about \noindent
led me to believe that maybe it was being ignored because the line wasn't recognized as being a new line, but adding a paragraph break doesn't seem to work either.
My current thinking is that the horizontal rule might not be recognized as real text, so LaTeX just sees an empty line and ignores the \noindent
, and I seem to remember that there's some non-printing character I could stick in there that would get it to be recognized, but I don't know what that is or how to search for it.
This same document was working for me recently, but broke when I updated R. And it's only a problem with the Tufte handout. In a normal LaTeX PDF document the \noindent
works fine.
ANSWER
Answered 2022-Feb-28 at 17:42Your latex code is correct, but the conversation from rmarkdown to latex butchers it up by adding line breaks after \noindent
(which makes zero sense...).
You can avoid the problem like this:
QUESTION
On the same machine the knitr + LaTeX compilation of the Rnw file below fails in RStudio with Invalid UTF-8 byte "97
LaTeX error; but compiles with TexShop. Here is the source code:
ANSWER
Answered 2022-Feb-23 at 16:18The problem seems to be the ×
in the intermediate .tex file.
You can avoid the problem by choosing an unicode aware engine, like lualatex or xelatex, to compile your document:
QUESTION
I have no problem defining color of newthought() with Tufte style when rendering to HTML, as follows:
`r newthought('The Lab Supervisor')` ...
However, it does not work out when rendering to pdf.
I learned to define color when rendering to both HTML and pdf by the following code:
ANSWER
Answered 2022-Jan-25 at 04:38I just worked it with your exact code. It worked in both pdf and HTML. You just combine the functions as you would in any other set of function calls.
(I used the tufte
template.)
QUESTION
I am testing some templates of ggplot2
, and I am interesting to the slope chart, available from here:
It works perfectly.
I am only trying to make a similar one but with only a group defined, like the following code:
...ANSWER
Answered 2021-Dec-30 at 18:17May I suggest a much easier way, with the {ggh4x} package, which has a base R type = "b" like geom. You can remove the points, and plot text instead.
You'll get your result in three lines of code :)
QUESTION
geese = ["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"]
birds = ["Mallard", "Hook Bill", "African", "Crested", "Pilgrim", "Toulouse", "Blue Swedish"]
def goose_filter(birds):
for i in birds:
if i in geese:
birds.remove(i)
print(goose_filter)
...ANSWER
Answered 2021-Nov-12 at 11:00geese = ["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"]
birds = ["Mallard", "Hook Bill", "African", "Crested", "Pilgrim", "Toulouse", "Blue Swedish"]
def goose_filter(birds,geese):
for i in birds:
if i in geese:
birds.remove(i)
return birds
print(goose_filter(birds,geese)) #['Mallard', 'Hook Bill', 'Crested', 'Toulouse', 'Blue Swedish']
QUESTION
I have a pandoc grid table in an otherwise brand-new bookdown project:
...ANSWER
Answered 2021-Nov-09 at 14:53This was an issue in the tufte package.
It has now been fixed in dev version 0.10.2 one can install from github
QUESTION
I'd like to set different fonts for the body and margin notes of a bookdown::pdf_book
with base_format: tufte::tufte_book
. This answer shows how to change the overall styling by adding to header-includes:
in the YAML.
Is there a similar latex approach for setting different fonts/sizes to control the main vs margin note text?
...ANSWER
Answered 2021-Aug-28 at 19:52You can adjust the fonts like this:
QUESTION
I am working on converting a tufte-LaTeX book to tufte-Bookdown using the tufte and msmbstyle packages. I have a whole bunch of sidenotes and would like the numbering to restart with each chapter so I don't reach like 400 by the end of the book.
I found this CSS code in the Bookdown GitHub for doing this with regular Bookdown, which uses footnotes/endnotes. However, my attempts to modify the code to work with sidenotes have failed. This is my current CSS addition, which just takes that code and drops in sidenote
or sidenote-number
(which Inspect Element suggests are the correct tags) where footnote
originally was:
ANSWER
Answered 2021-May-26 at 05:27I ended up paying someone to solve this. They wrote some JavaScript that will fix it. The following code can be saved as an HTML file, and added to the book with
QUESTION
I would like to make a plot with R that looks like the sample made with Mac's Numbers. I'm struggling with the space between the plot and the legend box. This is a sample of what I would like to achieve:
With the help of some users (see end of post for reference) I got really close already. This is my current function:
...ANSWER
Answered 2021-May-27 at 17:07I think the easiest solution is to simply apply wrapping to the text in your legend. You can do this using stringr::str_wrap()
to give results like the following:
Here is a very minimal edit to your function which allows a user to control the text wrapping:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tufte
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page