How can we detect what the current column is, in a two-column document? The simplest approach I can think of is to compare the current horizontal coordinate to half of the \textwidth, and if less then we are in the first column, otherwise in the second column (assuming columns of equal width). The solutions for finding coordinates that seem to have been proposed are using tikz, and in my case tikz cannot be used.

A neighboring question is how to detect that a column break occurred within an environment, which is what I am aiming at (by knowing the current column number, I can record the current column in the preamble and postamble of the environment, and then compare, as done for pages).

A relevant question is this, though specifically when using the multicol package.

  • Any reason why you would not use the multicol package? – Michael Palmer Jul 11 '17 at 1:54
  • 2
    you could use \pdfsavepos to implement what you propose but note that those values are only available on the next run of latex (the same is true of tikz/tikzmark which is a wrapper around the same primitive) – David Carlisle Jul 11 '17 at 6:54
  • Thanks for the suggestion, @DavidCarlisle, I will experiment with \pdfsavepos. @Michael Palmer, I am using a IEEE document class that already implements a two-column format, so avoiding modifications to the class is preferred. – Ioannis Filippidis Jul 11 '17 at 19:08

Your Answer

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

Browse other questions tagged or ask your own question.