nanxstats / liftr

🐳 Containerize R Markdown documents for continuous reproducibility
https://nanx.me/liftr/
GNU General Public License v3.0
170 stars 20 forks source link

Using custom tex template example #25

Open Bakaniko opened 6 years ago

Bakaniko commented 6 years ago

Hi,

I liked your liftr package, but i needed some refining like custom templates.

As student, I often have to produce reports in french, and even if there is no mandatory template, I created mine.

So I integrated it to liftr, because I liked how it works. I think it can be a good example.

It can be seen there:

https://github.com/Bakaniko/liftr/tree/templates_usage

Features:

Cons / issues:

Not tested:

Shows some (R)markdown features:

Custom colors

You can add your color in etude.tex file.

Anyway thanks for liftr, give me plenty reasons to procrastinate and an integrated Rmarkdown/latex writing workflow. I hope this will help people using and tweaking liftr.

Best,

Nicolas

nanxstats commented 6 years ago

Hi @Bakaniko ,

-this looks like an exceptional use case! Your project on customized LaTeX templates is really clearly structured. It demonstrates the flexibility of the liftr concept (while the package itself maintains a very low complexity), and its potential to serve as a general framework for creating complex containerized dynamic documents.

I'm delighted to see and will be actively collecting such interesting use cases. Please just let me know if there are any critical missing features you need in the liftr package in the future so we can make it better together.

Thanks so much, -Nan

Bakaniko commented 6 years ago

hi @road2stat

Thanks for you kind comment.

Yes, liftr is flexible (thanks to the Dockerfile inclusions)

liftr respond very well to a concern I had, which is use produce pdf file from markdown with the LaTeX possibilities. And use docker so I don't need to install TexLive because it is quite heavy to maintain.

With the changes I made, I'm able to do what I want load templates and images from the same folder and use a custom font (luckily I can get it with apt). So know I'm pretty satisfy.

What I plan:

I don't know yet if l'll more feature from liftr. I'll have several occasions to use it (reports, master thesis), I'll come to you if that happens.

One thing might be useful is an orphan cleaning option, because every time you compile a document (I did it a lot) it creates a new container and it can get quite big if you don't pay attention. I solved it with a command line in the Makefile. So if there is a way ton integrate an option to laucnh docker rmi $(docker images -f dangling=true -q), it will be nice.

Thanks again for liftr :) (I would like also to thanks @yihui, I think I would never thank him enough for all his work)

EDITED: 2017-10-27

yihui commented 6 years ago

@Bakaniko You are welcome. Regarding:

I don't need to install TexLive because it is quite heavy to maintain.

That is one thing I really disliked about TeXLive and I have been thinking of creating a lightweight LaTeX distribution (about 100Mb in size) for years, and I will start working on it in the next couple of weeks.

nanxstats commented 6 years ago

@Bakaniko - good point, I realized this almost instantly after I created this package and not sure why I haven't done that yet... Maybe now's a good time. You can track the ticket here: https://github.com/road2stat/liftr/issues/27

@yihui I think a portable minimalist TeX distribution would be tremendously useful (for everything) -- love this idea a lot. Looking forward to it!

Bakaniko commented 6 years ago

@road2stat thanks for creating the issue :) If you need help testing it, please ask !

@yihui A lightweight LaTeX will be nice, I'm not a very technical person, but I would be happy to help !

nanxstats commented 6 years ago

@Bakaniko - check this out for Yihui's TinyTeX: https://yihui.name/en/2017/12/test-tinytex/

Bakaniko commented 6 years ago

Yeah; I saw that last week.

Already made issues :stuck_out_tongue_closed_eyes:

https://github.com/yihui/tinytex/issues/5

Didn't had time yet to investigate more, but as always this new package from @yihui seems really promising.

Although we might need to think how to install package from CTAN too. Because, it is not so easy to do it manually (tried today to fix a small issue) compared to debian or CRAN packages.

What do you think ? Something similar to the last ones, included in the yaml header.

yihui commented 6 years ago

Once the feature/tinytex branch is merged to rmarkdown, R Markdown users should no longer need to worry about missing LaTeX packages (will be automatically installed by default).