Skip to content

Instantly share code, notes, and snippets.

View zr-tex8r's full-sized avatar
💭
🍣🦆⛄

Takayuki YATO zr-tex8r

💭
🍣🦆⛄
View GitHub Profile
@zr-tex8r
zr-tex8r / texmas2022.md
Last active December 17, 2023 19:15
TeX: Merry TeXmas 2022

Compile with:

pdftex "\catcode64=11 \input texmas2022.tex"

@zr-tex8r
zr-tex8r / 00addrite.md
Last active December 25, 2022 10:30
SATySFI: 年賀状宛名印刷用文書クラス

年賀状宛名印刷用文書クラス Addrite

全体構成

  • document : config list?→ block-text → block-text → document
    document ?:cfgs from to で全ての宛先面の印刷からなる文書を出力する。

    cfgs には設定項目のリストを指定し、既定値は空リスト(つまり既定の設定を使う)である。

from は高々1個の+address-fromコマンドのみからなるブロックテキストで、この+address-fromの出力は全てのページ(宛先面)に共通して配置される。

@zr-tex8r
zr-tex8r / hanoi.satyh
Created December 3, 2022 13:22
The Tower of Hanoi with graphics, in SATySFi
% hanoi.satyh: Tower of Hanoi with graphics
%
% Copyright (c) 2022 Takayuki YATO (aka. "ZR")
% GitHub: https://github.com/zr-tex8r
% Twitter: @zr_tex8r
% Distributed under the MIT License.
%=========================================================== module Hanoi
module Hanoi : sig
@zr-tex8r
zr-tex8r / count100k.saty
Created December 3, 2022 13:15
SATySFi: A simple 100000-page document
let text-box-board w h ib =
let (tw, th, _) = get-natural-metrics ib in
let gtxt = draw-text ((w -' tw) *' 0.5, (h -' th) *' 0.5) ib in
inline-graphics w h 0pt (fun p -> [shift-graphics p gtxt])
let text-board ctx w h fname fsize str =
let ctx = ctx |> (set-font-size fsize)
|> (set-font Latin (fname, 1., 0.)) in
let ib = read-inline ctx (embed-string str) in
text-box-board w h ib
@zr-tex8r
zr-tex8r / ddsk.satyg
Last active December 2, 2022 15:38
SATySFiでドドスコ(ラブ注入♡)
let_=`888888888888888888888888888888888888888888888888888888888888888888888
~#;}-\$"@`let([(-*);(-/)],nj,(^/)::(&/+-'+.>.*:/),(&-),(!))=((*)::[(/)],(!)
,[`@.]='}#*?;@=#\:<\=$<"|&^?"}~{?;ve;;`;`).':_,,`],[],8)let(*)o(*/)=((o))::
(*/)let([(//);(/-)],[_;(^-);(&/.''<);rec-;(^--)],(/<+->),(/),_::(^*-)::_)=(
[(!)-(!);(!)-/(!)],(^/)*`ドド`*`スコ`*`スコ`*`スコ`*(&-),(!)-*8,(let-rec(>)
`@`i=i|(-)r=(-)^(r)in(>)),(^/)*`ラブ注入♡`*[`\-,::]${'<@,_>:~}"#_#"(`])let
(-:)(*<*+-)(*>-)=(*<*+-)-((*<*+-)-/(*>-)-*(*>-))let-rec(!->)|8=(^-)|_=(^--)
let((/--)::[(/->);(/.>);(/.-)],ov)=([(/-)+(/-);(!)>>(/-);(!)-(/-);(/<+->)-*
(/<+->)],{,'=~[__]:?(})let((!),(/.--)::[(/.*-);(/.->)],_)=(nj,[(/.>)-*(/.>)
-*(/.>)-*(/.>)-*(/.>);((/-)<<((/->)-*(!)-(/-)))-(/-);(!)-*((/--)-*8+(/-))<<
@zr-tex8r
zr-tex8r / deque.tex
Last active November 10, 2022 01:10
Deque in TeX
% Compile this file with 'pdftex' command!
%% \DequeNew\DEQ : Makes a new deque \DEQ.
%% \DequePushBack\DEQ{<text>} : Pushes-back <text> to \DEQ.
%% \DequePushFront\DEQ{<text>} : Pushes-front <text> to \DEQ.
%% \DequePopBack\DEQ : Pops-back from \DEQ and sets the popped text
% to \DequePopped.
%% \DequePopFront\DEQ : Pops-front from \DEQ and sets the popped text
% to \DequePopped.
@zr-tex8r
zr-tex8r / 00README.md
Created August 12, 2022 09:18
TeX言語でラブ注入♡(ドドスコプログラム)

実行方法

plain pdfTeXを用いて以下のコマンド行のように実行する:

pdftex -translate-file=./ddsk ddsk.tex

注意

  • pdfTeXで和文文字を出力するため、ipaex-type1パッケージがインストールされている必要がある。
@zr-tex8r
zr-tex8r / platex.ini
Created August 7, 2022 16:36
新しい画期的なLaTeX実装⛄
\input sclatex
\dump
@zr-tex8r
zr-tex8r / main.tex
Created June 28, 2022 10:47
TeX: Depth-first search
%#!latex
% 0-2-4-6-8
% 0######### How many moves are
% :# # # # needed to go
% 2# ## ## from (1,1) to (7,1) ?
% :### # #
% 4# # #
% :#########
\makeatletter
\newcount\my@x \newcount\my@y \newcount\my@m
@zr-tex8r
zr-tex8r / test.tex
Last active February 16, 2023 14:09
新しいLaTeXで(u)pLaTeXしたいやつ
\ExplSyntaxOn
%---------------------------------------
%% \token_if_jachar:N <token>
% Tests if <token> is a jachar token or not.
\bool_lazy_or:nnTF
{ \sys_if_engine_ptex_p: }
{ \sys_if_engine_uptex_p: }
{
\use:x
{