23

I'm writing an article with 2 columns. If my document is this:

\documentclass[10pt,a4paper, twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
left=2.00cm,
right=2.00cm,
top=2.00cm,
bottom=2.00cm
]{geometry}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

Is there a way tho know exactly the width of the column (see picture)? I need it for draw in others softwares using this lenght.

enter image description here

  • 3
    it is (\textwidth-\columnsep)/2 but just stick \showthe\columnwidth into your document and tex will show the value in the log – David Carlisle Jul 04 '17 at 18:22
  • @DavidCarlisle Sorry, What is "the log"? – Daniel Valencia C. Jul 04 '17 at 18:29
  • 1
    whenever you run tex on a file something.tex all messages are written to a file something.log in the same directory. most of the messages (including \showthe messages are also shown on the terminal directly. – David Carlisle Jul 04 '17 at 18:36
  • 2
    @DavidCarlisle Found it!!! The values are in pt units, there's a way to change it to cm? – Daniel Valencia C. Jul 04 '17 at 18:38
  • 2
    type the value into a calculator divide by 72.27 to get inches and then convert to whatever unit you want:-) – David Carlisle Jul 04 '17 at 18:44
  • For a conversion table see e.g. https://tex.stackexchange.com/q/8260/95544 – StefanH Jul 04 '17 at 20:37
  • If you use also columnsep=1cm then is (21-2-2-1)/2=8 cm. You can also test it in the PDF preview with \the\columnwidth (I am to lazy to search in the logs)... but why the hell you need to know if the column is 8.00 cm or 8.03 cm ? You can(must) always use a relative length as \columnwidth instead of absolute length as 8cm in images, tables, etc. Using relative lengths as far you can, guarantees that if you change the document layout, everything change accordingly (this does not happen if you manage lengths in cm). – Fran Jul 05 '17 at 06:54
  • @Fran I don't know about OP, but I wanted to find the IEEE template column width so that when I'm making figures on some drawing app I can have an idea of how much width I have available to use. I still use relative lengths, like you suggest, when putting it in a figure environment though. Using the multiple suggestions given here I managed to get the width with \the\columnwidth (252.0pt) and turn that into cm with the lengthconvert package with \Convert{\the\columnwidth} (8.85679 cm). – Daniel Jul 19 '23 at 19:25

1 Answers1

24

The column width is stored in the length \columnwidth. It's value can be turned into a text representation using \the\columnwidth. Either use this inside \message{...} to print it to the LaTeX compiler output and log file or directly in the text if you want. The value is in Points (pt) which are 1/72.27 of an inch. (Not that PDF and Postscript have points with 1/72 inches for simplify calculations. These are called "big points" (bp) in TeX.)

\documentclass[10pt,a4paper, twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
left=2.00cm,
right=2.00cm,
top=2.00cm,
bottom=2.00cm
]{geometry}
\usepackage{lipsum}
\begin{document}
\section{bla}
some text \message{The column width is: \the\columnwidth}
The column width is: \the\columnwidth
\lipsum
\lipsum
\end{document}

Which gives me: The column width is: 236.84843pt

Martin Scharrer
  • 262,582