From: Uwe Stöhr Date: Wed, 4 Nov 2015 00:18:13 +0000 (+0100) Subject: achemso.layout: add a flex inset X-Git-Tag: 2.2.0alpha1~78 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=62a69584e6143c91149b09ca847105dd83ce2b5d;p=features.git achemso.layout: add a flex inset - this one is in achemso since version 3.8 - fileformat change --- diff --git a/development/FORMAT b/development/FORMAT index c7af47a1f8..7ec9be71bf 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -11,6 +11,12 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. ----------------------- +2015-11-04 Uwe Stöhr + * Format incremented to 500 + No new parameters. + achemso layout improvement: + - new flex inset Latin + 2015-10-27 Uwe Stöhr * Format incremented to 499 No new parameters. diff --git a/lib/examples/achemso.lyx b/lib/examples/achemso.lyx index 512c894a36..c4af5975b0 100644 --- a/lib/examples/achemso.lyx +++ b/lib/examples/achemso.lyx @@ -1,7 +1,8 @@ -#LyX 2.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 474 +#LyX 2.2 created this file. For more info see http://www.lyx.org/ +\lyxformat 500 \begin_document \begin_header +\origin /systemlyxdir/examples/ \textclass achemso \begin_preamble % If issues arise when submitting your manuscript, you may want to @@ -84,8 +85,9 @@ theorems-ams status open \begin_layout Plain Layout -This is an example LyX file for articles to be submitted to journals of - the American Chemistry Society (ACS). +This is an example \SpecialChar LyX + file for articles to be submitted to journals of the + American Chemistry Society (ACS). For general infos see \begin_inset Flex URL status open @@ -124,7 +126,8 @@ Note: \end_layout \begin_layout Title -A demonstration of the achemso LaTeX class +A demonstration of the achemso \SpecialChar LaTeX + class \begin_inset Argument 1 status open @@ -257,7 +260,8 @@ IR,NMR,UV \end_layout \begin_layout Keywords -American Chemical Society, LaTeX +American Chemical Society, \SpecialChar LaTeX + \end_layout \begin_layout Abstract @@ -363,6 +367,25 @@ key "Pople2003" \end_inset . + Notice that +\begin_inset Quotes eld +\end_inset + + +\begin_inset Flex Latin +status open + +\begin_layout Plain Layout +et al. +\end_layout + +\end_inset + + +\begin_inset Quotes erd +\end_inset + + is auto-formatted. \end_layout \begin_layout Standard @@ -392,7 +415,7 @@ status open This is a bibnote; its text will be moved the the references section. Bibnotes are inserted with the menu \family sans -Insert\SpecialChar \menuseparator +Insert\SpecialChar menuseparator Custom Insets \family default . @@ -422,7 +445,8 @@ Some Infos \end_layout \begin_layout Standard -Besides the standard figure and table floats, the achemso LaTeX-class provides +Besides the standard figure and table floats, the achemso \SpecialChar LaTeX +-class provides scheme, chart, and graph floats. \end_layout diff --git a/lib/layouts/achemso.layout b/lib/layouts/achemso.layout index 28d065a737..d11b2741ab 100644 --- a/lib/layouts/achemso.layout +++ b/lib/layouts/achemso.layout @@ -1,7 +1,7 @@ #% Do not delete the line below; configure depends on this # \DeclareLaTeXClass[achemso,caption.sty,courier.sty,cleveref.sty,float.sty,helvet.sty,mathptmx.sty,mciteplus.sty,natbib.sty,natmove.sty,setspace.sty,xkeyval.sty]{American Chemical Society (ACS)} # \DeclareCategory{Articles} -# textclass definition file for achemso 3.7c +# textclass definition file for achemso 3.8 and 3.9 # Author: Uwe Stöhr (uwestoehr@web.de) Format 54 @@ -295,3 +295,10 @@ InsetLayout Flex:Chemistry EndFont MultiPar false End + +InsetLayout Flex:Latin + CopyStyle Flex:Bibnote + LatexName latin + LabelString "Latin" + MultiPar false +End diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 5346eec254..ad13afe224 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -85,7 +85,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_6", list(range(277,346)), minor_versions("1.6" , 10)), ("2_0", list(range(346,414)), minor_versions("2.0" , 8)), ("2_1", list(range(414,475)), minor_versions("2.1" , 0)), - ("2_2", list(range(475,500)), minor_versions("2.2" , 0)) + ("2_2", list(range(475,501)), minor_versions("2.2" , 0)) ] #################################################################### diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py index 7dd051377d..47bed39841 100644 --- a/lib/lyx2lyx/lyx_2_2.py +++ b/lib/lyx2lyx/lyx_2_2.py @@ -1992,6 +1992,30 @@ def convert_moderncv(document): i1 += 1 i2 += 1 + +def revert_achemso(document): + " Reverts the flex inset Latin to TeX code " + i = 0 + j = 0 + while True: + i = find_token(document.body, "\\begin_inset Flex Latin", i) + if i != -1: + j = find_end_of_inset(document.body, i) + else: + return + if j != -1: + beginPlain = find_token(document.body, "\\begin_layout Plain Layout", i) + endPlain = find_end_of_layout(document.body, beginPlain) + content = lyx2latex(document, document.body[beginPlain : endPlain]) + #content = lyx2latex(document, document.body[i : j + 1]) + document.body[i:j + 1] = put_cmd_in_ert("\\latin{" + content + "}") + #del document.body[i : j + 1] + else: + document.warning("Malformed LyX document: Can't find end of flex inset Latin") + return + i += 1 + + ## # Conversion hub # @@ -2025,10 +2049,12 @@ convert = [ [496, [convert_nounzip]], [497, [convert_external_bbox]], [498, []], - [499, [convert_moderncv]] + [499, [convert_moderncv]], + [500, []] ] revert = [ + [499, [revert_achemso]], [498, [revert_moderncv_1, revert_moderncv_2]], [497, [revert_tcolorbox_1, revert_tcolorbox_2, revert_tcolorbox_3, revert_tcolorbox_4, revert_tcolorbox_5, diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx index 8c6724fbd6..552ca21568 100644 --- a/src/tex2lyx/test/CJK.lyx.lyx +++ b/src/tex2lyx/test/CJK.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx index 355a3ee232..f6c071123f 100644 --- a/src/tex2lyx/test/CJKutf8.lyx.lyx +++ b/src/tex2lyx/test/CJKutf8.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx b/src/tex2lyx/test/DummyDocument.lyx.lyx index a105c6ac7d..bd0b641574 100644 --- a/src/tex2lyx/test/DummyDocument.lyx.lyx +++ b/src/tex2lyx/test/DummyDocument.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx b/src/tex2lyx/test/Dummy~Document.lyx.lyx index 85d416a5c0..89a02ed0cb 100644 --- a/src/tex2lyx/test/Dummy~Document.lyx.lyx +++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx index 0fb0377ad6..64d4d2116b 100644 --- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx +++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/algo2e.lyx.lyx b/src/tex2lyx/test/algo2e.lyx.lyx index fe6ec09cd1..5a32462cf3 100644 --- a/src/tex2lyx/test/algo2e.lyx.lyx +++ b/src/tex2lyx/test/algo2e.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx index 35e6bd41bc..d91072a8cc 100644 --- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx +++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-insets-basic.lyx.lyx b/src/tex2lyx/test/test-insets-basic.lyx.lyx index 4c9e136d37..e0d6e73b17 100644 --- a/src/tex2lyx/test/test-insets-basic.lyx.lyx +++ b/src/tex2lyx/test/test-insets-basic.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-insets.lyx.lyx b/src/tex2lyx/test/test-insets.lyx.lyx index f754e351d3..2ebeb1bb71 100644 --- a/src/tex2lyx/test/test-insets.lyx.lyx +++ b/src/tex2lyx/test/test-insets.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-memoir.lyx.lyx b/src/tex2lyx/test/test-memoir.lyx.lyx index 7f0e210e6f..32fa929c03 100644 --- a/src/tex2lyx/test/test-memoir.lyx.lyx +++ b/src/tex2lyx/test/test-memoir.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-modules.lyx.lyx b/src/tex2lyx/test/test-modules.lyx.lyx index 16d4845d27..a56bfb3c85 100644 --- a/src/tex2lyx/test/test-modules.lyx.lyx +++ b/src/tex2lyx/test/test-modules.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx index 52bc01a730..5bcf213e67 100644 --- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx +++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-scr.lyx.lyx b/src/tex2lyx/test/test-scr.lyx.lyx index 555267b649..2f02590e98 100644 --- a/src/tex2lyx/test/test-scr.lyx.lyx +++ b/src/tex2lyx/test/test-scr.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test-structure.lyx.lyx b/src/tex2lyx/test/test-structure.lyx.lyx index 2a60201eb4..45d1035625 100644 --- a/src/tex2lyx/test/test-structure.lyx.lyx +++ b/src/tex2lyx/test/test-structure.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx index 27dee5eb28..4b219a6747 100644 --- a/src/tex2lyx/test/test.lyx.lyx +++ b/src/tex2lyx/test/test.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/tex2lyx/test/verbatim.lyx.lyx b/src/tex2lyx/test/verbatim.lyx.lyx index 568b5d5c95..d6a05c3532 100644 --- a/src/tex2lyx/test/verbatim.lyx.lyx +++ b/src/tex2lyx/test/verbatim.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.2 -\lyxformat 499 +\lyxformat 500 \begin_document \begin_header \origin roundtrip diff --git a/src/version.h b/src/version.h index 7fb1e552aa..04f4b82b1f 100644 --- a/src/version.h +++ b/src/version.h @@ -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 499 // uwestoehr: moderncv module improvements -#define LYX_FORMAT_TEX2LYX 499 +#define LYX_FORMAT_LYX 500 // uwestoehr: achemso layout improvement +#define LYX_FORMAT_TEX2LYX 500 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER