Skip to content

Instantly share code, notes, and snippets.

🐻
Cute!!

Kazuki Maeda kmaed

🐻
Cute!!
View GitHub Profile
@kmaed
kmaed / letargswapped.tex
Created Oct 13, 2012
2012/10/13 の解答
View letargswapped.tex
\catcode`\@=11
\def\letargswapped#1#2{%
\edef\def@macroB{\def\noexpand#1####1####2{\expandafter\unexpanded\expandafter{#2{##2}{##1}}}}%
\def@macroB}
\catcode`\@=12
\def\Frac#1#2{{#1\over#2}}
\letargswapped\RFrac\Frac
$$\RFrac{13}{42}$$ %==>分数「13分の42」が出力される
\edef\hogeA#1#2{#1\string~#2\noexpand~}
\letargswapped\hogeB\hogeA
@kmaed
kmaed / length.tex
Created Oct 11, 2012
2012/09/17 の解答
View length.tex
\documentclass[a4paper]{article}
\begin{document}
\makeatletter
%% \length{<token list>}
% <token list> に含まれるトークンの数の * に展開される.完全展開可能.
\def\length#1{\len@begin#1{\len@end}}
%% \len@begin<token list>{
% { までのトークン列を取ってきて \len@count に渡す.
% 残りは \len@ifend に.
\def\len@begin#1#{\len@count{#1\len@count@end}\len@ifend}
@kmaed
kmaed / numtohex.tex
Created Oct 10, 2012
2012/10/08 の解答
View numtohex.tex
%#! luatex
\catcode`\@=11
\def\len@begin{\directlua{
local len_count = 0
local len_flag = true
while len_flag do
local t = token.get_next()
if token.csname_name(t) == 'len@end' then
len_flag = false
print(); print()
@kmaed
kmaed / numtohex.tex
Created Oct 9, 2012
2012/10/08 の失敗例2
View numtohex.tex
%#! luatex
\catcode`\@=11
\def\len@begin{\directlua{
local len_count = 0
local len_flag = true
while len_flag do
local t = token.get_next()
if token.csname_name(t) == 'len@end' then
len_flag = false
print(); print()
@kmaed
kmaed / numtohex.tex
Created Oct 8, 2012
2012/10/08 の失敗例
View numtohex.tex
%#! luatex
\catcode`\@=11
\def\len@begin{\directlua{
local len_count = 0
local len_flag = true
while len_flag do
local t = token.get_next()
if token.csname_name(t) == 'len@end' then
len_flag = false
len_count = len_count+2 % \newcount\@tempcnta の分を足す
@kmaed
kmaed / length.tex
Created Sep 30, 2012
2012/09/17 の解答(!!?)
View length.tex
%#! lualatex
\documentclass[a4paper]{article}
\makeatletter
\def\len@begin{\directlua{
local len_count = 0
local len_flag = true
while len_flag do
local t = token.get_next()
% print(token.csname_name(t))
if token.csname_name(t) == 'len@end' then
@kmaed
kmaed / length.tex
Created Sep 29, 2012
2012/09/17 の解答(!?)
View length.tex
%#! lualatex
\documentclass[a4paper]{article}
\def\length#1{%
\directlua{\unexpanded{
require('lualibs-unicode')
local input = [[#1]]
local state = 'r'
% print(input)
for i = 1, utf.len(input) do
local r = utf.byte(utf.sub(input, i, i))
@kmaed
kmaed / makecounterprinter.sty
Created Sep 27, 2012
2012/09/26 の解答
View makecounterprinter.sty
^^5c^^64^^65^^66^^5c^^6d^^61^^6b^^65^^63^^6f^^75^^6e^^74^^65^^72^^70^^72^^69^^6e^^74^^65^^72^^23^^31^^23^^32^^7b^^5c^^64^^65^^66^^23^^31^^23^^23^^31^^7b^^5c^^65^^78^^70^^61^^6e^^64^^61^^66^^74^^65^^72^^5c^^70^^72^^6f^^74^^65^^63^^74^^5c^^65^^78^^70^^61^^6e^^64^^61^^66^^74^^65^^72^^23^^32^^5c^^65^^78^^70^^61^^6e^^64^^61^^66^^74^^65^^72^^7b^^5c^^74^^68^^65^^5c^^63^^73^^6e^^61^^6d^^65^^20^^63^^40^^23^^23^^31^^5c^^65^^6e^^64^^63^^73^^6e^^61^^6d^^65^^7d^^7d^^7d
@kmaed
kmaed / nal.tex
Created Sep 25, 2012
2012/09/25 の解答
View nal.tex
\documentclass[a4paper]{article}
\makeatletter
^^5c^^64^^65^^66^^5c^^4e^^61^^62^^65^^41^^7a^^7a^^4c^^69^^6b^^65^^23^^31^^7b^^5c^^65^^78^^70^^61^^6e^^64^^61^^66^^74^^65^^72^^5c^^40^^4e^^61^^62^^65^^41^^7a^^7a^^4c^^69^^6b^^65^^5c^^63^^73^^6e^^61^^6d^^65^^20^^63^^40^^23^^31^^5c^^65^^6e^^64^^63^^73^^6e^^61^^6d^^65^^7d
^^5c^^64^^65^^66^^5c^^40^^4e^^61^^62^^65^^41^^7a^^7a^^4c^^69^^6b^^65^^23^^31^^7b^^5c^^62^^65^^67^^69^^6e^^67^^72^^6f^^75^^70^^5c^^69^^66^^6e^^75^^6d^^5c^^6e^^75^^6d^^65^^78^^70^^72^^23^^31^^2f^^33^^2a^^33^^3d^^23^^31^^5c^^41^^68^^6f^^46^^6f^^6e^^74^^5c^^66^^69^^5c^^65^^78^^70^^61^^6e^^64^^61^^66^^74^^65^^72^^5c^^40^^4e^^61^^62^^65^^41^^7a^^7a^^54^^65^^73^^74^^5c^^74^^68^^65^^23^^31^^5c^^72^^65^^6c^^61^^78^^5c^^74^^68^^65^^23^^31^^5c^^65^^6e^^64^^67^^72^^6f^^75^^70^^7d
^^5c^^64^^65^^66^^5c^^40^^4e^^61^^62^^65^^41^^7a^^7a^^54^^65^^73^^74^^23^^31^^7b^^5c^^69^^66^^78^^23^^31^^5c^^72^^65^^6c^^61^^78^^5c^^65^^6c^^73^^65^^5c^^69^^66^^78^^23^^31^^33^^5c^^41^^68^^6f^^46^^6f^^6e^^74^^5c^^66^^69^^5c^^65^^78^^7
@kmaed
kmaed / test-ascmac.pdf
Created Aug 7, 2012
ascmac.sty with LuaTeX-ja
View test-ascmac.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.