]> git.lyx.org Git - features.git/commitdiff
IEEEtran.layout: support command \IEEEPARstart
authorUwe Stöhr <uwestoehr@lyx.org>
Thu, 7 Feb 2013 01:01:57 +0000 (02:01 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Thu, 7 Feb 2013 01:01:57 +0000 (02:01 +0100)
lib/layouts/IEEEtran.layout
lib/lyx2lyx/lyx_2_1.py
lib/templates/IEEEtran.lyx

index b921397203cd7ff36e31484ddaf4baf8c5f627ba..b0d960ed993ba39ecd9137769c912d54b58462cd 100644 (file)
@@ -33,7 +33,7 @@ EndFont
 
 
 Style Standard
-  Category      MainText
+  Category     MainText
   Margin       Static
   LatexType    Paragraph
   LatexName    dummy
@@ -225,6 +225,23 @@ Style Keywords
 End
 
 
+InsetLayout Flex:Paragraph_Start
+  LyxType      custom
+  LatexType    command
+  LaTeXName    IEEEPARstart
+  LabelString  "Paragraph Start"
+  Argument 1
+    Mandatory  1
+    AutoInsert 1
+    LabelString        "First Char"
+    Tooltip    "First character of first word"
+  EndArgument
+  Font
+    Size       Small
+  EndFont
+End
+
+
 Style Appendices
   Margin       Dynamic
   LatexType    Command
index 1c7ca482d838fc2f4bb74c6827802a502d4465f7..d5b507a19ef8efb35145b4a51d8c6c3b53726a19 100644 (file)
@@ -1578,6 +1578,7 @@ def revert_IEEEtran(document):
   '''
   if document.textclass == "IEEEtran":
     i = 0
+    i2 = 0
     j = 0
     k = 0
     while True:
@@ -1586,6 +1587,11 @@ def revert_IEEEtran(document):
       if i != -1:
         revert_Argument_to_TeX_brace(document, i, 1, 1, False)
         i = i + 1
+      if i2 != -1:
+        i2 = find_token(document.body, "\\begin_inset Flex Paragraph Start", i2)
+      if i2 != -1:
+        revert_Argument_to_TeX_brace(document, i2, 1, 1, False)
+        i2 = i2 + 1
       if j != -1:
         j = find_token(document.body, "\\begin_layout Biography without photo", j)
       if j != -1:
@@ -1601,7 +1607,25 @@ def revert_IEEEtran(document):
         # start with the second argument, therefore 2
         revert_Argument_to_TeX_brace(document, k, 2, 2, True)
         k = k + 1
-      if i == -1 and j == -1 and k == -1:
+      if i == -1 and i2 == -1 and j == -1 and k == -1:
+        return
+
+
+def revert_IEEEtran_2(document):
+  '''
+  Reverts Flex Paragraph Start to TeX-code
+  '''
+  if document.textclass == "IEEEtran":
+    begin = 0
+    while True:
+      if begin != -1:
+        begin = find_token(document.body, "\\begin_inset Flex Paragraph Start", begin)
+      if begin != -1:
+        end1 = find_end_of_inset(document.body, begin)
+        document.body[end1 - 2 : end1 + 1] = put_cmd_in_ert("}")
+        document.body[begin : begin + 4] = put_cmd_in_ert("\\IEEEPARstart{")
+        begin = begin + 5
+      if begin == -1:
         return
 
 
@@ -3537,7 +3561,7 @@ revert =  [
            [449, [revert_garamondx, revert_garamondx_newtxmath]],
            [448, [revert_itemargs]],
            [447, [revert_literate]],
-           [446, [revert_IEEEtran, revert_AASTeX, revert_AGUTeX, revert_IJMP, revert_SIGPLAN, revert_SIGGRAPH, revert_EuropeCV, revert_Initials, revert_ModernCV]],
+           [446, [revert_IEEEtran, revert_IEEEtran_2, revert_AASTeX, revert_AGUTeX, revert_IJMP, revert_SIGPLAN, revert_SIGGRAPH, revert_EuropeCV, revert_Initials, revert_ModernCV]],
            [445, [revert_latexargs]],
            [444, [revert_uop]],
            [443, [revert_biolinum]],
index f47ba7f527929d9683473ac4ab34a158d6079558..2b509ed6888a1d03827ba45de30697aaa2fe275f 100644 (file)
@@ -96,7 +96,7 @@ status open
 \begin_layout Plain Layout
 This is a template LyX file for articles to be submitted to journals of
  the Institute of Electrical and Electronics Engineers (IEEE).
- For general infos see 
+ For general info see 
 \begin_inset Flex URL
 status open
 
@@ -120,9 +120,11 @@ http://wiki.lyx.org/Examples/IEEE
 status open
 
 \begin_layout Plain Layout
-You find the IEEEtran document class documentation here: 
+It is important that you use the correct document class options for your
+ document..
+ These are explained in the IEEEtran document: 
 \begin_inset Flex URL
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
@@ -334,20 +336,6 @@ et al.
 \end_inset
 
 : Your Title
-\begin_inset Note Note
-status open
-
-\begin_layout Plain Layout
-left side
-\series bold
-}{
-\series default
-right side
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Publication ID
@@ -398,52 +386,36 @@ Introduction
 \end_layout
 
 \begin_layout Standard
-\begin_inset Note Note
-status collapsed
+\begin_inset Flex Paragraph Start
+status open
 
 \begin_layout Plain Layout
-The 
-\series bold
-
-\backslash
-IEEEPARstart
-\series default
- command is needed in the first paragraph fo the document.
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
+\begin_inset Argument 1
+status open
 
 \begin_layout Plain Layout
-
-
-\backslash
-IEEEPARstart{
+H
 \end_layout
 
 \end_inset
 
-H
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-}{
+ere
 \end_layout
 
 \end_inset
 
-ere
-\begin_inset ERT
+
+\begin_inset Note Note
 status collapsed
 
 \begin_layout Plain Layout
+The 
+\series bold
 
-}
+\backslash
+IEEEPARstart
+\series default
+ command is needed in the first paragraph of the document.
 \end_layout
 
 \end_inset