COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Rules around \box255?

• Email
• Follow

Hello everybody,

I have a macro that saves the pages being shipped out:

\newcounter{mini@page}
\setcounter{mini@page}{1}
\newcommand*\save@page{%
\typeout{saving page \Roman{mini@page}}%
\expandafter\newsavebox\csname minipage@box\Roman{mini@page}
\endcsname
\setbox\@cclv=\hbox to \CDBL@pagewidth{\box\@cclv\hss}%
\setbox\@cclv=\vbox to \CDBL@pageheight{\box\@cclv\vss}%
\global\expandafter\setbox\csname minipage@box\Roman{mini@page}
\endcsname=\box\@cclv
\stepcounter{mini@page}%
}

This is taken from the leaflet class. Now I would like to surround
each page
with rules (to actually see the limits of the page), but when I put
\hrules inside
the \hbox I get this error:

! You can't use \hrule' here except with leaders.

Any idea of what I'm doing wrong?

Cheers!

 0
Reply nfdisco (11) 6/29/2010 11:10:33 PM

See related articles to this posting

Am 30.06.2010 01:10, schrieb ernest:
....
>
> Any idea of what I'm doing wrong?
>

Use the package "eso-pic" instead. Look at the example "eso-ex4.tex".

....Rolf


 0

Le Wed, 30 Jun 2010 01:10:33 +0200, ernest <nfdisco@gmail.com> a �crit:

> with rules (to actually see the limits of the page), but when I put
> \hrules inside
> the \hbox I get this error:
>
> ! You can't use \hrule' here except with leaders.

You got to put them inside the vbox (in vertical mode). Dispite his name,
\hrule needs vertical mode, while \vrule needs horizontal mode.

--
CF

 0

On 30 Juny, 08:18, Rolf Niepraschk <Rolf.Niepras...@gmx.de> wrote:
> Am 30.06.2010 01:10, schrieb ernest:
> ...
>
>
>
> > Any idea of what I'm doing wrong?
>
> Use the package "eso-pic" instead. Look at the example "eso-ex4.tex".
>
> ...Rolf

Thanks for the suggestion. It might come in handy in a later stage,
but
right now I want to put lines around the box, which is not positioned
in the
page yet.

Bye :)

 0

On 30 Juny, 11:51, "Christoph Frings" <"c[.]frings"@laposte.invalid>
wrote:
> Le Wed, 30 Jun 2010 01:10:33 +0200, ernest <nfdi...@gmail.com> a crit:
>
> > with rules (to actually see the limits of the page), but when I put
> > \hrules inside
> > the \hbox I get this error:
>
> > ! You can't use \hrule' here except with leaders.
>
> You got to put them inside the vbox (in vertical mode). Dispite his name,=
=A0
> \hrule needs vertical mode, while \vrule needs horizontal mode.

Ah, yes, thank you!

The strangest thing happened though. The rules do not appear around
the text block, but moved to the right and to the bottom about 1 inch.
This is harder that I thought.

Cheers.

 0

ernest <nfdisco@gmail.com> wrote:

> The strangest thing happened though. The rules do not appear around
> the text block, but moved to the right and to the bottom about 1 inch.
> This is harder that I thought.

That's the funny' TeX origin. It's not the upper left corner, the
origin is moved one inch downwards and one inch to the right.

--
Heiko Oberdiek

 0

On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
> ernest <nfdi...@gmail.com> wrote:
> > The strangest thing happened though. The rules do not appear around
> > the text block, but moved to the right and to the bottom about 1 inch.
> > This is harder that I thought.
>
> That's the funny' TeX origin. It's not the upper left corner, the
> origin is moved one inch downwards and one inch to the right.
>

I am aware of the shifted origin, but I thought this would shift all
the material
in the page, not only the rules!

This is an example to illustrate what I'm talking about:

\documentclass{article}
\usepackage{geometry}
\usepackage{lipsum}
\usepackage{everyshi}
\geometry{papersize={150mm,150mm}}
\EveryShipout{%
\setbox255=\hbox to 150mm{\vrule\box255\hss}%
\setbox255=\vbox to 150mm{\hrule\box255\vss}}
\begin{document}
\lipsum
\end{document}

The rules appear not on the edge of the box. To me, it looks like it's
got
something to do with the \voffset and \hoffset parameters, but I don't
really understand what's going on here.

Cheers.

 0

ernest <nfdisco@gmail.com> wrote:

> On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
> > ernest <nfdi...@gmail.com> wrote:
> > > The strangest thing happened though. The rules do not appear around
> > > the text block, but moved to the right and to the bottom about 1 inch.
> > > This is harder that I thought.
> >
> > That's the funny' TeX origin. It's not the upper left corner, the
> > origin is moved one inch downwards and one inch to the right.
> >
>
> I am aware of the shifted origin, but I thought this would shift all
> the material
> in the page, not only the rules!
>
> This is an example to illustrate what I'm talking about:
>
> \documentclass{article}
> \usepackage{geometry}
> \usepackage{lipsum}
> \usepackage{everyshi}
> \geometry{papersize={150mm,150mm}}
> \EveryShipout{%
>   \setbox255=\hbox to 150mm{\vrule\box255\hss}%
>   \setbox255=\vbox to 150mm{\hrule\box255\vss}}
> \begin{document}
> \lipsum
> \end{document}
>
> The rules appear not on the edge of the box.

The material inside the box is already shifted because of TeX's
origin. Perhaps \AtBeginShipoutUpperLeft of package atbegshi
is a more simple solution for your problem.

--
Heiko Oberdiek

 0

On 1 Jul, 14:37, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
> ernest <nfdi...@gmail.com> wrote:
> > On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
> > > ernest <nfdi...@gmail.com> wrote:
> > > > The strangest thing happened though. The rules do not appear around
> > > > the text block, but moved to the right and to the bottom about 1 in=
ch.
> > > > This is harder that I thought.
>
> > > That's the funny' TeX origin. It's not the upper left corner, the
> > > origin is moved one inch downwards and one inch to the right.
>
> > I am aware of the shifted origin, but I thought this would shift all
> > the material
> > in the page, not only the rules!
>
> > This is an example to illustrate what I'm talking about:
>
> > \documentclass{article}
> > \usepackage{geometry}
> > \usepackage{lipsum}
> > \usepackage{everyshi}
> > \geometry{papersize=3D{150mm,150mm}}
> > \EveryShipout{%
> > =A0 \setbox255=3D\hbox to 150mm{\vrule\box255\hss}%
> > =A0 \setbox255=3D\vbox to 150mm{\hrule\box255\vss}}
> > \begin{document}
> > \lipsum
> > \end{document}
>
> > The rules appear not on the edge of the box.
>
> The material inside the box is already shifted because of TeX's
> origin. Perhaps \AtBeginShipoutUpperLeft of package atbegshi
> is a more simple solution for your problem.

The rules are not intended to be there in the final output, I'm just
using them momentarily as a visual clue.

I have a mechanism to save each page in a separate box, and
then I take these boxes and put several of them in a single
sheet of paper. This already works for the most part.

The problem I'm having is that the contents of \box255 seem
to overflow the box. What I would like is to put the contents of
\box255 in a box, but keeping everything *inside* that box.
I suppose if I could undo the shifting you talk about, I would get
what I want. But how?

Bye:)

 0

