Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to find a way to place a logo at the top left of the page, with at the same height and right aligned my information (eg name, adress). The rest of the text has to be placed below that.

I can't find how to do that. My problems are

  1. my information (name) is not on the same height as the logo;
  2. the text just starts under my name, on the right side of the logo, not under it.

Most search results I saw are about headers and footers and I'm not looking for that.

My code:

\begin{wrapfigure}{l}{0.5\textwidth}
  \begin{center}
    \includegraphics[width=0.5\textwidth]{D:/SkyDrive/Backup/Latex/logo.jpg} 
  \end{center}
\end{wrapfigure}

\begin{flushright}
    \noindent name\\
    info\\
    \today
\end{flushright}

Text
share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It is considered a lot better to put in some code that will compile, as it makes it a lot easier for us to copy it into our text editor and work with it, and see exactly what it is you are trying to do. –  Martin Schröder Nov 11 '12 at 14:57
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Martin Schröder Nov 11 '12 at 14:58
1  
OK, added my code. –  Aaron Nov 11 '12 at 15:06
    
Some additional options can be found here –  Scott H. Nov 11 '12 at 16:17
add comment

1 Answer

up vote 5 down vote accepted

This seems like a crude way of doing it, but it is fairly straight forward:

enter image description here

\documentclass{article}
\usepackage{array,graphicx,lipsum}% http://ctan.org/pkg/{array,graphicx,lipsum}
\begin{document}
\noindent\begin{tabular}{@{}p{.5\textwidth}@{}>{\raggedleft\arraybackslash}p{.5\textwidth}@{}}
   & My name \\ & My street \\ & My city \\ & My postal code \\ 
  \smash{\includegraphics[height=5\normalbaselineskip]{example-image-a}} & My country
\end{tabular}

\lipsum
\end{document}

I've made the height of the image be equivalent to the height of the name/address portion (5 lines or \normalbaselineskips). Inserting the image on the same line as the last entry of your address allows you to use \smash to avoid any vertical adjustment within the tabular.

Some components involved in the solution:

  • \noindent: Removed the regular paragraph indent inserted when starting a paragraph (note that this happens with the first Lorem ipsum paragraph below the image);
  • @{} in the tabular column specification removes the inter-column spacing inserted usually between adjacent columns like. This space inside a tabular is given by \tabcolsep;
  • >{<stuff>}: This is a directive offered by the array package that inserts <stuff> before the start of the cell. An analogous <{<stuff>} is also provided (but not used) for inserting <stuff> after the end of the cell. I insert \raggedleft to make the cell contents be flush with the right margin. There's also \arraybackslash which is a correction tool when using the > and < directives, re-establishing the functionality of \\;
  • p{.5\textwidth}: Both columns in the tabular are set in paragraph mode/style with a width of .5\textwidth - half the text block width.
  • \smash: removes any vertical height of an object which would otherwise influence the line gap between successive rows in the tabular.
  • \normalbaselineskip: The regular \baselineskip that is used outside the tabular environment is captured in \normalbaselineskip for use inside the tabular, if needed. I made the image as high as 5 lines, since my personal details spanned 5 lines.
share|improve this answer
1  
Thanks works perfectly! Don't fully understand how it workes though :p –  Aaron Nov 11 '12 at 15:55
    
@Aaron: I've added some detail. –  Werner Nov 11 '12 at 16:12
1  
Thanks for your time! –  Aaron Nov 11 '12 at 16:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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