Skip to content

Instantly share code, notes, and snippets.

@user202729
user202729 / typer-io-steno-compatibility.user.js
Last active January 8, 2022 13:33
typer-io-steno-compatibility.user.js
// ==UserScript==
// @name Typer.io - No input limit
// @namespace blob
// @version 0.0.1
// @match https://typer.io/*
// @grant none
// @run-at document-end
// ==/UserScript==
'use strict';
@user202729
user202729 / TeX-notes.md
Last active January 9, 2022 12:16
TeX-notes.md

.some notes.

Why TeX, as a programming language, is so hard?

There are some issues with TeX. Not that it's a expansion language.

  • It has a few quirks in behavior that will take you hours of debugging if you don't know them in advance.
from dataclasses import dataclass
from typing import Any
from gdb_call_lambda import get_gdb_expression_from_value
class EmptyPrinter:
def to_string(self):
return "{}"

======== implementing in https://github.com/user202729/TeXlib

Part 1. Preprocess as text

  • grab all rest of document
  • rescan with synctex kept (only possible in LuaLaTeX)
  • as string, can do anything

Part 2. Catcode

[luatex - LaTeX3 versus pure Lua - TeX - LaTeX Stack Exchange](https://tex.stackexchange.com/questions/45183/latex3-versus-pure-lua?noredirect=1&lq=1)
String N
scan token
etc.
// moreflags=-std=c++17
#if not LOCAL
#define NDEBUG 1
#endif
#include<bits/stdc++.h>
#include<variant>
using std::variant;
using std::in_place_type;
@user202729
user202729 / TeX brace hack motivation.md
Last active December 24, 2022 04:53
TeX brace hack motivation

Why are brace hacks so complicated?

It's not complicated. In fact, given what you want to do in TeX, and in combination with how the other primitives work, brace hacks is the simplest way to implement the engine.

(basically, as Knuth writes both TeX the engine and plain.tex, the engine tend to be made simpler if some "trick" suffices to achieve a functionality instead of adding another primitive to the engine)

First brace hack, \bgroup/\egroup

The motivation of this brace hack is simple -- one example is described in the TeXbook:

@user202729
user202729 / .a-sympytex-on-overleaf.md
Last active January 12, 2026 12:00
sympytex on overleaf

Use sympytex on overleaf

This is not officially supported, but you can made it to work...

  • first, see the test.tex file below (because of an annoying GitHub gist "bug", all files following a large raw file are shown as "cannot display file this big...", thus the "a-" prefix)

  • download sympy.zip attached below in the gist, and upload it to your overleaf.

@user202729
user202729 / a-description.md
Last active January 3, 2025 11:18
a hack to get PythonTeX to work on overleaf...

Put this as your TeX file

\documentclass{article}
\usepackage{shellesc}

%\usepackage{fancyvrb}
%\usepackage{fvextra}
%\fvset{breaklines=true, breakanywhere=true}