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 / sample.tex
Created December 6, 2014 09:30
TeX: to embed JPEG image data inside a TeX document
\nopagenumbers
%\pdfminorversion=4
%\pdfcompresslevel=0
\pdfobjcompresslevel=0 % This is necessary!
% This is dump data of a JPEG image, of which size is
% 256px x 256px and resolution is 96dpi.
\edef\ImageBinary{\pdfunescapehex{%
FFD8FFE000104A46494600010101006000600000FFDB0043000A07070807060A%
0808080B0A0A0B0E18100E0D0D0E1D15161118231F2524221F2221262B372F26%
@zr-tex8r
zr-tex8r / sample.tex
Last active August 29, 2015 14:11
The dancing men that are really dancing
\documentclass{article}
\usepackage[papersize={12cm,3cm},
noheadfoot,margin=0pt]{geometry}
\usepackage{color}
\pagecolor{white}
\definecolor{myred}{rgb}{0.85,0,0}
\definecolor{mygreen}{rgb}{0,0.45,0}
\usepackage{tcdancers}
\begin{document}
\centering\dancers
@zr-tex8r
zr-tex8r / tctoarrow.sty
Created December 20, 2014 07:50
TikZ: a variant of the arrow tip 'to' that really looks like '\to'
\def\tcqqa@scale{1.5}
\pgfarrowsdeclare{to'}{to'}
{%
\pgfutil@tempdima=\tcqqa@scale\pgflinewidth
\pgfutil@tempdima=-3\pgfutil@tempdima
\advance\pgfutil@tempdima -0.5\pgflinewidth
\pgfutil@tempdimb=\tcqqa@scale\pgflinewidth
\pgfutil@tempdimb=0.75\pgfutil@tempdimb
\advance\pgfutil@tempdimb 0.5\pgflinewidth
\pgfarrowsleftextend{+\pgfutil@tempdima}%
@zr-tex8r
zr-tex8r / texadvent2014.tex
Created December 25, 2014 14:25
XeLaTeX: 2014年もメリークリスマス!
\^^,^^%^^4~\^^#^^!^^4^^#^^/^^$^^%~`⑨~`~\^^,^^%^^4⑨\^^,^^%^^4
~`¬9~`¤1¬0~`@~`^^2~`⑥1¬3⑨⑥\@^^.^^!^^-^^%^^5^^3^^%~`☃~`¤
~`㊷~`⑥⑨¬㊷\^^#^^/^^5^^.^^4@~`⑤~`~⑨⑤\^^!^^$^^6^^!^^.^^#^^%
¬~`①~`~~`°~`~~`»~`~⑨①\^^$^^%^^&①»#1.^^;}~`⑧~`⑥%'¡^^!^^#!
①¬⑧^^;㊷++`𝟎¤\^^,^^/^^/^^0°\^^)^^&^^.^^5^^-㊷<`𝟵¤⑤㊷\@^^.^^%
\^^2^^%^^0^^%^^!^^4}~`④~`»⑨④\^^,^^#^^#^^/^^$^^%①°¬{~㊷+1¬3
④¬¬㊷1¤}⑧㊷¤"6¬1¤~`³=1¤①°#¬1^^;④`#^^31-¬0④`^^59㊷%\(^^)/
\^^,^^/^^7^^%^^2^^#^^!^^3^^%{①^^23¬1^^;^^59}^^=⑤¬㊷1¤}~`²+2¤
»☃𝟚𝟘𝟙𝟜.°𝟧°𝟗°𝟓°𝟚°𝟑°𝟩°𝟘°𝟬°𝟕°𝟫°𝟣°𝟥°𝟞°𝟠°𝟲°𝟴°𝟰°𝟏°𝟫°𝟜°𝟰°𝟮°𝟮°𝟮°°%¤𝟣𝟤.𝟮𝟱☃«
①°{\^^)^^&^^.^^5^^-④¬㊷>-0¤④+㊷0¤~㊷9☃\^^&^^)^^=⑧%^^43^^5
@zr-tex8r
zr-tex8r / pxbabel-up-otf.sty
Last active August 29, 2015 14:14
LaTeX: To make the combination upLaTeX + otf + pxbabel work
% upLaTeX での pxbabel はCJK言語の切替を
% J20,J21,J22,J23,J30,J31,J32,J33
% という"和文エンコーディング"の切替で実現している.
% これらのエンコーディングに対応する和文フォントは
% pLaTeX の既定である mc, gt のファミリにのみ提供される.
%
% 一方で, otf パッケージ(noreplace非指定)は, 和文の
% 総称ファミリの既定値(\mcdefault/\gtdefault)を
% "hmc"/"hgt" に変更する.
% 日本語の種々の"素敵な"フォントはこのファミリに
@zr-tex8r
zr-tex8r / spinning-goseicho.tex
Created February 14, 2015 06:52
LaTeX: Beamerで御清聴をアレする件
% pLaTeX 文書
\documentclass[dvipdfmx]{beamer}
\usepackage{bxdpx-beamer}
\usepackage{pxjahyper}
\usepackage{tikz}
\usepackage[deluxe]{otf}
% フォント設定は適当に
\usepackage[ipaex]{pxchfon}
\setxboldgothicfont[0]{hgrpp1.ttc}%HG創英角ポップ体
\renewcommand{\kanjifamilydefault}{\gtdefault}
@zr-tex8r
zr-tex8r / tctexallez.sty
Created February 23, 2015 15:10
LaTeX: \TeXはアレ
% tctexallez.sty
% package declaration
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tctexallez}[2015/02/22 v0.2]
%% preparation
\def\xx@pkgname{tctexallez}
\def\xx@error{\PackageError\xx@pkgname}
@zr-tex8r
zr-tex8r / tcpgfmathex.sty
Created March 1, 2015 04:47
LaTeX: To use “string functions” in pgfmath expressions
% tcpgfmathex.sty
%% avoid duplicate loading
\csname tcpgfmathexLoaded\endcsname
\let\tcpgfmathexLoaded\endinput
%% code guards
\def\tcpgfmathexRestoreCodes{
\catcode64=\the\catcode64%
\endlinechar=\the\endlinechar
@zr-tex8r
zr-tex8r / bct.mcrd
Created April 8, 2015 11:53
Macrodown: BCT language interpreter
\macro \cons @hd @tl {%
\ifempty{@tl;}{@hd;}{\ifempty{@hd;}{@tl;}{@hd;|@tl;}}}%
\macro \same @x @y {%
\ifsame{@x;}{@y;}{*}{}}%
\macro \cat-list @lst {%
\pop @hd @tl {@lst;}{%
@hd;\ifempty{@tl;}{}{\cat-list{@tl;}}}}%
\macro \countdown @tmr {%
\pop @hd @tl {@tmr;}{%
\ifsame{@hd;}{*}{*}{@tl;}}}%
@zr-tex8r
zr-tex8r / example-prob.tex
Created May 8, 2015 11:48
LaTeX: probなアレがアレになるアレ
\documentclass{jsarticle}
\usepackage{fancyhdr}
\newcounter{probnumber} %設問番号
\def\pagecont{} %ヘッダーの中身
\newenvironment{prob}[1]{%
\stepcounter{probnumber}
\global\expandafter\def\expandafter\pagecont\expandafter{\pagecont \quad・#1}