Yihui Xie
yihui.name · Personal blog · on HN since 2010
Yihui Xie is the author of knitr and TinyTeX who writes on R, reproducible reporting, LaTeX and tooling.
What HN saysHN commenters link his notebook wars response and recommend knitr for embedding R and LaTeX in reports.
27HN people shared it
15linked it in comments
13stories submitted
155story points
7 years agolast shared
2010people per year2026
Most-shared posts
- 1The First Notebook Wars4 people · 4 points · first shared 2018 · discussion on HN
- 2Engines4 people · first shared 2012
- 3TinyTeX: A lightweight and easy-to-maintain LaTeX distribution3 people · 131 points · first shared 2018 · 52 comments on HN
- 4Knitr: Elegant, Flexible and Fast Dynamic Report Generation with R3 people · 1 points · first shared 2016 · discussion on HN
- 5My Early Career Crisis (2014 – 2015)2 people · 3 points · first shared 2018 · 1 comments on HN
- 6GitHub Pages Is Dead, Long Live Netlify1 people · 5 points · first shared 2017 · discussion on HN
- 7Timezones, and Worse, Daylight Saving Time1 people · 3 points · first shared 2018 · 2 comments on HN
- 8On the Gory Loops in R1 people · 2 points · first shared 2010 · discussion on HN
- 9On Tiobe Index and the era of decision fatigue1 people · 2 points · first shared 2019 · discussion on HN
- 10Why TinyTeX? What is the pain with other LaTeX distributions?1 people · 2 points · first shared 2018 · 1 comments on HN
- 11A Special Graphics Device in R: the Null Device1 people · 1 points · first shared 2013 · discussion on HN
- 12Markdown or LaTeX? (2013)1 people · 1 points · first shared 2017 · discussion on HN
- 13Lyx vs latex1 people · first shared 2013
- 14Graphics1 people · first shared 2017
- 15So bounties1 people · first shared 2018
What HN people wrote when they linked it
jasode · 2019-05-08
...and a well-written response to that by Yihui Xie: https://yihui.name/en/2018/09/notebook-war/
Since Xie's post discusses a "meta" layer above Joel Grus, I recommend people read it before JG. This actually helps one understand the underlying thinking in JG's slides.
akshayn · 2019-03-18
> We also recommend to save the command used to generate a figure in the LaTeX file
An approach I have adopted recently is Knitr[1], so this layer of indirection goes away. With knitr, my data goes directly into the paper repository, and then my Makefile has something like this:
%.tex: graphs/%.Rnw
Rscript -e "library(knitr); knit('$?')"
The nice thing is exactly what the authors recommend: it's much easier to enforce a standard appearance across all the figures, and automatically incorporate more recent data into the paper as part of the compilation process.
[1] https://yihui.name/knitr/
andrewla · 2017-03-17
tikzDevice [1] defines a device in tikz terms, which I've used for vanilla R plots, and should work for ggplot, but I'm not positive.
Actually, a quick search yielded [2], so it appears that ggplot2 is supported as well. And apparently supported in one of the knitr examples [3] (if you use knitr, which I highly recommend).
[1] https://cran.r-project.org/web/packages/tikzDevice/index.html
[2] http://iltabiai.github.io/tips/latex/2015/09/15/latex-tikzdevice-r.htm…
[3] https://yihui.name/knitr/demo/graphics/
ska · 2014-05-30
knitr does this reasonably well for letting you drop LaTeX directly into R reports with a delimiter... if you haven't seen that might be worth a look at the interface in some examples (e.g. http://yihui.name/knitr/demo/showcase/)
eigenloss · 2018-09-30
> Part of the problem with blogs is that they're less rewarding than Facebook and Twitter: your post may perhaps get some thoughtful responses but it doesn't get immediate likes.
To me, this is not a problem. People should not be rewarded with instant dopamine for low-effort actions. [0] The reward for publishing on a blog is in the responses you receive from readers and not from a counter incremented by a click or pageview.
I rarely see more than shallow insight on Twitter/Facebook, as posts have a short visibility lifetime and replies longer than a sentence are collapsed. By contrast, blogs (not like Medium or Stack Exchange) will often receive deep, thoughtful replies months or years after they are published. There's no "algorithm" to please when you're writing a blog; your post will stay there until your domain name expires.
If you are having issues finding worthwhile blogs to read, ask people around you for suggestions. Not everything needs to be indexed by software.
> And part of the problem is, of course, that writing a good post is much harder than writing a witty tweet.
Where is the problem here? Thermodynamics and information theory tell us that a valuable long-form post ought to be more difficult to write by several orders (of orders) of magnitude. Yes -- it would be wonderful if we could all spit out fascinating 17-page theses every week or two, but that just isn't compatible with our biology. On the other hand, publishing 17 pithy tweets in a week is pretty…
baldfat · 2016-10-11
From kintr website: http://yihui.name/knitr/demo/engines/
Language wise you can use the following in knitr:
We can use any languages in knitr, including but not limited to R. Here are some simple demos with Python, Awk, Ruby, Haskell, Bash, Perl, Graphviz, TikZ, SAS, Scala, and CoffeeScript, etc:
python.Rmd (output)
c.Rmd (output)
fortran.Rmd (output)
sql.Rmd (output)
awk.Rmd (output)
ruby.Rmd (output)
haskell.Rmd (output)
bash.Rmd (output)
perl.Rmd (output)
dot.Rmd (output)
tikz.Rmd (output)
sas.Rmd (output)
coffeescript.Rmd (output)
polyglot.Rmd (output)
Scala, Python, and Bash
Also glad Python works for you and it is an awesome choice. I would just recommend looking at dplyr tutorial for the "plumbing." you might keep to your Python but this is an awesome workflow. https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.htm…
achompas · 2016-01-19
A recent episode of Not So Standard Deviations (a great podcast for anyone in the sciences or applied statistics) covered reproducibility:
https://soundcloud.com/nssd-podcast/episode-5-irl-roger-is-totally-wit…
I'd suggest treating your code like a software project: convert repeated logic into methods, collect methods into modules/libraries depending on their use, write lots of documentation, and use version control (Github with a nice README.md in each project is a great start).
If you transition projects, take 5-10 minutes to update your docs (I keep a "captain's log") with the latest details and a list of todo items. I like to note my victories ("on 1/19 I produced this plot that sent me in a different direction; on 1/21 I demoed my project and received such-and-such feedback") and next steps in the log, as a way to retrace my progress over weeks or months.
That podcast also mentions knitr (http://yihui.name/knitr/), which looks great for docs.
bruce_one · 2019-04-30
https://yihui.name/tinytex/ is a pretty cool minimal tex distro with nice utilities for finding dependencies, if of interest :-)
johnminter · 2019-01-09
There is a recent development that provides a much smaller subset: TinyTex by Yihui Xie (who has made many contributions to Rmarkdown). See https://yihui.name/tinytex/
One can add just the packages you need and it can be installed in user directories for people who do not have admin privleges.
radmuzom · 2018-10-31
A really good article on notebooks is the blog post by Yihui Xie - https://yihui.name/en/2018/09/notebook-war/.
gaius · 2018-04-15
combine several languages in a single document without any issues
You can do this with RMarkdown as well, despite the name, and run notebooks in RStudio. Much better experience than Jupyter in a browser.
https://yihui.name/knitr/demo/engines/
a_bonobo · 2018-02-19
You might enjoy reading Yihui Xie (bookdown, Knitr)'s very honest blog post on his problems that sound similar to yours:
https://yihui.name/en/2018/02/career-crisis/
geomark · 2016-07-06
As well as a number of other rather useful languages [1].
Now days I use RMarkdown even for experiments because it's nice to document my line of thinking as I write the code and get a nicely formatted output when I'm finished.
[1] http://yihui.name/knitr/demo/engines/
Surio · 2013-02-22
I don't have a problem about "geeking out" with LaTeX `\' slashes, but frankly, what you mention about LyX is right. Thought you might appreciate this writeup by someone else who also agrees on your LyX viewpoint....
http://yihui.name/en/2012/10/lyx-vs-latex/
Enjoy the read.
yihui · 2012-12-08
Python will be better supported in knitr in future; for now it only has preliminary support: http://yihui.name/knitr/demo/engines/