]> git.lyx.org Git - features.git/commitdiff
Format incremented to 574: Ruby inset, fixes for Japanese.
authorGünter Milde <milde@lyx.org>
Wed, 15 May 2019 15:32:09 +0000 (17:32 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:29 +0000 (15:48 +0200)
New auxiliary functions for lyx2lyx:
del_module(), append_local_layout(), del_local_layout()

35 files changed:
development/FORMAT
lib/doc/ja/Additional.lyx
lib/doc/ja/Customization.lyx
lib/doc/ja/EmbeddedObjects.lyx
lib/doc/ja/Intro.lyx
lib/doc/ja/Math.lyx
lib/doc/ja/Shortcuts.lyx
lib/doc/ja/Tutorial.lyx
lib/doc/ja/UserGuide.lyx
lib/examples/ja/Multilingual_Typesetting_with_CJKutf8.lyx
lib/layouts/ruby.module
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_2_3.py
lib/lyx2lyx/lyx_2_4.py
src/tex2lyx/test/CJK.lyx.lyx
src/tex2lyx/test/CJKutf8.lyx.lyx
src/tex2lyx/test/DummyDocument.lyx.lyx
src/tex2lyx/test/Dummy~Document.lyx.lyx
src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
src/tex2lyx/test/algo2e.lyx.lyx
src/tex2lyx/test/beamer.lyx.lyx
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/test/listpreamble.lyx.lyx
src/tex2lyx/test/tabular-x-test.lyx.lyx
src/tex2lyx/test/test-insets-basic.lyx.lyx
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-memoir.lyx.lyx
src/tex2lyx/test/test-minted.lyx.lyx
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
src/tex2lyx/test/test-scr.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/test/verbatim.lyx.lyx
src/version.h

index 3b99985ca08b27bb8885b911d6d79acc86ed1674..fd2b6c4f93186ce412ef848722c6ce5b1b438d90 100644 (file)
@@ -8,7 +8,10 @@ changes happened in particular if possible. A good example would be
 -----------------------
 
 2019-04-16  Günter Milde <milde@lyx.org>
-        * format incremented to 573: Rename legacy input encoding settings.
+        * Format incremented to 574: Ruby inset, fixes for Japanese.
+
+2019-04-16  Günter Milde <milde@lyx.org>
+        * Format incremented to 573: Rename legacy input encoding settings.
 
 2019-04-07  Kornel Benko <kornel@lyx.org>
        * format incremented to 572: Extended Noto fonts.
index aaba5802a386fed1e27e295a0fe7e520c8d66d8e..13cd17ec6eb01203a94c0c6da8f11231c0df82fa 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
@@ -48,6 +48,7 @@ theorems-ams
 theorems-ams-extended
 multicol
 shapepar
+ruby
 \end_modules
 \maintain_unincluded_children false
 \begin_local_layout
@@ -64,42 +65,11 @@ Preamble
 \newcommand*{\menuitem}[1]{{\sffamily #1}}
 EndPreamble
 End
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
 \end_local_layout
 \language japanese
 \language_package default
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -173,6 +143,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle headings
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
@@ -206,7 +177,6 @@ status collapsed
 status open
 
 \begin_layout Plain Layout
-\noindent
 
 \family typewriter
 <lyx-docs@lists.lyx.org>
@@ -5424,7 +5394,6 @@ includegraphics{logo.eps}}}
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
 
 \family typewriter
 
@@ -23621,7 +23590,6 @@ go back to the default
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
 shapepar
 \end_layout
 
@@ -24123,7 +24091,6 @@ shapepar
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
 shapepar
 \end_layout
 
@@ -24447,6 +24414,7 @@ status open
 \begin_inset CommandInset include
 LatexCommand input
 filename "../SpecialParagraphShape.tex"
+literal "true"
 
 \end_inset
 
@@ -24520,7 +24488,6 @@ status collapsed
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
 shapepar
 \end_layout
 
index 175f7d9e8425e2b4237bb14371152c1dc2e763e8..871775916680227e1639977969ae66a24608bcf2 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
@@ -28,6 +28,7 @@
 \use_default_options false
 \begin_modules
 logicalmkup
+ruby
 \end_modules
 \maintain_unincluded_children false
 \begin_local_layout
@@ -54,42 +55,10 @@ End
 #\renewcommand{\code}[1]{{\sffamily #1}}
 #EndPreamble
 #End
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-ResetsFont true
-End
 \end_local_layout
 \language japanese
 \language_package default
-\inputencoding utf8-platex
+\inputencoding utf8
 \fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
@@ -108,8 +77,6 @@ End
 \output_sync 0
 \bibtex_command default
 \index_command default
-\float_placement class
-\float_alignment class
 \paperfontsize 12
 \spacing single
 \use_hyperref true
@@ -5965,13 +5932,7 @@ type  "lyxinfo"
 arg   "version"
 \end_inset
 
-では,最新書式は
-\begin_inset Info
-type  "lyxinfo"
-arg   "layoutformat"
-\end_inset
-
-です)
+では,最新書式は69です)
 \end_layout
 
 \begin_layout Standard
@@ -6294,13 +6255,7 @@ DeclareLyXModule{My Package}
 \end_layout
 
 \begin_layout LyX-Code
-Format 
-\begin_inset Info
-type  "lyxinfo"
-arg   "layoutformat"
-\end_inset
-
-
+Format 69
 \begin_inset Newline newline
 \end_inset
 
@@ -7631,16 +7586,10 @@ status collapsed
 \end_inset
 
 1.3.x以前のレイアウトファイルには,明示されたファイル形式がないため,書式1と解されます.\SpecialChar LyX
-現行版のファイル形式は,書式
-\begin_inset Info
-type  "lyxinfo"
-arg   "layoutformat"
-\end_inset
-
-です.しかし,\SpecialChar LyX
+現行版のファイル形式は,書式69です.しかし,\SpecialChar LyX
 の各版は,旧版の\SpecialChar LyX
-で作成されたファイルを読むことができるように,旧版のレイアウトファイルも読むことができます.しかしながら,以前の書式に変換する方法
-はありません.
+で作成さ
\82\8cã\81\9fã\83\95ã\82¡ã\82¤ã\83«ã\82\92読ã\82\80ã\81\93ã\81¨ã\81\8cã\81§ã\81\8dã\82\8bã\82\88ã\81\86ã\81«ï¼\8cæ\97§ç\89\88ã\81®ã\83¬ã\82¤ã\82¢ã\82¦ã\83\88ã\83\95ã\82¡ã\82¤ã\83«ã\82\82読ã\82\80ã\81\93ã\81¨ã\81\8cã\81§ã\81\8dã\81¾ã\81\99ï¼\8eã\81\97ã\81\8bã\81\97ã\81ªã\81\8cã\82\89ï¼\8c以å\89\8dã\81®æ\9b¸å¼\8fã\81«å¤\89æ\8f\9bã\81\99ã\82\8bæ\96¹æ³\95ã\81¯ã\81\82ã\82\8aã\81¾ã\81\9bã\82\93ï¼\8e
 \end_layout
 
 \begin_layout Subsection
index 8359ea5c79ccb6a36d16684e269971277369c898..90699a857aab2dc0418a1b5c0e6496592fb2c527 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
 initials
 graphicboxes
 varwidth
+ruby
 \end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package default
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -289,6 +257,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
+\tablestyle default
 \bullet 1 1 34 -1
 \bullet 2 2 35 -1
 \bullet 3 2 7 -1
@@ -775,6 +744,8 @@ reference "sec:キャプションの配置"
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -818,6 +789,8 @@ name "fig:星形"
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -957,6 +930,8 @@ reference "fig:A-star"
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -967,6 +942,8 @@ status open
 
 
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -1009,6 +986,8 @@ name "fig:Pink-object"
 
 
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -2503,6 +2482,7 @@ reference "sec:フロートはじめに"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -10687,6 +10667,7 @@ status collapsed
 \noindent
 \begin_inset Float table
 placement H
+alignment document
 wide false
 sideways false
 status open
@@ -10912,6 +10893,7 @@ p\SpecialChar LaTeX
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -11377,6 +11359,7 @@ status collapsed
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -11564,6 +11547,8 @@ reference "tab:半分でない表"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -14214,6 +14199,7 @@ reference "tab:ブックタブ表の例"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -14944,6 +14930,7 @@ status collapsed
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -16239,6 +16226,7 @@ status collapsed
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -16803,6 +16791,7 @@ cellcolor{Maroon}
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -17264,6 +17253,7 @@ rowcolors{1}{white}{lightgray}
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -17443,6 +17433,7 @@ hline]{1}{lightgray}{cyan}
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -17793,6 +17784,7 @@ Wc
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -18024,6 +18016,7 @@ arrayrulecolor{black}}
 
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -18184,6 +18177,7 @@ reference "tab:色付き罫線の表"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -18394,6 +18388,8 @@ reference "tab:着色水平罫線表"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -19008,6 +19004,8 @@ multicolumn{1}{|c|}{
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -19776,6 +19774,8 @@ reference "tab:回転表"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -19999,6 +19999,8 @@ is an example for a rotated multiline cell where a variable width minipage
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -20787,6 +20789,7 @@ reference "tab:垂直揃え"
 \noindent
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -20815,6 +20818,8 @@ name "tab:垂直揃え"
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -20929,6 +20934,8 @@ status collapsed
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -21160,6 +21167,7 @@ arg   "tabular-feature align-decimal"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -21247,6 +21255,7 @@ name "tab:表セル"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -21433,6 +21442,8 @@ reference "tab:演算子揃え表"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -22047,6 +22058,7 @@ S{2.5cm}{2}
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -22289,6 +22301,8 @@ arrayrulewidth}{1.5pt}
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -22567,6 +22581,8 @@ arrayrulewidth 0.4pt}}
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -22779,6 +22795,8 @@ Vc
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -22960,6 +22978,7 @@ arydshln
 \begin_layout Standard
 \begin_inset Float table
 placement H
+alignment document
 wide false
 sideways false
 status open
@@ -23559,6 +23578,7 @@ status collapsed
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -24545,6 +24565,7 @@ status collapsed
 \begin_layout Standard
 \begin_inset Float algorithm
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -26220,6 +26241,8 @@ status open
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways true
 status open
@@ -26367,6 +26390,8 @@ reference "tab:従属表を横に並べたもの"
 
 の従属フロートです.
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -26395,6 +26420,8 @@ name "tab:従属表を横に並べたもの"
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -26489,6 +26516,8 @@ name "tab:これは従属表a"
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -26588,6 +26617,8 @@ name "tab:これは従属表b"
 
 
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -26614,6 +26645,8 @@ name "tab:従属表を縦に並べたもの"
 \noindent
 \align center
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -26693,6 +26726,8 @@ status collapsed
 \noindent
 \align center
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -26854,6 +26889,8 @@ reference "sec:ミニページ"
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -27355,6 +27392,7 @@ status open
 \begin_layout Standard
 \begin_inset Float figure
 placement !p
+alignment document
 wide false
 sideways false
 status open
@@ -27413,6 +27451,7 @@ on}
 \begin_layout Standard
 \begin_inset Float table
 placement !p
+alignment document
 wide false
 sideways false
 status open
@@ -27686,6 +27725,8 @@ reference "tab:標準表"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -27829,6 +27870,8 @@ c & d
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -28680,6 +28723,8 @@ FigBesBeg
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -28752,6 +28797,8 @@ TabBesBeg
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -29027,6 +29074,8 @@ sidecaptionvpos{figure}{c}
 
 
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -29099,6 +29148,8 @@ TabBesBeg[5]
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -30536,6 +30587,7 @@ status collapsed
 を読み込みます.
 \begin_inset Float figure
 placement !h
+alignment document
 wide false
 sideways false
 status open
@@ -30603,6 +30655,7 @@ name "fig:標準的脚注配置"
 \begin_layout Standard
 \begin_inset Float figure
 placement !h
+alignment document
 wide false
 sideways false
 status open
@@ -30721,6 +30774,8 @@ theendnotes
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -37741,6 +37796,7 @@ status collapsed
 \begin_inset CommandInset include
 LatexCommand include
 filename "DummyDocument1.lyx"
+literal "true"
 
 \end_inset
 
@@ -37829,6 +37885,7 @@ includeonly
 \begin_inset CommandInset include
 LatexCommand input
 filename "DummyDocument2.lyx"
+literal "true"
 
 \end_inset
 
@@ -37869,6 +37926,7 @@ textvisiblespace
 \begin_inset CommandInset include
 LatexCommand verbatiminput
 filename "DummyTextDocument.txt"
+literal "true"
 
 \end_inset
 
@@ -37884,6 +37942,7 @@ filename "DummyTextDocument.txt"
 \begin_inset CommandInset include
 LatexCommand verbatiminput*
 filename "DummyTextDocument.txt"
+literal "true"
 
 \end_inset
 
@@ -38768,6 +38827,7 @@ reference "lst:file-listing"
 LatexCommand lstinputlisting
 filename "EmbeddedObjects.lyx"
 lstparams "breaklines=true,caption={Lines 10 - 15 of this LyX file},extendedchars=true,firstline=10,label={lst:file-listing},language={[LaTeX]TeX},lastline=15"
+literal "true"
 
 \end_inset
 
@@ -38970,6 +39030,7 @@ reference "tab:単位"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
index 8ff8db913553d6c61db76266db39b0e9704228ad..f9b8bd82a36bb17241cb954423be8bf7402398a3 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
    \pagenumbering{arabic} }
 \end_preamble
 \use_default_options false
+\begin_modules
+ruby
+\end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -135,6 +105,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
@@ -2991,6 +2962,8 @@ reference "tab:画像用単位"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
index 217674b52b9d3d00b2d6800be1cd3140650e4f9c..5ae171fd759e8a758e91f12fad84e836bbd756b2 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
 \use_default_options true
 \begin_modules
 subequations
+ruby
 \end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package default
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -201,6 +169,8 @@ End
 \output_sync 0
 \bibtex_command default
 \index_command default
+\float_placement class
+\float_alignment class
 \paperfontsize default
 \spacing single
 \use_hyperref true
@@ -260,6 +230,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle plain
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
@@ -971,6 +942,7 @@ status collapsed
 \align center
 \begin_inset Float table
 placement H
+alignment document
 wide false
 sideways false
 status open
@@ -35219,8 +35191,8 @@ begin{multicols}{2}
 
 \lang ngerman
 Das Spektrum wird fouriertransformiert.
- Die Fouriertransformation wird verwendet, um die 
überlagerten Signale (Netzwerk, Lösungsmittel) zu trennen.
+ Die Fouriertransformation wird verwendet, um die  überlagerten Signale
+ (Netzwerk, Lösungsmittel) zu trennen.
  Nachdem wir die Phasenverschiebung bestimmen konnten, interessiert uns
  nun das Aussehen des Ausgangssignals.
  Im Experiment haben wir es mit sehr vielen Teilchen zu tun, so das man
@@ -35295,7 +35267,8 @@ wobei
 
 -rf-Puls beginnt sich die Magnetisierung zu entfokussieren, wodurch sich
  das Signal zusätzlich abschwächt.
- Diese Abschwächung verläuft exponentiell in Abhängigkeit der so genannten 
+ Diese Abschwächung verläuft exponentiell in Abhängigkeit der so genannten
 \begin_inset Formula $T_{2}$
 \end_inset
 
index 800fd2a2c5452c0b521c9bf0b5ef55928dd140ea..2e555009134d496c9e2d166223b3bd2cb95930e5 100644 (file)
@@ -1,49 +1,19 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
 \origin /systemlyxdir/doc/ja/
 \textclass bxjsarticle
 \use_default_options true
+\begin_modules
+ruby
+\end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -61,6 +31,8 @@ End
 \output_sync 0
 \bibtex_command default
 \index_command default
+\float_placement class
+\float_alignment class
 \paperfontsize default
 \spacing single
 \use_hyperref false
@@ -101,6 +73,7 @@ End
 \papercolumns 1
 \papersides 1
 \paperpagestyle empty
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
index 146aee9de502633648194a984ee0da0cd1d58587..5ae7415dc891a7c4b80f5be45184bb43cd517e6d 100644 (file)
@@ -1,49 +1,19 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 544
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
 \origin /systemlyxdir/doc/ja/
 \textclass bxjsbook
 \use_default_options true
+\begin_modules
+ruby
+\end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "IPAGothic"
@@ -115,6 +85,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
index bbb35df091a27f5a76effe219e2946e8bf52a776..5fd34cf19d34f1c525232f814efa09a5ca1438fb 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 544
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties false
 \begin_modules
 customHeadersFooters
 enumitem
+ruby
 \end_modules
 \maintain_unincluded_children false
