博学
审问
慎思
明辨
笃行

Suos
Cultores
Scientia
Coronat

Education
Research
Service*

LuaTeX: Mimicking File System Input

In LaTeX, verbatim environments are extremely tricky. Different verbatim environments are based on distinct LaTeX magic, which makes their behavior inconsistent. The only realiable way to use a verbatim environment is to write them in the TeX source as-is, for any attempt to construct such environments programmatically usually fails. In existing packages, such problems are avoided by saving the constructed environments into files first and then use \input command to read them as TeX source files. I really dislike this solution as it induces significant I/O overhead (despite the fact that other I/O bottleneck may be more dominant). In this post, I provide a LuaTeX-based method that allows \input from Lua strings.

(This post corresponds to my question on TeX.SE.)

Introduction to LuaTeX

LuaTeX is a TeX engine which integrates Lua as its scripting language. The combination of an editing language and programming language allows us to generate beautiful structural documents.

LuaTeX is usually included in TeXLive and MikTeX distributions.

LaTeX Binary Search Tree

Recently, I have been exploring the essence of LaTeX. The discovery of LaTeX3 really uncovers the potential of LaTeX as a “generic” programming language. Although with LuaTeX, writing complicated data structure and algorithms in pure TeX seems to be a waste of time, I still find my effort somehow meaningful in a way: at this point, I haven’t really studied programming languages and compilers formally, but playing with TeX really allows me to feel the fine line between text and program. We are able to do amazing things with TeX (which is Turing complete), but accompanied by fact that the foundation of TeX is based on text substitution and some support for numerical evaluation, I am stunned by its simplicity and universality. Text is program, program is text, it is the perfect concord.

LaTeX3 Quick Reference Guide

As I am getting more and more familiar with LaTeX, my personal need of writing complicated LaTeX packages continue to increase. However, I am totally blown away by the complexity of expansion control in tradition LaTeX. Fortunately, the LaTeX3 project provides a way to write large scale LaTeX programs with much simpler expansion control and more systemic naming conventions. This post serves as a quick guide to introduce one to LaTeX3.

LaTeX is turing complete! If you know how to control expansions, you can pretty much do everything with LaTeX (tough the efficiency is awful).

CIS-375 Help Session Note 5 (Spring 2020)

Scire ad trascendere - Learn to transcend.

Topics covered:

  • Mathematical induction
  • Strong induction

Connecting a Linux Computer to SU Network

Since I am working with Linux, which is considered to be “insecure” by Syracuse University’s ITS, there is no official approach to connect to SU’s network with VPN. Fortunately, if you have an OSX or Windows machine around, which are capable of using SU’s VPN, we can set up a NAT rule to allow Linux computers in the same LAN to access SU hosts.

CIS-375 Help Session Note 4 (Spring 2020)

Scire ad trascendere - Learn to transcend.

Topics covered:

  • Functions

Please always pay attention to Blackboard announcements and your mailbox. Prof. Lee and I are trying different approaches to make sure this course can go on as usual. You do not want to miss major changes in course format or policies.

Generating Link Preview

Link previews can help one understand a link. It is also much more beautiful than a simple hyperlink. Let’s discuss how to generate these beautiful previews for a web page. The resulting preview block looks like this:

CIS-375 Help Session Note 3 (Spring 2020)

Scire ad trascendere - Learn to transcend.

Topics covered:

  • Relations
  • Indirect proof

CIS-375 Help Session Note 2 (Spring 2020)

Scire ad trascendere - Learn to transcend.

Topics covered:

  • Set-builder notation
  • Set operations: union, intersection, set difference, symmetric difference
  • Subset, power set
  • Using Boolean logic to prove set-related propositions
  • Logical quantifiers
  • Relation

View more posts→