5

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?

  • 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
6

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
  • 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
  • @egreg, I don't really grasp what's going on, so I better ask. Would you say it's safe if I put a \printbibliography inside \metabox? (the idea is that it doesn't appear). – gusbrs Jan 13 '18 at 14:57
  • @gusbrs Why should you? biblatex doesn't rely on the bibliography being printed. Just comment \printbibliography out. – egreg Jan 13 '18 at 15:01
  • @egreg, perhaps I'm doing it the wrong way, but I'm trying to extract some processed data out of biber to handle it myself (more precisely, to get a full list of bibentries of a certain entrytype sorted according to a sorting scheme). And the way I found to do this is to use printbiblist and use a hook to add the entries to a list. But I just want the list, not the print. I don't want to drag you into this, but in case you are curious, be my guest to take a look at tex.stackexchange.com/a/409970/105447. This is done in the update to the answer. – gusbrs Jan 13 '18 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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