All Projects → store2be → pape-rs

store2be / pape-rs

Licence: MIT License
A Latex template to PDF generation web service written in Rust.

Programming Languages

rust
11053 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to pape-rs

WHUT-Bachelor
武汉理工大学本科生毕业设计(论文) LaTeX 模板 LaTeX Template for Bachelor's Degree Thesis at Wuhan University of Technology (WHUT)
Stars: ✭ 18 (-73.91%)
Mutual labels:  latex, latex-template
CV-latex
latex template for CV
Stars: ✭ 19 (-72.46%)
Mutual labels:  latex, latex-template
latex-template
南方科技大学 LaTeX 模板目录 SUSTech LaTeX templates
Stars: ✭ 72 (+4.35%)
Mutual labels:  latex, latex-template
letter-2-reviewers-LaTeX-template
A LaTeX template to write response letters for journal revisions
Stars: ✭ 32 (-53.62%)
Mutual labels:  latex, latex-template
persian-latex
A Persian Latex Template that can be used in different instances such as assignments, exams, quizzes; Not suitable for long documents such as theses or project reports.
Stars: ✭ 42 (-39.13%)
Mutual labels:  latex, latex-template
Open Publisher
Using Jekyll to create outputs that can be used as Pandoc inputs. In short - input markdown, output mobi, epub, pdf, and print-ready pdf. With a focus on fiction.
Stars: ✭ 242 (+250.72%)
Mutual labels:  latex, latex-template
awsome-list-of-cv-and-resume-templetes
a collection of cv and resume styles
Stars: ✭ 78 (+13.04%)
Mutual labels:  latex, latex-template
Novathesis
LaTeX template for MSc and PhD thesis (for NOVA University Lisbon an other institutions)
Stars: ✭ 185 (+168.12%)
Mutual labels:  latex, latex-template
latex-beamer-teamplates
My LaTeX Beamer Templates for Daily Presentation and Documentation.
Stars: ✭ 14 (-79.71%)
Mutual labels:  latex, latex-template
concise-cheat-sheets
Cheat Sheets for programming languages and tools
Stars: ✭ 98 (+42.03%)
Mutual labels:  latex, latex-template
cv
A LaTeX template for academic CVs
Stars: ✭ 129 (+86.96%)
Mutual labels:  latex, latex-template
usyd-beamer-theme
A Beamer theme that adheres to the University of Sydney Branding
Stars: ✭ 24 (-65.22%)
Mutual labels:  latex, latex-template
Scientific Thesis Template
LaTeX template for Master, Bachelor, Diploma, and Student Theses
Stars: ✭ 228 (+230.43%)
Mutual labels:  latex, latex-template
TJUThesisLatexTemplate
LaTeX templates for TJU graduate thesis. Originally forked from code.google.com/p/tjuthesis
Stars: ✭ 77 (+11.59%)
Mutual labels:  latex, latex-template
Awesome Cv
📄 Awesome CV is LaTeX template for your outstanding job application
Stars: ✭ 14,957 (+21576.81%)
Mutual labels:  latex, latex-template
xdupgthesis
西安电子科技大学研究生学位论文XeLaTeX模板
Stars: ✭ 271 (+292.75%)
Mutual labels:  latex, latex-template
Ucasthesis
**国科大新版标准** 中国科学院大学学位论文模板,目前遵守2018国科大指导标准。 a LaTeX template for UCAS.
Stars: ✭ 166 (+140.58%)
Mutual labels:  latex, latex-template
Betterposter Latex Template
LaTeX Template for Mike Morrison's #betterposter
Stars: ✭ 171 (+147.83%)
Mutual labels:  latex, latex-template
Yet-Another-LaTeX-Template-for-NPU-Thesis
西北工业大学硕博学位论文模版 | Yet Another Thesis Template for Northwestern Polytechnical University
Stars: ✭ 82 (+18.84%)
Mutual labels:  latex, latex-template
latex-mimore
A minimal & modern LaTeX template for reports
Stars: ✭ 26 (-62.32%)
Mutual labels:  latex, latex-template

