我正在尝试从这里运行确切的代码以获得 pylatex 工作的示例。
在我正在工作的目录中,我从链接中复制并粘贴了:
from pylatex import Document, Section, Subsection, Command
from pylatex.utils import italic, NoEscape
import pdflatex
def fill_document(doc):
"""Add a section, a subsection and some text to the document.
:param doc: the document
:type doc: :class:`pylatex.document.Document` instance
"""
with doc.create(Section('A section')):
doc.append('Some regular text and some ')
doc.append(italic('italic text. '))
with doc.create(Subsection('A subsection')):
doc.append('Also some crazy characters: $&#{}')
if __name__ == '__main__':
# Basic document
doc = Document('basic')
fill_document(doc)
doc.generate_pdf(clean_tex=False,compiler='pdflatex')
doc.generate_tex()
# Document with `\maketitle` command …Run Code Online (Sandbox Code Playgroud) 如何隐藏启动和执行pylatex代码期间弹出的命令提示符。我有一个正在处理的页面并生成pdf。运行代码时,我需要隐藏弹出窗口。
谈论这个窗口:
有没有办法隐藏或不显示latexmk.exe弹出窗口?
我一直在搜寻和搜寻,但没有发现与此问题相关的内容。
如果我有一个使用 pylatex 设置的简单文档...
import pylatex as pl
geometry_options = {
"head": "1pt",
"margin": "0.2in",
"bottom": "0.2in",
"includeheadfoot": False}
doc = pl.Document(geometry_options=geometry_options)
doc.append("text")
Run Code Online (Sandbox Code Playgroud)
...如何在文本块后添加一定粗细的黑色水平分隔线?