0

I want to put a calendar below an image.

But difficult with resizebox: and change x or y position

Minimal code:

\documentclass[a5paper,oneside,10pt]{article}
\usepackage{translator, tikz, array}
\usetikzlibrary{calendar,shapes.geometric}
\usetikzlibrary{calc}

\begin{document}

\includegraphics[width=10cm]{example-image-a} 
\\
\hspace{3.5cm}
\vspace{-2.0cm}
    \resizebox{10cm}{!}{
   \begin{tikzpicture}[every node/.append style = {anchor=center}]
      \calendar (mycal) [dates=2019-9-1 to 2019-9-last,   week list,
      day text=\%d0,
      month label above centered,
      month text={\%mt} \%y-,
      day xshift =1.0cm,
      day yshift = 0.65cm
  ]
  if (Saturday) [blue]
  if (Sunday)   [green]
    ;
  \end{tikzpicture}
  }
  \end{document}

Please help putting a calendar below image A or better a solution of how one can have a definite absolute position for resizebox?

2

You can just add the graphics to the tikzpicture (and make sure its width does not exceed \linewidth).

\documentclass[a5paper,oneside,10pt]{article}
\usepackage{translator, tikz, array}
\usetikzlibrary{calendar,positioning}

\begin{document}
\begin{tikzpicture}[every node/.append style = {anchor=center}]
\begin{scope}[local bounding box=calendar]
      \calendar (mycal) [dates=2019-9-1 to 2019-9-last,   week list,
      day text=\%d0,
      month label above centered,
      month text={\%mt} \%y-,
      day xshift =1.0cm,
      day yshift = 0.65cm
  ]
  if (Saturday) [blue]
  if (Sunday)   [green]
    ;
\end{scope} 
\node[above=0.2cm of calendar]{\includegraphics[width=0.9\linewidth]{example-image-a}};   
\end{tikzpicture}
\end{document}

enter image description here

\documentclass[a5paper,oneside,10pt]{article}
\usepackage{translator, tikz, array}
\usetikzlibrary{calendar,positioning}

\begin{document}
\begin{tikzpicture}[every node/.append style = {anchor=center}]
\begin{scope}[local bounding box=calendar]
      \calendar (mycal) [scale=0.7,dates=2019-9-1 to 2019-9-last,   week list,
      day text=\%d0,
      month label above centered,
      month text={\%mt} \%y-,
      day xshift =1.0cm,
      day yshift = 0.65cm
  ]
  if (Saturday) [blue]
  if (Sunday)   [green]
    ;
\end{scope} 
\node[above=2cm of calendar]{\includegraphics[width=0.9\linewidth]{example-image-a}};   
\end{tikzpicture}
\end{document}

enter image description here

4
  • @schroedinger's cat is ok but one blank page added before
    – latexforti
    Sep 18 '19 at 15:32
  • 1
    @latexforti Good point! I fixed it by reducing the vertical distance between the picture and the calendar. Other options include scaling the calendar down by adding, say, scale=0.8, to its options.
    – user194703
    Sep 18 '19 at 15:41
  • @Schroedinger's cat. Can you give me other solution if i want big distance above=2cm of calendar. Thanks
    – latexforti
    Sep 18 '19 at 15:53
  • 1
    @latexforti Well, you can scale the calendar down even more. I added something along those lines.
    – user194703
    Sep 18 '19 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.