[英]Is there a way to change LaTeX preview output size or font size in sympy
我正在用 discord.py 制作 discord 機器人。 目前,我正在使用帶有 sympy 的 LaTeX 打印機。
我有代碼:
@commands.command(name="latex",
aliases=["tex", "tx"])
async def texPrt(self, ctx, *, text):
Funcs.command_exec(ctx)
expre = sympify(text, evaluate=False)
preview(expre, viewer="file", filename="output.png")
await ctx.send(file=discord.File(f"./output.png", filename="LaTeX_output.png"))
唯一的問題是輸出的圖像非常小且分辨率低。 有沒有辦法讓它渲染圖像更大並增加字體大小。
另外,如果可能的話,我想將背景顏色更改為類似於 discord,但這不是優先事項。
在dvioptions
中設置密度參數:
preview(expr, viewer="file", filename="output.png", dvioptions=['-D','1200'])
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.