Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrXelatexNotExist = errors.New("xelatex does not exists") ErrNoOutputPDF = errors.New("xelatex compiled successfully but no output pdf found") )
Functions ¶
This section is empty.
Types ¶
type Compiler ¶ added in v0.3.0
type Compiler struct {
// contains filtered or unexported fields
}
Compiler reads main LaTex file and compiles all LaTex files to a PDF.
func (*Compiler) Compile ¶ added in v0.3.0
Compile compiles all LaTex files to a PDF.
Example ¶
package main import ( "log" "github.com/northbright/tex2pdf" ) func main() { texFile := "example/src/my_book.tex" outputPDF := "output/my_book.pdf" // Create a compiler with specified stdout and stderr options. // c := tex2pdf.New(texFile, outputPDF, tex2pdf.Stdout(os.Stdout), tex2pdf.Stderr(os.Stderr)) // Create a compiler. c := tex2pdf.New(texFile, outputPDF) log.Printf("start compiling Tex File to PDF...\nTex file: %v\noutput PDF: %v", texFile, outputPDF) // Compile a Tex file to a PDF. if err := c.Compile(); err != nil { log.Printf("Compile() error: %v", err) return } log.Printf("compile successfully") }
Click to show internal directories.
Click to hide internal directories.