# How to set vertical length of a column in a multicols environment avoid column breaking

The first column break in two parts. How can avoid it?

\documentclass[12pt]{article}
%Some packages I commonly use.
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{framed}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[top=1 in,bottom=1in, left=1 in, right=1 in]{geometry}

\usepackage{libertine}
\usepackage{multicol}

\begin{document}

\begin{multicols}{3}
POSCAR\\
fcc (100)\\
surface\\
3.53\\
.50000   .50000   .00000\\
-.50000   .50000   .00000\\
.00000   .00000  5.00000\\
5\\
Selective Dynamics\\
Kartesisch\\
.00000   .00000   .00000 F F F\\
.00000   .50000   .50000 F F F\\
.00000   .00000  1.00000 F F F\\
.00000   .50000  1.50000 T T T\\
.00000   .00000  2.00000 T T T\\

INCAR
ISTART = 0; ICHARG = 2\\
general:\\
SYSTEM = clean Ni(100) surface\\
ENCUT = 270 \\
ISMEAR = 2 ; SIGMA = 0.2\\
ALGO = Fast\\
EDIFF = 1E-6\\
spin:\\
ISPIN=2\\
MAGMOM = 5*1\\
dynamic:
NSW = 100\\
POTIM = 0.8
IBRION = 1

KPOINTS
k-points\\

0\ Monkhorst-Pack\ 9 9 1\ 0 0 0\

\end{multicols}
\end{document}


• I have some doubts that multicol is the right environment for whatever you are trying to achieve. – Ulrike Fischer Jun 20 '19 at 15:09
• which one should I use? – Andrea Angeletti Jun 20 '19 at 15:23
• the column breaking is the least of the problems, it is very hard to guess what output you want but presumably you don't want it to look like the image? For example aren't the sections like Kartesisch\\ .00000 .00000 .00000 F F F\\ .00000 .50000 .50000 F F F\\ .00000 .00000 1.00000 F F F\\ .00000 .50000 1.50000 T T T\\ .00000 .00000 2.00000 T T T\\  supposed to be lined up as a 6-column table, you are just setting them as word spaced lines with no alignment at all???? – David Carlisle Jun 20 '19 at 18:25

I would guess that the text is some kind of config file display? I set here as verbatim but force a column break using \columnbreak at a hopefully good place rather than latex just break the text at the half way point.

\documentclass[12pt]{article}
%Some packages I commonly use.
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{framed}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[top=1 in,bottom=1in, left=1 in, right=1 in]{geometry}

\usepackage{libertine}
\usepackage{multicol}

\begin{document}

\setlength\columnseprule{1pt}

\begin{multicols}{2}\small

\begin{verbatim}
POSCAR
fcc (100)
surface
3.53
.50000   .50000   .00000
-.50000   .50000   .00000
.00000   .00000  5.00000
5
Selective Dynamics
Kartesisch
.00000   .00000   .00000 F F F
.00000   .50000   .50000 F F F
.00000   .00000  1.00000 F F F
.00000   .50000  1.50000 T T T
.00000   .00000  2.00000 T T T
\end{verbatim}
\columnbreak
\begin{verbatim}
INCAR
ISTART = 0; ICHARG = 2
general:
SYSTEM = clean Ni(100) surface
ENCUT = 270
ISMEAR = 2 ; SIGMA = 0.2
ALGO = Fast
EDIFF = 1E-6
spin:
ISPIN=2
MAGMOM = 5*1
dynamic:
NSW = 100
POTIM = 0.8
IBRION = 1

KPOINTS
k-points

0 Monkhorst-Pack 9 9 1 0 0 0
\end{verbatim}

\end{multicols}
\end{document}