Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\pdfsavepos / \zsavepos : strange behaviour in lists

53 views
Skip to first unread message

GL

unread,
Nov 26, 2010, 4:28:01 PM11/26/10
to
Hello,


I can't understand why \zsavepos (\pdfsavepos) doesn't return the
same result.

What's the effect of \leavevmode on the current position ?
It's not visible in the pdf...

% ---------------------------------------------
\documentclass{article}
\usepackage{etex}
\usepackage{zref,zref-savepos,zref-user}

\begin{document}\makeatletter

\begin{itemize}
\item \zsavepos{HERE}HERE
\item Something \loggingall strange \\
\zsavepos{STRANGE}STRANGE \tracingnone
\item \leavevmode\zsavepos{EXPLAIN}EXPLAIN
\end{itemize}

HERE: \zposx{HERE}

STRANGE: \zposx{STRANGE}

EXPLAIN: \zposx{EXPLAIN}

\end{document}\endinput
% ---------------------------------------------

Thanks if you have a "solution" ;-)

Dan

unread,
Nov 26, 2010, 5:37:29 PM11/26/10
to
On Nov 26, 3:28 pm, GL <gouail...@gmail.com> wrote:
> Hello,
>
> I can't understand why \zsavepos (\pdfsavepos) doesn't return the
> same result.
>
> What's the effect of \leavevmode on the current position ?
> It's not visible in the pdf...
>
> % ---------------------------------------------
> \documentclass{article}
> \usepackage{etex}
> \usepackage{zref,zref-savepos,zref-user}
>
> \begin{document}\makeatletter
>
> \begin{itemize}
> \item \zsavepos{HERE}HERE

\item doesn't actually print anything, nor does it start a new line.
It saves
the box containing the bullet, and arranges for \everypar to print it
whenever
the next paragrapg starts, which is _after_ \zsavepos has marked the
current
position (which is then just above the coming new line and at the left
margin.

> \item Something \loggingall strange  \\
>        \zsavepos{STRANGE}STRANGE \tracingnone
> \item \leavevmode\zsavepos{EXPLAIN}EXPLAIN

Here, \leavevmode starts a new paragraph, causing the bullet to be
printed
and only after that is the position saved. Thus, it will align with
the one above
it, indented by the amount of the list indentation.


Dan

Heiko Oberdiek

unread,
Nov 26, 2010, 9:46:55 PM11/26/10
to
GL <goua...@gmail.com> wrote:

> I can't understand why \zsavepos (\pdfsavepos) doesn't return the
> same result.
>
> What's the effect of \leavevmode on the current position ?

> \begin{itemize}


> \item \zsavepos{HERE}HERE
> \item Something \loggingall strange \\
> \zsavepos{STRANGE}STRANGE \tracingnone
> \item \leavevmode\zsavepos{EXPLAIN}EXPLAIN
> \end{itemize}

\item does not set its bullet immediately. This is
deferred by \everypar.

--
Heiko Oberdiek

0 new messages