2

In a two-column XeLaTeX setting, I'm trying to get a framebox to completely take up the full height of one of the two columns in order to display some contents independent of the actual document (think advertisement or impress, etc.). So, the actual document would flow around that box.

But I would like it so that I can declare (in the preamble) the page number where this box is supposed to appear, and the column should always be the outer column, i.e., the first column on a left page and the second column a right page. Likewise, the contents of the box should be declared in the preamble.

From a previous question, I know of techniques to address the issue of targeting a specific page, but I'm scratching my head over the following issue:

How to make a framebox with fixed contents that starts at the top of the outer column and stretches all the way to the bottom, all within sth. like \AtBeginShipout?

Basically, this is the result I'm after but my knowledge of LaTeX is too limited.

target layout with pre-defined contents on page 43

To make things worse, I'm stuck on a legacy system with an old version of XeLaTeX (XeTeX 3.141592-0.996-patch1 (Web2C 7.5.6)). On the upside, I know that the actual document will contain no figures or tables.

Thomas
  • 253
  • 1
  • 8
  • "specific page" specified by number or by the content that appears in the text column? (in the former case you know in advance which column is the outer edge) – David Carlisle Aug 19 '21 at 23:30
  • By page number. – Thomas Aug 20 '21 at 06:17
  • @DavidCarlisle Is it even possible? – Thomas Aug 20 '21 at 13:56
  • oh sure everything's possible you may be able to do it out of the box with xor (which had a force float on to page n feature at one time but im not sure if it does still) or I may hav ean answer on this site doing something similar with the standard latex output routine, I'll look later – David Carlisle Aug 20 '21 at 13:58
  • @DavidCarlisle Thank you so much! In the mean time, I will check out xor. – Thomas Aug 20 '21 at 15:07
  • 1
    See https://tex.stackexchange.com/questions/506766/pin-figure-to-page-and-column-in-a-2-column-document. You can put a framed minipage filling the column. Note \fboxrule and \fboxsep. You can also use a tikz node. – John Kormylo Aug 20 '21 at 15:46
  • @JohnKormylo Great, that is a very helpful resource. – Thomas Aug 20 '21 at 18:50

1 Answers1

3

this puts the float on the outer edge of page 5.

The trick is to use [p] so latex doesn't add it to a text column, then adjust the routine that adds floats to float columns to always fail until you get to the second column of page 5.

enter image description here

\documentclass[twocolumn]{article}
\usepackage[latin]{babel}
\usepackage{lipsum}
\makeatletter
\let\zz@tryfcolumn\@tryfcolumn

\def@tryfcolumn{% \global @fcolmadefalse \ifnum\c@page<5 \expandafter@gobble \else \if@firstcolumn \expandafter\expandafter\expandafter@gobble \else \expandafter\expandafter\expandafter\zz@tryfcolumn \fi \fi} \makeatother \begin{document} \begin{figure}[p] \centering \rule{3cm}{.8\textheight} \end{figure} \lipsum\lipsum\lipsum \lipsum\lipsum\lipsum \end{document}

David Carlisle
  • 757,742