Skip to main content

module lang::box::util::Box2Text

rascal-0.34.0

This is an implementation of "From Box to Tex:An algebraic approach to the construction of documentation tools" by Mark van den Brand and Eelco Visser (June 30, 1994)

The main function format maps a box tree (which describes 2-dimensional layout constraints for a linear text) to a string which satisfies these constraints.

Usage

import lang::box::util::Box2Text;

Dependencies

import List;
import String;
import IO;
import lang::box::util::Box;

alias options

map [str, int]

function fprint

Print boxes

void fprint(Box b)

function fprintln

Print boxes followed by newline

void fprintln(Box b)

function format

Converts boxes into a string

str format(Box b)

function box2latex

Converts boxes into latex

text box2latex(Box b)

function box2html

Converts boxes into html

text box2html(Box b)

function box2text

Converts boxes into list of lines (ASCII)

text box2text(Box b)

alias foptions

map[str, list[str]]

function vv

text vv(text a, text b)

function blank

str blank(str a)

function wd

text wd(text a)

function width

int width(str s)

function twidth

int twidth(text t)

function hwidth

int hwidth(text t)

function bar

text bar(str a, text b)

function hskip

text hskip(int n)

function vskip

text vskip(int n)

function isBlank

bool isBlank(str a)

function prepend

text prepend(str a, text b)

function hh

text hh(text a, text b)

function _hh

text _hh(text a, text b)

function _vv

text _vv(text a, text b)

function hh {#lang-box-util-Box2Text-hh}

text hh_(text a, text b)

function vv {#lang-box-util-Box2Text-vv}

text vv_(text a, text b)

function LL

text LL(str s )

function HH

text HH(list[Box] b, Box _, options opts, int m)

function VV

text VV(list[Box] b, Box c, options opts, int m)

function II

text II(list[Box] b, Box c, options opts, int m)

function WDWD

text WDWD(list[Box] b, Box c ,options opts, int m)

function ifHOV

text ifHOV(text t, Box b,  Box c, options opts, int m)

function HOVHOV

text HOVHOV(list[Box] b, Box c, options opts, int m)

function HVHV

text HVHV(text T, int s, text a, Box A, list[Box] B, options opts, int m)

text HVHV(text T, int s, list[Box] b, options opts, int m, Box c)

text HVHV(list[Box] b, Box _, options opts, int m)

function font

text font(text t, str tg)

function QQ

text QQ(Box b, Box c, options opts, foptions f, int m)

function O

text O(Box b, Box c, options opts, int m)

function boxSize

Box boxSize(Box b, Box c, options opts, int m)

function RR

list[list[Box]] RR(list[Box] bl, Box c, options opts, int m)

function getMaxWidth

int getMaxWidth(list[Box] b)

function Awidth

list[int] Awidth(list[list[Box]] a)

function AA

text AA(list[Box] bl, Box c ,options opts, foptions f, int m)

function changeHV2H

bool changeHV2H(list[Box] hv)

function removeHV

Box removeHV(Box b)

function removeHOV

Box removeHOV(Box b)

function box2data

text box2data(Box b)

function convert2latex

str convert2latex(str s)

function text2latex

str text2latex(str t)

function selectBeginTag

str selectBeginTag(str tg, str key)

function selectEndTag

str selectEndTag(str tg)

function convert2html

str convert2html(str s)

function text2html

str text2html(str t)

function text2txt

str text2txt(str t)

function text2latex

text text2latex(text t)

function text2html

text text2html(text t)

function text2txt

text text2txt(text t)

function tst

void tst()

function baseName

str baseName(str input)

function toExport

void toExport(loc src,loc dest, text r,str suffix)

function main

void main(Box b)