Thanks Jorg,

The following worked.

```
.. list-table::  Smoldyn model in Python and plain text
   :align: left

   * - .. literalinclude:: /../examples/S10_boxes/box.txt
     - .. literalinclude:: /../examples/S10_boxes/box.py
          :language: python

```

I replaced the files names with their relative paths. It seems that
`list-table` does not (yet) support changing the vertical alignment of the
content in the cell
(https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table).
Currently the content is vertically aligned to the middle; I'd like it to be
aligned to the top. Is there a way around it other than playing with the css?

best,
    Dilawar


--
On Jul 01, 06:49, Jörg Faschingbauer wrote:
On 6/30/20 9:01 PM, Dilawar Singh wrote:

I want to show two code listings side by side to make a comparison. The left column would include a plain text model and the right one has the equivalent Python model. There is some discussion here https://github.com/sphinx-doc/sphinx/issues/4553 but it didn't help much.

You can use a table for that. For example, a list-table with one row and two columns,

.. list-table::
  :align: left

  * - .. literal-include:: model.txt
    - .. literal-include:: model.py

Cheers,
Jörg
--
DI Jörg Faschingbauer   
Linux und Open Source - Programmierung, Beratung und Schulung   
https://www.faschingbauer.me    
https://www.faschingbauer.co.at 
[email protected]        
Bergwirtstrasse 10      
A-8075 Hart bei Graz    
Tel. +43-664-5783814    
UID: ATU64329756

--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/20200701074528.GA20715%40localhost.localdomain.

Reply via email to