Skip to content

Commit

Permalink
XeLaTeX support (#291)
Browse files Browse the repository at this point in the history
* XeLaTeX support
  • Loading branch information
zhiyuanzhai authored May 10, 2022
1 parent 2e45fa9 commit a03ac8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/man/save.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ PGFPlotsX.CLASS_OPTIONS

## Choosing the LaTeX engine used

Thee are two different choices for latex engines, `PDFLATEX`, `LUALATEX`.
By default, `LUALATEX` is used if it was available during `Pkg.build()`. The active engine can be retrieved with the `latexengine()` function and be set with `latexengine!(engine)` where `engine` is one of the two previously mentioned engines (e.g. `PGFPlotsX.PDFLATEX`).
Thee are three different choices for latex engines, `PDFLATEX`, `LUALATEX` and `XELATEX`.
By default, `LUALATEX` is used if it was available during `Pkg.build()`. The active engine can be retrieved with the `latexengine()` function and be set with `latexengine!(engine)` where `engine` is one of the three previously mentioned engines (i.e. `PGFPlotsX.PDFLATEX` or `PGFPlotsX.XELATEX`).

## Custom flags

Expand Down
6 changes: 3 additions & 3 deletions src/build.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
################
# LaTeX-engine #
################
@enum(LaTeXEngine, LUALATEX, PDFLATEX)
@enum(LaTeXEngine, LUALATEX, PDFLATEX, XELATEX)

"""
The active LaTeX engine. Initialized the first time [`latexengine`](@ref) is called.
"""
const ACTIVE_LATEX_ENGINE = Ref{Union{Nothing, LaTeXEngine}}(nothing)
function latexengine()
if ACTIVE_LATEX_ENGINE[] === nothing
for (engine, enum) in zip(("lualatex", "pdflatex"), (LUALATEX, PDFLATEX))
for (engine, enum) in zip(("lualatex", "pdflatex", "xelatex"), (LUALATEX, PDFLATEX, XELATEX))
@debug "latexengine: looking for latex engine $engine"
if Sys.which(engine) !== nothing
@debug "latexengine: found latex engine $engine, using it"
return ACTIVE_LATEX_ENGINE[] = enum
end
end
throw(MissingExternalProgramError("No LaTeX installation found, figures will not be generated. ",
"Make sure either pdflatex or lualatex are installed and that ",
"Make sure either pdflatex, xelatex or lualatex are installed and that ",
"the PATH variable is correctly set."))
end
return ACTIVE_LATEX_ENGINE[]
Expand Down

0 comments on commit a03ac8e

Please sign in to comment.