Mathematica can be used to write very nice documents. Does anyone know if it is possible to write documents with 2 columns? If so, can you provide some examples or links to othe
I don't think any good implementation of multicolumns are supported in Mathematica - it's not really compatible with the structure of the notebook interface. The fact that publicon does not support proper multiple columns is probably a good hint that Mathematica does not.
Q: Does Publicon support multi-column layout?
Publicon documents are oriented toward a vertical scrolling paradigm much like HTML, rather than a page-by-page configuration found in page-layout programs. Multiple columns can be configured in tables, but not maintained as flows. Publicon's focus is on document structure, allowing clean translation to LaTeX or XML for submission to publishers. Publishers can then use page-layout tools that exploit their own particular formats to generate single- or double-column layouts to their own specifications.
Although, of course, hacks like Bilateral Cells (part of the Author Tools package mentioned in Verbia's answer) and that below can be used.
Here's some code that generates a two column text cell that will resize the columns to the window size - but the text does not flow from one column to another. Once the cell is generated, you can type in it as per normal.
Cell[BoxData[
GridBox[{{Cell["Column One:\nsome text", "Text"],
Cell["Column Two:\nmore text", "Text"]}}, ColumnsEqual -> True,
ColumnSpacings -> 2, ColumnAlignments -> Left,
ColumnWidths -> Dynamic[First[WindowSize /. Options[EvaluationNotebook[]]]/(2*18)]]],
"Text"] // CellPrint
Or you can have text on the left an input/output on the right
Cell[BoxData[GridBox[{
{Cell["Column One:\nsome text", "Text"], Cell[BoxData[RowBox[{"1", "+", "1"}]], "Input"]},
{"\[SpanFromAbove]", Cell[BoxData["2"], "Output"]}},
ColumnsEqual -> True, ColumnSpacings -> 2, ColumnAlignments -> Left,
ColumnWidths -> Dynamic[First[WindowSize /. Options[EvaluationNotebook[]]]/(2*18)]]],
"Text"] // CellPrint
Note that I've only done a dodgy conversion from pixels to em by dividing the former by 18. The true conversion will be system and font dependent. Also, just adding CellLabel
s to the input and output cells does not work. So the In[n]:=
Out[n]=
might need to be added manually using a small middle column.
Finally, it should be possible to construct something like the bilateral cell code used by the author tools package that grabs a Text/MathCaption cell followed by an Input and Output cell and combines them into a two-column construction.