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

推荐订阅源

P
Privacy International News Feed
WordPress大学
WordPress大学
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
G
GRAHAM CLULEY
N
News | PayPal Newsroom
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
美团技术团队
J
Java Code Geeks
I
Intezer
The Cloudflare Blog
SecWiki News
SecWiki News
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
D
DataBreaches.Net
S
Security Affairs
Help Net Security
Help Net Security
S
Securelist
F
Full Disclosure
C
Check Point Blog
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园_首页
G
Google Developers Blog
Google Online Security Blog
Google Online Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog

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.