有没有办法在 sympy 中更改 LaTeX 预览输出大小或字体大小
Is there a way to change LaTeX preview output size or font size in sympy
我正在用 discord.py 制作一个不和谐的机器人。目前,我正在使用 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'])
我正在用 discord.py 制作一个不和谐的机器人。目前,我正在使用 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'])