2

I would like to use the latex code which is available here to create a page a day calendar. My goal would be to get the same result proposed on the link but by dividing the sheet of paper in four, i.e. instead of starting a new page after each day, to put four days on each page. By doing so, I hope to avoid wasting too much paper. My difficulties are:

  1. I don't know how to play with the crop marks so well,
  2. I am not familiar with using recursive scripts in latex.

Point 1. is actually the main issue but 2. makes it more complicated...

Thanks a lot for you help!

1
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – user11232
    Mar 1, 2014 at 15:08

1 Answer 1

2

Well, this is going to be ugly. But here it goes. We first generate the calendar, then crop it using Heiko's pdfcrop and insert the cropped pages using pdfpages package. All of these is done in a single file. calendar.tex inside the filecontents* environment is the actual original calendar file.

%% main.tex file

\documentclass[a4paper]{article}    %% change paper size
\usepackage{filecontents}
\begin{filecontents*}{calendar.tex}
\documentclass[17pt,oneside,final,showtrims]{memoir}
\usepackage{marvosym}

\setstocksize{11in}{8.5in}

\settrims{0in}{0in}

\settrimmedsize{4in}{6in}{*}
\settypeblocksize{3.5in}{1.75in}{*}
\setlrmargins{0.25in}{*}{*}
\setulmargins{0.05in}{*}{*}
\setheadfoot{0.01in}{0.1in}
\setheaderspaces{*}{*}{*}
\setmarginnotes{0.25in}{3.5in}{0in}

\checkandfixthelayout

\pagestyle{empty}

\usepackage[final]{graphicx}

\pagestyle{empty}

\newcommand{\daypage}[6] {%
  \marginpar{\includegraphics[height=3.4in]{#1}}
  \begin{center}
    \Large{#2} \\
    \HUGE{\textbf{#3}} \\
    \large{#4}
    \vspace{0.4in}
    \small{#5}
    \vspace{0.2in}
    \scriptsize{\textit{#6}}
  \end{center}
  \newpage
}%

\begin{document}
  % Cover page
  \marginpar{\includegraphics[height=3.4in]{example-image}}
  \newpage

  \daypage{example-image-a}{Friday}{01}{Jan 2010}{~}{~}
  \daypage{example-image-b}{Saturday}{02}{Jan 2010}{~}{~}
  \daypage{example-image-c}{Sunday}{03}{Jan 2010}{~}{~}
  \daypage{example-image}{Monday}{04}{Jan 2010}{~}{~}
\end{document}
\end{filecontents*}
%
\immediate\write18{pdflatex calendar}

% crop the pdf using Heiko's pdfcrop
\immediate\write18{pdfcrop calendar.pdf croppedcalendaer.pdf}
\usepackage{pdfpages}

\begin{document}
  \pagestyle{empty}
  \includepdf[pages=-,nup=1x2,delta=0in 0.4in,noautoscale,]{croppedcalendaer.pdf}  %% you may drop noautoscale,
\end{document}

Compile this with --shell-escape:

pdflatex --shell-escape main

enter image description here

6
  • This is amazing, thanks a lot! I am going to try to understand what you have done and will certainly learn quit a lot!
    – Nre
    Mar 1, 2014 at 15:05
  • @Nre Feel free to ask for clarifications. I am feeling too lazy now to write detailed explanations :) You know, it is saturday late evening here ;)
    – user11232
    Mar 1, 2014 at 15:07
  • Unfortunately, I did exactly what you told and I get a pdf with 5 pages and one day on each page... Could you please help me to understand what I am doing wrong? thanks :)
    – Nre
    Mar 2, 2014 at 19:48
  • @Nre Did you run my code above as such with --shell-escape enabled? The nup=1x2 option to \includepdf puts them as 2 in on.
    – user11232
    Mar 2, 2014 at 22:37
  • 1
    @Nre Remove noautoscale from \includepdf options.
    – user11232
    Mar 3, 2014 at 22:24

You must log in to answer this question.

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