better message when bad latex word encountered

This commit is contained in:
Damien Elmes 2012-10-25 18:48:28 +09:00
parent e2d0ef0cc4
commit c9b3d89d44

View file

@ -79,7 +79,11 @@ def _buildImg(col, latex, fname, model):
# it's only really secure if run in a jail, but these are the most common # it's only really secure if run in a jail, but these are the most common
for bad in ("write18", "\\readline", "\\input", "\\include", "\\catcode", for bad in ("write18", "\\readline", "\\input", "\\include", "\\catcode",
"\\openout", "\\write", "\\loop", "\\def", "\\shipout"): "\\openout", "\\write", "\\loop", "\\def", "\\shipout"):
assert bad not in latex if bad in latex:
return _("""\
For security reasons, '%s' is not allowed on cards. You can still use \
it by placing the command in a different package, and importing that \
package in the LaTeX header instead.""") % bad
# write into a temp file # write into a temp file
log = open(namedtmp("latex_log.txt"), "w") log = open(namedtmp("latex_log.txt"), "w")
texpath = namedtmp("tmp.tex") texpath = namedtmp("tmp.tex")