Tag Info

Hot answers tagged

24

I would use alignat*, instead of array, since it's designed to handle spacing around operators like + and =. That would lead to lots of code ugly code which would look like x &-{}& 2y &-{}& 4z && &={}& 1 (where the && skips a column), which is what makes all of the existing solutions look ugly, too. But we can get ...


22

It's possible to trick supertabular to work inside a multicols environment by redefining \newpage to be \columnbreak in the first column and \newpage in the second. I also needed to stick a height 0, width \linewidth rule at the bottom of the first column. Strange things happen without it. \documentclass{article} \usepackage[margin=1in]{geometry} ...


21

This is a mixture of very unsuitable input ;-) and a deficiency of multicol. Multicol was originally designed for text balancing and the algorithm makes some assumptions based on this. One of the assumption is that the galley material to cut the columns from has a suitable number of breakpoints to allow for this and inparticular to allow for balancing. Now ...


19

Use the starred variant of the multicols environment: \documentclass{article} \usepackage{multicol}% http://ctan.org/pkg/multicol \usepackage{lipsum}% http://ctan.org/pkg/lipsum \usepackage[scale=0.9]{geometry}% http://ctan.org/pkg/geometry \begin{document} \begin{multicols*}{2} \lipsum[1-6] \end{multicols*} \end{document}


17

Put \vfill after the last line to break. And then put \columnbreak after \vfill. \documentclass{article} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{lipsum,multicol} \usepackage[colorlinks]{hyperref} \title{Introduction to \LaTeX} \author{xport} \begin{document} \begin{multicols}{2} \maketitle %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section*{Abstract} ...


16

As mentioned by Ulrike and Werner the way to stop multicols from balancing is to use the multicols* environment instead. But from the form of your question and your MWE I wonder if a simpler answer may not be: do not use multicols at all. After all \documentclass[twocolumn]{article} or \twocolumn[Some single column material] ... will also get you two ...


16

The multicol environment is not designed to support column floats. The concept of balancing makes this next to impossible to automatically provide correct results in the general case and therefore I decided not to extend multicolin this direction for 2e. For example, with multicol you can change the number of columns mid-page, how should that reflect on ...


14

