texrunner-0.0.1.0: Functions for running Tex from Haskell.

Copyright(c) 2015 Christopher Chalmers
LicenseBSD-style (see LICENSE)
Maintainerc.chalmers@me.com
Safe HaskellNone
LanguageHaskell2010

System.Texrunner.Online

Contents

Description

Functions for running and parsing using Tex's online interface. This is mostly used for getting measurements like hbox dimensions and textwidth.

Tex's online interface is basically running the command line. You can see it by running pdflatex without any arguments. The contents can be writen line by and tex can give feedback though stdout, which gets parsed in by this module. This is the only way I know to get info like hbox sizes. Please let me know if you know a better way.

Synopsis

Documentation

data OnlineTex a Source

Type for dealing with Tex's pipping interface, the current streams are availble though the MonadReader instance.

Running Tex online

runOnlineTex Source

Arguments

:: String

tex command

-> [String]

tex command arguments

-> ByteString

preamble

-> OnlineTex a

Online Tex to be Run

-> IO a 

Interaction

hbox :: Fractional n => ByteString -> OnlineTex (Box n) Source

Get the dimensions of a hbox.

hsize :: Fractional n => OnlineTex n Source

Dimensions from filling the current line.

showthe :: Fractional n => ByteString -> OnlineTex n Source

Parse result from showthe.

onlineTexParser :: Parser a -> OnlineTex a Source

Run an Attoparsec parser on Tex's output.

Low level

These functions allow give you direct access to the iostreams with tex. The implementation is likely to change in the future and using them directly is not recommended.

getInStream :: OnlineTex (InputStream ByteString) Source

Get the input stream to give text to tex.

getOutStream :: OnlineTex (OutputStream ByteString) Source

Get the output stream to read tex's output.

clearUnblocking :: OnlineTex () Source

Clear any output tex has already given.