The following example does not compile. \rotatebox (graphics.sty)
seems not to be allowed in the preamble, due to pgf package.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,french]{article}
\usepackage[T1]{fontenc}
\usepackage{pgf,graphics}
\newsavebox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\setbox0=\hbox{\rotatebox{90}{Hello}}
\copy0 %% OK
\copy\mybox %% Fail
\end{document}\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-----------------------------------------------------------
> \box0=
\hbox(22.4945+0.0)x6.8872
.\hbox(22.4945+0.0)x6.8872
..\kern 6.8872
..\hbox(6.8872+0.0)x0.0
...\pdfsave
...\pdfsetmatrix{0 1 -1 0} <----------------------------
...\hbox(6.8872+0.0)x0.0
....\T1/cmr/m/n/10 H
....\T1/cmr/m/n/10 e
....\T1/cmr/m/n/10 l
....\T1/cmr/m/n/10 l
....\T1/cmr/m/n/10 o
...\pdfrestore
-----------------------------------------------------------
logbox: \mybox
> \box33=
\hbox(22.4945+0.0)x6.8872
.\hbox(22.4945+0.0)x6.8872
..\kern 6.8872
..\hbox(6.8872+0.0)x0.0
...\pdfsave
...\pdfsetmatrix{\cos(90) \sin(90) -\sin(90) \cos(90) } < ??????????
...\hbox(6.8872+0.0)x0.0
....\T1/cmr/m/n/10 H
....\T1/cmr/m/n/10 e
....\T1/cmr/m/n/10 l
....\T1/cmr/m/n/10 l
....\T1/cmr/m/n/10 o
...\pdfrestore
-----------------------------------------------------------
[snip]
> ...\pdfsetmatrix{\cos(90) \sin(90) -\sin(90) \cos(90) } < ??????????
This is the normal way to express transformations in PDF (with
trigonometric functions). And it obviously mean the same thing as "0 1
-1 0".
I guess the culprit is \newsavebox. Why do you use it for the first box
and not the second?
Paul
> Hello,
>
> The following example does not compile. \rotatebox (graphics.sty)
> seems not to be allowed in the preamble, due to pgf package.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass[a4paper,french]{article}
> \usepackage[T1]{fontenc}
> \usepackage{pgf,graphics}
>
> \newsavebox \mybox
> \setbox\mybox = \hbox{\rotatebox{90}{Hello}}
>
> \begin{document}
>
> \setbox0=\hbox{\rotatebox{90}{Hello}}
>
> \copy0 %% OK
>
> \copy\mybox %% Fail
>
> \end{document}\endinput
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hi
Why a problem with pgf ? you don't use pgf in the code and
\documentclass[a4paper,french]{article}
\usepackage[T1]{fontenc}
\usepackage{graphics,pgf}
\newsavebox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\setbox0=\hbox{\rotatebox{90}{Hello}}
\copy0 %% OK
\copy\mybox %% Fail
\end{document}\endinput
gives the same error
I don't know why but
\documentclass[a4paper]{article}
\usepackage{graphicx}
\newsavebox \mybox
\begin{document}
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\copy\mybox
\end{document}\endinput
is correct
but
\documentclass[a4paper]{article}
\usepackage{graphicx,pgf}
\newbox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\copy\mybox
\end{document}\endinput
fails
rotatebox is not allowed in the preamble and without pgf !
Alain
> Hello,
>
> The following example does not compile. \rotatebox (graphics.sty)
> seems not to be allowed in the preamble, due to pgf package.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass[a4paper,french]{article}
> \usepackage[T1]{fontenc}
> \usepackage{pgf,graphics}
>
> \newsavebox \mybox
> \setbox\mybox = \hbox{\rotatebox{90}{Hello}}
>
> \begin{document}
>
> \setbox0=\hbox{\rotatebox{90}{Hello}}
>
> \copy0 %% OK
>
> \copy\mybox %% Fail
>
> \end{document}\endinput
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hi
The first message was unclear
Why a problem with pgf ? you don't use pgf in the code and
\documentclass[a4paper,french]{article}
\usepackage[T1]{fontenc}
\usepackage{graphics,pgf}
\newsavebox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\setbox0=\hbox{\rotatebox{90}{Hello}}
\copy0 %% OK
\copy\mybox %% Fail
\end{document}\endinput
gives the same error
I don't know why but
\documentclass[a4paper]{article}
\usepackage{graphicx}
\newsavebox \mybox
\begin{document}
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\copy\mybox
\end{document}\endinput
is correct
but
\documentclass[a4paper]{article}
\usepackage{graphicx,pgf}
\newbox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\copy\mybox
>Hello,
>
>The following example does not compile. \rotatebox (graphics.sty)
>seems not to be allowed in the preamble, due to pgf package.
>
>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>\documentclass[a4paper,french]{article}
>\usepackage[T1]{fontenc}
>\usepackage{pgf,graphics}
>
>\newsavebox \mybox
> \setbox\mybox = \hbox{\rotatebox{90}{Hello}}
Much of pdftex support of graphics is loaded at
\begin{document}. Put this \setbox command after it.
(By the way, this is unrelated to pgf, fontenc,
A4paper, or the french option, so those don't belong
in a minimal example.)
>
>\begin{document}
>
> \setbox0=\hbox{\rotatebox{90}{Hello}}
>
> \copy0 %% OK
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}% put here
>
> \copy\mybox %% Fail
>
>\end{document}\endinput
Dan
To reply by email, change LookInSig to luecking
> The following example does not compile. \rotatebox (graphics.sty)
> seems not to be allowed in the preamble,
Yes.
> due to pgf package.
??? without pgf, pdlfatex produces the same error:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{graphics}
\newsavebox \mybox
\setbox\mybox = \hbox{\rotatebox{90}{Hello}}
\begin{document}
\setbox0=\hbox{\rotatebox{90}{Hello}}
\copy0 %% OK
\copy\mybox %% Fail
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>
Sorry but I gave the ouput of \showbox to show where the problem
came from... so i can't imagine it was "unclear" !
> Why a problem with pgf ? you don't use pgf in the code and
i use : \usepackage{pgf} this means that i use pgf in the code,
for pgf expands some commands even if i don't use one of them
explicitly.
But you're (almost) always right, and the culprit is not pgf,
but the "basic" graphics package (not graphicx) with pdftex.def
But trig.sty defines:
graphics (DPC) defines \sin(90)=\@ne (not expandable)
and pdftex.def turn it into \number\@ne = 1
But don't understand why pdftex.def does this \AtBeginDocument ??
If i remove \AtBeginDocument, this works fine... May be H. Oberdiek as
an answer, or a clue ;-)
Thanks.
> On Fri, 28 Jan 2011 21:39:19 +0100, GL <goua...@gmail.com> wrote:
>
> >Hello,
> >
> >The following example does not compile. \rotatebox (graphics.sty)
> >seems not to be allowed in the preamble, due to pgf package.
> >
> >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> >\documentclass[a4paper,french]{article}
> >\usepackage[T1]{fontenc}
> >\usepackage{pgf,graphics}
> >
> >\newsavebox \mybox
> > \setbox\mybox = \hbox{\rotatebox{90}{Hello}}
>
> Much of pdftex support of graphics is loaded at
> \begin{document}. Put this \setbox command after it.
The problem is trig.sty, some of the cos and sin values aren't
expandandable anymore. pdftex.def fixes this at \begin{document}:
| % undo the trig.sty `optimization' so that these 0 1 and -1 values
| % get written out as digits, not unexpandable TeX primitives.
| % 0.04q: space added to remain consistent with trig.sty.
| \AtBeginDocument{%
| \def\GPT@temp#1(#2)=#3 {%
| \expandafter\def\csname #1(#2)\endcsname{#3 }%
| }%
| \GPT@temp sin(0)=0 %
| \GPT@temp cos(0)=1 %
| \GPT@temp sin(90)=1 %
| \GPT@temp cos(90)=0 %
| \GPT@temp sin(-90)=-1 %
| \GPT@temp cos(-90)=0 %
| \GPT@temp sin(180)=0 %
| \GPT@temp cos(180)=-1 %
| % added in 0.04q
| \GPT@temp sin(270)=-1 %
| \GPT@temp cos(270)=0 %
| \GPT@temp sin(360)=0 %
| \GPT@temp cos(360)=1 %
| \GPT@temp sin(-180)=0 %
| \GPT@temp cos(-180)=-1 %
| \GPT@temp sin(-270)=1 %
| \GPT@temp cos(-270)=0 %
| \GPT@temp sin(-360)=0 %
| \GPT@temp cos(-360)=1 %
| }
In 0.05d I have improved the patching, update is on its way to CTAN.
With 0.05d load trig.sty before pdftex.def (e.g. graphics before
color) or use memoir, scrlfile or filehook.
--
Heiko Oberdiek
> But you're (almost) always right, and the culprit is not pgf,
> but the "basic" graphics package (not graphicx) with pdftex.def
>
> But trig.sty defines:
>
> graphics (DPC) defines \sin(90)=\@ne (not expandable)
> and pdftex.def turn it into \number\@ne = 1
>
> But don't understand why pdftex.def does this \AtBeginDocument ??
>
> If i remove \AtBeginDocument, this works fine... May be H. Oberdiek as
> an answer, or a clue ;-)
\usepackage{color}% then trig.sty isn't loaded.
See pdftex.def 0.05d (berlios, CTAN update is on its way).
--
Heiko Oberdiek
\newsavebox\mybox
\setbox\mybox=\hbox{\rotatebox{90}{Hello}}
\begin{document}
\copy\mybox
\end{document}\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Same error:
! pdfTeX error (\pdfsetmatrix): Unrecognized format..
<to be read again>
And listfiles says:
*File List*
minimal.cls 2001/05/25 Standard LaTeX minimal class
color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2010/11/26 v0.05c Graphics/color for pdfTeX
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC) <---------------
graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
supp-pdf.mkii
???????????????????????????? so what ?
Good night.
> Le 29/01/2011 01:06, Heiko Oberdiek a écrit :
> > GL<goua...@gmail.com> wrote:
> >
> >> But you're (almost) always right, and the culprit is not pgf,
> >> but the "basic" graphics package (not graphicx) with pdftex.def
> >>
> >> But trig.sty defines:
> >>
> >> graphics (DPC) defines \sin(90)=\@ne (not expandable)
> >> and pdftex.def turn it into \number\@ne = 1
> >>
> >> But don't understand why pdftex.def does this \AtBeginDocument ??
> >>
> >> If i remove \AtBeginDocument, this works fine... May be H. Oberdiek as
> >> an answer, or a clue ;-)
> >
> > \usepackage{color}% then trig.sty isn't loaded.
> >
> > See pdftex.def 0.05d (berlios, CTAN update is on its way).
> >
> What d'you mean ? i got the pdftex.def 0.05c
Version 0.05d with
> pdftex.def 2010/11/26 v0.05c Graphics/color for pdfTeX
date 2011/01/28 (!)
--
Heiko Oberdiek
Ok cheers ! No later than yesterday ;-)
BY the way, if you have a few minutes, what do'you think
of my (pure TeX) implementation of trimallspaces (cf my
post at 2:10 am in answer to 'A. Musing')
As long as the process only use \@tempa, it's possible
to removing the grouping, as a (last) optimisation...
Younrs sincerely.
> BY the way, if you have a few minutes, what do'you think
> of my (pure TeX) implementation of trimallspaces (cf my
> post at 2:10 am in answer to 'A. Musing')
No, discussion about methods was last year (also with Ahmed Musa).
I should rather work on the documentation.
--
Heiko Oberdiek
It's exactly the same method as the one proposed by A. Musa (with
\ifx instead of \pdfstrcmp) and implemented in trimspace.sty.
But I looked carefully at the method (the .log) and optimized it,
trimming the first space before the last one, in order not to
read the whole string argument twice, but only once...
Yours sincerely.