
이 패키지는 lilyglyphs
Lilypond 글꼴을 XeLaTeX 파일에 쉽게 통합하기 위한 매크로 세트를 제공합니다. 해당 패키지를 사용할 수 있습니다.여기. TeXLive 2013을 사용하고 있습니다.
다음 MWE를 사용하면 XeLaTeX에서 예상대로 작동합니다.
\documentclass{memoir}
\usepackage{fontspec}
\usepackage{lilyglyphs}
\begin{document}
\lilyTimeC
\end{document}
LuaLaTeX로 실행하면 다음 오류가 발생합니다.
! Undefined control sequence. \lilyGetGlyph #1^^@-\XeTeXglyph
\XeTeXglyphindex "#1"
core/genericAccess.inp
나는 이것을 다음 줄이 포함된 파일 로 추적했습니다 .
\newcommand*{\lilyGetGlyph}[1]{\XeTeXglyph\XeTeXglyphindex"#1" }
좋습니다. XeTeX 관련 명령입니다. LuaLaTeX에서 이 작업을 수행하려면 LuaTeX 버전이 필요합니다. 나는 찾았다이 답변이는 다음과 같은 것을 제안합니다.
\def\lilyGetGlyph#1{\directlua{fonts.otf.char("#1")}}
하지만 MWE에서 LuaLaTeX를 실행하면 다음 오류가 발생합니다.
! LuaTeX error [string "\directlua "]:1: attempt to index field 'otf' (a nil value)
stack traceback:
[string "\directlua "]:1: in main chunk.
\lilyGetGlyph ...\directlua {fonts.otf.char("#1")}
나는 그것이 무엇을 의미하는지 전혀 모르지만 내가 시도한 수정의 구문도 이해하지 못합니다. (나는 단지 뭔가가 작동하기를 바라는 단어와 기호를 계속 입력합니다.)
lilyglyphs
그래서 제가 찾고 있는 것은 패키지가 LuaLaTeX와 함께 작동할 수 있게 해주는 XeLaTeX 코드의 LuaTeX 버전입니다 . 물론 이것이 이 문제를 해결하는 적절한 방법이라고 가정합니다.
답변1
좋습니다. \directlua{fonts.otf.char
LuaTeX에서는 더 이상 지원되지 않습니다.이 답변. 다행히도 그들(@phg)도 솔루션을 제공했습니다.
\usepackage{luaotfload,luacode}
\begin{luacode}
documentdata = documentdata or { }
local stringformat = string.format
local texsprint = tex.sprint
local slot_of_name = luaotfload.aux.slot_of_name
documentdata.fontchar = function (chr)
local chr = slot_of_name(font.current(), chr, false)
if chr and type(chr) == "number" then
texsprint
(stringformat ([[\char"%X"]], chr))
end
end
\end{luacode}
\def\lilyGetGlyph#1{\directlua{documentdata.fontchar "#1"}}
파일 에 추가했는데 core/genericAccess.inp
이제 모든 것이 제대로 작동합니다. LuaTeX와 XeTeX를 확인하기 위해 몇 가지 테스트를 원래 코드에 추가하고 이 모든 것을 패키지 작성자에게 보낼 것입니다.