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 / nyc2024.tex
Created January 1, 2024 00:07
LaTeX: New year post card of the year 2024
%#!lualatex
\documentclass{article}
\usepackage[papersize={100mm,148mm},margin=0cm,
noheadfoot]{geometry}
\usepackage{luatexja-fontspec}
\usepackage{amsmath,tikz,graphicx,xcolor,xparse,pgfmath,ifthen}
\newboolean{soeikakupoptai}
%↓チュノムの漢字を出力するフォントの設定.
%trueの場合は"創英角ポップ体"が使われる.
%falseの場合は"花園明朝A/B"が使われる.
@zr-tex8r
zr-tex8r / texlogo0.typ
Last active December 31, 2023 03:21
Typst: to print TeX and LaTeX logos
#let TeX = {
[T]; "\u{2060}"
box({h(-0.1667em); box(move(dy: 0.2153em)[E]); h(-0.125em)})
"\u{2060}"; [X]
}
#let LaTeX = {
[L]; "\u{2060}"
box(style(styles => {
let size = measure([T], styles)
h(-0.36em)
@zr-tex8r
zr-tex8r / 2023texmas.md
Created December 24, 2023 15:47
TeX: Merry TeXmas 2023

Compile with:

pdftex --translate-file ./texmas texmas.tex

@zr-tex8r
zr-tex8r / whatisthis
Created December 12, 2023 15:07
A document source that can be compiled both as plain TeX and Typst (polyglot)
// \begingroup \catcode`\#=12
#let s = ```
\endgroup \newdimen\pwd \newdimen\pht
\pwd=160bp \pht=90bp
\ifnum\ifx\pdfoutput\unDef0\else\pdfoutput\fi>0
\pdfpagewidth=\pwd \pdfpageheight=\pht \let\os\relax
\else \def\os{\special{papersize=\the\pwd,\the\pht}}\fi
\shipout\vbox to\pht{\os \font\ff=cmr10 at 36bp \vskip-1inplus1fil
\moveleft1in\hbox to\pwd{\hfil\ff \TeX!!\hfil}\vskip1inplus1fil}
\output{\setbox0\box255\deadcycles=0}\bye
@zr-tex8r
zr-tex8r / 11README.md
Last active November 11, 2023 04:38
sc1Typst ― もっともっと画期的なTypst用文書テンプレート

sc1Typst ― もっともっと画期的なTypst用文書テンプレート

画期的なTeXフォーマットである[1TeX]のコンセプトを踏襲しつつ、さらに画期的になるように抜本的に仕様を見直して作製された、[Typst]用の文書テンプレート。

前提環境

  • Typst: 0.8.0~0.9.0版
  • [原ノ味フォント][haranoaji]

インストール

@zr-tex8r
zr-tex8r / 00README.md
Created September 24, 2023 07:50
TeX:チョット読みにくいFizzBuzzプログラム

チョット読みにくいFizzBuzzプログラム🙃

実行方法

plain TeX専用である(LaTeXでは動かない)。

fizzbuzz.tex自体は「ライブラリ」であり、これを読み込むと\FizzBuzzマクロが定義される。

  • \FizzBuzz{<整数n>}: 1からnまでのFizzBuzz文字列を出力する。
@zr-tex8r
zr-tex8r / example-1.tex
Last active August 8, 2023 13:58
LaTeX:“Macのヒラギノ”で平和に(u)pLaTeXするやつ(※ただし画期的)
% upLaTeX+dvipdfmx用の横組みの文書の例
\documentclass[uplatex,dvipdfmx,a4paper]{jsarticle}
\usepackage{schira}
\begin{document}
吾輩は{\schira}である。
意味はまだない。
\end{document}
@zr-tex8r
zr-tex8r / bxdpx-tchack.sty
Created July 1, 2023 08:19
LaTeX: Hack for top-level color changes with dvipdfmx
% bxdpx-tchack.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bxdpx-tchack}[2023/07/01 v0.1]
\def\bxqcx@pkgname{bxdpx-tchack}
\ifx\currentgrouplevel\@undefined
\PackageError\bxqcx@pkgname{e-TeX extension not supported}\@ehc
\expandafter\endgroup\fi\relax
\AtBeginDocument{%
\def\bxqcx@org@set@color{\special{color pop}}
\ifx\bxqcx@org@set@color\reset@color
@zr-tex8r
zr-tex8r / nabeazz.typ
Created June 11, 2023 04:28
Typst:NabeAzzする文書
#import "zrsimple.typ"
#show: zrsimple.doc.with(
paper: "a5",
title: "NabeAzz with Typst",
author: "ZR"
)
#let aho-font = "Allura"
#let nabeazz(lmt) = {
@zr-tex8r
zr-tex8r / ddsk.typ
Created June 11, 2023 04:26
Typst:ドドスコ(ラブ注入♡)する文書
#import "zrjasimple.typ"
#show: zrjasimple.doc.with(
title: "Typst でドドスコしてみた",
author: "某 ZR"
)
// ddsk(seed)は, 乱数種を seed としたときの
// "ドドスコ問題"の出力の文字列.
#let ddsk(seed) = {