Documentation
¶
Overview ¶
Package tex2svg provides the support for coverting the specified TeX input into a parsed SVG's HTML node.
To work, we will first generate a TeX file and convert it into a PDF or DVI file using "pdflatex". Then we will convert the PDF file into the SVG file using "pdf2svg".
Index ¶
- type Cache
- type Option
- func WithAttributes(attrs map[string]string) Option
- func WithCache(cache Cache) Option
- func WithControlPrecision(precision int) Option
- func WithFallable(fallable bool) Option
- func WithFontSize(pt int) Option
- func WithLogger(logger *log.Logger) Option
- func WithOptions(opts ...Option) Option
- func WithPrecision(precision int) Option
- func WithTemplate(template string) Option
- func WithTemplateDir(dir string) Option
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v1.0.2
Cache is the content cache that the Generate function could refer to before pulling up any subprocess and generate content.
The key and value must be transparent so that this package could arrange its content freely.
type Option ¶
type Option func(*option)
Option passed for controlling the SVG generation.
func WithAttributes ¶
WithAttributes specifies the attributes.
func WithControlPrecision ¶
WithControlPrecision updates the precision of the control points in path.
func WithFallable ¶
WithFallable specifies that the "latex.tex" will be used when a specified type is not present.
func WithLogger ¶
WithLogger sets a logger for printing out content.
func WithOptions ¶
WithOptions aggregates a few options into a single option.
func WithPrecision ¶
WithPrecision updates the precision of the node points.
func WithTemplate ¶
WithTemplate sets the template forcefully.
Setting this will force all kinds of generation to use the specified template instead. This is useful for debugging template generation dedicatedly.
func WithTemplateDir ¶
WithTemplateDir sets the template search directory.
The template corresponding to specified node type will be looked up and used. Each template should accept in the template arguments FontSize and Code.
By default, the executable's directory will be searched for templates. And DeX comes with some preset templates.