diff options
author | Norbert Preining <norbert@preining.info> | 2022-02-15 03:01:03 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-02-15 03:01:03 +0000 |
commit | f53e32586563f8905b64242c461f777360059e2e (patch) | |
tree | 197cc9b11100c7c9023d91b0462d7bd3aa3e50af /macros/latex/contrib/kanbun/kanbun.lua | |
parent | 01b69c78ff33854f7f28149e8167cb4219fcb416 (diff) |
CTAN sync 202202150301
Diffstat (limited to 'macros/latex/contrib/kanbun/kanbun.lua')
-rw-r--r-- | macros/latex/contrib/kanbun/kanbun.lua | 29 |
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") |