\documentclass[a5paper]{article} \usepackage{multicol,caption} \usepackage[demo]{graphicx} \usepackage{lipsum} \newenvironment{Figure} {\par\medskip\noindent\minipage{\linewidth}} {\endminipage\par\medskip} \begin{document} \begin{multicols}{2} \lipsum[1] \begin{Figure} \centering \includegraphics[width=\linewidth]{foo} \captionof{figure}{my caption ...


14

A simple solution would look somewhat like this: \documentclass{book} \usepackage{multicol} \makeatletter \def\closeopenmulticols{% % test if current env is "multicols" if so close it \def\@tempa{multicols}% \ifx\@tempa\@currenvir \end{multicols}% \fi } \makeatother \newcommand\Mychapter[1]{% \closeopenmulticols % start new multicols with ...


12

An option would be to use the ltxgrid package, developed by Arthur Ogawa as part of the revtex distribution that is used to typeset papers for the American Physics Society (aps.org) journals. The ltxgrid package was commissioned by the American Physical Society and is distributed under the terms of the LaTeX Project Public License, the same license under ...


12

The nesting of enumeration environments and multicolumn layouts is always problematic. Besides the code becomes messy quickly and will be difficult to use. The user commands should be able to run as: \begin{...}[] \question{} \option{} \option{} \question{} \option{} \option{} \end{...} And give you this: Here is the MWE code: ...


11

The multicol manual (Section 2 - The User Interface, p. 2ff) offers a very simple solution. \documentclass[11pt,a4paper,english]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage{multicol} \usepackage{blindtext} \begin{document} \begin{multicols}{2}[\section{A Section title}] \blindtext \end{multicols} ...


11

multicol package provides multicols environment. % \usepackage{multicol} \begin{multicols}{2} \begin{itemize} \item Lorem \item Ipsum \item Dolor \item Sit \item Amet \end{itemize} \end{multicols} You may want to add a \item[] at the end to obtain better spacing.


11

As Andrew remarked in his answer a solution for multicols is rather more complicated as the "current" column is not at all known while doing the typesetting. So a rather complicated approach with multiple typesetting runs (using the .aux file) is needed. Below is a first draft of a solution providing \docolaction{left}{middle}{right} for executing ...


10

If you're trying to put three equations on a line, then multicol isn't necessary. For example, \begin{align*} a&=b &a&=b &a&=b \end{align*} produces output that looks like what you want from your MWE, and works for multiple lines of equations like usual for align. If that doesn't answer your question, then the problem was ...


10

Here is a short solution: \documentclass{book} \usepackage{lipsum} \usepackage{multicol,etoolbox} \newenvironment{Chapter}[2][1]{\chapter[#1]{#2}}{} %\usepackage{setlistings} private code edited out \makeatletter \def\multicols@string{multicols} \BeforeBeginEnvironment{Chapter}{% \ifx\@currenvir\multicols@string ...


10

If you don't want longtable to add headers and footers to the table at the same time that multicol is balancing where to make the break (which would require that frank and I cooperate:-) then multicol will balance the output from longtable if you first trick longtable into thinking that it isn't in multicol at all. I added some rules, just to show that ...


10

You may use the \raggedright command (or the \RaggedRight variant of the ragged2e package which allows hyphenation) at the begin of a single multicols environment. You may also "patch" the multicols environment using \AtBeginEnvironment which is provided by the etoolbox package. \documentclass{article} \usepackage{multicol} \usepackage{ragged2e} ...


10

You can locally set \multicolsep to 0pt (or another desired value; the default value for \multicolsep is 12pt plus 4pt minus 3pt): \documentclass{article} \usepackage{multicol} \usepackage{enumitem} \setenumerate{nolistsep} \setitemize{nolistsep} \usepackage[compact]{titlesec} \begin{document} Some text \begin{itemize} ...


10

Your interest in prettifying the expression is most likely around the alignment. Regardless, don't use eqnarray. Rather use the capabilities of amsmath's align environment(s): \documentclass[twocolumn]{article} \usepackage{lipsum}% http://ctan.org/pkg/lipsum \usepackage{amsmath}% http://ctan.org/pkg/amsmath \newcommand{\noeq}{\phantom{=}{}} ...


10

You might want to play with the spacing a bit but something like this \documentclass{article} \usepackage{multicol,color} \makeatletter \let\old@page@sofar\page@sofar \let\old@box\box \let\old@rlap\rlap \def\page@sofar{% \let\box\colorcolumn \def\rlap{\let\box\old@box\old@rlap}% \old@page@sofar } \def\colorcolumn#1{% ...


9

Here is a solution that should fit in with your automation. The needspace package provides a command \needspace{<length>} which checks to see whether there is <length> left in the column or on the page, otherwise it issues a \break. This allows the text to roll over into another column/page. In that sense you can modify your code to the ...


9

If you do not want any column balancing: just use multicols* as the environment. If you do want balancing but control the breakpoint then \columnbreak will allow you to set them explicitly as needed. If you just want to ensure that column breaks are happening only between paragraphs then you could set \interlinepenalty=10000 inside the multicols ...


9

Don't try to adjust the column width directly: multicol is designed to calculate it. What you should do instead is first set up a notional page with a 'text block' which represents the text you would get if you had a single column. This involves quite a number of potential lengths, and you would be well-advised to use the geometry package to do this: most ...


9

Let me show you how to implement this for twocolumn layouts rather than via the multicol package. This will fix some of your coding issues. \documentclass[twocolumn]{article} \usepackage{wrapfig} \usepackage{lipsum} \makeatletter \newenvironment{pquote}[1][\relax]{% \ifx#1\relax\def\@mypl{\if@firstcolumn l\else r\fi}% \else\def\@mypl{#1}\fi% ...


8

The multicol package should solve this problem \documentclass{report} \usepackage{lipsum} \usepackage{multicol} \begin{document} \begin{multicols*}{3} \lipsum[1] \lipsum[2] \end{multicols*} \end{document} the *-version diables the balancing Just for comparison, the version without * gives: And the version with star results in:


8

What follows is a very crude solution to your main problem (lining up the rows properly): Use a tabbing environment. IIRC, there's no easy way to center the contents of a tabbing "cell", but column/page breaks inside a tabbing environment are permitted. The trick is to use \\* to forbid breaks after certain rows. \documentclass[12pt]{article} ...


8

You can redefine the thebibliography environment to use two columns and use the optional argument of multicols to place the title; add the following lines to the preamble of your document: \usepackage{multicol} \makeatletter \renewenvironment{thebibliography}[1] {\begin{multicols}{2}[\section*{\refname}]% ...


8

Apart from following the good advice by henrique, you can say \begingroup\setlength{\multicolsep}{0pt} \begin{multicols}{2}[{\printbibheading[title={Second Bibliography}]}] \printbibliography[heading=none] \end{multicols}\endgroup or, probably, define a personal command: \newcommand\twocolprintbibliography[2][0pt]{% ...


8

Use the \twocolumn format, then you can use the package supertabular \documentclass[11pt,a4paper]{article} \usepackage{supertabular} \begin{document} \twocolumn \tablehead{Header of first column & Header of second column \\} \begin{supertabular}{ccc} Table cell 1, 1 & Table cell 1, 2 \\ Table cell 2, 1 & Table cell 2, 2 \\ Table cell 1, 1 ...



Only top voted, non community-wiki answers of a minimum length are eligible