Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🍣🦆

Takayuki YATO zr-tex8r

💭
🍣🦆
View GitHub Profile
@zr-tex8r
zr-tex8r / snowmansday2020.tex
Last active Aug 9, 2020
LaTeX: Happy Snowman’s Day 2020
View snowmansday2020.tex
%#!pdflatex
\documentclass[margin=0pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{lmodern,pifont}
\usepackage{xcolor,scsnowman,tikzducks,pgfmath}
\newcommand*{\cLet}{\pgfmathsetmacro}
\setlength{\unitlength}{1bp}
\colorlet{bgcolor}{blue!30!green!10}
\pagecolor{bgcolor}
%
@zr-tex8r
zr-tex8r / tcspingif.pl
Created Aug 8, 2020
tcfaspinを利用した“回るLaTeX文書”からアニメGIF画像を生成する
View tcspingif.pl
#!/usr/bin/env perl
use v5.12;
my $program = "tcspingif";
my $version = "0.4.0";
my $mod_date = "2020/08/08";
use constant DEFAULT_TICKS => 32;
use constant CYCLE => 2; # seconds
my ($ticks, $in_file, $out_file);
my $engine = "pdflatex";
@zr-tex8r
zr-tex8r / defaults.yaml
Created Jul 27, 2020
Pandoc:節番号のスタイルを変えるやつ
View defaults.yaml
input-files:
- test.md
filters:
- numbering.lua
output-file: test_out.html
standalone: true
table-of-contents: true
toc-depth: 2
number-sections: true
@zr-tex8r
zr-tex8r / defaults.yaml
Last active Jul 27, 2020
Pandoc: 節番号はCSSで付ければいいんじゃないの
View defaults.yaml
input-files:
- test.md
output-file: test_out.html
standalone: true
css: test.css
table-of-contents: true
toc-depth: 2
# avoid pandoc's numbering...
number-sections: false
@zr-tex8r
zr-tex8r / Dockerfile
Created Jul 14, 2020
pandoc/latexをいじって日本語LaTeXできるようにしたやつ
View Dockerfile
FROM pandoc/latex:2.9.2
# Here 'update latex' is needed, because LaTeX in this
# container is of version <2020-02-02> PL2, and LuaTeX-ja
# cannot run with this version.
RUN tlmgr install \
bxjscls \
bxwareki \
everyhook \
ipaex \
@zr-tex8r
zr-tex8r / spaced-ruby.tex
Created Jul 11, 2020
expl3:スペース区切りでモノルビ指定
View spaced-ruby.tex
% https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2899&parent=16984
\documentclass[uplatex]{jsarticle}
\usepackage{xparse}
\usepackage{okumacro}
\ExplSyntaxOn %!!!!!!!!!!!!!!!!!!!!!!!! expl3 code BEGIN
\seq_new:N \l__sruby_body_seq
\seq_new:N \l__sruby_ruby_seq
@zr-tex8r
zr-tex8r / latex-emoji.lua
Last active Jul 4, 2020
Pandoc: To use color emoji font in convertion from Markdown to LaTeX
View latex-emoji.lua
-- latex-emoji.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 = 'latex-emoji'
---------------------------------------- helpers
@zr-tex8r
zr-tex8r / 00do.sh
Created May 9, 2020
An example of pandoc_remove_codelisting_filter
View 00do.sh
#!/bin/bash
pandoc --filter=pandoc-crossref --filter=pandoc_remove_codelisting_filter -N test.md -s -o test-output.tex
@zr-tex8r
zr-tex8r / filter.lua
Last active Feb 22, 2020
Pandoc:新しいPandocでCSVをpandoc.readするテスト
View filter.lua
function CodeBlock(block)
if block.classes:includes("csvin", 1) then
return pandoc.read(block.text, "csv").blocks[1]
end
end
@zr-tex8r
zr-tex8r / okashi.lua
Created Jan 26, 2020
Lua:単価が異なるお菓子をどういう組み合わせで買えば目標の合計値になるか問題
View okashi.lua
function okashi(total, prices)
local count, solved = solve(total, prices)
print_solution(count, solved, total, prices)
end
function print_solution(count, solved, total, prices)
if solved then
for i = 1, #prices do
io.stdout:write(("%d円のが%d個"):format(prices[i], count[i]))
if i ~= #prices then io.stdout:write("") end
You can’t perform that action at this time.