0
は、私は、Webサイトフラスコアプリを実行している(のpython 3)を持っていると私はPDFを生成しようとすると、私はこのエラーを得た:pylaTexですべてのUNICODE文字を処理する方法は?
Traceback (most recent call last):
File "./web/frontend/printr.py", line 204, in generate_files
File "/env/flask3/lib/python3.5/site-packages/pylatex/document.py", line 228, in generate_pdf
stderr=subprocess.STDOUT)
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['latexmk', '--pdf', '--interaction=nonstopmode', 'a05f271c-1a7b-4996-9533-1c8ff17a90bf.tex']' returned non-zero exit status 12
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/env/flask3/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/env/flask3/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/env/flask3/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/env/flask3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/env/flask3/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/env/flask3/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/env/flask3/lib/python3.5/site-packages/flask_login/utils.py", line 228, in decorated_view
return func(*args, **kwargs)
File "./web/frontend/views.py", line 690, in report
File "./web/frontend/printr.py", line 206, in generate_files
File "/env/flask3/lib/python3.5/site-packages/pylatex/document.py", line 228, in generate_pdf
stderr=subprocess.STDOUT)
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['xetex', '--interaction=nonstopmode', 'a05f271c-1a7b-4996-9533-1c8ff17a90bf.tex']' returned non-zero exit status 1
コード:
try:
doc.generate_pdf(file,clean_tex=True)
except Exception as e:
doc.generate_pdf(file,clean=False,compiler='xetex')
オプション= Falseをきれいに
1ソリューションを確認する! Package inputenc Error: Unicode char ‐ (U+2010)
(inputenc) not set up for use with LaTeX.
:そう、eは、特定のエラーを得た私は再び試みたサーバーのコマンドライン(にpdflatexのfile_name.text)を使用して、多くのファイルは* .texを含まダンプファイルに次の行を手動で追加します。
\DeclareUnicodeCharacter{2010}{-}% support older LaTeX version
しかし、私はこれをPYLATEXでどうやって行うことができますか?このケースを扱う別の方法がありますか?私の意見では、ラテックスで扱うことのできないUnicodeCharacterをすべて設定するのは難しいです。