繁体   English   中英

有没有办法在 sympy 中更改 LaTeX 预览 output 大小或字体大小

[英]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"))

这采用用户输入并输出 png 图像的方程:

唯一的问题是输出的图像非常小且分辨率低。 有没有办法让它渲染图像更大并增加字体大小。
另外,如果可能的话,我想将背景颜色更改为类似于 discord,但这不是优先事项。

dvioptions中设置密度参数:

preview(expr, viewer="file", filename="output.png", dvioptions=['-D','1200'])

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM