Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using custom tex template example #25

Open
Bakaniko opened this issue Oct 22, 2017 · 8 comments
Open

Using custom tex template example #25

Bakaniko opened this issue Oct 22, 2017 · 8 comments

Comments

@Bakaniko
Copy link

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:

  • all file are in one docs folder, with template folder and image folder
  • all templates are loaded in /data/templates in the docker image
  • all images are loaded in /images/ in the docker image and listed in process (easier to debug)
  • several parameters are available:
    • mainfont: custom main font (Linux Libertine O installed with apt by default)
    • sansfont: custom sans font (Linux Biolinum O installed with apt by default)
    • maincolor: choose main color for section title and title page ribbon
    • secondcolor: for horizontal ribbon
    • fontsize: 11pt ( show Rmarkdown option usage)
    • lang: fr ( show Rmarkdown option usage)
    • tocname: custom toc name (in France, with have 2 names depending of TOC position in the document)
  • custom yml entries for title page:
    • title
    • subtitle
    • author
    • classname : project name
    • formation: diploma major
    • parcours: diploma minor
    • notesA
    • notesB

Cons / issues:

  • multiple author list don't work, needs to be on 1 line/string
  • cls file needs the texlive-lang-french deb package, even for english document
  • some configurations need to be done in etude.cls and etude.tex file (moving things in title page, custom LoF and LoT titles), tweaking is not easy (2 separated files, latex macros, tikz).
  • Makefile needs improvements (Rscript call to build the pdf), for now it just clean the working folder
  • needs xelatex (provided by the docker image to work)

Not tested:

  • include appendix or tex files
  • bibliography
  • other bookdown classes (epub, html, etc)

Shows some (R)markdown features:

  • sectionning
  • images
  • references
  • footnotes
  • python code execution

Custom colors

  • MSBlue (M$ blue)
  • MSLightBlue (lighter M$ blue)
  • DarkColor( similar to DarkGrey)
  • LightColor (similar to LightGrey)
  • LightGrey
  • DarkGrey
  • BaseColor (currently set to greenish color)
  • TextColor (black)
  • VertDepartementGeo (greenish color from my university department)
  • jaune (yellow)
  • bleu (blue)
  • bleuciel (skyblue)
  • rstudioblue

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
Copy link
Owner

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
Copy link
Author

Bakaniko commented Oct 27, 2017

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:

  • provide an article template (without cover sheet)
  • find if it is possible to work with multiple Rmd files (to split chapters for big files) => not sure
  • improve the makefile to build the document from CLI

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
Copy link

yihui commented Oct 27, 2017

@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
Copy link
Owner

@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: #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
Copy link
Author

@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
Copy link
Owner

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

@Bakaniko
Copy link
Author

Yeah; I saw that last week.

Already made issues 😝

rstudio/tinytex#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
Copy link

yihui commented Dec 12, 2017

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants