1

I was getting some strange results trying to position things in beamer, and I realised that \strip@pt was removing not only the pt, but also the hundreds from the number.

Here's my MWE:

\documentclass[]{beamer} 

\makeatletter
\newcommand{\testOne}{\dimexpr100pt\relax}
\newcommand{\testTwo}{\strip@pt\dimexpr100pt\relax}
\makeatother

\begin{document}
    \begin{frame}
        \the\testOne

        \the\testTwo
    \end{frame}
\end{document}

and the result:

enter image description here

This is a bug, right? Or is there something I'm doing wrong?

For the record, I need to remove the dimensions to avoid a warning from \putat. In case this is an XY problem, I'm open for suggestions on better ways to position things on the slide.

craq
  • 371
  • 1
    it's not \strip@pt removing the 1, but the \the that you added (as the error message shows) – David Carlisle Dec 06 '18 at 00:12
  • \the\testTwo yields \the\strip@pt\dimexpr100pt\relax yields \the100 . Here \the does not find that kind of expression it expects but the digit 1 and thus delivers an error-message and the digit 0, so in the end you have an error-message and the sequence 000. So the answer is: It is not a bug. You are doing something wrong. – Ulrich Diez Dec 06 '18 at 00:24

1 Answers1

5

After an error message you should not even look at the generated PDF. the posted document produces

! You can't use `the character 1' after \the.
<argument> 1
            00
l.13     \end{frame}

? 

You can not use \the on 100

\documentclass[]{beamer} 

\makeatletter
\newcommand{\testOne}{\dimexpr100pt\relax}
\newcommand{\testTwo}{\strip@pt\dimexpr100pt\relax}
\makeatother

\begin{document}
    \begin{frame}
        \the\testOne

        \testTwo
    \end{frame}
\end{document}

enter image description here

David Carlisle
  • 757,742