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

SwiftLaTeX/SwiftLaTeX: SwiftLaTeX, a WYSIWYG Browser-based LaTeX Editor

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

开源软件名称(OpenSource Name):

SwiftLaTeX/SwiftLaTeX

开源软件地址(OpenSource Url):

https://github.com/SwiftLaTeX/SwiftLaTeX

开源编程语言(OpenSource Language):

C 58.0%

开源软件介绍(OpenSource Introduction):

SwiftLaTeX

Demo Website https://www.swiftlatex.com

Building Assets

Introduction for SwiftLaTeX

SwiftLaTeX, LaTeX Engines in Browsers with optional WYSIWYG support. We are a big fan of WebAssembly and all computation is done locally.

Main Features

  1. Speed. SwiftLaTeX engines run in browsers, all computation is done strictly locally.
  2. Library Support. Simply include a script tag and use PdfTeX or XeTeX in your own webpage.
  3. Compatibility. Produce exact same output you would get from TexLive or MikTeX.
  4. WYSIWYG. SwiftLaTeX provides an optional WYSIWYG editor, allowing users to editing PDF output directly (WIP).

Quick Installation Guide

  1. Download latest release from Github. Extract the files and put them into your webpage directory.
  2. Include the src tag in your page.
<script src="PdfTeXEngine.js"></script>
  1. Initialize the engine.
const engine = new PdfTeXEngine();
await engine.loadEngine();
  1. Load the tex files/pictures/fonts to engines.
engine.writeMemFSFile("main.tex", "\documentclass{...");
  1. Set the main file and fire the engine.
engine.setEngineMainFile("main.tex");
let r = await engine.compileLaTeX(); // r contains PDF binray and compilation log.

APIs

  1. async loadEngine(): Promise.
    Load the webassembly engine.
  2. isReady(): boolean.
    Check whether the engine is ready to compile documents.
  3. writeMemFSFile(filename: string, srccode: string | Uint8Array).
    Upload source codes / assets to the engine.
  4. makeMemFSFolder(folder: string).
    Create a directory.
  5. setEngineMainFile(filename: string).
    Tell the engine which latex file is the entry file.
  6. compileLaTeX():Promise.
    Start compiling LaTeX documents and return CompileResult.
  7. flushCache().
    Purge all the files uploaded.
  8. closeWorker().
    Shutdown the engine.
  9. setTexliveEndpoint(url: string).
    If you host your own texlive server, you can ask the engine to fetch files from the server.
  10. compileFormat().
    If you host your own texlive server, you may wanna generate the tex engine format file via this function.

Compile Engines by yourself

SwiftLaTeX compiles XeTeX and PdfTeX engines into WebAssembly. We recommend the XeTeX engine as it supports UTF-8 and Opentype fonts out of box. The engine is almost 100% identical to XeTeX except SwiftLaTeX does not include a full ICU dataset. As a result, the locale linebreaking may not function as expected. This issue is easy to fix: we just need to initialize the ICU library with the correct dataset. If you just need to handle English, the PdfTeX is also a nice option. It is less compilcated, thus faster and less buggy.

  1. Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
  1. Enter that directory
cd emsdk
  1. Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
  1. Download and install the latest SDK tools.
./emsdk install latest
  1. Make the latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
  1. Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
  1. Compile XeTeX or PdfTeX
cd pdftex.wasm or xetex.wasm
make

CTAN files

LaTeX is not a stand-alone typesetting program in itself, but document preparation software that runs on top of Donald E. Knuth's TeX typesetting system. TeX distributions usually bundle together all the parts needed for a working TeX system and they generally add to this both configuration and maintenance utilities. Nowadays LaTeX, and many of the packages built on it, form an important component of any major TeX distribution. In SwiftLaTeX, all required files are fetched from CTAN (Comprehensive TeX Archive Network), https://www.ctan.org, or our mirror server https://texlive.swiftlatex.com. You can checkout the repo https://github.com/SwiftLaTeX/Texlive-Ondemand and host your own server.

WYSIWYG Editor

We are also working hard to bring back our WYSIWYG latex editor. The editor is pretty similar to overleaf, except users are allowed to edit pdf output directly.

License

The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the LICENSE file. Copyright (c) SwiftLab, 2018-2022.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
chaxiu/KotlinJetpackInAction: 发布时间:2022-07-07
下一篇:
FriendlyUser/LatexDiagrams: Latex Diagrams that I have generated/taken from inte ...发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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