latex-online

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

About LaTeX.Online alt text

This 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.

In addition, the service provides command-line utility (for compiling local documents), API and Stand-Alone version. See more below.

Latex-Online

Contents

Capabilities

  • Compile .TEX file via link. (Limitation: includes will be ignored)
  • Compile GIT repo via link.
  • Compile local files or git repo via command-line interface.
  • REST API for compiling.

API

HTTP Response Codes

The service will return HTTP.2xx on success and compiled PDF file. Otherwisea HTTP.4xx code will be returned with a compilation error log in response body.

Compile url

Format:

/compile?url=<url to tex file>

Example:

latexonline.cc/compile?url=https://raw.githubusercontent.com/aslushnikov/latex-online/master/sample/sample.tex

Limitation: this command will ignore all includes during compiling

Compile text

Format:

/compile?text=<tex file content>

Example:

latexonline.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

Compile git repo

Format:

/compile?git=<repo>&target=<target file>

This will fetch git repo and compile the target. target should be a relative path to the repository root.

Example:

latexonline.cc/compile?git=https://github.com/aslushnikov/diplom-latex&target=diplom.tex

Optional request arguments

For every compilation request you can pass the following additional arguments:

  • force=true This will force cache skipping and document recompilation
  • command=xelatex This will compile document with xelatex compiler. Other available options are:
    • pdflatex
    • xelatex
    • lualatex
  • download=sample.pdf This will initiate downloading of the resulting PDFinto the file with the name "sample.pdf"

Command-line interface

The command-line interface makes it possible to edit TeX documents invim/emacs and compile them whenever you want from the command-line. To do so, you willneed a tool called laton.

Installation

curl -L https://raw.githubusercontent.com/aslushnikov/latex-online/master/util/latexonline > laton && chmod 755 laton

This command will result in a laton script created in a current directory. Put it somewhereyour $PATH references to make it available around the system.

Example 1: compile single file

If you've got a single file (say main.tex) that doesn't have any includes,then you can compile it like this:

laton main.tex

After compiling file main.pdf will be created in the current dir

Example 2: compile files with dependencies

If your paper includes some files, you have to declare them to thelaton.

laton main.tex some-image.jpg some-cool-file.tex

NB The first file should be the file you want to compile, all others aresupporting files.

Example 3: compile local git repo

In case you store all your .tex and supporting files in a git repo, youcan compile the project with the command

laton -g main.tex

The script will behave as if main.tex includes each file stored in your git repo.

How it works?

In this section a brief description of the service from the inside is given.

Generally speaking the service is made out of two parts

  • Node.js part which with the help of express.js provides the REST API, andwith the help of mc bridges the gap with memcached instance
  • Bash scripts which handle all the jobs related to the service (fetchingfiles, hashSumming them, compiling e.t.c)

There are three types of requests:

  1. Given a link to a .TEX file, compile it
  2. Given a tarball with files structure, compile it
  3. Given a git repo, compile it

Every request is handled in a bit special way

1. Given a link to a .TEX file, compile it

  1. The URL of the given file is fetched and saved locally
  2. The hash sum of the file is counted in some way
  3. Check in cache if we've got a PDF for the hashsum
  4. If yes, then just return the precompiled PDF from cache
  5. If no, then compile the file, cache the result and return it to user

2. Given a .TEX file content, compile it

  1. Given content is saved locally
  2. The hash sum of the file in counted in some way
  3. Check in cache if we've got a PDF for the hashsum
  4. If yes, then just return the precompiled PDF from cache
  5. If no, then compile the file, cache the result and return it to user

3. Given a tarball with files structure, compile it

  1. The tarball is saved locally
  2. The hash sum of the tarball is counted in some way
  3. Check in cache if we've got a PDF for the hashsum
  4. If yes, then just return the precompiled PDF from cache
  5. If no, then extract file structure from the tarball, compile it,cache the result and return it to user

4. Given a git repo, compile it

This kind of request is handled in a bit different way, as we canget a hashSum of the repo without cloning the entire repository.

  1. Using git ls-remote extracting sha1 of the master branch
  2. Check in cache if we've got a PDF for the given sha1
  3. If yes, then just return the precompiled PDF from cache
  4. If no, then do a shallow copy of the given git repo
  5. Compile it, cache the result and return it to user

DEPLOYMENT

This part is for you if you'd like to deploy the service on yourown machine. There are two ways to do it:

  • easy one, with the help of awesome project Docker
  • the hard one - to do everything manually.

Deploy with Docker

A Docker image is hosted and auto-updated on hub.docker.com

  1. docker pull aslushnikov/latex-online
  2. docker run -d -p 2700:2700 -t aslushnikov/latex-online

Deploy manually

Dependencies

  • pdflatex command to compile documents
  • bc to estimate some values in scripts
  • curl to fetch documents from web
  • node.js to run server
  • npm to install node dependencies
  • memcached for caching compiled documents
  • md5 or md5sum utility to hash documents according to their value
  • python3 to run the latexrun build system

