Giter Site home page Giter Site logo

marign_note() rookie... about tuftesque HOT 6 OPEN

nstrayer avatar nstrayer commented on August 15, 2024
marign_note() rookie...

from tuftesque.

Comments (6)

nstrayer avatar nstrayer commented on August 15, 2024 2

I have been lazy with just reverting to html for lots of stuff because that's the route I came from. That being said, it's formulaic enough that I really should package it. I will look into this shortly. Thanks for bringing it up!

from tuftesque.

JohnsonBrent avatar JohnsonBrent commented on August 15, 2024 1

If it helps any, you can include in your tuftesque-themed blog posts a lot of the tufte elements, even marginfigure{}, from the tufte package. You just need to first create your post in an R Markdown document and knit it outside of blogdown and tuftesque. That is, don't use blogdown::build_site() just yet. Then after knitr produces your html document, copy the html code from that document and paste it into a brand new post created using blogdown and tuftesque, i.e., use new_post(). Now you can use build_site() on the new post and your margin figures, plots, or whatever else you created from the tufte package will magically appear. A lot of other Hugo themes won't respect this simple copy-paste method and won't render the html reflecting margin figures and code chunks as nicely as tuftesque.

...But the problem I'm now having with the above method is that tuftesque doesn't like the smart quotes inside the pasted html (or is it vice versa?). When tuftesque renders a document containing html code that was knit using the tufte package, phrases like "predictive models" (with quotes) appear as “predictive modelsâ€� (quotes replaced by weird symbols). Or the simple phrase "It's" (with a smart apostrophe) winds up appearing as Itâ€TMs.

Any suggestions?

from tuftesque.

nstrayer avatar nstrayer commented on August 15, 2024

The margin_note function only works when done on an inline R snippet. Aka

# title
this is some text `r tufte::margin_note("this is my note")`
continuing my normal text

You could also specify the output of the larger chunk to asis. Aka {r, results = "asis"} and it should work too. Basically, since it outputs raw html a normal R chunk wont work because it wraps the output in a <code> html block to make it clear its coming from R code.

from tuftesque.

rosseji avatar rosseji commented on August 15, 2024

Great, should have read your blog post twice... 🙃

No luck with the suggestion {r, results = "asis"}...

```{r, results='asis'}
tufte::margin_note("this is my note")
```

screen shot 2017-10-16 at 8 07 41 am

from tuftesque.

rosseji avatar rosseji commented on August 15, 2024

I'm interested in a tool though...

Would really love to be able to adapt @yihui Tufte handout tools that allow chuck options that format chuck output in the awesome Tufte margin style.

I see that on on the LFOD blog you guys just use inline html to add video/image content in the margin... so might try a work around

from tuftesque.

1danjordan avatar 1danjordan commented on August 15, 2024

Hi, I was having similar issues trying to use tufte::margin_note and just wanted to suggest that it's more clearly documented. I thought we could use {marginfigure} from the tufte package, but that doesn't work, which was quite confusing.

And I just wanted to say thanks a million, I really love this theme!

from tuftesque.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.