Papers

Papers Logo

Build Status PRs Welcome license

A Latex template to PDF generation web service written in Rust. Papers is available as a docker image on Docker Hub. It relies on an installation of xelatex.

Papers uses semantic versioning. So until 1.0.0 is reached expect many breaking changes.

Examples / Documentation

Security

This service is not secure yet so it should not be publicly accessible. An invader could create a template that does bad things with Latex. Therefore, it is recommended to set the PAPERS_BEARER environment variable to a long and arbitrary string and set this string in the Authorization header of every request.

Endpoints

GET /healthz

Returns 200. For liveness probes in Kubernetes.

POST /submit

Headers:

Content-Type: application/json

Example body:

{
  "template_url": "http://example.com/template.tex.tera",
  "asset_urls": [
    "http://example.com/logo.png"
  ],
  "variables": {
    "world": "World"
  },
  "callback_url": "http://example.com/callback"
}
  • template_url: The Latex template as a downloadable URL.
  • asset_urls: An array of asset URLs that are used in the Latex template. They are downloaded next to the Latex document.
  • variables: The variables that are used in the Latex template.
  • callback_url: The URL that the final PDF or the error will be sent to.
  • no_escape_tex: (Optional) Disable escaping strings from variables for TeX special characters like &, % and $.

POST /preview

Headers:

Content-Type: application/json

Example body:

{
  "template_url": "http://example.com/template.tex.tera",
  "asset_urls": [
    "http://example.com/logo.png"
  ],
  "variables": {
    "world": "World"
  }
}
  • template_url: The Latex template as a downloadable URL.
  • asset_urls: An array of asset URLs that are used in the Latex template. They are downloaded next to the Latex document.
  • variables: The variables that are used in the Latex template.

Example Latex template

The templating language is Tera

\documentclass{article}

\begin{document}
hello, {{world}}

\end{document}

Papers registers two custom Tera filters which can be used in your templates:

  • unescape_tex: Papers defaults to escaping TeX special characters. This filter will remove the escape backslashes to make the contents of the variable be evaluated as TeX.
  • escape_tex: escapes TeX special characters - this is done by default by Papers so it's only useful combined with the no_escape_tex setting in the POST body.

Local server

Papers ships with the papers local command that you can use to develop your templates locally. Just put your assets in a directory, name your template template.tex.tera, put variables in a variables.json and run the binary. You will get a rendered PDF that is produced by the same code that runs in the service.

Take a look at the simple example in the examples directory for a quick introduction.

Explanation of the environment variables

PAPERS_BEARER

The string that will be checked in the Authorization header.

Default: <empty string>

Example:

PAPERS_BEARER=secret-string
=> Authorization=Bearer secret-string

PAPERS_LOG_LEVEL

The logger level for the Papers service.

Default: info
Other options: debug

PAPERS_PORT

The port the Papers sever runs on.

Default: 8080

PAPERS_MAX_ASSETS_PER_DOCUMENT

The maximum amount of assets per document/request accepted by Papers

Default: 20

PAPERS_MAX_ASSET_SIZE

The maximum size of assets in bytes (or with K, M or G suffix).

Default: 10M

PAPERS_ACCESS_KEY_ID

The key will be used for the S3 uploads.

Required.

PAPERS_SECRET_ACCESS_KEY

The secret key corresponding to PAPERS_ACCESS_KEY_ID.

Required.

PAPERS_S3_BUCKET

The S3 bucket where generated documents and debug output should be uploaded.

Required.

Example: my-company-name-papers

PAPERS_AWS_REGION

The AWS region the bucket belongs to.

Required.

Example: eu-central-1

PAPERS_S3_EXPIRATION_TIME

The expiration delay on the presigned urls returned to the callback url, in seconds.

Default: 86400

SENTRY_DSN

This is for tracking errors with sentry.io. If left blank, nothing will happen.

Default: ""
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].