0

I am utilising rmarkdown to create some PDF handouts for a therapy group. Tufte handout is working brilliantly and I can combine markdown and some latex elements, this all is very well. My main tool is Rstudio with tinytex and pandoc installed.

What I need is how to create a custom front page (only that) for this set of handouts. I would like to show author, title and publisher on the front page and include an image in the page as well, if that is possible, say with \includegraphics. I know I could make a custom page in "Microsoft Publisher", but I would not like to do that in the project as it would be different aesthetics and cumbersome to maintain.

What compiles so far:

---
title: "MBT-i Group"
author: "Author"
publisher: "Publisher"

documentclass: tufte
output: 
  tufte::tufte_book:
    number_sections: false
knit: (function(inputFile, encoding) {
  rmarkdown::render(inputFile, encoding = encoding, output_dir = "pdf-output") })
---

Tt compiles into a single page PDF, but only gives a page with Author and Title. Publisher information is not there and I do not know why. In addition, if someone knew how to include an image on the cover page, that would be great. If it were possible to include a custom text field on the cover, it would be very nice too. PDF output

1 Answer 1

1

Note that this MWE work with pdflatex, but fail for some reason with the default xelatex (and with lualatex):

\documentclass{tufte-book}
\title{foo}
\author{foo}
\publisher{foo}
\begin{document}
\frontmatter
\maketitle
\mainmatter
\chapter{foo} foo
\end{document}

And AFAIK the default template have not option for $publisher$, so a workaround for Quarto markdown without make a custom template could be:

--
title: MBT-i Group
author: Author
format: pdf
documentclass: tufte-book
include-in-header: 
- text: \publisher{Publisher}
pdf-engine: pdflatex
---

# Introduction 

foo

mwe

4
  • Thanks, this is great, it works. I am still thinking why it should work as it does and thinking if I could place a small graphic/image on the front cover, but this is very well. Would you happen to know if there is a way to insert frontmatter on the subsequent page using markdown (rstudio, quarto)?
    – r0berts
    Commented Jun 26 at 20:19
  • 1
    tufte-book is a bit tricky and it seems that is not well supported by the default Quarto template (even just foo ![text](img) as document content break the code!) . This is also true for insert an image in the tufte title directly in LaTeX (see here . Therefore, for something complex my suggestion is try to make it first in LateX, and once you check that it work, convert it in a custom quarto template.
    – Fran
    Commented Jun 27 at 7:24
  • Am I right in thinking that I could use latex directly in a *.rnw file to compile via sweave and then when it works I could try see if I can implement it in rmarkdown too?
    – r0berts
    Commented Jun 27 at 12:54
  • 1
    No. No export process is not the same, but no matter that you start with a .Rnw, Rmd, .qmd or .lyx file, you will end with a latex file that in theory should work. The question is that not always this is true and then you should first debug the final .tex and once you discover the issue, you can search for a workaround to avoid that issue in the source. E.g.: Try to compile a default rmarkdown with just a very simple markdown table. It works? OK. Now one with option twocolumn and just some words. Work. It works? Now try add the former table in this document. You'll see how fun.
    – Fran
    Commented Jun 27 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .