Skip to content

Instantly share code, notes, and snippets.

@h20y6m
h20y6m / mt19937.tex
Last active January 4, 2024 08:30
LaTeX: メルセンヌ・ツイスタ
% https://h20y6m.github.io/posts/2023-12-11-texadvent2023-2/
\documentclass[a4paper,twocolumn]{article}
% https://github.com/h20y6m/latex-biguint
\usepackage{biguint}
\ExplSyntaxOn
% https://en.wikipedia.org/wiki/Mersenne_Twister
@h20y6m
h20y6m / ipamjm.sty.diff
Created November 27, 2023 12:50
ipamjm.sty を新しめの LaTeX に対応させる
--- C:/texlive/texmf-local/tex/platex/ipamjm/ipamjm-2022-01-09.sty Thu Jan 9 22:42:00 2020
+++ C:/texlive/texmf-local/tex/platex/ipamjm/ipamjm.sty Sun Nov 26 20:39:04 2023
@@ -29,6 +29,7 @@
\ifnum \@tempcntb<65536
\divide\@tempcntb by "1000
\kanjishape{\ifcase\@tempcntb0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or a\or b\or c\or d\or e\or f\fi}%
+ \selectfont
\multiply\@tempcntb by "1000
\advance\@tempcnta by -\@tempcntb
\else
@h20y6m
h20y6m / 00README.md
Last active January 4, 2024 08:29
IPAmj明朝VF作成
#!/bin/sh -x
# Ubuntu 22.04 LTS on WSL2, TeX Live 2023
#
# sudo apt install build-essential libexpat1-dev libfontconfig-dev libicu-dev libteckit-dev libgraphite2-dev libmpfr-dev libzzip-dev libgmp-dev libcairo2-dev libpixman-1-dev libgd-dev libfreetype-dev libpng-dev zlib1g-dev
NPTEX_WORK=`pwd`
NPTEX_SRCDIR=./texlive-source
NPTEX_TEXMFROOT=`kpsewhich -var-value=TEXMFROOT`
@h20y6m
h20y6m / build-platex-on-euptex.lua
Created July 11, 2023 11:44
TeX Live 2023 06-01以降の環境でl3buildでpLaTeXのテストをするためのやつ
-- File: build-platex-on-euptex.lua
--
-- usage:
-- ```build.lua
-- kpse.set_program_name("kpsewhich")
-- ...
-- dofile("build-platex-on-euptex.lua")
-- ```
-- Check if a file contains lines matching a pattern
@h20y6m
h20y6m / pl3str-convert.sty
Created June 18, 2023 14:28
Patch for l3str-convert for (u)pLaTeX
\NeedsTeXFormat{pLaTeX2e}
\ProvidesExplPackage{pl3str-convert}{2023-06-05}{}
{Patch for l3str-convert for (u)pLaTeX}
% Check if pTeX is old.
% Needs pTeX p3.10.0 or latar.
\msg_new:nnn { pl3str-convert } { old-ptex }
{ Your~pTeX~is~too~old. }
\token_if_primitive:NF \toucs
{ \msg_error:nn { pl3str-convert } { old-ptex } }
% Check that the expl3 function definitions are what we expect.
@h20y6m
h20y6m / jfont-in-encoding.tex
Last active March 8, 2023 14:30
新しい upLaTeX で min10 してみるやつ
%#!uplatex
%% upLaTeX で min10 してみる
%% TeX Live 2023 以降の uplatex が必要
% ----------------------------------------------------------------------
% どうして uplatex じゃないの?
\ifnum\jis"2121="3000 \else
\typeout{Why not run `uplatex'?}
@h20y6m
h20y6m / tate-tcolorbox-dvipdfmx.tex
Created January 20, 2023 12:28
LaTeX: (u)pLaTeX + dvipdfmxで縦組みでtcolorboxを使ってみる。
%#! ptex2pdf -u -l
%
% (u)pLaTeX + dvipdfmxで縦組みでtcolorboxを使ってみる。
%
% 【警告】
% 下記のコードはtcolorboxではなくTikZ/PGFのsystemlayerに変更を加えます!
% 最悪TikZ/PGF関連のすべてが壊れます!
% 「わかっている人」以外は使わないように!
%
% 【注意】
@h20y6m
h20y6m / zenkaku.sty
Created June 4, 2022 13:58
LaTeX: 全角にする
%%
%% This is file 'zenkaku.sty'.
%%
%% Copyright (c) 2022 Yukimasa Morimi (h20y6m)
%% GitHub: https://github.com/h20y6m
%%
%% This package is distributed under the MIT License.
%%
\NeedsTeXFormat{LaTeX2e}
@h20y6m
h20y6m / platex-lab.sty
Last active May 31, 2022 14:20
(u)pLaTeX で latex-lab するためのなにか
\ExplSyntaxOn
% (u)pLaTeXでなければ何もしない
\bool_lazy_or:nnF
{ \sys_if_engine_ptex_p: }
{ \sys_if_engine_uptex_p: }
{
\ExplSyntaxOff
\file_input_stop:
}