The arara automation tool can help to automate the idea given by Peter Grill in his answer.
You simply save the following arara rule, onetwocolumns.yaml, into a directory where arara knows to find it, and then you can run
arara myfile
on the following file, and you'll receive two pdfs:
myfileONECOLUMN.pdf
myfileTWOCOLUMN.pdf
The arara directives are detailed in the rule file but, just for clarity, you can use them in any of the following ways:
% arara: onetwocolumns
% arara: onetwocolumns: {columns: onecolumn}
The default value of columns is twocolumn but you can change that as you see fit.
myfile.tex
% arara: onetwocolumns
% arara: onetwocolumns: {columns: onecolumn}
\ifdefined\ColumnType
\else
\def\ColumnType{onecolumn}
\fi
\documentclass[\ColumnType]{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
\end{document}
onetwocolumns.yaml
!config
# Make one and two column document
# author: Chris Hughes
# last edited by: cmh, April 26th, 2014
# https://tex.stackexchange.com/questions/173532/two-pdf-versions-from-one-single-tex-file
# requires arara 3.0+
#
# Sample usage
#
# % arara: onetwocolumns
# % arara: onetwocolumns: {columns: onecolumn}
# % arara: onetwocolumns: {columns: twocolumn}
#
identifier: onetwocolumns
name: OneTwoColumns
commands:
- <arara> pdflatex "\def\ColumnType{@{columns}}\input{@{file}}"
- <arara> @{ isWindows( "cmd /c move", "mv" ) } @{getBasename(file)}.pdf @{getBasename(file)}@{columns.toUpperCase()}.pdf
arguments:
- identifier: columns
flag: <arara> @{parameters.columns}
default: twocolumn
\inputs the samecontent.texfile? Then you could also compile both with a simple loop... – jon Apr 26 '14 at 00:05