如何将变量作为 includesgraphics 的参数:

如何将变量作为 includesgraphics 的参数:

我正在尝试根据这个问题的第一个答案创建一个日历:

如何创建每日一页日历模板

我想为每一天准备一张图片,所以我尝试在 includesgraphic 中使用变量,但不起作用。这是我的代码:

\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}

沒有線

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

它运行得很好。但就目前而言,每当我尝试编译时,Texmaker 都会开始运行然后停止,不会给我任何错误,也不会生成任何 pdf。

你能帮助我吗?

相关内容