Coder Social home page Coder Social logo

lol's Introduction

lol a LaTeX online compiler CLI tool

lol is a small command line interface (CLI) that sends local files to distant server (https://latexonline.cc/ or latex.ytotech.com) for LaTeX compilation and save the resulting pdf.

Usage

To compile a single main.tex file to main.pdf using latexonline.cc:

> ./lol main.tex

To compile main.tex including png images in imgs folder with xelatex using latex.ytotech.com:

> ./lol -s ytotech -c xelatex main.tex imgs/*.png

A help message is provided:

> ./lol -h
lol (version: ---)
LaTeX online compiler. More info at www.github.com/kpym/lol.

Available options:
  -s, --service string    Service can be laton or ytotex.
  --url        string    The base url for the service. If empty, the default URL is used.
  -c, --compiler string   One of pdflatex,xelatex or lualatex.
                          For ytotex platex, uplatex and context are also available.
                           (default "pdflatex")
  -f, --force             Do not use the laton cache. Force compile. Ignored by ytotech.
  -b, --biblio string     Can be bibtex or biber for ytotex. Not used by laton.
  -o, --output string     The name of the pdf file. If empty, same as the main tex file.
  -m, --main string       The main tex file to compile.
  -q, --quiet             Prevent any output.
  -v, --verbose           Print info and errors. No debug info is printed.
      --debug             Print everithing (debug info included).

Examples:
> lol main.tex
> lol  -s ytotech -c xelatex main.tex
> lol main.tex personal.sty images/img*.pdf
> cat main.tex | lol -c lualatex -o out.pdf

Installation

Precompiled executables

You can download the executable for your platform from the Releases.

Compile it yourself

Using Go

$ go install github.com/kpym/lol@latest

Using goreleaser

After cloning this repo you can compile the sources with goreleaser for all available platforms:

git clone https://github.com/kpym/lol.git .
goreleaser --snapshot --skip-publish --clean

You will find the resulting binaries in the dist/ sub-folder.

Configuration

As lol use viper the parameters can be provided not only by flags but also be read from config file (lol.yaml, lol.toml, lol.json...) or/and from environment variables (starting with LOL_).

Using config file

You can provide all default values for flags in a config lol file in the current folder. For example if your project needs xelatex and use imgs/logo.png you can save the following lol.yaml in the current folder

Compiler: xelatex
Patterns:
  - imgs/logo.png

Using environment variables

If you wan to provide global default values you can set an environment variable. For example if you want by default to use ytotech service you can set LOL_SERVICE=ytotech.

License

MIT for this code (but all used libraries may have different licences).

lol's People

Contributors

kpym avatar monsieurv avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

monsieurv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.