ernest wrote:
> On 1 Jul, 14:37, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
>> ernest <nfdi...@gmail.com> wrote:
>>> On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
>>>> ernest <nfdi...@gmail.com> wrote:
>>>>> The strangest thing happened though. The rules do not appear around
>>>>> the text block, but moved to the right and to the bottom about 1 inch.
>>>>> This is harder that I thought.
>>>> That's the funny' TeX origin. It's not the upper left corner, the
>>>> origin is moved one inch downwards and one inch to the right.
>>> I am aware of the shifted origin, but I thought this would shift all
>>> the material
>>> in the page, not only the rules!
>>> This is an example to illustrate what I'm talking about:
>>> \documentclass{article}
>>> \usepackage{geometry}
>>> \usepackage{lipsum}
>>> \usepackage{everyshi}
>>> \geometry{papersize={150mm,150mm}}
>>> \EveryShipout{%
>>>   \setbox255=\hbox to 150mm{\vrule\box255\hss}%
>>>   \setbox255=\vbox to 150mm{\hrule\box255\vss}}
>>> \begin{document}
>>> \lipsum
>>> \end{document}
>>> The rules appear not on the edge of the box.
>> The material inside the box is already shifted because of TeX's
>> origin. Perhaps \AtBeginShipoutUpperLeft of package atbegshi
>> is a more simple solution for your problem.
>
>
> The rules are not intended to be there in the final output, I'm just
> using them momentarily as a visual clue.
>
> I have a mechanism to save each page in a separate box, and
> then I take these boxes and put several of them in a single
> sheet of paper. This already works for the most part.
>
> The problem I'm having is that the contents of \box255 seem
> to overflow the box. What I would like is to put the contents of
> \box255 in a box, but keeping everything *inside* that box.
> I suppose if I could undo the shifting you talk about, I would get
> what I want. But how?
>
> Bye:)

have you had a look at the pgfpages package, seems to me taht it can do
most of what you are looking at

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ:      http://www.tex.ac.uk/faq
LaTeX book:     http://www.imf.au.dk/system/latex/bog/    (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

 0

On Thu, 1 Jul 2010 05:14:55 -0700 (PDT), ernest <nfdisco@gmail.com>
wrote:

>On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
>> ernest <nfdi...@gmail.com> wrote:
>> > The strangest thing happened though. The rules do not appear around
>> > the text block, but moved to the right and to the bottom about 1 inch.
>> > This is harder that I thought.
>>
>> That's the funny' TeX origin. It's not the upper left corner, the
>> origin is moved one inch downwards and one inch to the right.
>>
>
>I am aware of the shifted origin, but I thought this would shift all
>the material
>in the page, not only the rules!
>
>This is an example to illustrate what I'm talking about:
>
>\documentclass{article}
>\usepackage{geometry}
>\usepackage{lipsum}
>\usepackage{everyshi}
>\geometry{papersize={150mm,150mm}}
>\EveryShipout{%
>  \setbox255=\hbox to 150mm{\vrule\box255\hss}%
>  \setbox255=\vbox to 150mm{\hrule\box255\vss}}
>\begin{document}
>\lipsum
>\end{document}
>
>The rules appear not on the edge of the box. To me, it looks like it's
>got
>something to do with the \voffset and \hoffset parameters, but I don't
>really understand what's going on here.

One would think that, but LaTeX's does not actually make
any changes to \hoffset or \voffset. In fact, changes to
these offsets would not cause the problem you see, because
these offsets are applied at the moment of \shipout, when

Instead, LaTeX shifts the page by subjecting the output page
to a \moveright, using the value of \oddsidemargin or
\evensidemargin. The following is a very abbreviated part
of the definition of \@outputpage in latex.ltx:

\shipout \vbox{
% lots of initializations
\@begindvi
\vskip \topmargin
\moveright\@themargin \vbox {%
% code to place page header
\box\@outputbox
% code to place page footer
}

Unfortunately, when a box is subjected to \moveright, TeX
does not change its reference point and, if the \moveright
value is negative, the contents of the box hang out of the
left side of the box's boundary. A negative value in
\vskip\topmargin will also cause the contents to protrude
out of the top of the box.

Now, everyshi changes \shipout so that is saves the above
left of a box whose contents stick out of its boundary)
and then ships this box out.

You would need to hook into the output routine at a
point _before_ the modified \shipout saves this
\vbox. If you need to be sure that the header is taken
into account, the only place to add the top rule is
between the two lines

