• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mneri/pnglatex: Create PNG Images from LaTeX Formulas

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mneri/pnglatex

开源软件地址(OpenSource Url):

https://github.com/mneri/pnglatex

开源编程语言(OpenSource Language):

Shell 100.0%

开源软件介绍(OpenSource Introduction):

pnglatex

pnglatex is a small script that turns LaTeX formulas into png images.

$ pnglatex -f "E=mc^2"

E=mc^2

Installation

Download or clone the repository, then type

# chmod +x pnglatex
# cp pnglatex /usr/bin/pnglatex

Dependencies

pnglatex depends on dvipng, imagemagick, latex and optipng packages.

Tips

You can pipe into pnglatex:

$ cat formula.tex | pnglatex

You can generate and open your image with a one-liner:

$ pnglatex -f "E=mc^2" | xargs eog

Omitting -f option will start interactive mode.

$ pnglatex
E=mc^2
<Ctrl-D>

Logs can give you a good idea of what went wrong.

$ pnglatex -f "E=mc^2" -l out.log

Options

  • -b <color> Set the background color
  • -B <color> Set the border color
  • -d <dpi> Set the output resolution to the specified dpi
  • -e <environment> Set the environment for the formula (i.e. displaymath or eqnarray)
  • -f <formula> The LaTeX formula
  • -F <color> Set the foreground color
  • -h Print the help message
  • -H <file> Insert the content of the specified file in the preamble
  • -l <file> Log file
  • -m <margin> Set the margin
  • -o <file> Specify the output file name
  • -O Optimize the image
  • -p <packages> A colon separated list of LaTeX package names
  • -P <padding> Set the padding
  • -s <size> Set the font size
  • -S Don't print image file name
  • -v Show version

Defaults

You can set default options by creating a properties file named .pnglatex in your home directory. The following is an example content:

BACKGROUND=White
BORDER=
DPI=180
ENVIRONMENT=displaymath
FOREGROUND=Black
HEADER=
MARGIN=
OPTIMIZE=1
PACKAGES=amsmath:amssymb
PADDING=3
SIZE=11

Command line provided options override the default options in the ~/.pnglatex file.

cliptex Plugin

cliptex is a small script that creates LaTeX formulas using the system clipboard.

$ cliptex

The above command uses the content of the system clipboard to generate a LaTeX formula. The clipboard is then replaced by the generated image.

Tips

Bind the script to the Ctrl + Alt + C key combination. Write your formula directly in the GMail editor, select it and strike the key combination. Then, press Ctrl + V to replace the formula with the generated image.

cliptex uses the default options set in the ~/.pnglatex file.

Installation

Download or clone the repository, then type

# chmod +x cliptex
# cp cliptex /usr/bin/cliptex

Dependencies

cliptex depends on pnglatex, wl-clipboard and xclip.

Options

  • -h Print this help message.
  • -s <session> Force a session (wayland or x11).
  • -S Don't show system notifications.
  • -v Show version.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
joeyuping/quick_latex_obsidian发布时间:2022-07-09
下一篇:
volodymyrprokopyuk/kotlin-sdp: Software Design Patterns in Kotlin发布时间:2022-07-07
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap