我計劃推出線上LuaTeX編譯服務。
我在 CentOS 7 中使用 TexLive 2015 安裝了 LuaTeX。因此,我設定了openin_any=p
.但是,它也限制打開安裝在texmf-dist
.其他編譯器可以讀取模板檔。
我嘗試編譯這個檔案:
\documentclass{ltjsarticle}
\usepackage{graphicx}
\title{title}
\author{auth}
\date{\today}
\begin{document}
\maketitle
\section{section}
This is sample.
\end{document}
我編譯了這個文件lualatex sample.tex
並收到如下訊息:
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)
restricted \write18 enabled.
(./sample.tex
LaTeX2e <2016/02/01>
Babel <3.9o> and hyphenation patterns for 1 language(s) loaded.
lualatex: Not reading from /usr/local/texlive/2015/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls (openin_any = p).
! LaTeX Error: File `ltjsarticle.cls' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
我該如何修復它?
答案1
關於 TeX 作為線上服務:[http://cseweb.ucsd.edu/~hovav/dist/texhack.pdf
關於Lua:格式可以依照自己的意願重新定義lua,所以
local myopen = function(...) print("ERROR: open is not permitted") return false end
local _std = {}
_std.oldopen = io.open
io.open = myopen
for k,v in pairs(_std) do print(k,v) end
assert(io.open("foo"), 'Error on io.open' )
io.open 是安全的(直到 _std 被隱藏)
如果不關心 io.open:
local myopen = function(...) print("ERROR: open is not permitted") return false end
io.open = myopen
assert(io.open("foo"), 'Error on io.open' )