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 / intersection.tex
Created January 23, 2021 10:13
昇順の整数のリストが複数あったとき、それらの共通部分を抜き出すやつ(わかりにくい)
\documentclass{article}
\makeatletter %!!!!!!!!!!!!!!!!!!!!!!!!! TeX code BEGIN
\newif\ifxx@ok
\newcommand*\xxLetIntersectionTo[2]{%
\let\xx@ret\relax
\@tfor\xx@l:=#2\do{%
\ifx\xx@ret\relax \edef\xx@ret{\xx@l}%
\else \xx@intersect@two \fi}%
\let#1\xx@ret}
\def\xx@head#1#2{\edef\xx@next{\noexpand\xx@head@a#2}\xx@next\relax#1}
@zr-tex8r
zr-tex8r / 01sample.tex
Last active January 21, 2021 17:31
例のdvipdfmxのCMapのアレ
% upLaTeX文書
% KleeOne-Regular.ttf と Adobe-Japan1-KleeOne-Regular を配置する
\documentclass[uplatex,dvipdfmx,a4paper]{jsarticle}
\usepackage{otf}
\usepackage[noalphabet]{pxchfon}% unicodeは無し
\setminchofont{KleeOne-Regular.ttf}% クレー One
\begin{document}
\CID{1481}城市\ajSnowman\ajLig{ウルシ}\CID{7652}飾区
\ajMaruHira{1}\ajKuroMaruHira{42}\ajKakuKata{1}\ajKuroKakuKata{42}%
\ajMaru{12}\ajMaru{34}\ajMaru{56}
@zr-tex8r
zr-tex8r / wdsnowman2021.tex
Created January 17, 2021 15:41
LaTeX: Happy World Day of Snowman!
\documentclass[margin=0pt]{standalone}
\usepackage{xcolor,tikz,scsnowman}
\usetikzlibrary{calc}
\newcommand*{\cLet}{\pgfmathsetmacro}
\cLet{\yA}{115}\cLet{\yB}{15}\cLet{\vSS}{12}
\cLet{\vRA}{1}\cLet{\vRB}{5}\cLet{\vRS}{3}
\cLet{\vT}{\number\faStopTicks/\number\faAllTicks}
\cLet{\vA}{-mod(\vT*\vRA,1)*360}
\cLet{\vB}{-mod(\vT*\vRB,1)*360}
\cLet{\vS}{-mod(\vT*\vRS,1)*360}
@zr-tex8r
zr-tex8r / bxkvcmd-sty
Created January 4, 2021 10:45
LaTeX:key-value型の引数指定をもつユーザ命令を(LaTeXレベルで)定義する
%%
%% This is file 'bxkvcmd.sty'.
%%
%% Copyright (c) 2021 Takayuki YATO (aka. "ZR")
%% GitHub: https://github.com/zr-tex8r
%% Twitter: @zr_tex8r
%%
%% This package is distributed under the MIT License.
%%
@zr-tex8r
zr-tex8r / nyc2021.tex
Created January 1, 2021 02:02
LaTeX: New year post card of the year 2021
\documentclass{article}
\usepackage[papersize={100mm,148mm},margin=0cm,
noheadfoot]{geometry}
\usepackage{luatexja-fontspec}
\usepackage{amsmath,tikz,graphicx,xcolor,xparse}
\usetikzlibrary{calc,positioning}
\newfontface{\fRobo}{RobotoSlab-Bold.otf}
\newfontface{\fChicago}{QTChicagoland.otf}
\newfontface{\fNishiki}{Nishiki-teki.ttf}
\newjfontface{\jNishiki}{Nishiki-teki.ttf}
@zr-tex8r
zr-tex8r / texmas2020.tex
Created December 25, 2020 14:49
Merry TeXmas!
^^`^^;^^`\^^$^^%^^&\!^^;\^^$^^%^^&^^=^^`\!\^^:#1^^;^^=^^`%^^'^^`1~^^`^^"
\!\[{^^2}\!\<{%% --:--:--:--:--:--:--:-- 2 @ 2 @ --:--:--:--:--:--:--:--
\^^#^^3^^.^^!^^-^^%}\!\]{^^3}\^^:?\!\>{\^^%^^.^^$^^#^^3^^.^^!^^-^^%}%**%
\!\={\^^,^^%^^4}\=\?\^^#^^!^^4^^#^^/^^$^^%\=\#\^^:\?`*\?`\^\?`.\?`\*%[#\
\?`/\?`\^\!\|{^^5}\=\@\^^%^^$**%**&\?`\@\?`//*\=\+%+5.//)=\?..{**!};@^^:
\..!^^$//6..!^^.//#..%\=\&\..'//,^^/.."^^!//,\#6\=\%\^^,**#..#///..$**%%
\@\_{\<..,**/..7^^%\[^^#..!\]..%\>}\!\^^!{\?\(\?`+\%\(\)\+\(\@^^.//%%7;)
\+\)\@**.^^%}\=\^^"\**!\=\^^#\..!\!\..${\^^!\**"\..#}\=\..%\..$%.:8:*:8:
\@\({\**$//!**9}\@\){\<//9..%**!\[\>}\!\**'{{\)`/\+\)\@...**%\(\)\+\(\)%
\//$\..%\^^!\..$\+\)\?`\^\//$\^^%\_{\&\!\..:@^^:{%%.(.**$!\\;//:%@>./++.
@zr-tex8r
zr-tex8r / scframe.satyh
Created December 21, 2020 06:44
SATySFi: To make an animated GIF image of a spinning snowman
% scframe.satyh
%
% Copyright (c) 2020 Takayuki YATO (aka. "ZR")
% GitHub: https://github.com/zr-tex8r
% Twitter: @zr_tex8r
% Distributed under the MIT License.
@require: pervasives
@require: list
@zr-tex8r
zr-tex8r / yubaba.lua
Created December 12, 2020 10:11
Pandoc: Pandocで湯婆婆するLuaフィルタ
-- yubaba.lua
--
-- @copyright 2020 Takayuki YATO (aka. "ZR")
-- GitHub: https://github.com/zr-tex8r
-- Twitter: @zr_tex8r
-- This program is distributed under the MIT License.
--
local filter_name = 'yubaba'
---------------------------------------- 設定
@zr-tex8r
zr-tex8r / lua-ul-japanese-1.tex
Created October 28, 2020 15:30
LaTeX: To combine ul-lua and LuaTeX-ja
% LuaLaTeX document
\documentclass[a6paper]{ltjsarticle}%for Japanese
\usepackage{lua-ul}
\begin{document}% mix of Japanese and English phrases
色は匂へど、
\underLine{散りぬるを(alas)、
「我が世」誰ぞ、“常”ならむ?
有為の奥山今日越えて(go on!)、
浅き夢見じwow yeah}酔ひもせず……。
\end{document}
@zr-tex8r
zr-tex8r / snowingsnowman.tex
Created October 17, 2020 04:55
LaTeX:TeXでつくる「雪降りナントカ」
% tcspingif -e pdflatex -t 32 -b 0.75 snowingsnowman.tex
\documentclass[margin=0pt]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage{tikz,pgfmath,scsnowman}
\newcommand*{\cLet}{\pgfmathsetmacro}
%
\cLet{\vES}{40}
\cLet{\xE}{160}\cLet{\yE}{160}
%
\cLet{\vT}{\number\faStopTicks/\number\faAllTicks}