{"id":14036959,"url":"https://github.com/aslushnikov/latex-online","last_synced_at":"2025-05-15T12:04:23.893Z","repository":{"id":3157897,"uuid":"4188244","full_name":"aslushnikov/latex-online","owner":"aslushnikov","description":"Online latex compiler. You give it a link, it gives you PDF","archived":false,"fork":false,"pushed_at":"2024-10-21T18:00:31.000Z","size":2257,"stargazers_count":529,"open_issues_count":33,"forks_count":97,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-14T19:59:37.357Z","etag":null,"topics":["javascript","latex","latex-online","pdf","tex"],"latest_commit_sha":null,"homepage":"http://latexonline.cc","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aslushnikov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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":"aslushnikov","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2012-05-01T00:12:12.000Z","updated_at":"2025-03-24T21:57:56.000Z","dependencies_parsed_at":"2024-10-21T23:10:19.383Z","dependency_job_id":null,"html_url":"https://github.com/aslushnikov/latex-online","commit_stats":{"total_commits":283,"total_committers":15,"mean_commits":"18.866666666666667","dds":0.4558303886925795,"last_synced_commit":"c785d5a03749023441442705fb906999878962d1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Flatex-online","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Flatex-online/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Flatex-online/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslushnikov%2Flatex-online/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aslushnikov","download_url":"https://codeload.github.com/aslushnikov/latex-online/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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":["javascript","latex","latex-online","pdf","tex"],"created_at":"2024-08-12T03:02:21.726Z","updated_at":"2025-05-15T12:04:18.833Z","avatar_url":"https://github.com/aslushnikov.png","language":"Python","funding_links":["https://github.com/sponsors/aslushnikov"],"categories":["Python"],"sub_categories":[],"readme":"\u003c!-- links to social media icons --\u003e\n\u003c!-- icons with padding --\u003e\n[1.1]: http://i.imgur.com/tXSoThF.png (twitter icon with padding)\n\u003c!-- icons without padding --\u003e\n[1.2]: http://i.imgur.com/wWzX9uB.png (twitter icon without padding)\n\u003c!-- links to your social media accounts --\u003e\n[1]: http://www.twitter.com/latex_online\n\u003c!-- Please don't remove this: Grab your social icons from https://github.com/carlsednaoui/gitsocial --\u003e\n\n# About LaTeX.Online [![alt text][1.1]][1]\n\nThis service is developed to compile latex documents online. It can build PDF directly from GIT repository with TeX sources or from any link to TeX file. \n\nIn addition, the service provides command-line utility (for compiling local documents), API and Stand-Alone version. See more below.\n\n[Latex-Online](http://latexonline.cc)\n\n## Contents\n\n- [Latex-Online](#latex-online)\n    - [Capabilities](#capabilities)\n    - [API](#api)\n        - [Compile url](#compile-url)\n        - [Compile text](#compile-text)\n        - [Compile git repo](#compile-git-repo)\n        - [Optional request arguments](#optional-request-arguments)\n    - [Command-line interface](#command-line-interface)\n        - [Installation](#installation)\n        - [Example 1: compile single file](#example-1-compile-single-file)\n        - [Example 2: compile files with dependencies](#example-2-compile-files-with-dependencies)\n        - [Example 3: compile local git repo](#example-3-compile-local-git-repo)\n    - [How it works?](#how-it-works)\n        - [1. Given a link to a `.TEX` file, compile it](#1-given-a-link-to-a-tex-file-compile-it)\n        - [2. Given a `.TEX` file content, compile it](#2-given-a-tex-file-content-compile-it)\n        - [3. Given a tarball with files structure, compile it](#3-given-a-tarball-with-files-structure-compile-it)\n        - [4. Given a git repo, compile it](#4-given-a-git-repo-compile-it)\n    - [DEPLOYMENT](#deployment)\n        - [Deploy with Docker](#deploy-with-docker)\n        - [Deploy manually](#deploy-manually)\n            - [Dependencies](#dependencies)\n            - [Installation](#installation)\n            - [Running](#running)\n\n## Capabilities\n\n- Compile `.TEX` file via link. (Limitation: includes will be ignored)\n- Compile GIT repo via link.\n- Compile local files or git repo via command-line interface.\n- REST API for compiling.\n\n## API\n\n**HTTP Response Codes**\n\nThe service will return HTTP.2xx on success and compiled PDF file. Otherwise\na HTTP.4xx code will be returned with a compilation error log in response body.\n\n### Compile url\n\n**Format:**\n\n```\n/compile?url=\u003curl to tex file\u003e\n```\n\n**Example:**\n\n```\nlatexonline.cc/compile?url=https://raw.githubusercontent.com/aslushnikov/latex-online/master/sample/sample.tex\n```\n\n**Limitation:** this command will ignore all includes during compiling\n\n### Compile text\n\n**Format:**\n\n```\n/compile?text=\u003ctex file content\u003e\n```\n\n**Example:**\n```\nlatexonline.cc/compile?text=%5Cdocumentclass%5B%5D%7Barticle%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Blmodern%7D%0A%5Cusepackage%7Bamssymb%2Camsmath%7D%0A%5Cusepackage%7Bifxetex%2Cifluatex%7D%0A%5Cusepackage%7Bfixltx2e%7D%20%25%20provides%20%5Ctextsubscript%0A%25%20use%20microtype%20if%20available%0A%5CIfFileExists%7Bmicrotype.sty%7D%7B%5Cusepackage%7Bmicrotype%7D%7D%7B%7D%0A%5Cifnum%200%5Cifxetex%201%5Cfi%5Cifluatex%201%5Cfi%3D0%20%25%20if%20pdftex%0A%20%20%5Cusepackage%5Butf8%5D%7Binputenc%7D%0A%5Celse%20%25%20if%20luatex%20or%20xelatex%0A%20%20%5Cusepackage%7Bfontspec%7D%0A%20%20%5Cifxetex%0A%20%20%20%20%5Cusepackage%7Bxltxtra%2Cxunicode%7D%0A%20%20%5Cfi%0A%20%20%5Cdefaultfontfeatures%7BMapping%3Dtex-text%2CScale%3DMatchLowercase%7D%0A%20%20%5Cnewcommand%7B%5Ceuro%7D%7B%E2%82%AC%7D%0A%5Cfi%0A%5Cusepackage%5Ba4paper%5D%7Bgeometry%7D%0A%5Cifxetex%0A%20%20%5Cusepackage%5Bsetpagesize%3Dfalse%2C%20%25%20page%20size%20defined%20by%20xetex%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20unicode%3Dfalse%2C%20%25%20unicode%20breaks%20when%20used%20with%20xetex%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xetex%5D%7Bhyperref%7D%0A%5Celse%0A%20%20%5Cusepackage%5Bunicode%3Dtrue%5D%7Bhyperref%7D%0A%5Cfi%0A%5Chypersetup%7Bbreaklinks%3Dtrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20bookmarks%3Dtrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20pdfauthor%3D%7B%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20pdftitle%3D%7B%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20colorlinks%3Dtrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20urlcolor%3Dblue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20linkcolor%3Dmagenta%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20pdfborder%3D%7B0%200%200%7D%7D%0A%5Csetlength%7B%5Cparindent%7D%7B0pt%7D%0A%5Csetlength%7B%5Cparskip%7D%7B6pt%20plus%202pt%20minus%201pt%7D%0A%5Csetlength%7B%5Cemergencystretch%7D%7B3em%7D%20%20%25%20prevent%20overfull%20lines%0A%5Csetcounter%7Bsecnumdepth%7D%7B0%7D%0A%0A%5Cauthor%7B%7D%0A%5Cdate%7B%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BHello%20World%7D%5Clabel%7Bhello-world%7D%0A%0AThis%20is%20your%20first%20%5Cemph%7BC%7D%20program%3A%0A%0A%5Cbegin%7Bverbatim%7D%0A%23include%20%3Cstdio.h%3E%0A%0Aint%20main(void)%20%0A%7B%0A%20%20printf(%22hello%2C%20world%5Cn%22)%3B%0A%20%20return%200%3B%0A%7D%0A%5Cend%7Bverbatim%7D%0A%0ALet's%20write%20some%20math%3A%0A%5C%5B%20%5Cfrac%7Bdf(x)%7D%7Bdx%7D%3D%5Clim_%7Bh%20%5Cto%200%7D%7B%5Cfrac%7Bf(x%2Bh)-f(x)%7D%7Bh%7D%7D%20%5C%5D%0A%5Cend%7Bdocument%7D\n```\n\n### Compile git repo\n\n**Format:**\n\n```\n/compile?git=\u003crepo\u003e\u0026target=\u003ctarget file\u003e\n```\n\nThis will fetch git `repo` and compile the `target`. `target` should be a relative path to the repository root.\n\n**Example:**\n\n```\nlatexonline.cc/compile?git=https://github.com/aslushnikov/diplom-latex\u0026target=diplom.tex\n```\n\n### Optional request arguments\n\nFor every compilation request you can pass the following additional arguments:\n\n- `force=true` This will force cache skipping and document recompilation\n- `command=xelatex` This will compile document with `xelatex` compiler. Other available options are:\n    - `pdflatex`\n    - `xelatex`\n    - `lualatex`\n- `download=sample.pdf` This will initiate downloading of the resulting PDF\n    into the file with the name \"sample.pdf\"\n\n## Command-line interface\n\nThe command-line interface makes it possible to edit TeX documents in\n`vim`/`emacs` and compile them whenever you want from the command-line. To do so, you will\nneed a tool called `laton`.\n\n### Installation\n\n\n```\ncurl -L https://raw.githubusercontent.com/aslushnikov/latex-online/master/util/latexonline \u003e laton \u0026\u0026 chmod 755 laton\n```\n\nThis command will result in a `laton` script created in a current directory. Put it somewhere\nyour $PATH references to make it available around the system.\n\n### Example 1: compile single file\n\nIf you've got a single file (say `main.tex`) that doesn't have any includes,\nthen you can compile it like this:\n\n```\nlaton main.tex\n```\n\nAfter compiling file `main.pdf` will be created in the current dir\n\n### Example 2: compile files with dependencies\n\nIf your paper includes some files, you have to declare them to the\n`laton`.\n\n```\nlaton main.tex some-image.jpg some-cool-file.tex\n```\n\n*NB* The first file should be the file you want to compile, all others are\nsupporting files.\n\n### Example 3: compile local git repo\n\nIn case you store all your `.tex` and supporting files in a git repo, you\ncan compile the project with the command\n\n```\nlaton -g main.tex\n```\n\nThe script will behave as if `main.tex` includes each file stored in your git repo.\n\n## How it works?\n\nIn this section a brief description of the service from the inside is given.\n\nGenerally speaking the service is made out of two parts\n\n- `Node.js` part which with the help of `express.js` provides the REST API, and\n  with the help of `mc` bridges the gap with `memcached` instance\n- `Bash` scripts which handle all the jobs related to the service (fetching\n  files, hashSumming them, compiling e.t.c)\n\nThere are three types of requests:\n\n1. Given a link to a `.TEX` file, compile it\n2. Given a tarball with files structure, compile it\n3. Given a git repo, compile it\n\nEvery request is handled in a bit special way\n\n### 1. Given a link to a `.TEX` file, compile it\n\n1. The URL of the given file is fetched and saved locally\n2. The hash sum of the file is counted in some way\n3. Check in cache if we've got a PDF for the hashsum\n4. If yes, then just return the precompiled PDF from cache\n5. If no, then compile the file, cache the result and return it to user\n\n### 2. Given a `.TEX` file content, compile it\n\n1. Given content is saved locally\n2. The hash sum of the file in counted in some way\n3. Check in cache if we've got a PDF for the hashsum\n4. If yes, then just return the precompiled PDF from cache\n5. If no, then compile the file, cache the result and return it to user\n\n### 3. Given a tarball with files structure, compile it\n\n1. The tarball is saved locally\n2. The hash sum of the tarball is counted in some way\n3. Check in cache if we've got a PDF for the hashsum\n4. If yes, then just return the precompiled PDF from cache\n5. If no, then extract file structure from the tarball, compile it,\n    cache the result and return it to user\n\n### 4. Given a git repo, compile it\n\nThis kind of request is handled in a bit different way, as we can\nget a hashSum of the repo without cloning the entire repository.\n\n1. Using `git ls-remote` extracting `sha1` of the master branch\n3. Check in cache if we've got a PDF for the given `sha1`\n4. If yes, then just return the precompiled PDF from cache\n5. If no, then do a shallow copy of the given git repo\n6. Compile it, cache the result and return it to user\n\n## DEPLOYMENT\n\nThis part is for you if you'd like to deploy the service on your\nown machine. There are two ways to do it:\n- easy one, with the help of awesome project [Docker](http://www.docker.io/)\n- the hard one - to do everything manually.\n\n### Deploy with Docker\n\nA Docker image is hosted and auto-updated on [hub.docker.com](https://hub.docker.com/r/aslushnikov/latex-online/)\n\n1. `docker pull aslushnikov/latex-online`\n2. `docker run -d -p 2700:2700 -t aslushnikov/latex-online`\n\n### Deploy manually\n\n\n#### Dependencies\n\n- `pdflatex` command to compile documents\n- `bc` to estimate some values in scripts\n- `curl` to fetch documents from web\n- `node.js` to run server\n- `npm` to install node dependencies\n- `memcached` for caching compiled documents\n- `md5` or `md5sum` utility to hash documents according to their value\n- `python3` to run the `latexrun` build system\n\n#### Installation\n\n1. `git clone git@github.com:aslushnikov/latex-online.git` to clone repo\n2. `sh util/check.sh` to check if all dependencies are satisfied and create\n   `tmp/` dir\n3. `npm install` to install node dependencies\n\nInstallation of `pdflatex` is beyond the scope of the document.\n\n#### Running\n\n1. `node app.js` - runs node server\n2. `memcached` - runs local memcached instance\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslushnikov%2Flatex-online","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faslushnikov%2Flatex-online","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslushnikov%2Flatex-online/lists"}