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?
\includegraphicsshould 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