This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#! 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#! 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#! 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 の分を足す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#! 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#! 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^^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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.