Skip to content

Latest commit

 

History

History

test

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tests and Examples

The included files in this directory serve as test input and usage example for users of gokhlayeh/latex.

Contents

  • eps/
    • main.tex Very simple LaTeX document showcasing the use of PostScript graphics using the graphicx package.
    • signal.eps Demo PostScript graphic.
  • fontawesome5/
    • main.tex Very simple LaTeX document demonstrating the use of FontAwesome icons. Very useful for composing Tikz illustrations.
  • gnuplot/
    • .latexmkrc Configuration for latexmk, defining a custom rule to compile .gnuplot files, generated by Tikz, into .table files.
    • main.tex Very simple LaTeX document demonstrating how to render plots with gnuplot. Note that Tikz's GNU plot feature relies either on --shell-escape or an external builder. This example uses latexmk to compile .gnuplot files.
  • pdf2svg/
    • .latexmkrc Configuration for latexmk users, which ensures that pdflatex is invoked with --shell-escape.
    • main.tex Very simple LaTeX standalone document, rendering a Tikz image. The resulting PDF will be converted to SVG.
  • plantuml/
    • .latexmkrc Configuration for latexmk users, which ensures that lualatex is invoked with --shell-escape. Unlike the other documents this one must be compiled with source/build directory being the same (limitation of plantuml LaTeX package)!
    • main.tex Very simple LaTeX document showcasing the use of inline PlantUML code.
  • pythontex/
    • .latexmkrc Configuration for latexmk users, which ensures that PythonTeX is ran on any pytxcode in the build directory.
    • main.tex Very simple document showcasing the use of PythonTeX in a LaTeX document.
  • svg/
    • .latexmkrc Configuration for latexmk users, which ensures that pdflatex is invoked with --shell-escape.
    • main.tex Very simple LaTeX document rendering signals.svg.
    • signals.svg Demo SVG graphic.

Note: This setup (except plantuml/... and pdf2svg/...) expects to run with separate source/build directories. See latexmk's -outdir=... option.

The resulting PDF document should contain the expanded Python output.

Usage

In Visual Studio Code

When using Visual Studio Code and LaTeX Workshop ensure your .vscode/settings.json contains the following:

{
  // requires LaTeX Workshop extension (james-yu.latex-workshop)
  "latex-workshop.docker.enabled": true,
  "latex-workshop.docker.image.latex": "gokhlayeh/latex", // >= v2
  "latex-workshop.latex.outDir": "%DIR%/build", // separate build artifacts from LaTeX source
}

Afterwards, simply open the main.tex document in vscode and build it using LaTeX Workshop latexmk 🔃 recipe.

In Terminal

Compiling the example document by hand using gokhlayeh/latex is simple:

git clone https://github.com/ChiefGokhlayeh/latex.git
cd latex/test
docker pull gokhlayeh/latex
docker run \
  -t \
  --rm \
  -v "$(pwd):/workspace" \
  -w '/workspace/pythontex' \
  gokhlayeh/latex \
  latexmk \
  -outdir=build \
  -pdf \
  main.tex