Created
June 23, 2021 06:49
-
-
Save mkpoli/620ea65bb2403c98ad4913e37cd17d06 to your computer and use it in GitHub Desktop.
字母ルビー(複数行のふりがな+自動括弧)
This file contains hidden or 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[article, lualatex, [...], tate, landscape]{jlreq} | |
| \usepackage{pythontex} | |
| [...] | |
| \begin{pycode} | |
| def addparen(string): | |
| result = "\\vspace{-0.8\\zh}" | |
| for char in string: | |
| result += ("\\tatechuyoko{(" + char + ")}" if char != " " else " ") | |
| return result | |
| \end{pycode} | |
| \newcommand{\addparen}[1]{\py{addparen("#1")}} | |
| \newcommand{\jibo}[2]{\shortstack{\addparen{#2}\\#1}} | |
| \newcommand{\jruby}[3]{\ruby{#1}{\jibo{#2}{#3}}} | |
| [...] | |
| \begin{document} | |
| \jruby{山茶}{つばき}{ 者 } | |
| \end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment