Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm placing a PDF meta information in a \vbox in a plain XeTeX document, and I would like it to behave as if there were no box at all (so any additional \vskip after the \vbox will appear). Right now, I'm using the following:

\nointerlineskip\vbox to 0pt { … }\nointerlineskip

I've tried \nointerlineskip{\offinterlineskip\vbox …} as well, but that left a gap afterwards, even when there was no skip meant to be.

How can I make this vertical box seamless in every context?

share|improve this question
    
I did not thought to tag this question as "xetex" nor "pdf", since I though, that the question itself does not have to do anything with XeTeX nor PDF, (which is make a vertical box seamless,) beside that I described the full scenario, as in I'm using XeTeX, and do this with a PDF meta info, a \special command, to be precise. –  Adam L. S. Jul 5 '11 at 8:28
    
Can't you put the pdf information in the header or the footer? Or use e.g. atbegshi (it supports plain tex)? –  Ulrike Fischer Jul 5 '11 at 9:28
    
I'm using a PDF annotation, so no. –  Adam L. S. Jul 8 '11 at 23:18
add comment

1 Answer 1

up vote 4 down vote accepted

I'd say that the correct procedure is

\edef\theprevdepth{\the\prevdepth}\nointerlineskip
\vbox to 0pt{...}\prevdepth=\theprevdepth

Example

\def\metabox#1{\edef\theprevdepth{\the\prevdepth}\nointerlineskip
  \vbox to0pt{#1\vss}\prevdepth=\theprevdepth}

\leavevmode\vbox{\hsize=.3\hsize
  some text some text some text some text 
  some text some text some text some text 

  \metabox{META INFO}

  some text some text some text some text 
  some text some text some text some text }%
\quad
\vbox{\hsize=.3\hsize
  some text some text some text some text
  some text some text some text some text

  some text some text some text some text
  some text some text some text some text }

\vskip2cm

\hrule

\leavevmode\vbox{\hsize=.3\hsize
  \metabox{META INFO}

  some text some text some text some text 
  some text some text some text some text }%
\quad
\vbox{\hsize=.3\hsize
  some text some text some text some text
  some text some text some text some text }

\vskip1cm
\hrule
\leavevmode\vbox{\hsize=.3\hsize
  some text some text some text some text
  some text some text some text some text }

\bye
share|improve this answer
    
Could a \vadjust be used, too? –  morbusg Jan 14 '12 at 9:53
    
@morbusg I'd say no: \vadjust has to be issued in horizontal mode. –  egreg Jan 14 '12 at 10:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.