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 using the following script in beamer to locate our logo at the right-most corner of all pages in the presentation,

\begin{textblock}{5}(10.0, \dimexpr 0.5\headheight - 7.5pt )
   \includegraphics[width=40pt]{logo.png}
\end{textblock}

The placement of the textblock in the page is fine, however there is an undesired equal sign (see added image) in the page. It's the first time I use \dimexpr, do I make a mistake?

enter image description here

I think this undesired equal sign comes from \dimexpr 0.5\headheight - 7.5pt this part of script. Because when I replace it with, for example, 1, the equal sign goes.

I just tried to do something \dimexpr 15pt - 7.5pt it still gives an undesired equal sign.

share|improve this question
1  
Please, convert it to a full Minimal (non-)Working Example. –  tohecz Nov 20 '12 at 8:48
1  
You probably also get some compilation errors: never overlook them. –  egreg Nov 20 '12 at 9:18
    
@egreg Yes, I have some compilation errors too. However, my deadline is coming and I pretend like there no warnings. I really wish I had time to create a perfect template. –  celebisait Nov 20 '12 at 9:21
    
Error messages and warnings are different things; an error can lead to very unexpected results, as you found out. –  egreg Nov 20 '12 at 9:23
add comment

2 Answers 2

up vote 3 down vote accepted

Another option is to use the starred version of the textblock environment. This way, you can indicate the unit and, when the calc package is loaded, you can do your usual calc computations.

\documentclass[10pt]{beamer}
\usetheme{Warsaw}
\usepackage{calc}
\usepackage{textpos}
\title{Topic name}
\author{My name}
\date{\today}
\begin{document}
\begin{frame}
\maketitle
\begin{textblock*}{5cm}(10pt,\dimexpr0.5\headheight - 7.5pt)
   \includegraphics[width=40pt]{example-image}
\end{textblock*}
\end{frame}
\end{document}
share|improve this answer
add comment

I suppose that testblock doesn't accept values with a unit. You have to strip it:

\PassOptionsToPackage{demo}{graphicx}%% only for demo
\documentclass[12pt]{beamer}
\usepackage{textpos}
\begin{document}

\makeatletter
\def\foo{\strip@pt\dimexpr0.5\headheight - 5pt\relax}
\makeatother
\begin{textblock}{5}(10.0,\foo)
   \includegraphics[width=40pt]{logo.png}
\end{textblock}

\end{document}

However, instead of using textblock you should redefine your header which is possible with the default macros which beamer provides.

share|improve this answer
    
This manipulation generates an undesired @pt 0.5= –  celebisait Nov 20 '12 at 9:15
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.