.tex
Swift を使用してファイルをコンパイルしたかったのです。次のコードがあります。
class FileManager {
class func compileLatex(#file: String) {
let task = NSTask()
task.launchPath = "/usr/texbin/latexmk"
task.currentDirectoryPath = (NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! String).stringByAppendingString("/roster")
task.arguments = ["-xelatex", file]
task.launch()
}
}
ただし、呼び出すFileManager.compileLatex(file: "latex.tex")
と、「起動パスにアクセスできません」というエラーが表示されます。どうやら、起動パスが間違っているようですが、それが実際にどれであるかを見つける方法がわかりませんか? どうすれば見つけることができますか、または一般的なパスはありますか? 助けてくれてありがとう
編集:
更新されたコードとこのエラーが発生しました:
Latexmk: This is Latexmk, John Collins, 10 January 2015, version: 4.42.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'xelatex -recorder "Praktikumsbericht.tex"'
------------
sh: xelatex: command not found
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
pdflatex: (Pdf)LaTeX failed to generate the expected log file 'Praktikumsbericht.log'
Latexmk: Did not finish processing file 'Praktikumsbericht.tex':
(Pdf)LaTeX failed to generate the expected log file 'Praktikumsbericht.log'
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.