]> git.lyx.org Git - features.git/commitdiff
New module for Ruby (furigana) text.
authorGünter Milde <milde@lyx.org>
Mon, 13 May 2019 14:31:53 +0000 (16:31 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:29 +0000 (15:48 +0200)
New fileversion and conversion routines will follow once tested.

lib/examples/ja/Multilingual_Typesetting_with_CJKutf8.lyx
lib/layouts/ruby.module [new file with mode: 0644]

index fbd220e1a14ff47fffb9e8cdfad22ebcc10183a5..1b3fe93d185f22ca5ca3970fad690524683c4357 100644 (file)
@@ -34,6 +34,7 @@
 \use_default_options true
 \begin_modules
 logicalmkup
+ruby
 \end_modules
 \maintain_unincluded_children false
 \language japanese-cjk
@@ -122,7 +123,7 @@ logicalmkup
 \begin_layout Title
 
 \lang english
-Multilingual typesetting with CJKutf8
+Multilingual typesetting with the CJK package
 \end_layout
 
 \begin_layout Date
@@ -274,7 +275,7 @@ Then, the following should work:
 \end_layout
 
 \begin_layout Enumerate
-\SpecialChar LyX
+Japanese text, of course: \SpecialChar LyX
 は優秀な取扱説明書を同梱していますので、これをお使いください!まずは
 \family sans
 ヘルプ\SpecialChar menuseparator
@@ -336,15 +337,79 @@ Russisch:
 \begin_layout Enumerate
 
 \lang english
-Japanese characters (
+Japanese characters, e.g., 介 し
+\family sans
+ 門
+\family default
+, may also be used in text parts set to other languages.
+\end_layout
+
+\begin_layout Enumerate
+
+\lang english
+Ruby (ルビ, furigana) with the help of the Ruby module:
 \lang japanese-cjk
-介, し
+\begin_inset Flex Ruby
+status open
+
+\begin_layout Plain Layout
+東 京
+\begin_inset Argument post:1
+status open
+
+\begin_layout Plain Layout
+とう きょう
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+
+\lang english
+Select D
 \family sans
-, 門
+ocument\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
+Modules\SpecialChar menuseparator
+Annotation&Revision\SpecialChar menuseparator
+Ruby
 \family default
+.
+\end_layout
+
+\begin_layout Itemize
+
 \lang english
-) may also be used in text parts set to other languages.
+Select 
+\family sans
+Edit\SpecialChar menuseparator
+Custom Text Styles\SpecialChar menuseparator
+Ruby
+\family default
+ for the base characters.
+\end_layout
+
+\begin_layout Itemize
+
+\lang english
+Select 
+\family sans
+Insert\SpecialChar menuseparator
+Ruby text
+\family default
+ for the reading aid.
 \end_layout
 
+\end_deeper
 \end_body
 \end_document
diff --git a/lib/layouts/ruby.module b/lib/layouts/ruby.module
new file mode 100644 (file)
index 0000000..1ad14e2
--- /dev/null
@@ -0,0 +1,46 @@
+#\DeclareLyXModule{Ruby (Furigana)}
+#\DeclareCategory{Annotation & Revision}
+#DescriptionBegin
+#Defines an inset to typeset reading aids (ruby, furigana) to Chinese
+#characters. Uses the "okumakro", "luatexja-ruby", or "ruby" package
+#(depending on the TeX engine) or a fallback definition.
+#DescriptionEnd
+#Requires
+#Excludes
+
+#Authors: Koji Yokota (original implementation as local layout),
+#         Günter Milde <milde@lyx.org> (module)
+
+Format 74
+
+InsetLayout Flex:Ruby
+       LyxType         charstyle
+       LatexType       command
+       LatexName       ruby
+       BgColor         none
+       LabelString     "Ruby"
+       Decoration      Conglomerate
+       Preamble
+         \ifdefined\kanjiskip
+           \IfFileExists{okumacro.sty}{\usepackage{okumacro}}{}
+         \else \ifdefined\luatexversion
+           \usepackage{luatexja-ruby}
+         \else \ifdefined\XeTeXversion
+           \usepackage{ruby}%
+         \fi\fi\fi
+         \providecommand{\ruby}[2]{\shortstack{\tiny #2\\#1}}
+       EndPreamble
+       Argument        post:1
+               LabelString     "ruby text"
+               MenuString      "Ruby Text|R"
+               Tooltip         "Reading aid (ruby, furigana) for Chinese characters."
+               Decoration      Conglomerate
+               Font
+                 Size          tiny
+               EndFont
+               LabelFont
+                 Size          tiny
+               EndFont
+               Mandatory       1
+       EndArgument
+End