I am using pdfLaTeX (in MikTex) to write technical articles for a company newsletter.
Inside any one article I switch between two column layout for descriptive text and one column layout for code segments, figures, tables etc.
%newsletterA4.text
\documentclass[a4paper,12pt]{article}
\usepackage{multicol}
\usepackage{lipsum}
\begin{document}
\input{editorial.tex}
\input{article1.tex}
\input{article2.tex}
\end{document}
A typical article file:
% article1.tex
Headings go over the full text width
\begin{multicols}{2}
\lipsum
\end{multicols}
\begin{verbatim}
code listing (or figure or image go over the full text width)
\end{verbatim}
\begin{multicols}{2}
\lipsum
\end{multicols}
The articles I write, are occasionally published also in different media
- with smaller
\textwidth
and/or - inside a (narrow) minipage
In future all articles may also be published in
- html on the company's intranet
In those scenarios I prefer a single column layout.
Currently, I run a script creating an alternative version of the article file, commenting out the \begin{multicols}
and \end{multicols}
. Not exactly elegant
Is there a way that LaTeX takes care of this automatically?
Something like:
If \textwidth
is smaller than some value then ignore the multicol environment.
Does a minipage have its own \textwidth
parameter so the test would be possible as well?
I admit, I have not looked into the latex2html topic yet (no web presence yet) but I thought I mention it in case it influences the answers. I would appreciate a hint how I could "ignore" multicol for publishing in html.
Thanks a lot in advance!