TransWikia.com

texshop knitr -> XeLaTeX engine

TeX - LaTeX Asked on April 11, 2021

In TeXShop, my current knitr engine is

#!/bin/bash
export PATH=$PATH:/usr/texbin:/usr/local/bin
Rscript -e "library(knitr); knit('$1')"
latexmk -pdf "${1%.*}"

My current XeLaTeX engine is

#!/bin/tcsh

set path= ($path /Library/TeX/texbin /usr/texbin /usr/local/bin)
xelatex  -file-line-error -synctex=1 "$1"
  1. How do I replace latexmk with an equivalent xelatex command in the knitr engine?
  2. The current default shell in MacOS is zsh. Could the response to 1 include a modification for zsh.

One Answer

I suggest you might want to keep latexmk, to make sure the document is fully compiled. If you create a latexmkrc file in your working directory containing

$pdf_mode = 1;
$pdflatex = 'xelatex -file-line-error -synctex=1 %O %S';

then latexmk will use the invocation there, and you can even remove "-pdf" from the call.

(%O stands for latexmk options, e.g. if you set $recorder = 1, then -recorder will be added here; %S stands for the file name.)

You could also set this using the -pdflatex switch to latexmk.

Answered by Alex Watson on April 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP