Public Repository

Last pushed: 2 years ago
Short Description
An extension of Asciidoctor for writing mathematical articles - render to HTML or LaTeX
Full Description

About Asciidoctor-LaTeX

Asciidoc-LaTeX is a superset of the Asciidoc markup language which makes it easy to publish mathematics on the web. Marked up text is transformed into HTML or LaTeX using the
Asciidoctor-LaTeX extension of the Asciidoctor text processor.

In Asciidoc-LaTeX, inline formulas are written just as they are in LaTeX, e.g., $a^2 + b^2 = c^2$, and likewise with displayed formulas, e.g.,

  \int_0^1 x^n dx = \frac{1}{n+1}.

See the examples and documentation at for more information, e.g., on how LaTeX environments are supported. Noteshare runs on

Using this container

Pull the container to your computer with

docker pull jxxcarlson/asciidoctor-latex
Then execute

docker run -it -v <your directory>:/documents/ jxxcarlson/asciidoctor-latex

to load the container and share a folder between the host machine and the container.
To render an `.adoc` file into HTML, use

asciidoctor-latex foo.adoc -b html

and to render it into LaTeX, use

asciidoctor-latex foo.adoc

You can do this inside the container -- that 's the whole point!!

# Contents

* `asciidoctor`
* `asciidoctor-latex` (pre-release)
* `asciidoctor-pdf` (alpha)
* `asciidoctor-epub` (alpha)
* sample files in `documents/manuscript_208`

 `asciidoctor-pdf` and `asciidoctor-epub` do not yet understand `asciidoc-LaTeX`

# Example

_We will install the container, run it, and convert an asciidoc-latex file
into both html and LaTeX, then copy the files to the host where we can test them._

In one terminal window, get the `asciidoctor-latex` container

$ docker pull jxxcarlson/asciidoctor-latex

Load the container and run the example file, `manuscripts_208/208.adoc`, through `asciidoctor-latex` and  `asciidoctor-latex -b html`.  This will create (or re-create) the files `208.tex`
and `208.html`.

$ docker run -it jxxcarlson/asciidoctor-latex
[root@17a4708b080b documents]# ls
[root@17a4708b080b documents]# cd manuscript_208
[root@17a4708b080b manuscript_208]# asciidoctor-latex 208.adoc
[root@17a4708b080b manuscript_208]# asciidoctor-latex -b html 208.adoc

In another terminal window find the name of the currently running instance of the container
using `docker ps`.  Let's imagine that it is `hefty_walrus`:

$ docker cp hefty_walrus:/documents/manuscript_208/208.adoc .
$ docker cp hefty_walrus:/documents/manuscript_208/208.html .
$ docker cp hefty_walrus:/documents/manuscript_208/208.tex .

You can view `208.html` with your browser.  To process `208.tex`, run `xelatex` on it
twice.  Then view the resulting file, `208.pdf`.


* I learned how to build this docker image by studying
 the [asciidoctor/docker-asciidoctor]( container and its documentation.

* The `adoc` to `tex` converter is experimental.  Please report issues to [Asciidoctor-LaTeX]( ).

# Dockerfile

FROM fedora

MAINTAINER James Carlson

RUN yum install -y tar make gcc ruby ruby-devel rubygems graphviz rubygem-nokogiri asciidoctor unzip findutils which wget

RUN gem install --no-ri --no-rdoc asciidoctor-latex --pre && \
gem install --no-ri --no-rdoc asciidoctor-epub3 --version 1.0.0.alpha.2 && \
gem install --no-ri --no-rdoc asciidoctor-pdf --version 1.5.0.alpha.7 && \
gem install --no-ri --no-rdoc coderay pygments.rb thread_safe epubcheck kindlegen && \
mkdir /documents

WORKDIR /documents
VOLUME /documents

ADD adl/ms208.tar /documents/

CMD ["/bin/bash"]

Docker Pull Command

Comments (0)