-\begin_local_layout
-InsetLayout            Flex:Ruby
-LyxType                charstyle
-LatexType              command
-LatexName              ruby
-BgColor                none
-LabelString            "ルビ"
-Decoration             Conglomerate
-Argument post:1
-LabelString    "ルビ文"
-MenuString     "ルビ文(S)|S"
-Decoration     Conglomerate
-Font
-Size           tiny
-EndFont
-LabelFont
-Size           tiny
-EndFont
-Mandatory      1
-EndArgument
-Preamble
-\IfFileExists{okumacro.sty}
-\ifdefined\kanjiskip
-  \IfFileExists{okumacro.sty}%
-    {\usepackage{okumacro}}%
-    {\newcommand{\ruby}[2]{\shortstack{\tiny ##2\\##1}}}%
-\else \ifdefined\luatexversion
-  \usepackage{luatexja-ruby}
-\else \ifdefined\XeTeXversion
-  \usepackage{ruby}%
-\fi\fi\fi
-EndPreamble
-End
-\end_local_layout
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
-\fontencoding global
+\inputencoding utf8
+\fontencoding auto
 \font_roman "lmodern" "IPAexMincho"
 \font_sans "default" "IPAexGothic"
 \font_typewriter "default" "default"
@@ -175,6 +142,7 @@ End
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
+\tablestyle default
 \tracking_changes false
 \output_changes false
 \html_math_output 0
@@ -1615,6 +1583,7 @@ reference "tab:水平スクロールのテスト"
 \begin_layout Standard
 \begin_inset Float table
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -6650,6 +6619,8 @@ Return
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -9756,6 +9727,8 @@ reference "tab:空白の幅"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -19973,6 +19946,7 @@ arg   "layout-paragraph"
 \begin_layout Standard
 \begin_inset Float figure
 placement htbp
+alignment document
 wide false
 sideways false
 status open
@@ -20083,6 +20057,8 @@ reference "fig:カモノハシ"
 
 \begin_layout Standard
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -20093,6 +20069,8 @@ status open
 
 
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -20134,6 +20112,8 @@ name "fig:何かわからない"
 
 
 \begin_inset Float figure
+placement document
+alignment document
 wide false
 sideways false
 status collapsed
@@ -20244,6 +20224,7 @@ reference "tab:表フロート"
 \begin_layout Standard
 \begin_inset Float table
 placement htbp
+alignment document
 wide false
 sideways false
 status open
@@ -21613,6 +21594,8 @@ reference "tab:アクセント名とそれに対応するコマンド"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -22692,6 +22675,8 @@ reference "tab:書体とそれに対応するコマンド"
 
 \begin_layout Standard
 \begin_inset Float table
+placement document
+alignment document
 wide false
 sideways false
 status open
@@ -28660,6 +28645,7 @@ reference "fig:ページレイアウト"
 \begin_layout Standard
 \begin_inset Float figure
 placement h
+alignment document
 wide false
 sideways false
 status open
@@ -40706,6 +40692,7 @@ reference "tab:単位"
 \begin_layout Standard
 \begin_inset Float table
 placement t
+alignment document
 wide false
 sideways false
 status open
index 1b3fe93d185f22ca5ca3970fad690524683c4357..05a25ae45550f1f05780b8428f4ea7f6996688ef 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -351,7 +351,7 @@ Ruby (ルビ, furigana) with the help of the Ruby module:
 \lang japanese-cjk
  
 \begin_inset Flex Ruby
-status open
+status collapsed
 
 \begin_layout Plain Layout
 東 京
@@ -396,7 +396,7 @@ Edit\SpecialChar menuseparator
 Custom Text Styles\SpecialChar menuseparator
 Ruby
 \family default
- for the base characters.
+ for the base character(s).
 \end_layout
 
 \begin_layout Itemize
index 1ad14e2e3d047090b5c84c4db25b3c3c789dfcd8..95532bde8fd76b20ec7e263218b07efcea54c542 100644 (file)
 #Authors: Koji Yokota (original implementation as local layout),
 #         Günter Milde <milde@lyx.org> (module)
 
+# References:
+# required packages
+#   okumacro.sty:       https://ctan.org/pkg/jsclasses
+#   luatexja-ruby.sty:  https://ctan.org/pkg/luatexja
+#   ruby.sty:           https://www.ctan.org/pkg/cjk
+# extended ruby support package (currently not used): 
+#   https://ctan.org/pkg/pxrubrica
+# W3W spec: 
+#   https://www.w3.org/International/articles/ruby/markup.en.html
+
 Format 74
 
 InsetLayout Flex:Ruby
        LyxType         charstyle
        LatexType       command
        LatexName       ruby
+       HTMLTag         ruby
+       HTMLAttr        ""
+       HTMLInnerTag    rb
+       HTMLInnerAttr   ""
        BgColor         none
        LabelString     "Ruby"
        Decoration      Conglomerate
@@ -30,6 +44,7 @@ InsetLayout Flex:Ruby
          \fi\fi\fi
          \providecommand{\ruby}[2]{\shortstack{\tiny #2\\#1}}
        EndPreamble
+        # Fixme: Currently the ruby text is ignored in HTML
        Argument        post:1
                LabelString     "ruby text"
                MenuString      "Ruby Text|R"
index 5ea84b7963ff63d45b6aeb9cf4942eb85fbcffea..245cc6e5b88324027f533843634381c60b1f2757 100644 (file)
@@ -20,8 +20,8 @@
 
 " The LyX module has all the rules related with different lyx file formats."
 
-from parser_tools import get_value, check_token, find_token, \
-     find_tokens, find_end_of
+from parser_tools import (get_value, check_token, find_token, find_tokens,
+                          find_end_of, find_complete_lines)
 import os.path
 import gzip
 import locale
@@ -595,6 +595,7 @@ class LyX_base:
 
     #Note that the module will be added at the END of the extant ones
     def add_module(self, module):
+      " Append module to the modules list."
       i = find_token(self.header, "\\begin_modules", 0)
       if i == -1:
         #No modules yet included
@@ -615,7 +616,16 @@ class LyX_base:
       self.header.insert(j, module)
 
 
+    def del_module(self, module):
+        " Delete `module` from module list, return success."
+        modlist = self.get_module_list()
+        if module not in modlist:
+            return False
+        self.set_module_list([line for line in modlist if line != "ruby"])
+        return True
+
     def get_module_list(self):
+      " Return list of modules."
       i = find_token(self.header, "\\begin_modules", 0)
       if (i == -1):
         return []
@@ -624,23 +634,23 @@ class LyX_base:
 
 
     def set_module_list(self, mlist):
-      modbegin = find_token(self.header, "\\begin_modules", 0)
-      newmodlist = ['\\begin_modules'] + mlist + ['\\end_modules']
-      if (modbegin == -1):
+      i = find_token(self.header, "\\begin_modules", 0)
+      if (i == -1):
         #No modules yet included
         tclass = find_token(self.header, "\\textclass", 0)
         if tclass == -1:
           self.warning("Malformed LyX document: No \\textclass!!")
           return
-        modbegin = tclass + 1
-        self.header[modbegin:modbegin] = newmodlist
-        return
-      modend = find_token(self.header, "\\end_modules", modbegin)
-      if modend == -1:
-        self.warning("(set_module_list)Malformed LyX document: No \\end_modules.")
-        return
-      newmodlist = ['\\begin_modules'] + mlist + ['\\end_modules']
-      self.header[modbegin:modend + 1] = newmodlist
+        i = j = tclass + 1
+      else: 
+        j = find_token(self.header, "\\end_modules", i)
+        if j == -1:
+            self.warning("(set_module_list) Malformed LyX document: No \\end_modules.")
+            return
+        j += 1
+      if mlist:
+          mlist = ['\\begin_modules'] + mlist + ['\\end_modules']
+      self.header[i:j] = mlist
 
 
     def set_parameter(self, param, value):
@@ -773,6 +783,53 @@ class LyX_base:
         return mode, steps
 
 
+    def append_local_layout(self, new_layout):
+        " Append `new_layout` to the local layouts."
+        # new_layout may be a string or a list of strings (lines)
+        try:
+            new_layout = new_layout.splitlines()
+        except AttributeError:
+            pass
+        i = find_token(self.header, "\\begin_local_layout", 0)
+        if i == -1:
+            k = find_token(self.header, "\\language", 0)
+            if k == -1:
+                # this should not happen
+                self.warning("Malformed LyX document! No \\language header found!")
+                return
+            self.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"]
+            i = k - 1
+
+        j = find_end_of(self.header, i, "\\begin_local_layout", "\\end_local_layout")
+        if j == -1:
+            # this should not happen
+            self.warning("Malformed LyX document: Can't find end of local layout!")
+            return
+
+        self.header[i+1 : i+1] = new_layout
+
+    def del_local_layout(self, old_layout):
+        " Delete `old_layout` from local layouts, return success."
+        i = find_complete_lines(self.header, old_layout)
+        if i == -1:
+            return False
+        j = i+len(old_layout)
+        if (self.header[i-1] == "\\begin_local_layout" and
+            self.header[j] == "\\end_local_layout"):
+            i -=1
+            j +=1
+        self.header[i:j] = []
+        return True
+
+    def del_from_header(self, lines):
+        " Delete `lines` from the document header, return success."
+        i = find_complete_lines(self.header, lines)
+        if i == -1:
+            return False
+        j = i + len(lines)
+        self.header[i:j] = []
+        return True
+
 # Part of an unfinished attempt to make lyx2lyx gave a more
 # structured view of the document.
 #    def get_toc(self, depth = 4):
index 8b834c1abc4130ebec9dc8b45d60f461fa9dd209..48e0dab82e4d8fbf28d649754fe40d49da65d6b1 100644 (file)
@@ -26,7 +26,7 @@ import sys, os
 
 from parser_tools import (del_token, del_value, del_complete_lines,
     find_complete_lines, find_end_of, find_end_of_layout, find_end_of_inset,
-    find_re, find_substring, find_token, find_token_backwards,
+    find_re, find_substring, find_token, find_token_backwards, find_across_lines,
     get_containing_inset, get_containing_layout, get_bool_value, get_value,
     get_quoted_value, is_in_inset, set_bool_value)
 #  find_tokens, find_token_exact, check_token, get_option_value
@@ -157,6 +157,31 @@ def revert_ibranches(document):
         document.header[i:i] = lines
 
 
+beamer_article_styles = [
+    "### Inserted by lyx2lyx (more [scr]article styles) ###",
+    "Input article.layout",
+    "Input beamer.layout",
+    "Provides geometry 0",
+    "Provides hyperref 0",
+    "DefaultFont",
+    "     Family                Roman",
+    "     Series                Medium",
+    "     Shape                 Up",
+    "     Size                  Normal",
+    "     Color                 None",
+    "EndFont",
+    "Preamble",
+    "     \\usepackage{beamerarticle,pgf}",
+    "     % this default might be overridden by plain title style",
+    "     \\newcommand\makebeamertitle{\\frame{\\maketitle}}%",
+    "     \\AtBeginDocument{",
+    "             \\let\\origtableofcontents=\\tableofcontents",
+    "             \\def\\tableofcontents{\\@ifnextchar[{\\origtableofcontents}{\\gobbletableofcontents}}",
+    "             \\def\\gobbletableofcontents#1{\\origtableofcontents}",
+    "     }",
+    "EndPreamble",
+    "### End of insertion by lyx2lyx (more [scr]article styles) ###"]
+
 def revert_beamer_article_styles(document):
     " Include (scr)article styles in beamer article "
 
@@ -164,52 +189,9 @@ def revert_beamer_article_styles(document):
     if document.textclass not in beamer_articles:
         return
 
-    inclusion = "article.layout"
     if document.textclass == "scrarticle-beamer":
-        inclusion = "scrartcl.layout"
-
-    i = find_token(document.header, "\\begin_local_layout", 0)
-    if i == -1:
-        k = find_token(document.header, "\\language", 0)
-        if k == -1:
-            # this should not happen
-            document.warning("Malformed LyX document! No \\language header found!")
-            return
-        document.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"]
-        i = k - 1
-
-    j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-    if j == -1:
-        # this should not happen
-        document.warning("Malformed LyX document: Can't find end of local layout!")
-        return
-
-    document.header[i+1 : i+1] = [
-        "### Inserted by lyx2lyx (more [scr]article styles) ###",
-        "Input " + inclusion,
-        "Input beamer.layout",
-        "Provides geometry 0",
-        "Provides hyperref 0",
-        "DefaultFont",
-        "     Family                Roman",
-        "     Series                Medium",
-        "     Shape                 Up",
-        "     Size                  Normal",
-        "     Color                 None",
-        "EndFont",
-        "Preamble",
-        "     \\usepackage{beamerarticle,pgf}",
-        "     % this default might be overridden by plain title style",
-        "     \\newcommand\makebeamertitle{\\frame{\\maketitle}}%",
-        "     \\AtBeginDocument{",
-        "             \\let\\origtableofcontents=\\tableofcontents",
-        "             \\def\\tableofcontents{\\@ifnextchar[{\\origtableofcontents}{\\gobbletableofcontents}}",
-        "             \\def\\gobbletableofcontents#1{\\origtableofcontents}",
-        "     }",
-        "EndPreamble",
-        "### End of insertion by lyx2lyx (more [scr]article styles) ###"
-    ]
-
+        beamer_article_styles[1] = "Input scrartcl.layout"
+    document.append_local_layout(beamer_article_styles)
 
 def convert_beamer_article_styles(document):
     " Remove included (scr)article styles in beamer article "
@@ -218,29 +200,9 @@ def convert_beamer_article_styles(document):
     if document.textclass not in beamer_articles:
         return
 
-    i = find_token(document.header, "\\begin_local_layout", 0)
-    if i == -1:
-        return
-
-    j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-    if j == -1:
-        # this should not happen
-        document.warning("Malformed LyX document: Can't find end of local layout!")
-        return
-
-    k = find_token(document.header, "### Inserted by lyx2lyx (more [scr]article styles) ###", i, j)
-    if k != -1:
-        l = find_token(document.header, "### End of insertion by lyx2lyx (more [scr]article styles) ###", i, j)
-        if l == -1:
-            # this should not happen
-            document.warning("End of lyx2lyx local layout insertion not found!")
-            return
-
-        if k == i + 1 and l == j - 1:
-            # that was all the local layout there was
-            document.header[i : j + 1] = []
-        else:
-            document.header[k : l + 1] = []
+    if document.textclass == "scrarticle-beamer":
+        beamer_article_styles[1] = "Input scrartcl.layout"
+    document.del_local_layout(beamer_article_styles)
 
 
 def revert_new_babel_languages(document):
@@ -396,61 +358,22 @@ def revert_quotes(document):
         i = l
 
 
+iopart_local_layout = ["### Inserted by lyx2lyx (stdlayouts) ###",
+                       "Input stdlayouts.inc",
+                       "### End of insertion by lyx2lyx (stdlayouts) ###"""]
+
 def revert_iopart(document):
     " Input new styles via local layout "
     if document.textclass != "iopart":
         return
-
-    i = find_token(document.header, "\\begin_local_layout", 0)
-    if i == -1:
-        k = find_token(document.header, "\\language", 0)
-        if k == -1:
-            # this should not happen
-            document.warning("Malformed LyX document! No \\language header found!")
-            return
-        document.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"]
-        i = k-1
-
-    j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-    if j == -1:
-        # this should not happen
-        document.warning("Malformed LyX document! Can't find end of local layout!")
-        return
-
-    document.header[i+1 : i+1] = [
-        "### Inserted by lyx2lyx (stdlayouts) ###",
-        "Input stdlayouts.inc",
-        "### End of insertion by lyx2lyx (stdlayouts) ###"
-    ]
+    document.append_local_layout(iopart_local_layout)
 
 
 def convert_iopart(document):
     " Remove local layout we added, if it is there "
     if document.textclass != "iopart":
         return
-
-    i = find_token(document.header, "\\begin_local_layout", 0)
-    if i == -1:
-        return
-
-    j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-    if j == -1:
-        # this should not happen
-        document.warning("Malformed LyX document! Can't find end of local layout!")
-        return
-
-    k = find_token(document.header, "### Inserted by lyx2lyx (stdlayouts) ###", i, j)
-    if k != -1:
-        l = find_token(document.header, "### End of insertion by lyx2lyx (stdlayouts) ###", i, j)
-        if l == -1:
-            # this should not happen
-            document.warning("End of lyx2lyx local layout insertion not found!")
-            return
-        if k == i + 1 and l == j - 1:
-            # that was all the local layout there was
-            document.header[i : j + 1] = []
-        else:
-            document.header[k : l + 1] = []
+    document.del_local_layout(iopart_local_layout)
 
 
 def convert_quotestyle(document):
@@ -1192,27 +1115,12 @@ def revert_biblatex(document):
 
     # Emulate the old biblatex-workaround (pretend natbib in order to use the styles)
     if biblatex:
-        i = find_token(document.header, "\\begin_local_layout", 0)
-        if i == -1:
-            k = find_token(document.header, "\\language", 0)
-            if k == -1:
-                # this should not happen
-                document.warning("Malformed LyX document! No \\language header found!")
-                return
-            document.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"]
-            i = k-1
-
-        j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-        if j == -1:
-            # this should not happen
-            document.warning("Malformed LyX document! Can't find end of local layout!")
-            return
-
-        document.header[i+1 : i+1] = [
+        biblatex_emulation = [
             "### Inserted by lyx2lyx (biblatex emulation) ###",
             "Provides natbib 1",
             "### End of insertion by lyx2lyx (biblatex emulation) ###"
         ]
+        document.append_local_layout(biblatex_emulation)
 
 
 def revert_citekeyonly(document):
@@ -1273,28 +1181,12 @@ def revert_bibpackopts(document):
         # Nothing to do for empty options
         return
 
-    i = find_token(document.header, "\\begin_local_layout", 0)
-    if i == -1:
-        k = find_token(document.header, "\\language", 0)
-        if k == -1:
-            # this should not happen
-            document.warning("Malformed LyX document! No \\language header found!")
-            return
-        document.header[k-1 : k-1] = ["\\begin_local_layout", "\\end_local_layout"]
-        i = k - 1
-
-    j = find_end_of(document.header, i, "\\begin_local_layout", "\\end_local_layout")
-    if j == -1:
-        # this should not happen
-        document.warning("Malformed LyX document! Can't find end of local layout!")
-        return
-
-    document.header[i+1 : i+1] = [
+    bibliography_package_options = [
         "### Inserted by lyx2lyx (bibliography package options) ###",
         "PackageOptions " + engine + " " + biblio_options,
         "### End of insertion by lyx2lyx (bibliography package options) ###"
     ]
-
+    document.append_local_layout(bibliography_package_options)
 
 def revert_qualicites(document):
     " Revert qualified citation list commands to ERT "
index fa61754f80a88d186023aaee6d55f467c22330a4..56490855d9c9fc9f12cdf139ab9f5b140c10f4a0 100644 (file)
@@ -1083,13 +1083,10 @@ def revert_dateinfo(document):
     }
 
     types = ["date", "fixdate", "moddate" ]
-    i = 0
-    i = find_token(document.header, "\\language", 0)
-    if i == -1:
-        # this should not happen
+    lang = get_value(document.header, "\\language")
+    if lang == "":
         document.warning("Malformed LyX document! No \\language header found!")
         return
-    lang = get_value(document.header, "\\language", i)
 
     i = 0
     while True:
@@ -1146,7 +1143,7 @@ def revert_dateinfo(document):
             # In Python 2, datetime module works with binary strings,
             # our dateformat strings are utf8-encoded:
             result = result.decode('utf-8')
-        document.body[i : j+1] = result
+        document.body[i : j+1] = [result]
         i = i + 1
 
 
@@ -1435,20 +1432,19 @@ def revert_lformatinfo(document):
 
 
 def convert_hebrew_parentheses(document):
-    """ Swap opening/closing parentheses in Hebrew text. 
-    
-    Up to LyX 2.4, ")" was used as opening parenthesis and
-    "(" as closing parenthesis for Hebrew in the LyX source.
+    """ Swap opening/closing parentheses in Hebrew text.
+
+    Up to LyX 2.4, "(" was used as closing parenthesis and
+    ")" as opening parenthesis for Hebrew in the LyX source.
     """
-    
-    print("convert hebrew parentheses")
+    # print("convert hebrew parentheses")
     current_languages = [document.language]
     for i, line in enumerate(document.body):
         if line.startswith('\\lang '):
             current_languages[-1] = line.lstrip('\\lang ')
         elif line.startswith('\\begin_layout'):
             current_languages.append(current_languages[-1])
-            print (line, current_languages[-1])      
+            # print (line, current_languages[-1])
         elif line.startswith('\\end_layout'):
             current_languages.pop()
         elif current_languages[-1] == 'hebrew' and not line.startswith('\\'):
@@ -1480,7 +1476,7 @@ def revert_soul(document):
     i = find_token(document.body, "\\begin_inset Flex Highlight", 0)
     if i != -1:
         add_to_preamble(document, ["\\usepackage{color}"])
-    
+
     revert_flex_inset(document.body, "Spaceletters", "\\so")
     revert_flex_inset(document.body, "Strikethrough", "\\st")
     revert_flex_inset(document.body, "Underline", "\\ul")
@@ -1627,6 +1623,78 @@ def revert_cmidruletrimming(document):
         i += 1
 
 
+ruby_inset_def = [
+    r'### Inserted by lyx2lyx (ruby inset) ###',
+    r'InsetLayout Flex:Ruby',
+    r'  LyxType       charstyle',
+    r'  LatexType     command',
+    r'  LatexName     ruby',
+    r'  HTMLTag       ruby',
+    r'  HTMLAttr      ""',
+    r'  HTMLInnerTag  rb',
+    r'  HTMLInnerAttr ""',
+    r'  BgColor       none',
+    r'  LabelString   "Ruby"',
+    r'  Decoration    Conglomerate',
+    r'  Preamble',
+    r'    \ifdefined\kanjiskip',
+    r'      \IfFileExists{okumacro.sty}{\usepackage{okumacro}}{}',
+    r'    \else \ifdefined\luatexversion',
+    r'      \usepackage{luatexja-ruby}',
+    r'    \else \ifdefined\XeTeXversion',
+    r'      \usepackage{ruby}%',
+    r'    \fi\fi\fi',
+    r'    \providecommand{\ruby}[2]{\shortstack{\tiny #2\\#1}}',
+    r'  EndPreamble',
+    r'  Argument  post:1',
+    r'    LabelString  "ruby text"',
+    r'    MenuString  "Ruby Text|R"',
+    r'    Tooltip    "Reading aid (ruby, furigana) for Chinese characters."',
+    r'    Decoration  Conglomerate',
+    r'    Font',
+    r'      Size    tiny',
+    r'    EndFont',
+    r'    LabelFont',
+    r'      Size    tiny',
+    r'    EndFont',
+    r'    Mandatory  1',
+    r'  EndArgument',
+    r'End',
+]
+
+def convert_ruby_module(document):
+    " Use ruby module instead of local module definition "
+    if document.del_local_layout(ruby_inset_def):
+        document.add_module("ruby")
+
+def revert_ruby_module(document):
+    " Replace ruby module with local module definition "
+    if document.del_module("ruby"):
+        document.append_local_layout(ruby_inset_def)
+
+
+def convert_utf8_japanese(document):
+    " Use generic utf8 with Japanese documents."
+    lang = get_value(document.header, "\\language")
+    if not lang.startswith("japanese"):
+        return
+    inputenc = get_value(document.header, "\\inputencoding")
+    if ((lang == "japanese" and inputenc == "utf8-platex")
+        or (lang == "japanese-cjk" and inputenc == "utf8-cjk")):
+        document.set_parameter("inputencoding", "utf8")
+
+def revert_utf8_japanese(document):
+    " Use Japanese utf8 variants with Japanese documents."
+    inputenc = get_value(document.header, "\\inputencoding")
+    if inputenc != "utf8":
+        return
+    lang = get_value(document.header, "\\language")
+    if lang == "japanese":
+        document.set_parameter("inputencoding", "utf8-platex")
+    if lang == "japanese-cjk":
+        document.set_parameter("inputencoding", "utf8-cjk")
+
+
 ##
 # Conversion hub
 #
@@ -1662,9 +1730,11 @@ convert = [
            [571, []],
            [572, [convert_notoFonts]],  # Added options thin, light, extralight for Noto
            [573, [convert_inputencoding_namechange]],
+           [574, [convert_ruby_module, convert_utf8_japanese]],
           ]
 
-revert =  [[572, [revert_inputencoding_namechange]],
+revert =  [[573, [revert_ruby_module, revert_utf8_japanese]],
+           [572, [revert_inputencoding_namechange]],
            [571, [revert_notoFonts]],
            [570, [revert_cmidruletrimming]],
            [569, [revert_bibfileencodings]],
index 266d4ab50df4888165d3d1d60043cb1f310e6b72..1ac86dd012c48701cbc585de2598bbf257413c20 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index e0115ee1f3f3ab9c21feb27c2c46c7302b25adf2..bac8bbea75e5a197c5c24b0c1c78079600a169fb 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 0e01be3950e4571fd3a5ed45c660bdb6e48bd398..158ba2ae1f55e2a55eac073521655d0d7499a389 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 1f26fee5efaf7de61748d7196fa85a09ead4b56f..c9cfcf29ee99243225dcfe7cbb9f43381265c7be 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index f88a7e19de261c282d016286c4e48c66e8c095b6..560db824ca98ead23a43b2fa564e1059d45e93bf 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index f18e438e26308fe5f719b7e30f368f57cdae89d3..b2f6e9690a3d8f9746a7afc19f7b62149f1c7e6c 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 81c60c5a3e7c756e55d2e0c8f8e71a3b3b9d99e8..da885118d9bf9d83c3e54f26654b4d2b2b73d397 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 8671944359e1df28b465572bb446594c50085d14..dc66a3ad3b48cbbda00b595128241eb4fc3f9f71 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 00119a71ca9260a1acb5c3355e68b12e4696295f..71efd675bd658ab8a381d51c59d2243aeb0a862b 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 449c9b4455d3a60035131de991b36f90df2c5638..856cf146b45c08b6edee8d871a118ef92a0417a0 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index d9102f6438a71a31f5c6f6f891a2f1dad09c920f..7e3f2c3d6ca11d53758aef6488d88ec75e735f38 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 9f98df22ebb6a05a726d5f1d140e7fa2ddd38593..3a4991d75943114b1d35356170b9c3dcf2778302 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index b0d381c5865dbcfbb9fb9c287fb9a5ff6a097f19..d00374d6f6cfdbffd857b7cf390222d347b5ac19 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index e2a1bffee985d05b6f61039c488571b936dcbe3a..b6f8c3cb07457f23d5b888d152a7ff957b0e6794 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 79ff14c5e21d8095ddc14b90daa47ce3af511afc..78788f7c9b58cc66c22fb2d03511fa29ce2ad543 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 8264db5c0c1778ca118011c125b8e005de0f7ef7..170d87ab67d70f2d3a86cdbae87b821dc5a9405a 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 24eba4a6d8a5fed7845b35777c2543c72312e4c1..fb6ad8252deddcf03adeb2b0360ee10a29290328 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 16e26dcb139dc206aa6c128f76b8283528914481..0f94d6da74679ef42a643dc1cc516202c9a302a3 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 2ec3708335a9778fb7a348f84cc9e1d09840ab83..7df48ccf533aeba79945f3678803fe056ff86fef 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index db1231394b52feca3685bd3f6ea44f61783b5a66..6193574cb0e3fcf3d55f98142af001e4ded8c84d 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 573
+\lyxformat 574
 \begin_document
 \begin_header
 \save_transient_properties true
index 7ed1561ac9cf57596a3cb56cbcbb7da71e61f497..a92854e8a9e5754268c6700fae9dec7c9eb97a86 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 573 // gm: rename input encoding settings
-#define LYX_FORMAT_TEX2LYX 573
+#define LYX_FORMAT_LYX 574 // gm: Japanese fixes
+#define LYX_FORMAT_TEX2LYX 574
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER