Doconce promises the moon: write one flavor of markup and process the result into LaTeX, HTML, Jupyter, etc!

This is a rough description of how I’m setting up my Doconce evironment. It’s mostly intended to be a guide for me to reproduce it, but perhaps others will find it useful.

Installation

Doconce is just a Python package.

pip install doconce

Check if installation worked with which doconce. If a directory is returned, you’re good.

A simple document

Here’s a simple doconce document. Some of it is ripped straight from here.

TITLE: A Title
AUTHOR: Rico A.R. Picone {copyright|CC BY} Email:rpicone@stmartin.edu at Department of Mechanical Engineering, Saint Martin's University.
DATE: today

__Summary.__
This is a paragraph with the heading ``Summary.''

## Include table of contents (latex and html; sphinx always has a toc).
## (Lines starting with ## are not propagated to the output file,
## otherwise comments lines starting with # are visible in the
## output file.)

TOC: on


!split
======= A Foo Section =======
label{section:foo}

## Purpose: it's perhaps ambitious to believe this has a purpose.

idx{key thing to say} idx{and another}

We address making things up

!bt
\begin{align}
x'(t) &= -ax(t), \quad t \in (0,T_0], label{ode}\\
x(0)  &= I,                         label{initial:value}
\end{align}
!et
where $a$, $I$, and $T$ are maths.

By convention, all doconce documents should be given the extension .do.txt. Save the above as doc.do.txt and run the following command to generate a LaTeX version.

doconce format pdflatex doc --latex_font=palatino \
        --latex_admon=yellowicon '--latex_admon_color=yellow!5' \
        --latex_fancy_header --latex_code_style=pyg \
        --latex_section_headings=blue --latex_colored_table_rows=blue