2

I am trying to generate a pdf file with a logo at the top left, and an address right below it. Here is what I have tried so far: Based on this

\documentclass[8pt]{extarticle}

\usepackage{tikz}
\usepackage{relsize}
\usepackage{caption}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (current page.north west)
  {\includegraphics[scale=0.2]{NSW-MungoNP-1000x450.png}};
\end{tikzpicture}
\caption*{123 East XYZ Street, ABC City, YYY 123456}\par
\caption*{(123)456-7890 FAX: (123) 456-7890}
\end{figure}

\end{document}

which results in this: enter image description here

And also based on this:

\documentclass[8pt]{extarticle}

\usepackage{tikz}
\usepackage{relsize}
\usepackage{caption}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (current page.north west)
  {\includegraphics[scale=0.2]{NSW-MungoNP-1000x450.png}};
\end{tikzpicture}
\noindent\hspace{0.0in}123 East XYZ Street, ABC City, YYY 123456\par
\noindent\hspace{0.0in}(123) 456-7890 FAX: (123)456-7890
\end{figure}

\end{document}

which results in this: enter image description here

What am I doing wrong?

ytk
  • 137
  • 2
    figure is a floating environment, meaning LaTeX, not you, makes the final decision on where it goes. Perhaps this question may offer insights: http://tex.stackexchange.com/questions/169808/what-are-the-ways-to-position-things-absolutely-on-the-page – Steven B. Segletes Jul 22 '16 at 18:45

1 Answers1

4

You should place the image-and-caption as a single block in the \node of your tikzpicture. Below I use a tabular to contain the content:

enter image description here

\documentclass[8pt]{extarticle}

\usepackage{tikz}
\usepackage{graphicx}

\begin{document}

\begin{tikzpicture}[remember picture,overlay]
  \node[anchor=north west,inner sep=0pt] at (current page.north west)
    {\begin{tabular}{@{}c@{}}
       \includegraphics[scale=0.2]{example-image} \\
       123 East XYZ Street, ABC City, YYY 123456 \\
       (123) 456-7890 FAX: (123) 456-7890
     \end{tabular}};
\end{tikzpicture}

\end{document}

You can change the alignment from centre to left, or something else.

Werner
  • 603,163