[texhax] Re: [pdftex] writing `#', `{', `}' into auxiliary file

Morten Høgholm morten.hoegholm at latex-project.org
Fri Apr 29 12:13:44 CEST 2005


On Fri, 29 Apr 2005 11:50:09 +0200, Alexander Grahn  
<A.Grahn at fz-rossendorf.de> wrote:

> One certainly has to persuade LaTeX to make use of \the\count1 instead
> of \thepage on writing the \newlabel's.

Try with this preamble:

\documentclass{book}
\usepackage{count1to}

\newcounter{lineno}
\makeatletter
\def\thecountone{\the\count1 }
\def\speciallabel#1{\@bsphack
   \protected at write\@auxout{\let\thecountone\relax}%
          {\string\newlabel{#1}{{}{\thecountone}}}%
   \@esphack}
\def\p{%
   This is physical page: \pageref{line\thelineno}.%
   \speciallabel{line\thelineno}%
   \stepcounter{lineno}%
   \par
}%
\makeatother
\parindent=0pt

-- 
Morten



More information about the texhax mailing list