{"id":13401457,"url":"https://github.com/jonocarroll/mathpix","last_synced_at":"2025-04-04T10:07:30.845Z","repository":{"id":37587487,"uuid":"84137080","full_name":"jonocarroll/mathpix","owner":"jonocarroll","description":"Query the mathpix API to convert math images to LaTeX","archived":false,"fork":false,"pushed_at":"2024-04-26T09:56:33.000Z","size":309,"stargazers_count":249,"open_issues_count":1,"forks_count":25,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T09:06:14.000Z","etag":null,"topics":["latex","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonocarroll.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jonocarroll","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2017-03-07T00:56:42.000Z","updated_at":"2025-03-22T11:14:03.000Z","dependencies_parsed_at":"2024-01-13T18:24:45.348Z","dependency_job_id":"52c43e49-d27a-4153-8fa7-606d0ee69476","html_url":"https://github.com/jonocarroll/mathpix","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"76592ad423460817649d8e3d45d3be2ee9993c37"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fmathpix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fmathpix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fmathpix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonocarroll%2Fmathpix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonocarroll","download_url":"https://codeload.github.com/jonocarroll/mathpix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157081,"owners_count":20893202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latex","r"],"created_at":"2024-07-30T19:01:02.853Z","updated_at":"2025-04-04T10:07:30.805Z","avatar_url":"https://github.com/jonocarroll.png","language":"R","funding_links":["https://github.com/sponsors/jonocarroll"],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n![](./tools/logo_blue.png)\n\n# mathpix\n\n[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/mathpix)](https://cran.r-project.org/package=mathpix)\n[![packageversion](https://img.shields.io/badge/Package%20version-0.3.0-orange.svg?style=flat-square)](commits/master)\n[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](/commits/master)\n\n[![Linux/Mac Travis Build Status](https://img.shields.io/travis/jonocarroll/mathpix/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/jonocarroll/mathpix)\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/jonocarroll/mathpix?branch=master\u0026svg=true)](https://ci.appveyor.com/project/jonocarroll/mathpix)\n[![codecov](https://codecov.io/gh/jonocarroll/mathpix/branch/master/graph/badge.svg)](https://codecov.io/gh/jonocarroll/mathpix)\n\n[![Downloads](http://cranlogs.r-pkg.org/badges/mathpix)](http://www.r-pkg.org/pkg/mathpix)\n[![GitHub forks](https://img.shields.io/github/forks/jonocarroll/mathpix.svg)](https://github.com/jonocarroll/mathpix/network)\n[![GitHub stars](https://img.shields.io/github/stars/jonocarroll/mathpix.svg)](https://github.com/jonocarroll/mathpix/stargazers)\n[![Twitter](https://img.shields.io/twitter/url/https/github.com/jonocarroll/mathpix.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:\u0026url=%5Bobject%20Object%5D)\n\n## Installation:\n\n`mathpix` is now on CRAN, so you can install using\n\n```{r, eval = FALSE}\ninstall.packages(\"mathpix\")\n```\n\nIf you're after newer development features (if there are any); you can install from GitHub using\n\n```{r, eval = FALSE}\ndevtools::install_github(\"jonocarroll/mathpix\")\n```\n\n## Authentication\n\nThe free API key has been removed due to overuse. Please sign up at https://dashboard.mathpix.com/ then save your\nID and key in your `.Renviron` file as\n\n```\nMATHPIX_APP_ID='yourid'\nMATHPIX_APP_KEY='yourkey'\n```\n\nNote that this requires you to accept Mathpix's terms and conditions and sign up for any relevant pricing scheme.\n\nYou can check that your credentials are loaded correctly with `credentials()`.\n\n## Usage\n\nIf you have an image you would rather properly encode in LaTeX, for example\n\n![](./tools/integral.jpg)\n\nthen simply calling\n\n```{r, eval = FALSE}\nmathpix(\"./integral.jpg\")\n```\n\n(with the appropriate path to the file) will insert a LaTeX block into your document which will render what the image represents\n\n```\n$$\n \\int \\frac { 4 x } { \\sqrt { x ^ { 2 } + 1 } } d x  \n$$\n```\n\nwhich renders to\n\n![](./tools/eq_no_01.png)\n\nEven complicated, hand-drawn figures work \n\n![](./tools/matrix_3x3.jpg)\n\n```{r, eval = FALSE}\nmathpix(\"matrix_3x3.jpg\")\n```\n\n```\n$$\n A = \\left( \\begin{array} { l l l } { 2 } \u0026 { 7 } \u0026 { 3 } \\\\ { 3 } \u0026 { 5 } \u0026 { 2 } \\\\ { 9 } \u0026 { 4 } \u0026 { 1 } \\\\ \\end{array} \\right)  \n$$\n```\n\n![](./tools/eq_no_02.png)\n\nIf your image only result in warnings and no LaTeX, use `retry = TRUE` to attempt some pre-processing of the image into a more amenable form. Unfortunately, there are still images which fail.\n\nTo *not* insert the resulting equation directly into your document, but rather store it in a variable, use `insert = FALSE`.\n\n\u003c!-- If you also wish to generate the images (although `rmarkdown` will gladly do this for you) this can be achieved using --\u003e\n\n\u003c!-- ```{r, eval = FALSE} --\u003e\n\u003c!-- render_latex(latex, fileDir) --\u003e\n\u003c!-- ``` --\u003e\n\u003c!-- where `latex` is the LaTeX generated by `mathpix()` (or any other escaped LaTeX) and `fileDir` is the (optional) directory where you wish to save the image (by default, a temp file). This requires that you have `pdflatex` set up correctly and available on your machine. --\u003e\n\n## API Documentation\n\nRefer to http://docs.mathpix.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonocarroll%2Fmathpix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonocarroll%2Fmathpix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonocarroll%2Fmathpix/lists"}