Documentation
¶
Overview ¶
Package tex provides tools to typeset TeX documents.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToDVI ¶ added in v0.7.0
ToDVI reads the provided TeX document from r and compiles it to the provided writer as a ToDVI document.
func ToPDF ¶ added in v0.7.0
ToPDF reads the provided TeX document from r and compiles it to the provided writer as a PDF document.
Example ¶
package main
import (
"bytes"
"fmt"
"log"
"strings"
"star-tex.org/x/tex"
"star-tex.org/x/tex/kpath"
)
func main() {
const src = `%% A simple TeX document.
Hello, world !
\hrule
Bye.
\bye
`
ktx := kpath.New()
pdf := new(bytes.Buffer)
err := tex.ToPDF(ktx, pdf, strings.NewReader(src))
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", pdf.Bytes()[:8])
}
Output: %PDF-1.4
Types ¶
type Engine ¶
type Engine struct {
// Stdin specifies the TeX engine's standard input.
//
// If Stdin is nil, the engine reads from the null device (os.DevNull).
Stdin io.Reader
// Stdout and Stderr specify the TeX engine's standard output and error.
//
// If either is nil, Process connects the corresponding file descriptor
// to the null device (os.DevNull).
Stdout io.Writer
Stderr io.Writer
// Jobname used for TeX output.
// Default is "output".
Jobname string
// Stdlog collects TeX logging messages.
//
// If Stdlog is nil, Process connects Stdlog to the null device (os.DevNull).
Stdlog io.Writer
}
Engine is a TeX engine.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
afm-dump
command
|
|
|
dvi-cnv
command
Command dvi-cnv converts a DVI document into a (set of) PNG or PDF file(s).
|
Command dvi-cnv converts a DVI document into a (set of) PNG or PDF file(s). |
|
dvi-dump
command
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
Command kpath-find finds files in a TeX Directory Structure.
|
Command kpath-find finds files in a TeX Directory Structure. |
|
pk2bm
command
|
|
|
star-tex
command
Command star-tex compiles TeX documents to PDFs.
|
Command star-tex compiles TeX documents to PDFs. |
|
tfm2pl
command
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. |
|
dvimg
Package dvimg provides a DVI renderer that renders to an image.
|
Package dvimg provides a DVI renderer that renders to an image. |
|
dvipdf
Package dvipdf prodivdes a DVI renderer that renders to a PDF document.
|
Package dvipdf prodivdes a DVI renderer that renders to a PDF document. |
|
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. |
|
pkf
Package pkf implements a decoder for the Packed (PK) Font file format.
|
Package pkf implements a decoder for the Packed (PK) Font file format. |
|
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. |
|
Package kpath provides tools to locate TeX related files.
|
Package kpath provides tools to locate TeX related files. |
Click to show internal directories.
Click to hide internal directories.