Skip to content

Instantly share code, notes, and snippets.

View k16shikano's full-sized avatar
💭
I may be slow to respond.

keiichiro shikano k16shikano

💭
I may be slow to respond.
View GitHub Profile
@k16shikano
k16shikano / space-before-cmd.tex
Last active February 1, 2025 12:26
コマンドの「前」の文字をみて挙動を変える(LuaTeX)
\documentclass{article}
\usepackage{luacode}
\usepackage{luatexbase}
\newattribute\inlineattr
\newcommand{\inlinestart}{\kern0pt\setattribute{\inlineattr}{100}\kern0pt}
\newcommand{\inlineend}{\kern0pt\setattribute{\inlineattr}{101}\kern0pt}
\newcommand{\myinlinecmd}[1]{\inlinestart#1\inlineend}
\begin{luacode*}
local inlineattr = luatexbase.attributes['inlineattr']