mathpix

授权协议 Readme
开发语言
所属分类 企业应用、 LaTeX排版系统
软件类型 开源软件
地区 不详
投 递 者 单于俊智
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

mathpix

Installation:

mathpix is now on CRAN, so you can install using

install.packages("mathpix")

If you’re after newer development features (if there are any); you caninstall from GitHub using

devtools::install_github("jonocarroll/mathpix")

Authentication

The free API key has been removed due to overuse. Please sign up athttps://dashboard.mathpix.com/ then save your ID and key in your.Renviron file as

MATHPIX_APP_ID='yourid'
MATHPIX_APP_KEY='yourkey'

Note that this requires you to accept Mathpix’s terms and conditions andsign up for any relevant pricing scheme.

You can check that your credentials are loaded correctly withcredentials().

Usage

If you have an image you would rather properly encode in LaTeX, forexample

then simply calling

mathpix("./integral.jpg")

(with the appropriate path to the file) will insert a LaTeX block intoyour document which will render what the image represents

$$
 \int \frac { 4 x } { \sqrt { x ^ { 2 } + 1 } } d x  
$$

which renders to

Even complicated, hand-drawn figures work

mathpix("matrix_3x3.jpg")
$$
 A = \left( \begin{array} { l l l } { 2 } & { 7 } & { 3 } \\ { 3 } & { 5 } & { 2 } \\ { 9 } & { 4 } & { 1 } \\ \end{array} \right)  
$$

If your image only result in warnings and no LaTeX, use retry = TRUEto attempt some pre-processing of the image into a more amenable form.Unfortunately, there are still images which fail.

To not insert the resulting equation directly into your document, butrather store it in a variable, use insert = FALSE.

If you also wish to generate the images (although rmarkdown willgladly do this for you) this can be achieved using

render_latex(latex, fileDir)

where latex is the LaTeX generated by mathpix() (or any otherescaped LaTeX) and fileDir is the (optional) directory where you wishto save the image (by default, a temp file). This requires that you havepdflatex set up correctly and available on your machine.

API Documentation

Refer to http://docs.mathpix.com/