Installation

  1. git clone git@github.com:aslushnikov/latex-online.git to clone repo
  2. sh util/check.sh to check if all dependencies are satisfied and createtmp/ dir
  3. npm install to install node dependencies

Installation of pdflatex is beyond the scope of the document.

Running

  1. node app.js - runs node server
  2. memcached - runs local memcached instance
  • LATEX 真的是比较强大,排版也比较好看,KNUTH大神NB。 插入图片时(使用\begin{figure},\end{figure}块)出现一个问题 提示undefined control sequence \includegraphics 然后只需在\documentclass{article}后加一句\usepackage{graphicx} ,有点像java使用jar包或者 C++包含一

  • eqneditor:有强大的几乎所有常用的数学符号对应的图标形式,便于快速完成latex公式编辑且易于粘贴拷贝。 此外,更为重要的一点是,随着编辑窗口内公式的编辑,会在页面的底部,自动生成其对应的 html 标签语言,便于在一些不支持编译 latex 公式的网页内嵌入 latex 公式(自然生成图片,以插入图片(甚至可以选择图片的类型)的形式进行) Mathcha sharelatex:在线排版工

  • 表格位置 eg. \begin{table}[h!] h! 参数代表着表格的位置是必须这里 h 大约出现在这里(here)。 t 出现在页面的顶部(top)。 b 出现在页面的底部(bottom)。 p 将表格放置在一个专门放置表格的特殊页面。 ! 覆盖LaTeX内部的参数。 H 将表格精确地放置在其出现的位置,一般等价于h! 表格参数 合并行和列 关键词:multicolumn eg. \mul

  •   LaTeX Example Here's my example set of LaTeX files to create paper.ps : paper.tex - Here's the "main" program intro.tex - First included file meat.tex - Second included file conc.tex - Last included

  • LATEX Templates Journals BioMed Central's TeX template http://www.biomedcentral.com/info/ifora/tex LaTeX style files for the Proceedings of the SPIE http://public.lanl.gov/kmh/spie/ Conferences NIPS 2

  • Home HTML to LaTeX (htmltolatex) is a Java program for converting HTML (XHTML also supported) pages into LaTeX format (or possibly to other markup formats - which depends only on the configuration). P

  • 网址 Online LaTeX diff tool 这个在线工具是latexdiff的包装脚本。通过使用这个工具,您可以不同安装Perl。 使用方法 将旧版的tex文件全文复制放在左边 将新版的tex文件全文复制放在右边 点击按钮,下方会生成新的文本 自己新建一个tex文件(注意这个文件和自己的新版tex文件在一个目录下) 将新生成的文本全文复制,放进新建的tex文件,生成即可 可能遇到的问题 问

  • Wiley Online Library的LATEX模板在WinEdt中的使用 请问大家这个latex模板在WinEdt你们是怎么操作的可以运行,我老是调试不通。非常感谢大家。 针对我的问题,总结一下: 我是因为MiKTeX配置不对。而且在使用WinEdt时,注意不要使用latex调试,会出现样式的不同。但是我调试时候仍然有些许问题。如:有很多警告。欢迎小伙伴前来一起讨论。 如何解决: 这里非常感

 相关资料
  • 部署 LaTeX 安装 texlive-core 新建 a.tex 文件,内容如下: \documentclass[11pt,a4paper]{article} %加入了一些针对XeTeX的改进并且加入了 \XeTeX 命令来输入漂亮的XeTeX logo \usepackage{xltxtra} %启用一些LaTeX中的功能 \usepackage{xunicode} %%%% fontspe

  • LaTeX(LATEX,音译“拉泰赫”)是一种基于TeX的排版系统。 LaTeX通过CTAN服务器发布,或作为TeX用户组(TUG)或第三方提供的许多易于安装和可用的TeX发布版本的一部分。如果您遇到问题,请访问帮助部分。 LaTeX本身并不是一个独立的排版程序,而是运行在Donald E. Knuth的TeX排版系统之上的文档准备软件。TeX发行版通常会将工作中的TeX系统所需的所有部件捆绑在一

  • Vim + LaTeX snippets setup How I'm able to take notes in mathematics lectures using LaTeX and Vim Vim configuration Copy tex.snippets to ~/.vim/UltiSnips/ and assuming you're using Vim Plug, add the f

  • latex-action GitHub Action to compile LaTeX documents. This actions runs on docker using a maximal TeXLive environment installed. Inputs root_file The root LaTeX file to be compiled. This input is req

  • PDF 下载: 放映版 阅读版 Copyright (C) 2018–2021 by Xiangdong Zeng.

  • Warning — looking for a maintainer This extension is no longer maintained. I'm sorry, it's not you, it's me. I still love this functionality, I've just moved to a different editor to get it.I don't wa