summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/kanbun/kanbun.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/kanbun/kanbun.lua')
-rw-r--r--macros/latex/contrib/kanbun/kanbun.lua29
1 files changed, 25 insertions, 4 deletions
diff --git a/macros/latex/contrib/kanbun/kanbun.lua b/macros/latex/contrib/kanbun/kanbun.lua
index 9f8f01aab3..3d24708abf 100644
--- a/macros/latex/contrib/kanbun/kanbun.lua
+++ b/macros/latex/contrib/kanbun/kanbun.lua
@@ -1,3 +1,20 @@
+-- Copyright 2022 Yuanhao Chen
+
+-- This work may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either version 1.3
+-- of this license or (at your option) any later version.
+-- The latest version of this license is in
+-- http://www.latex-project.org/lppl.txt
+-- and version 1.3 or later is part of all distributions of LaTeX
+-- version 2005/12/01 or later.
+--
+-- This work has the LPPL maintenance status `maintained'.
+--
+-- The Current Maintainer of this work is Yuanhao Chen.
+--
+-- This work consists of the files kanbun.sty, kanbun.lua,
+-- kanbun-example.tex and kanbun.tex.
+
function directtex(str)
coroutine.yield(str)
end
@@ -25,10 +42,10 @@ function main_loop()
brackets["furigana4saidokumoji"] = {"‹","›"}
brackets["okurigana4saidokumoji"] = {"«","»"}
--
- -- other_brackets["punctuation"] = {"⦉","⦊"}
- -- other_brackets["kanji"] = {"⌊","⌋"}
- -- other_brackets["multikanji"] = {"‘","’"}
- -- other_brackets["unit"] = {"“","”"}
+ brackets["punctuation"] = {"⦉","⦊"}
+ -- brackets["kanji"] = {"⌊","⌋"}
+ -- brackets["multikanji"] = {"‘","’"}
+ -- brackets["unit"] = {"“","”"}
--
left_brackets = {}
right_brackets = {}
@@ -218,6 +235,10 @@ function main_loop()
output = "{\\kanbunfont"..table.concat(annotated_lines_table, "\\par").."\\par}"
directtex("\\def\\printkanbun{"..output.."}")
directtex("\\def\\printkanbuncode{\\directlua{print('')print(output)}}")
+ -- nopar output
+ nopar_output = table.concat(annotated_lines_table, "\\\\")
+ directtex("\\def\\printkanbunnopar{"..nopar_output.."}")
+ directtex("\\def\\printkanbunnoparcode{\\directlua{print('')print(nopar_output)}}")
-- end loop in TeX
directtex("\\continuefalse")