tex

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2021 License: BSD-3-Clause Imports: 2 Imported by: 5

README

star-tex

Build status GoDoc

star-tex (or *TeX) is a TeX engine in Go.

cmd/star-tex

star-tex provides a TeX to DVI typesetter.

$> star-tex ./testdata/hello.tex out.div
$> dvipdf out.dvi
$> pdf out.pdf

cmd/dvi-dump

dvi-dump displays the content of a DVI file in a human readable format or JSON.

The human readable format should be exactly the same than the official dvitype command from TeX Live.

$> dvi-dump -h
Usage of dvi-dump:
  -json
    	enable JSON output
  -texmf string
    	path to TexMF root

$> dvi-dump ./testdata/hello_golden.dvi
numerator/denominator=25400000/473628672
magnification=1000;       0.00006334 pixels per DVI unit
' TeX output 1776.07.04:1200'
Postamble starts at byte 1290.
maxv=43725786, maxh=30785863, maxstackdepth=2, totalpages=1
Font 36: cmti10---loaded at size 655360 DVI units 
Font 23: cmbx10---loaded at size 655360 DVI units 
Font 12: cmsy10---loaded at size 655360 DVI units 
Font 6: cmmi10---loaded at size 655360 DVI units 
Font 0: cmr10---loaded at size 655360 DVI units 
 
42: beginning of page 1 
87: push 
level 0:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0) 
88: down3 -917504 v:=0-917504=-917504, vv:=-58 
92: pop 
[...]

cmd/kpath-find

kpath-find is a new command that finds files in a TeX directory structure:

$> kpath-find -h
Usage of kpath-find:
  -all
    	display all matches
  -texmf string
    	path to TEXMF distribution

$> kpath-find -texmf /usr/share/texmf-dist cmr10.pk
/usr/share/texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk

$> kpath-find -all -texmf /usr/share/texmf-dist latex
/usr/share/texmf-dist/makeindex/latex
/usr/share/texmf-dist/tex/latex
/usr/share/texmf-dist/tex4ht/ht-fonts/alias/latex
/usr/share/texmf-dist/tex4ht/ht-fonts/unicode/latex

cmd/tfm2pl

tfm2pl converts a TFM file to human-readable property list file or standard output. tfm2pl is a Go-based reimplementation of TFtoPL, distributed with TeX-live.

$> tfm2pl -h
Usage: tfm2pl [options] file.tfm [file.pl]

tfm2pl converts a TFM file to human-readable property list file or standard output.

ex:
 $> tfm2pl testdata/simple.tfm
 $> tfm2pl testdata/simple.tfm out.pl

options:

$> tfm2pl /usr/share/texmf-dist/fonts/tfm/public/cm/cmr10.tfm
(FAMILY CMR)
(FACE O 352)
(CODINGSCHEME TEX TEXT)
(DESIGNSIZE R 10.0)
(COMMENT DESIGNSIZE IS IN POINTS)
(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
(CHECKSUM O 11374260171)
(FONTDIMEN
   (SLANT R 0.0)
   (SPACE R 0.333334)
   (STRETCH R 0.166667)
   (SHRINK R 0.111112)
   (XHEIGHT R 0.430555)
   (QUAD R 1.000003)
   (EXTRASPACE R 0.111112)
   )
(LIGTABLE
   (LABEL O 40)
   (KRN C l R -0.277779)
   (KRN C L R -0.319446)
[...]

The output of tfm2pl should be exactly the same than the one from the official tftopl binary from TeX Live.

Documentation

Overview

Package tex provides tools to typeset TeX documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {

	// Jobname used for TeX output.
	// Default is "output".
	Jobname string
	// contains filtered or unexported fields
}

Engine is a TeX engine.

func NewEngine

func NewEngine(stdout io.Writer, stdin io.Reader) *Engine

NewEngine creates a new TeX engine connected to the provided stdin and stdout file descriptors.

func (*Engine) Process

func (engine *Engine) Process(w io.Writer, r io.Reader) error

Process reads the provided TeX document and compiles it to the provided writer.

type Processor

type Processor interface {
	Process(w io.Writer, r io.Reader) error
}

Processor is the interface that wraps the Process method.

Directories

Path Synopsis
cmd
dvi-dump
Command dvi-dump displays the content of a DVI file in a human readable format or JSON.
Command dvi-dump displays the content of a DVI file in a human readable format or JSON.
kpath-find
Command kpath-find finds files in a TeX Directory Structure.
Command kpath-find finds files in a TeX Directory Structure.
star-tex
Command star-tex compiles TeX documents.
Command star-tex compiles TeX documents.
tfm2pl
tfm2pl converts a TFM file to human-readable property list file or standard output.
tfm2pl converts a TFM file to human-readable property list file or standard output.
Package dvi implements encoding and decoding DVI documents.
Package dvi implements encoding and decoding DVI documents.
font
afm
Package afm implements a decoder for AFM (Adobe Font Metrics) files.
Package afm implements a decoder for AFM (Adobe Font Metrics) files.
fixed
Package fixed provides types to work with fixed-point numbers.
Package fixed provides types to work with fixed-point numbers.
tfm
Package tfm implements a decoder for TFM (TeX Font Metrics) files.
Package tfm implements a decoder for TFM (TeX Font Metrics) files.
internal
iobuf
Package iobuf provides buffered I/O tailored for TeX and DVI semantics.
Package iobuf provides buffered I/O tailored for TeX and DVI semantics.
tds
Package tds provides a minimal TeX Directory Structure for star-tex.
Package tds provides a minimal TeX Directory Structure for star-tex.
xtex
This program is copyright (C) 1982 by D. E. Knuth; all rights are reserved.
This program is copyright (C) 1982 by D. E. Knuth; all rights are reserved.
Package kpath provides tools to locate TeX related files.
Package kpath provides tools to locate TeX related files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL