0

I am trying to create a calendar based on the first answer to this question:

How to create Page-a-Day Calendar Template

I want to have an image for each day, so I tried using a variable inside includesgraphic, but it does not work. Here is my code:

\documentclass[12pt]{article}
\usepackage[margin=2cm,landscape,a5paper]{geometry}% http://ctan.org/pkg/geometry
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{calc}%
\usepackage{datatool}% http://ctan.org/pkg/datatool
\usepackage{graphicx}
%\graphicspath{ {./Imagens/} }
\DTLloaddb{calendar}{falendario.csv}% Load page-calendar.csv into calendar DB
\pagestyle{empty}% Remove page headers/footers

\begin{document} \sffamily% Default font family \DTLforeach{calendar} {\calDia=Dia, \calMes=Mes, \calSemana=Semana, \calPalavra=Palavra, \calSignificado=Significado} {% \begin{tikzpicture}[remember picture,overlay] %\fill[black!80!green!25] %(current page.north east) rectangle (current page.south west);% Outer frame %\shade [bottom color=black!70!green!25, top color=black!70!green!10] %($(current page.north east)+(-5mm,-5mm)$) rectangle ($(current page.south west)+(5mm,5mm)$); % Inner frame + shading \draw ($(current page.north west)+(5mm,-5mm)$) node[anchor=north west] {\scalebox{4}{\bfseries\color{black!65}\calDia;de;\calMes}};% Print YEAR \draw ($(current page.north east)+(-5mm,-5mm)$) node[anchor=north east] {\scalebox{3}{\bfseries\color{black!80}% \begin{minipage}{.5\linewidth}\raggedleft% \calSemana \par% Print WEEKDAY %\calDia~\calMes%print DAY + MONTH \end{minipage}}}; \draw ($(current page.west)+(+60mm,0)$) node {\scalebox{2}{\color{black!95!green}% \begin{minipage}{.3\linewidth} \begin{flushleft} \large\textbf{\calPalavra} \par \normalsize\calSignificado% Print SAYING \end{flushleft} \end{minipage}}}; \draw ($(current page.east)+(-50mm,0)$) node {\scalebox{2}{\color{black!95!green}% \begin{minipage}{.3\linewidth} \includegraphics[width=\linewidth]{\calPalavra} \end{minipage}}}; \end{tikzpicture}% \newpage% } \end{document}

Without the line

\includegraphics[width=\linewidth]{\calPalavra}

it works just fine. But as it is right now, whenever I try to compile Texmaker will just start running and then stop, without giving me any error, and producing no pdf.

Can you help me?

Siete9
  • 1
  • 1
    Welcome to TeX.SE! – Mensch Sep 15 '21 at 21:25
  • The argument to \includegraphics should be a file name. By the way, what’s the reason for scaling a minipage containing the image? Just do \includegraphics[width=0.6\linewidth]{filename] – egreg Sep 16 '21 at 07:06
  • Yeah, I forgot to put the scale. But the point is that my filename is different for every page, and I have 365 pages, so I am trying to use a variable as file name. Is it possible? – Siete9 Sep 16 '21 at 11:55

0 Answers0