惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
O
OpenAI News
Cloudbric
Cloudbric
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
J
Java Code Geeks
Help Net Security
Help Net Security
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
Security Archives - TechRepublic
Security Archives - TechRepublic
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
H
Help Net Security
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Jina AI
Jina AI
S
Security @ Cisco Blogs
月光博客
月光博客
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
F
Fortinet All Blogs
S
Securelist
M
MIT News - Artificial intelligence
V
Vulnerabilities – Threatpost
小众软件
小众软件
T
Tenable Blog
Y
Y Combinator Blog
T
Threat Research - Cisco Blogs
博客园 - 叶小钗
N
News | PayPal Newsroom
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity

Jonathan Fine

Towards 21st Century Digital Typography Render Latex Multiple Ways A Blind Math User Story A Visually Impaired Coder's User Story Accessible and Tagged PDF User Stories and Accessibility New Online Tools for TeX Beginners Tex Hour Agenda Blind Math News Accessibility Evaluation: Open University and RNIB Accessibility Tools Latex math on social media Multi Author Docs Blind Math News Happy Birthday Don Knuth New Year's and Christmas Fun Tex Office Hours Importance of Typography UK TeX users — from here to there Calling UK LaTeX editors etc LaTeX Tutor Sub and Sup A LaTeX Typing Tutor About the LaTeX Typing Tutor London Scholarly Tech Meetup UK TeX User Group survives Jonathan Fine's statement for Chair of UK TUG Some new 2019 Q3 ac.uk LaTeX pages UK TUG — more news soon Why 2358? Why did I choose Hugo? Linear homology in a nutshell: now on arxiv Contact
Lighter TeX Runs Faster
2021-03-24 · via Jonathan Fine

Summary

This post is making TeX working better on the cloud. It does this by making a custom TeX Live that contains only the resource your document needs. It's preparation for the TeX Hour tomorrow (Thursday 25 March). There's a proof-of-concept at the URLs at the foot of this page.

In case you didn't know, every Thursday (18:30 to 19:30 UK time) there's a zoom TeX Hour. The zoom URL and other details are here.

Introduction

Github provides free continuous integration (CI). This means for example that tests are run whenever there's a commit. And it doesn't have to be tests. We could run LaTeX whenever one of our source files is changed. This tests run quicker when we they install only the necessary resouces. Before about 2 minutes. After about 20 seconds. This is satisfactory for occasional use and, but construction, is fully integrated into Github. I expect the same to be true for Gitlab.

An example

The source file for Don Knuth's The TeXbook is, roughly, 20,000 lines occupying 1.4 MB. A TeX-Live distribution when installed occupies several gigabytes. In other words, perhaps 3,000 times the size. Most of this mass of files is not needed to typeset The TeXbook.

I've developed a semi-automated method that discovers exactly which files are needed to typeset a TeX or LaTeX document. Chapter 6 of The TeXbook uses a short file story.tex as an example. Here it is.

\hrule
\vskip 1in
\centerline{\bf A SHORT STORY}
\vskip 6pt
\centerline{\sl    by A. U. Thor} % !`?`?! (modified)
\vskip .5cm
Once upon a time, in a distant
  galaxy called \"O\"o\c c,
there lived a computer
named R.~J. Drofnats.

Mr.~Drofnats---or ``R. J.,'' as
he preferred to be called---% error has been fixed!
was happiest when he was at work
typesetting beautiful documents.
\vskip 1in
\hrule
\vfill\eject

To typeset this file to PDF requires 5 additional files, that occupy about 6MB in total. (When compressed, they're less than 2.5MB.)

# bytes name
34811	cmbx10.pfb
35752	cmr10.pfb
35022	cmsl10.pfb
2219712	pdftex
3899591	pdftex.fmt

A comparison

First before. We use this LaTeX file

\documentclass{article}
\begin{document}
Hello world.
\end{document}

Running the typesetting this document takes over 2 minutes. For evidence see the actions record page.

Now after. Running the typesetting story.tex using the lighter TeX takes about 20 seconds. For evidence see the actions record page.

Why the difference?

For both the TeX and LaTeX examples the typesetting task is in the queue for about 15 seconds before being started. The typesetting itself takes no more than a second in both cases. The big difference is in setting up the typesetting environment. In the CI system this is done from scratch every time. That helps ensure reproducible results.

For LaTeX we used a generic install from TeX-Live. For TeX we used a custom install that provided only the 5 files listed above, together with configuration and utitity scripts. For LaTeX this took almost 2 minutes. For TeX it took no time at all.

Isn't this unfair to LaTeX?

I chose to optimise Don Knuth's story.tex because it was small enough to be done by hand. I then chose to semi-automate it to avoid errors and ensure reproducibility.

Repeating this process for LaTeX might require more work on the automation tools. After that, I fully expect the LaTeX results to be within 5 seconds of the TeX results. And in both cases I expect more complex documents to add only a few seconds.

Of course, if you're typesetting a font catalog or a comprehensive symbol list then you'll have to install a lot of fonts. This might take a few seconds.

The future

To learn more go to the pages

and explore. Soon, probably tomorrow, I provide proof-of-concept instructions on how use these Social TeX repositories to typeset suitable content of your own.

Hint: Fork the repository, enable Actions in the fork, and modify the source files

but in your clone of the Social TeX repository.

When you go to your Actions tab and click on the TeX / LaTeX action in the workflows column, you'll see a Run workflow button. Press it!

Apologies

This is all proof-of-concept at present. My focus has been on understanding and solving the technical problems. So usability and documentation isn't quite there yet. A thorough reworking is needed.

Acknowledgement

Xu Cheng's https://github.com/xu-cheng/latex-action gave me a great help in getting my own work started. It provided something out of the box that worked, that I could tinker with. I'm most grateful. Altogether 68 people have forked his work.