Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write in a two-columns style in restructuredtext?

I would like to write a research paper using restructuredtext, is it possible to have the two-column style inherent to this kind of document? I looked at the specifications but apart using a table which will be a real pain I haven't been able to find an alternative.

like image 265
attwad Avatar asked Aug 11 '09 03:08

attwad


4 Answers

You can output 2-column in any of the formats docutils outputs.

If what you want is a 2-column ReST source then it's much harder.

Since there are no pages, it may not even make sense (imagine if the columns are 5000 lines long ;-), so I will assume you mean in the output, be it HTML, PDF or whatever.

For PDF, using rst2pdf, it's trivial, you only need to use the -s twocolumn option.

For HTML, it's a CSS thing, and I am sure google can help you.

like image 138
Roberto Alsina Avatar answered Sep 25 '22 18:09

Roberto Alsina


If you wan't two column latex from reST you can get it with:

rst2latex --documentoptions=twocolumn source.rst
like image 26
Matti Pastell Avatar answered Sep 25 '22 18:09

Matti Pastell


It is possible with rst2pdf but your layout has to be kept within PageBreak. In otherwords you cannot have 1 column layout and 2 column layout on one page.

.. raw:: pdf 

      PageBreak twoColumn 

some text in two columns 


.. raw:: pdf 

      PageBreak oneColumn 

some text in one column
like image 29
zzart Avatar answered Sep 25 '22 18:09

zzart


I haven't found a way to do so with ReST. You really should consider LaTeX for your research paper, especially for citations (BibTex), if you want to write it in plain text. You can easily switch between one and two columns:

% remove "twocolumn" for a single column
\documentclass[twocolumn]{article}
\begin{document}
Text here...
\end{document}

See Wikibooks for a good reference.

like image 21
jmdeldin Avatar answered Sep 22 '22 18:09

jmdeldin