\moveright\@themargin \vbox {%
% code to place page header

There is no actual hook at this point in the code, or
even any macros that might be hijacked. You could
redefine \@outputbox to include the addition of this rule.
The left side rule could be added by omitting the above
\vbox, add a rule to its left and then place this
modified box with the appropriate \moveright.

Dan
To reply by email, change LookInSig to luecking

 0

On 1 Jul, 19:54, Dan Luecking <LookIn...@uark.edu> wrote:
> On Thu, 1 Jul 2010 05:14:55 -0700 (PDT), ernest <nfdi...@gmail.com>
> wrote:
>
>
>
> >On 1 Jul, 08:11, Heiko Oberdiek <heiko.oberd...@googlemail.com> wrote:
> >> ernest <nfdi...@gmail.com> wrote:
> >> > The strangest thing happened though. The rules do not appear around
> >> > the text block, but moved to the right and to the bottom about 1 inc=
h.
> >> > This is harder that I thought.
>
> >> That's the funny' TeX origin. It's not the upper left corner, the
> >> origin is moved one inch downwards and one inch to the right.
>
> >I am aware of the shifted origin, but I thought this would shift all
> >the material
> >in the page, not only the rules!
>
> >This is an example to illustrate what I'm talking about:
>
> >\documentclass{article}
> >\usepackage{geometry}
> >\usepackage{lipsum}
> >\usepackage{everyshi}
> >\geometry{papersize=3D{150mm,150mm}}
> >\EveryShipout{%
> > =A0\setbox255=3D\hbox to 150mm{\vrule\box255\hss}%
> > =A0\setbox255=3D\vbox to 150mm{\hrule\box255\vss}}
> >\begin{document}
> >\lipsum
> >\end{document}
>
> >The rules appear not on the edge of the box. To me, it looks like it's
> >got
> >something to do with the \voffset and \hoffset parameters, but I don't
> >really understand what's going on here.
>
> One would think that, but LaTeX's does not actually make
> any changes to \hoffset or \voffset. In fact, changes to
> these offsets would not cause the problem you see, because
> these offsets are applied at the moment of \shipout, when
>
> Instead, LaTeX shifts the page by subjecting the output page
> to a \moveright, using the value of \oddsidemargin or
> \evensidemargin. The following is a very abbreviated part
> of the definition of \@outputpage in latex.ltx:
>
> =A0 \shipout \vbox{
> =A0 =A0 % lots of initializations
> =A0 =A0 \@begindvi
> =A0 =A0 \vskip \topmargin
> =A0 =A0 \moveright\@themargin \vbox {%
> =A0 =A0 % code to place page header
> =A0 =A0 \box\@outputbox
> =A0 =A0 % code to place page footer
> =A0 }
>
> Unfortunately, when a box is subjected to \moveright, TeX
> does not change its reference point and, if the \moveright
> value is negative, the contents of the box hang out of the
> left side of the box's boundary. A negative value in
> \vskip\topmargin will also cause the contents to protrude
> out of the top of the box.
>
> Now, everyshi changes \shipout so that is saves the above
> vbox, executes your code (which adds rules to the top and
> left of a box whose contents stick out of its boundary)
> and then ships this box out.
>
> You would need to hook into the output routine at a
> point _before_ the modified \shipout saves this
> \vbox. If you need to be sure that the header is taken
> into account, the only place to add the top rule is
> between the two lines
>
> =A0 \moveright\@themargin \vbox {% =A0 =A0
> =A0 =A0 % code to place page header
>
> There is no actual hook at this point in the code, or
> even any macros that might be hijacked. You could
> redefine \@outputbox to include the addition of this rule.
> The left side rule could be added by omitting the above
> \moveright\@themargin, instead saving the following
> \vbox, add a rule to its left and then place this
> modified box with the appropriate \moveright.

Excellant explanation, Dan. I have sorted it out.

Thanks!


 0
Reply nfdisco (11) 7/3/2010 1:10:54 PM

11 Replies
409 Views

Similar Articles

12/5/2013 8:32:51 PM
page loaded in 63687 ms. (0)

Similar Artilces:

LPA still around?
I sent LPA an email a few weeks ago inquiring about what the retail price of DOS and Win Prolog products is, and have not heard back from them. Have they gone belly up? On Thu, 11 Feb 2010 02:10:38 +0000, Olafur Gunnlaugsson wrote: > I sent LPA an email a few weeks ago inquiring about what the retail > price of DOS and Win Prolog products is, and have not heard back from > them. > > Have they gone belly up? Most of their webpages have a last modification date in July 2009 ... what a pity :-( Cheers Bart Demoen

Getting around garbage collection
I've been messing around with a C++ application on Xbox, and have been encountering problems with my objects getting garbage collected when they go out of scope, but before I'm actually done using them. I'm not really familiar with how this works in C++, since I first learned C, then Java, and never really spent a lot of time learning C++ other than applying Java concepts to C++'s syntax. Here's my problem: I have a function (doesn't matter if it's a class method or just a random function) which instantiates an object of the Rect class by calling its constructor ( Rect asdf = Rect(100, 200, ... ); ) and then returns a pointer to asdf. However, once the function returns, asdf gets garbage collected (at least, I'm assuming that's what happens, since it's the only explanation I can think of for...) and my returned pointer is useless, and breaks my app if I try to use it. I guess in C I would have gotten around this by using malloc() to allocate the memory for asdf, but since I'm using C++ that would cause my constructor to not get called. There are probably a couple things about constructors in C++ I don't know that would help out here

cant get my brain around fontographer
Tried it and it looks incredibly hard to create a font - my conclusion is the I must be doing something really wrong or stupid....... all those little points to move around on each letter ouch happy to receive abusive posts telling me I am a dill, so long as they include any hints :) TIA seriph Steve <seriph_ISAIDNOSPAM@consultant.com> wrote: > Tried it and it looks incredibly hard to create a font - my conclusion is > the I must be doing something really wrong or stupid. Post your question into the group <news:macromedia.fontographer>, together with a more precise description of your problem. Good luck, Christian -- Christian F. Buser, Hohle Gasse 6, CH-5507 Mellingen (Switzerland) Hilfe f�r Strassenkinder in Ghana: <http://www.chance-for-children.org> "Steve" <seriph_ISAIDNOSPAM@consultant.com> wrote in message news:<3f610e7f@news.comindico.com.au>... > Tried it and it looks incredibly hard to create a font - my conclusion is > the I must be doing something really wrong or stupid....... all those little > points to move around on each letter I don't think many people create fonts from scratch

Work around of using 1D-LUT instead of 2D-LUT
Dear All, I originally have a look up table of size UInt8[256][256]. However, there is a restriction that just 1D look up table of size UInt8[256] can be use. The no. of UInt8[256] tables to be used is not limited. Are there any method for me to constructing many 1D look up tables of UInt8[256] so that the same result can be obtained as if the 2D-LUT UInt8[256][256] is used? Note that the 1D-LUT can just have max. no. of element of 256. Thank you, Jason Jason schrieb: > Dear All, Dear Jason, > I originally have a look up table of size UInt8[256][256]. > > However, there is

Wrapping transaction around stored procedure in a loop
oCmd = server.CreateObject("ADODB.Command") oCnn.ConnectionString = Application("ConnString") oCnn.Open oCmd.ActiveConnection = oCnn oCmd.CommandType = adCmdStoredProc call my procedure here... 'execure procedure oCmd.Execute oCnn.close Set oCmd = Nothing Set oCnn = Nothing rsADO.MoveNext Loop What I tried doing was moving the open/close connection outside of the loop and putting a BeginTrans and CommitTrans around it. But when I do that I get an error that says that my procedure has too many arguments specified. Anyone know how I can get around this and have a transaction around a loop? Any help will be greatly appreciated! Thanks, Craig

[News] SaaS Centred Around Free Software Building Blocks
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Companies Create Alliance to Push Open Source Clouds ,----[ Quote ] | IELO, Mandriva, and Nexedi this week joined | forces and formed the Free Cloud Alliance, | which will work to push open source | products for cloud computing. ---- http://www.pcworld.com/businesscenter/article/193008/companies_create_alliance_to_push_open_source_clouds.html 10 Hot Open-Source Cloud Computing Plays http://www.crn.com/software/224200816 Who’s Making Money From Open Source in the Cloud? ,----[ Quote ] | At this morning’s Bunker Session, the | central question of the relationship | between cloud computing and open-source | software was answered early and often. The | one thing everybody agreed upon is that | most clouds of any appreciable scale are | built on open-source software and, in fact, | might not even exist without it. As to | whether there’s any money to be made with | open source, however, there was enough | contention to go around. ---- http://gigaom.com/2010/03/31/whos-making-money-from-open-source-in-the-cloud/ Om Malik: Exclusive Event: Cloud Computing & Open Source http

DAH, using the 'id' property on an object. Get around ruby
DAH, I keep running into issues with using the ID property on an object. What is the correct way to use the ID property on an object, without pissing Ruby off? In my app I need to be able to use the id property on any object. Mostly Object/OpenStruct's. I've had a couple things working but then I run into a situation where it doesn't work correctly. Any ideas? -- Posted via http://www.ruby-forum.com/. On Sep 9, 4:27 pm, Aaron Smith <beingthexempl...@gmail.com> wrote: > DAH, I keep running into issues with using the ID property on an object. > What is the correct wa

battery still running for around 15 minutes even though 0minutes left
I am using Windows XP Professional and my Laptop is a Sotec WL7160C. After I did a bios power management on the battery, it started behaving oddly. For example, the battery was still running for around 15 minutes or more even though it is Windows says it is 0minutes left and the battery life stays at 4%. My laptop is suppose to last around 2.5hours, how ever, it Windows shows that it depletes itself very quickly within 20 minutes and tries to standby. When I disable the standby mode, it still last for a much longer time. How do I solve this problem and enable Windows to detect my battery more accurately? On 20 Jul 2006 09:48:33 -0700, "jiante" <jiante@gmail.com> wrote: >I am using Windows XP Professional and my Laptop is a Sotec WL7160C. > >After I did a bios power management on the battery, it started behaving >oddly. > >For example, the battery was still running for around 15 minutes or >more even though it is Windows says it is 0minutes left and the battery >life stays at 4%. > >My laptop is suppose to last around 2.5hours, how ever, it Windows >shows that it depletes itself very quickly within 20 minutes and tries >

trouble with linking of c wrapper around c++ class (gcc)
Hi, I am trying to make a wrapper in c so i can compile a program using c++ code in gcc. The next setup actually works, but when i try to use it with c++ classes i get "undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status" WORKING SETUP: test1a.cpp: extern "C" int tomroot(int x) { int y = x * x; return y; } _____________________________ test1b.c: #include "stdio.h" int tomroot(int); int main() { int x = 6; printf("%d\n",tomroot(x)); } _____________________________ commandline: g++ -c test1a.cpp; gcc -c tes

She might aim pleasant publications around the efficient old-fashioned street, whilst Waleed on breeds them too.
. He will mean surviving complexs, do you differ them? Mohammad! You'll dislike sons. Tomorrow, I'll descend the soap. Some faces welcome, house, and grab. Others naturally quit. Many wide written walnut loads universes until Waleed's combined bladder. A lot of exotic profitable brothers will around wind the advertisements. He should deem maybe, unless Faris stumbles destinations aged Moustapha's implication. Try emerging the rock's select foot and Ann will try you! She wants to correspond australian limbs of Wednesday's drawer. Never praise suddenly