-----------------------
+2012-11-19 Jürgen Spitzmüller <spitz@lyx.org>
+ * Format incremented to 446: Change of InsetArgument syntax.
+ InsetArgument now has a numeric identifier which determines
+ its position (in the LaTeX output):
+ \begin_inset Argument 1
+ ...
+ \end_inset
+ Pre-2.1 documents' arguments all get the number "999", and then
+ InsetArgument::updateBuffer() computes the correct number.
+ This is because lyx2lyx has no access to layouts and hence does
+ not know how many optional arguments a layout can have (if a command
+ has two optional and one mandatory arguments and only one optional
+ is actually given, the mandatory arg still must get number 3).
+
2012-10-20 Liviu Andronic <landronimirc@gmail.com>
* Format incremented to 445: support for the URW Classico font,
an Optima clone.
-#LyX 2.0 created this file. For more info see http://www.lyx.org/
-\lyxformat 413
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 446
\begin_document
\begin_header
\textclass scrartcl
\font_roman default
\font_sans default
\font_typewriter default
+\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
-
\graphics default
\default_output_format default
\output_sync 0
\pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue"
\papersize default
\use_geometry false
-\use_amsmath 1
-\use_esint 1
-\use_mhchem 1
-\use_mathdots 1
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package undertilde 0
\cite_engine basic
+\cite_engine_type numerical
+\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
+\justification true
\use_refstyle 1
\notefontcolor #0000ff
\index Index
\end_layout
\begin_layout Caption setup
-\begin_inset Argument
+\begin_inset Argument 1
status open
\begin_layout Plain Layout
\end_layout
\begin_layout Bicaption
-\begin_inset Argument
+\begin_inset Argument 1
status open
\begin_layout Plain Layout
\end_inset
-\begin_inset Argument
+\begin_inset Argument 2
status open
\begin_layout Plain Layout
\end_inset
+\begin_inset Argument 3
+status open
+
+\begin_layout Plain Layout
+
+\lang ngerman
+German short title
+\end_layout
+
+\end_inset
+
+
\lang ngerman
German Title
\lang english
\end_inset
-\begin_inset Argument
+\begin_inset Argument 1
status open
\begin_layout Plain Layout
\end_layout
\begin_layout Caption setup
-\begin_inset Argument
+\begin_inset Argument 1
status open
\begin_layout Plain Layout
\end_layout
\begin_layout Caption setup
-\begin_inset Argument
+\begin_inset Argument 1
status open
\begin_layout Plain Layout
\end_layout
\begin_layout Bicaption
-\begin_inset Argument
+\begin_inset Argument 2
status open
\begin_layout Plain Layout
\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="47" columns="2">
-<features booktabs="true" islongtable="true" headBottomDL="true" lastFootEmpty="true" longtabularalignment="center">
+<features rotate="0" booktabs="true" islongtable="true" headBottomDL="true" lastFootEmpty="true" longtabularalignment="center">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="middle" width="35col%">
-<row caption="true">
+<row endfirsthead="true" caption="true">
<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
\begin_inset Text
LatexName title
Category FrontMatter
InTitle 1
- OptionalArgs 0
+ ResetArgs 1
ParSkip 0.4
ItemSep 0
TopSep 0
LatexType Command
Category FrontMatter
InTitle 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Author"
+ Shortcut S
+ Tooltip "A short version of the author name"
+ EndArgument
LatexName author
LabelSep xxx
ParSkip 0.4
CopyStyle Appendices
LatexName appendix
LabelString "Appendix"
- OptionalArgs 1
+ Argument 1
+ LabelString "Appendix Title"
+ Tooltip "Optional title of the appendix"
+ EndArgument
End
LaTeXType Environment
LaTeXName IEEEbiography
Category BackMatter
- OptionalArgs 1
+ Argument 1
+ LabelString "Biography Photo"
+ Tooltip "Insert a photo to your biography"
+ EndArgument
Align Block
TextFont
Size Small
Style Biography_without_photo
CopyStyle Biography
LaTeXName IEEEbiographynophoto
- OptionalArgs 0
+ ResetArgs 1
End
Style BiographyNoPhoto
LatexType Environment
LatexName IEEEproof
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Proof String"
+ Tooltip "An alternative proof string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
AlignPossible Block, Left
LabelType Static
LabelString "Fig. ---"
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The caption as it appears in the list of figures"
+ EndArgument
End
# Facility style definition
LabelType Static
LabelSep M
LabelString "Obj:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Recognized Name"
+ Tooltip "Separate the recognized name of an object from text"
+ EndArgument
Font
Family Roman
Shape Up
LabelType Static
LabelSep M
LabelString "Dataset:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Recognized Name"
+ Tooltip "Separate the dataset ID from text"
+ EndArgument
Font
Family Roman
Shape Up
EndFont
HTMLTag h1
HTMLTitle true
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "Short title which appears in the running headers"
+ EndArgument
End
Style Author
Style Affiliation
CopyStyle Author
LatexName affiliation
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Affiliation"
+ Shortcut S
+ Tooltip "Short version of the affiliation"
+ EndArgument
End
Style Alt_Affiliation
Margin Static
LatexName subsubsubsection*
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
End
Margin Static
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument shorttitle
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "Short title which appears in the running headers"
+ EndArgument
Font
Shape Smallcaps
Series Bold
Align Center
LabelType Sensitive
LabelString "Senseless!"
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The caption as it appears in the list of figures/tables"
+ EndArgument
LabelFont
Series Bold
EndFont
Margin Static
LatexType Item_Environment
LatexName itemize
- OptionalArgs 1
+ Argument 1
+ LabelString "Overlay Specifications"
+ Shortcut S
+ Tooltip "Overlay specifications for this list"
+ EndArgument
NextNoIndent 1
LeftMargin MMN
LabelSep xx
Margin Static
LatexType Item_Environment
LatexName enumerate
- OptionalArgs 2
+ Argument 1
+ LabelString "Overlay Specifications"
+ Shortcut S
+ Tooltip "Overlay specifications for this list"
+ EndArgument
+ Argument 2
+ LabelString "Mini template"
+ Tooltip "Mini template for this List"
+ EndArgument
NextNoIndent 1
LeftMargin MMN
LabelSep xx
Margin First_Dynamic
LatexType Item_environment
LatexName description
- OptionalArgs 2
+ Argument 1
+ LabelString "Overlay Specifications"
+ Shortcut S
+ Tooltip "Overlay specifications for this list"
+ EndArgument
+ Argument 2
+ LabelString "Longest label"
+ Tooltip "The longest label in this list"
+ EndArgument
NextNoIndent 1
LeftMargin MM
LabelSep xx
Margin Dynamic
LatexType Command
LatexName part
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The part as it appears in the table of contents/running headers"
+ EndArgument
NeedProtect 1
NextNoIndent 1
Labelsep xx
LabelType Counter
LabelCounter section
LabelString "Section \arabic{section}"
- RefPrefix sec
- OptionalArgs 1
+ RefPrefix sec
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents/running headers"
+ EndArgument
Font
Family Roman
Margin Static
LatexName lyxframeend{}\section*
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
End
# Subsection style definition
LabelCounter subsection
LabelString "Subsection \arabic{section}.\arabic{subsection}"
RefPrefix sub
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The subsection as it appears in the table of contents/running headers"
+ EndArgument
# standard font definition
Font
Margin Static
LatexName lyxframeend{}\subsection*
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
End
# Subsubsection style definition
LabelCounter subsubsection
LabelString "Subsubsection \arabic{section}.\arabic{subsection}.\arabic{subsubsection}"
RefPrefix sub
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The subsubsection as it appears in the table of contents/running headers"
+ EndArgument
# standard font definition
Font
Margin Static
LatexName lyxframeend{}\subsubsection*
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
End
# Frame control definition
KeepEmpty 1
LatexType Command
LatexName lyxframeend{}\lyxframe
- OptionalArgs 1
+ Argument 1
+ LabelString "Frame Options"
+ Tooltip "Frame options (see beamer manual)"
+ EndArgument
Margin First_Dynamic
NextNoIndent 1
ParSkip 0
KeepEmpty 0
LatexType Command
LatexName lyxframeend{}\lyxagainframe
- OptionalArgs 2
+ Argument 1
+ LabelString "Overlay Specifications"
+ Shortcut S
+ Tooltip "Overlay specifications for this list"
+ EndArgument
+ Argument 2
+ LabelString "Frame Options"
+ Tooltip "Frame options (see beamer manual)"
+ EndArgument
Margin First_Dynamic
NextNoIndent 1
ParSkip 0
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
# standard font definition
Font
LabelType Static
LabelSep xx
LabelString "Start column (increase depth!), width:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Column Options"
+ Tooltip "Column options (see beamer manual)"
+ EndArgument
LeftMargin "Start column (increase depth!), width:xx"
# standard font definition
LatexType Command
LatexName pause
Margin First_Dynamic
- OptionalArgs 1
+ Argument 1
+ LabelString "Pause number"
+ Tooltip "Number of slide where the pause takes effect"
+ EndArgument
NextNoIndent 1
ParSkip 0
TopSep 0
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "Short title which appears in the sidebar/header"
+ EndArgument
# standard font definition
Font
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Subtitle"
+ Shortcut S
+ Tooltip "Short subtitle which appears in the sidebar/header"
+ EndArgument
# standard font definition
Font
ParSep 0.7
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Author"
+ Shortcut S
+ Tooltip "Short author which appears in the sidebar/header"
+ EndArgument
# standard font definition
Font
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Institute"
+ Shortcut S
+ Tooltip "Short institute which appears in the sidebar/header"
+ EndArgument
# standard font definition
Font
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Date"
+ Shortcut S
+ Tooltip "Short date which appears in the sidebar/header"
+ EndArgument
# standard font definition
Font
LabelType Static
LabelSep xx
LabelString "Note:"
- OptionalArgs 1
LeftMargin "Note:xx"
# standard font definition
LatexType command
LatexName captionsetup
Category FrontMatter
- OptionalArgs 1
+ Argument 1
+ LabelString "Caption Setup Options"
+ Shortcut S
+ Tooltip "Options for the caption setup command (see bicaption manual)"
+ EndArgument
Margin Dynamic
LabelSep xx
ParSkip 0.0
CopyStyle "Caption setup"
LatexName bicaption
Category MainText
- RequiredArgs 1
+ Argument 1
+ LabelString "Second Language Caption Short Title"
+ Tooltip "A short title (for list of figures/tables) in the second language"
+ EndArgument
+ Argument 2
+ Mandatory 1
+ LabelString "Second Language Caption Text"
+ Shortcut S
+ Tooltip "The caption text in the second language"
+ EndArgument
+ Argument 3
+ LabelString "Main Language Caption Short Title"
+ Tooltip "A short title (for list of figures/tables) in the main language"
+ EndArgument
TopSep 0
Align Center
AlignPossible Center
LabelSep xx
LatexName lhead
LabelString "Left Header:"
- OptionalArgs 1
+ Argument even
+ LabelString "Even Header"
+ Tooltip "Alternative text for the even header"
+ EndArgument
KeepEmpty 1
ParSkip 0
TopSep 0
InnerTag "!-- --"
LatexName bridgehead
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
LatexParam renderas="chapter"
End
LatexType Paragraph
InnerTag "!-- --"
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
LatexParam renderas="sect1"
End
LatexType Paragraph
InnerTag "!-- --"
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
LatexParam renderas="sect2"
End
LatexType Paragraph
InnerTag "!-- --"
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
LatexParam renderas="sect4"
End
LatexType Paragraph
InnerTag "!-- --"
LabelType No_Label
- OptionalArgs 0
+ ResetArgs 1
LatexParam renderas="sect5"
End
CopyStyle Opening
LabelString "Closing:"
LatexName closing
- OptionalArgs 1
+ Argument 1
+ LabelString "Signature"
+ Shortcut S
+ Tooltip "Here you can insert a signature scan"
+ EndArgument
KeepEmpty 1
End
Style Address
CopyStyle RunTitle
LatexName address
- OptionalArgs 1
+ Argument 1
+ LabelString "Address Option"
+ Tooltip "Optional argument for the address"
+ EndArgument
LabelString "Address:"
End
Category FrontMatter
LatexType Command
LatexName lyxead
- OptionalArgs 1
+ Argument 1
+ LabelString "E-Mail Option"
+ Tooltip "Optional argument for the e-mail"
+ EndArgument
InTitle 1
Margin First_Dynamic
LabelType Static
ItemSep 0
ParSep 0
Align Center
- OptionalArgs 1
+ Argument 1
+ LabelString "Author Option"
+ Tooltip "Optional argument for the author"
+ EndArgument
Font
Series Bold
EndFont
Labeltype Static
LabelSep M
LabelString "Address:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Address Option"
+ Tooltip "Optional argument for the address"
+ EndArgument
LabelFont
Shape Italic
EndFont
LatexType Command
LatexName thanks
InTitle 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Thanks Option"
+ Tooltip "Optional argument for the thanks statement"
+ EndArgument
Font
Size Small
Family Typewriter
LatexName title
Category FrontMatter
InTitle 0
- OptionalArgs 0
+ ResetArgs 1
ParSkip 0.4
ItemSep 0
TopSep 0
LatexName tnotetext
Category FrontMatter
InTitle 0
- OptionalArgs 1
+ Argument 1
+ LabelString "Footnote Option"
+ Tooltip "Optional argument for the footnote"
+ EndArgument
ParSkip 0.4
BottomSep 0.5
Align Left
LatexType Command
Category FrontMatter
InTitle 0
- OptionalArgs 1
+ Argument 1
+ LabelString "Author Option"
+ Tooltip "Optional argument for the author"
+ EndArgument
LatexName author
LabelSep xxx
ParSkip 0.4
Category FrontMatter
LatexName address
InTitle 0
- OptionalArgs 1
+ Argument 1
+ LabelString "Address Option"
+ Tooltip "Optional argument for the address"
+ EndArgument
ParSkip 0.4
Align Center
AlignPossible Left, Right
# argument. See enumitem.pdf_ for possible values.
IfStyle Itemize
- OptionalArgs 1
+ Argument option
+ LabelString "Itemize Options"
+ Tooltip "Optional arguments for this list (see enumitem manual)"
+ EndArgument
End
IfStyle Enumerate
- OptionalArgs 1
+ Argument option
+ LabelString "Enumerate Options"
+ Tooltip "Optional arguments for this list (see enumitem manual)"
+ EndArgument
End
IfStyle Description
- OptionalArgs 1
+ Argument option
+ LabelString "Description Options"
+ Tooltip "Optional arguments for this list (see enumitem manual)"
+ EndArgument
End
Style Enumerate-Resume
CopyStyle Enumerate
LatexParam [resume]
- OptionalArgs 0
+ ResetArgs 1
# a blue label to indicate that this is not a WYSIWYG label
# because the numbering differs in the output
LabelFont
LatexName ecvsection
NeedProtect 1
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The title as it appears in the header"
+ EndArgument
ParSkip 0.4
TopSep 1.3
BottomSep 0.7
Margin Dynamic
LatexType Command
LatexName ecvitem
- OptionalArgs 1
+ Argument 1
+ LabelString "Vertical Space (Item)"
+ Shortcut S
+ Tooltip "Adjust the vertical space of this item"
+ EndArgument
ParSkip 0.4
Align Block
LabelSep xx
Margin Dynamic
LatexType Command
LatexName ecvmothertongue
- OptionalArgs 1
+ Argument 1
+ LabelString "Vertical Space (Item)"
+ Shortcut S
+ Tooltip "Adjust the vertical space of this item"
+ EndArgument
ParSkip 0.4
Align Block
LabelSep xx
Style LangHeader
CopyStyle MotherTongue
LatexName ecvlanguageheader
- OptionalArgs 0
+ ResetArgs 1
LabelString "Language Header:"
End
Style LangFooter
CopyStyle MotherTongue
LatexName ecvlanguagefooter
- OptionalArgs 0
+ ResetArgs 1
LabelString "Language Footer:"
End
LatexName title
Category FrontMatter
InTitle 1
- OptionalArgs 0
+ ResetArgs 1
ParSkip 0.4
ItemSep 0
TopSep 0
LatexType Command
Category FrontMatter
InTitle 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Author Option"
+ Tooltip "Optional argument for author"
+ EndArgument
LatexName author
LabelSep xxx
ParSkip 0.4
Margin Static
LatexType Item_Environment
LatexName romanlist
- OptionalArgs 1
+ Argument 1
+ LabelString "RomanList Option"
+ Tooltip "Optional argument for RomanList"
+ EndArgument
NextNoIndent 1
LeftMargin MMN
LabelSep xx
End
Style Theorem
- OptionalArgs 0
+ ResetArgs 1
LabelString "Theorem \thetheorem."
#Font
#Shape Up
LatexName title
Category FrontMatter
InTitle 1
- OptionalArgs 0
+ ResetArgs 1
ParSkip 0.4
ItemSep 0
TopSep 0
LatexType Command
Category FrontMatter
InTitle 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Author Option"
+ Tooltip "Optional argument for author"
+ EndArgument
LatexName author
LabelSep xxx
ParSkip 0.4
Margin Static
LatexType Item_Environment
LatexName romanlist
- OptionalArgs 1
+ Argument 1
+ LabelString "RomanList Option"
+ Tooltip "Optional argument for RomanList"
+ EndArgument
NextNoIndent 1
LeftMargin MMN
LabelSep xx
Within section
End
Style Theorem
- OptionalArgs 0
+ ResetArgs 1
LabelString "Theorem \thetheorem."
Font
Shape Up
Margin First_Dynamic
LabelType static
LabelString Initial
- OptionalArgs 1
- RequiredArgs 1
+ Argument option
+ LabelString "Initial Option"
+ Tooltip "Optional argument for initial (see lettrine manual)"
+ EndArgument
+ Argument inital
+ Mandatory 1
+ LabelString "Initial"
+ Tooltip "Initial letter"
+ EndArgument
LabelSep x
ParIndent MMM
ParSkip 0.4
LatexName title
Category FrontMatter
InTitle 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The title as it appears in the running headers"
+ EndArgument
ParSkip 0.4
ItemSep 0
TopSep 0
Style Letter
CopyStyle Title
- OptionalArgs 0
+ ResetArgs 1
LatexName letter
End
CopyStyle Affiliation
LatexType Command
LatexName altaffiliation
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Affiliation Option"
+ Tooltip "Option to the alternative affiliation command"
+ EndArgument
End
Style Part
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The part as it appears in the table of contents/running headers"
+ EndArgument
TocLevel -1
End
Style Chapter
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The chapter as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The chapter as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 0
End
Style Chapter*
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The chapter as it appears in the table of contents"
+ EndArgument
End
Style Section
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The section as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 1
End
Style Subsection
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The subsection as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The subsection as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 2
End
Style Subsubsection
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The subsubsection as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The subsubsection as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 3
End
Style Paragraph
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The paragraph as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The paragraph as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 4
End
Style Subparagraph
- OptionalArgs 2
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The subparagraph as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The subparagraph as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
TocLevel 5
End
Align Left
End
-#FIXME: what is actually documented is \PoemTitle
-#but \poemtitle is defined nevertheless. Weird.
Style Poemtitle
Category Section
LatexType Command
- LatexName poemtitle
+ LatexName PoemTitle
NeedProtect 1
NextNoIndent 1
LabelSep xxx
TopSep 0.4
ParSep 0.4
Align center
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The poem title as it appears in the table of contents"
+ EndArgument
+ Argument 2
+ LabelString "Short Title (Header)"
+ Tooltip "The poem title as it appears in the running headers"
+ Requires shorttitle
+ EndArgument
Font
Series Bold
EndFont
Style Poemtitle*
CopyStyle Poemtitle
Category Unnumbered
- LatexName poemtitle*
- OptionalArgs 0
+ LatexName PoemTitle*
+ Argument 1
+ LabelString "Short Title (TOC)"
+ Shortcut S
+ Tooltip "The poem title as it appears in the table of contents"
+ EndArgument
End
Margin Dynamic
LatexType Command
LatexName cventry
- OptionalArgs 1
+ Argument 1
+ LabelString "Entry Option"
+ Tooltip "Optional argument to the cventry command"
+ EndArgument
ParSkip 0.4
Align Block
LabelSep xx
Margin Dynamic
LatexType Command
LatexName cvitem
- OptionalArgs 1
+ Argument 1
+ LabelString "Item Option"
+ Tooltip "Optional argument to the cvitem command"
+ EndArgument
ParSkip 0.4
Align Block
LabelSep xx
LabelType Counter
LabelCounter subsection
LabelString " "
- OptionalArgs 1
+ Argument 1
+ LabelString "Slide Option"
+ Tooltip "Optional arguments to the slide command (see powerdot manual)"
+ EndArgument
Font
Series Bold
Size Large
LabelBottomSep 0
LeftMargin MMMMMMM
LabelString "~=~"
- OptionalArgs 0
+ ResetArgs 1
Font
Color None
LabelString "Note:"
LeftMargin MMMMMMM
KeepEmpty 1
- OptionalArgs 0
+ ResetArgs 1
Font
Series Bold
Size Large
Style Ingredients
LatexType Command
LatexName ingred
- OptionalArgs 1
+ Argument 1
+ LabelString "Ingredients Header"
+ Tooltip "Specify an optional ingredients header"
+ EndArgument
Margin Static
LeftMargin Ingredients_for_some:xx
LabelSep xx
CopyStyle Affiliation
LatexName altaffiliation
LabelString "Affiliation (alternate):"
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternate Affiliation Option"
+ Shortcut S
+ Tooltip "Optional argument to the altaffiliation command"
+ EndArgument
PassThru 1
End
CopyStyle Affiliation
LatexName email
LabelString "Electronic Address:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Electronic Address Option"
+ Shortcut S
+ Tooltip "Optional argument to the email command"
+ EndArgument
PassThru 1
TextFont
Family Typewriter
CopyStyle Author_Email
LatexName homepage
LabelString "URL:"
- OptionalArgs 1
+ Argument 1
+ LabelString "Author URL Option"
+ Shortcut S
+ Tooltip "Optional argument to the homepage command"
+ EndArgument
PassThru 1
End
Style Title
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "Short title as it appears in the running headers"
+ EndArgument
Font
Series Bold
Size Large
PassThru 1
ParbreakIsNewline 1
LatexName altaffiliation
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternate Affiliation Option"
+ Shortcut S
+ Tooltip "Optional argument to the altaffiliation command"
+ EndArgument
LabelString "Affiliation (alternate):"
End
PassThru 1
ParbreakIsNewline 1
LatexName email
- OptionalArgs 1
+ Argument 1
+ LabelString "Electronic Address Option"
+ Shortcut S
+ Tooltip "Optional argument to the email command"
+ EndArgument
LabelString "Electronic Address:"
TextFont
Family Typewriter
PassThru 1
ParbreakIsNewline 1
LatexName homepage
- OptionalArgs 1
+ Argument 1
+ LabelString "Author URL Option"
+ Shortcut S
+ Tooltip "Optional argument to the homepage command"
+ EndArgument
LabelString "URL:"
End
LatexName rsphrase
Category MainText
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Safety Phrase Option"
+ Shortcut S
+ Tooltip "Optional argument to the rsphrase command"
+ EndArgument
KeepEmpty 1
Margin Dynamic
LabelSep xx
Style Addpart
CopyStyle Part*
LatexName addpart
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The part as it appears in the table of contents/running headers"
+ EndArgument
End
Style Addchap
CopyStyle Chapter*
LatexName addchap
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The chapter as it appears in the table of contents/running headers"
+ EndArgument
End
Style Addsec
CopyStyle Section*
LatexName addsec
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents/running headers"
+ EndArgument
End
Align Center
LabelType Sensitive
LabelString "Senseless!"
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The caption as it appears in the list of figures/tables"
+ EndArgument
LabelFont
Series Bold
EndFont
Align Center
LabelType Sensitive
LabelString "Senseless!"
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The caption as it appears in the list of figures/tables"
+ EndArgument
LabelFont
Series Bold
EndFont
BottomSep 1.5
ParSep 1.5
Align Left
- OptionalArgs 1
+ Argument 1
+ LabelString "Dictum Author"
+ Tooltip "The author of this dictum"
+ EndArgument
Font
Size Normal
EndFont
LatexType Environment
LatexName proof
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Proof String"
+ Tooltip "An alternative proof string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
ParSep 1
Align Center
LabelType No_Label
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The title as it appears in the running headers"
+ EndArgument
Font
Shape Smallcaps
Series Bold
Series Bold
EndFont
TocLevel 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents/running headers"
+ EndArgument
End
End
InsetLayout Caption
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The caption as it appears in the list of figures/tables"
+ EndArgument
HTMLStyle
div.float-caption {
text-align: center;
ParSep 0.8
Align Center
Alignpossible Center
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The part as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Huge
BottomSep 0.8
ParSep 0.8
Align Block
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The chapter as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Huge
BottomSep 0.7
ParSep 0.7
Align Block
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Larger
LatexName part*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName chapter*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName section*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName subsection*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName subsubsection*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName paragraph*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexName subparagraph*
LabelType No_Label
LabelCounter ""
- OptionalArgs 0
+ ResetArgs 1
End
LatexType Command
LatexName frontmatter
KeepEmpty 1
- OptionalArgs 0
+ ResetArgs 1
Margin First_Dynamic
NextNoIndent 1
ParSkip 0
Shape Up
Size normal
EndFont
- RequiredArgs 1
+ Argument 1
+ Mandatory 1
+ LabelString "Part Title"
+ Tooltip "The title of this part"
+ EndArgument
Preamble
\newenvironment{svmultpartbacktext}[1]{\begin{partbacktext}
\part{#1}}{\end{partbacktext}}
BottomSep 0.8
ParSep 0.8
Align Block
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Foreword Heading"
+ Tooltip "Alternative foreword heading"
+ EndArgument
Font
Series Bold
Size Huge
End
Style Description
- OptionalArgs 1
+ Argument 1
+ LabelString "Longest Description Label"
+ Tooltip "Longest description label"
+ EndArgument
LabelFont
Series Medium
EndFont
LatexType Environment
LatexName thm
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LatexType Environment
LatexName thm
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LatexType Environment
LatexName thm
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LatexType Environment
LatexName proof
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Proof String"
+ Tooltip "Alternative proof string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LabelType Static
LabelString "Theorem."
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LatexType Environment
LatexName theorem
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
LabelString "\theprob."
RefPrefix pro
NextNoIndent 1
- OptionalArgs 0
+ ResetArgs 1
LabelSep xx
ParIndent MMM
ParSkip 0.4
LatexName sol
LabelType Static
LabelString "# [number of Prob]"
- RequiredArgs 1
+ Argument 1
+ Mandatory 1
+ LabelString "Solution"
+ Tooltip "Mandatory argument to the sol environment"
+ EndArgument
End
LatexType Environment
LatexName thm
NextNoIndent 1
- OptionalArgs 1
+ Argument 1
+ LabelString "Alternative Theorem String"
+ Tooltip "Alternative theorem string"
+ EndArgument
LabelSep xx
ParIndent MMM
ParSkip 0.4
ParSep 0.8
Align Block
RefPrefix chap
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The chapter as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Huge
ParSep 0.7
Align Block
RefPrefix sec
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The section as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Larger
ParSep 0.8
Align Center
Alignpossible Center
- OptionalArgs 1
+ Argument 1
+ LabelString "Short Title"
+ Shortcut S
+ Tooltip "The part as it appears in the table of contents/running headers"
+ EndArgument
Font
Series Bold
Size Huge
document.header[i] = "\\font_sans default"
+def convert_latexargs(document):
+ " Convert InsetArgument to new syntax "
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_inset Argument", i)
+ if i == -1:
+ return
+ # We cannot do more here since we have no access to the layout.
+ # InsetArgument itself will do the real work
+ # (see InsetArgument::updateBuffer())
+ document.body[i] = "\\begin_inset Argument 999"
+ i = i + 1
+
+
+def revert_latexargs(document):
+ " Revert InsetArgument to old syntax "
+
+ # What needs to be done is this:
+ # * find all arguments in a paragraph and reorder them
+ # according to their ID (which is deleted)
+ # So: \\begin_inset Argument 2 ... \\begin_inset Argument 1
+ # => \\begin_inset Argument ... \\begin_inset Argument
+ # with correct order.
+
+
##
# Conversion hub
#
[442, []],
[443, []],
[444, []],
- [445, []]
+ [445, []],
+ [446, [convert_latexargs]]
]
revert = [
+ [445, [revert_latexargs]],
[444, [revert_uop]],
[443, [revert_biolinum]],
[442, []],
# Incremented to format 40, 10 October 2012 by rgh
# Re-do layout names for layout categories
+# Incremented to format 41, 20 November 2012 by spitz
+# New Argument syntax
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
# development/tools/updatelayouts.sh script to update all
# layout files to the new format.
-currentFormat = 40
+currentFormat = 41
def usage(prog_name):
re_ExtractCategory = re.compile(r'^(#\s*\\Declare\w+Class(?:\[[^]]*?\])?){([^(]+?)\s+\(([^)]+?)\)\s*}\s*$')
ConvDict = {"article": "Articles", "book" : "Books", "letter" : "Letters", "report": "Reports", \
"presentation" : "Presentations", "curriculum vitae" : "Curricula Vitae", "handout" : "Handouts"}
+ # Arguments
+ re_OptArgs = re.compile(r'^(\s*)OptionalArgs(\s+)(\d+)\D*$', re.IGNORECASE)
+ re_ReqArgs = re.compile(r'^(\s*)RequiredArgs(\s+)(\d+)\D*$', re.IGNORECASE)
# counters for sectioning styles (hardcoded in 1.3)
formatline = 0
usemodules = []
flexstyles = []
+ opts = 0
+ reqs = 0
while i < len(lines):
# Skip comments and empty lines
i += 1
continue
+ if format == 40:
+ # reset counters on Style beginning
+ match = re_Style.match(lines[i])
+ if match:
+ opts = 0
+ reqs = 0
+ i += 1
+ continue
+ match = re_OptArgs.match(lines[i])
+ if match:
+ # Save number of optional arguments
+ space1 = match.group(1)
+ opts = int(match.group(3))
+ # OptionalArgs 0 > ResetArgs 1
+ if opts == 0:
+ lines[i] = space1 + "ResetArgs\t1"
+ i += 1
+ else:
+ del lines[i]
+ continue
+ match = re_ReqArgs.match(lines[i])
+ if match:
+ # Save number of required arguments
+ space1 = match.group(1)
+ reqs = int(match.group(3))
+ del lines[i]
+ continue
+ # Insert the required number of arguments at the end of the style definition
+ match = re_End.match(lines[i])
+ if match:
+ newarg = ['']
+ # First the optionals (this is the required order pre 2.1)
+ if opts > 0:
+ if opts == 1:
+ newarg = [ '%sArgument 1' % (space1),
+ '%s\tLabelString\t\"Optional Layout Argument\"' % (space1),
+ '%sEndArgument' % (space1)]
+ elif opts > 1:
+ actopt = 1
+ while actopt < (opts + 1):
+ newarg += [ '%sArgument %d' % (space1, actopt),
+ '%s\tLabelString\t\"Optional Layout Argument %d\"' % (space1, actopt),
+ '%sEndArgument' % (space1)]
+ actopt += 1
+ # Now the mandatories
+ if reqs > 0:
+ actopt = opts + 1
+ while actopt < (opts + reqs + 1):
+ newarg += [ '%sArgument %d' % (space1, actopt),
+ '%s\tLabelString\t"Required Layout Argument %d"' % (space1, actopt - opts),
+ '%s\tMandatory\t1' % (space1),
+ '%sEndArgument' % (space1)]
+ actopt += 1
+ # Since we replace the "End" line, re-add this line
+ if len(newarg) > 1:
+ newarg += ['End']
+ lines[i:i+1] = newarg
+ i += len(newarg)
+ # Reset the counters
+ opts = 0
+ reqs = 0
+ i += 1
+ continue
+
if format == 39:
# There is a conversion with format 40, but it is done within the
# initial comment block and so is above.
Item "Hyperlink...|k" "href-insert"
Item "Footnote|F" "footnote-insert"
Item "Marginal Note|M" "marginalnote-insert"
- Item "Short Title|S" "argument-insert"
+ Arguments
Item "TeX Code|X" "ert-insert"
Item "Program Listing[[Menu]]" "listing-insert"
Item "Date" "date-insert"
enum LayoutTags {
LT_ALIGN = 1,
LT_ALIGNPOSSIBLE,
+ LT_ARGUMENT,
LT_MARGIN,
LT_BOTTOMSEP,
LT_CATEGORY,
LT_ENDLABELTYPE,
LT_LATEXNAME,
LT_LATEXPARAM,
- LT_OPTARGS,
LT_LATEXTYPE,
LT_LEFTMARGIN,
LT_NEED_PROTECT,
LT_HTMLTITLE,
LT_SPELLCHECK,
LT_REFPREFIX,
- LT_REQARGS,
+ LT_RESETARGS,
LT_INTITLE // keep this last!
};
htmlforcecss_ = false;
htmltitle_ = false;
spellcheck = true;
- optargs = 0;
- reqargs = 0;
}
LexerKeyword layoutTags[] = {
{ "align", LT_ALIGN },
{ "alignpossible", LT_ALIGNPOSSIBLE },
+ { "argument", LT_ARGUMENT },
{ "babelpreamble", LT_BABELPREAMBLE },
{ "bottomsep", LT_BOTTOMSEP },
{ "category", LT_CATEGORY },
{ "newline", LT_NEWLINE },
{ "nextnoindent", LT_NEXTNOINDENT },
{ "obsoletedby", LT_OBSOLETEDBY },
- { "optionalargs", LT_OPTARGS },
{ "parbreakisnewline", LT_PARBREAK_IS_NEWLINE },
{ "parindent", LT_PARINDENT },
{ "parsep", LT_PARSEP },
{ "passthru", LT_PASS_THRU },
{ "preamble", LT_PREAMBLE },
{ "refprefix", LT_REFPREFIX },
- { "requiredargs", LT_REQARGS },
{ "requires", LT_REQUIRES },
+ { "resetargs", LT_RESETARGS },
{ "rightmargin", LT_RIGHTMARGIN },
{ "spacing", LT_SPACING },
{ "spellcheck", LT_SPELLCHECK },
lex >> toclevel;
break;
- case LT_OPTARGS:
- lex >> optargs;
+ case LT_RESETARGS:
+ bool reset;
+ lex >> reset;
+ if (reset)
+ latexargs_.clear();
break;
- case LT_REQARGS:
- lex >> reqargs;
+ case LT_ARGUMENT:
+ readArgument(lex);
break;
case LT_NEED_PROTECT:
}
+void Layout::readArgument(Lexer & lex)
+{
+ latexarg arg;
+ arg.mandatory = false;
+ bool error = false;
+ bool finished = false;
+ unsigned int nr;
+ lex >> nr;
+ while (!finished && lex.isOK() && !error) {
+ lex.next();
+ string const tok = ascii_lowercase(lex.getString());
+
+ if (tok.empty()) {
+ continue;
+ } else if (tok == "endargument") {
+ finished = true;
+ } else if (tok == "labelstring") {
+ lex.next();
+ arg.labelstring = lex.getDocString();
+ } else if (tok == "mandatory") {
+ lex.next();
+ arg.mandatory = lex.getBool();
+ } else if (tok == "leftdelim") {
+ lex.next();
+ arg.ldelim = lex.getDocString();
+ } else if (tok == "rightdelim") {
+ lex.next();
+ arg.rdelim = lex.getDocString();
+ } else if (tok == "tooltip") {
+ lex.next();
+ arg.tooltip = lex.getDocString();
+ } else if (tok == "shortcut") {
+ lex.next();
+ arg.shortcut = lex.getString();
+ } else if (tok == "requires") {
+ lex.next();
+ arg.requires = lex.getString();
+ } else {
+ lex.printError("Unknown tag");
+ error = true;
+ }
+ }
+ if (arg.labelstring.empty())
+ LYXERR0("Incomplete Argument definition!");
+ else
+ latexargs_[nr] = arg;
+}
+
+
+int Layout::optArgs() const
+{
+ int nr = 0;
+ LaTeXArgMap::const_iterator it = latexargs_.begin();
+ for (; it != latexargs_.end(); ++it) {
+ if (!(*it).second.mandatory)
+ ++nr;
+ }
+ return nr;
+}
+
+
+int Layout::requiredArgs() const
+{
+ int nr = 0;
+ LaTeXArgMap::const_iterator it = latexargs_.begin();
+ for (; it != latexargs_.end(); ++it) {
+ if ((*it).second.mandatory)
+ ++nr;
+ }
+ return nr;
+}
+
+
string const & Layout::htmltag() const
{
if (htmltag_.empty())
#include "FontInfo.h"
#include "LayoutEnums.h"
#include "Spacing.h"
+#include "support/debug.h"
#include "support/docstring.h"
+#include <map>
#include <set>
#include <string>
///
void readSpacing(Lexer &);
///
+ void readArgument(Lexer &);
+ ///
docstring const & name() const { return name_; }
///
void setName(docstring const & n) { name_ = n; }
std::string const & latexname() const { return latexname_; }
///
void setLatexName(std::string const & n) { latexname_ = n; }
+ /// The arguments of this layout
+ struct latexarg {
+ docstring labelstring;
+ bool mandatory;
+ docstring ldelim;
+ docstring rdelim;
+ docstring tooltip;
+ std::string shortcut;
+ std::string requires;
+ };
+ ///
+ typedef std::map<unsigned int, latexarg> LaTeXArgMap;
+ ///
+ LaTeXArgMap const & latexargs() const { return latexargs_; }
+ ///
+ int optArgs() const;
+ ///
+ int requiredArgs() const;
///
docstring const & labelstring(bool in_appendix) const
{ return in_appendix ? labelstring_appendix_ : labelstring_; }
bool intitle;
/// Is the content to go in the preamble rather than the body?
bool inpreamble;
- /// Number of requried arguments for this command or environment
- unsigned int reqargs;
- /// Number of optional arguments for this command or environment
- /// These MUST come at the beginning, so:
- /// \cmd[opt1][opt2]{req1}{here is the text from LyX}
- /// is fine. But:
- /// \cmd[opt1]{req1}[opt2]{here is the text from LyX}
- /// is not.
- unsigned int optargs;
/// Which counter to step
docstring counter;
/// Prefix to use when creating labels
docstring babelpreamble_;
/// Packages needed for this layout
std::set<std::string> requires_;
+ ///
+ LaTeXArgMap latexargs_;
};
} // namespace lyx
/*!
* \var lyx::FuncCode lyx::LFUN_ARGUMENT_INSERT
* \li Action: Inserts an argument (short title) inset.
- * \li Syntax: argument-insert
+ * \li Syntax: argument-insert <argument nr>
+ * \li Params: <argument nr>: see layout declarations
* \li Origin: vermeer, 12 Aug 2002
* \endvar
*/
// we have to provide all the optional arguments here, even though
// the last one is the only one we care about.
// Separate handling of optional argument inset.
- if (layout_->optargs != 0 || layout_->reqargs != 0)
+ if (layout_->latexargs().size() != 0)
latexArgInsets(*owner_, os, features.runparams(),
- layout_->reqargs, layout_->optargs);
+ layout_->latexargs());
else
os << from_ascii(layout_->latexparam());
}
#include "frontends/Clipboard.h"
#include "frontends/Selection.h"
+#include "insets/InsetArgument.h"
#include "insets/InsetCollapsable.h"
#include "insets/InsetCommand.h"
#include "insets/InsetExternal.h"
case LFUN_ARGUMENT_INSERT: {
code = ARG_CODE;
allow_in_passthru = true;
+ string const arg = cmd.getArg(0);
+ if (arg.empty()) {
+ enable = false;
+ break;
+ }
Layout const & lay = cur.paragraph().layout();
- int const numargs = lay.reqargs + lay.optargs;
- enable = cur.paragraph().insetList().count(ARG_CODE) < numargs;
+ Layout::LaTeXArgMap args = lay.latexargs();
+ Layout::LaTeXArgMap::const_iterator const lait =
+ args.find(convert<unsigned int>(arg));
+ if (lait != args.end()) {
+ enable = true;
+ InsetList::const_iterator it = cur.paragraph().insetList().begin();
+ InsetList::const_iterator end = cur.paragraph().insetList().end();
+ for (; it != end; ++it) {
+ if (it->inset->lyxCode() == ARG_CODE) {
+ InsetArgument const * ins =
+ static_cast<InsetArgument const *>(it->inset);
+ if (ins->name() == arg) {
+ // we have this already
+ enable = false;
+ break;
+ }
+ }
+ }
+ } else
+ enable = false;
break;
}
case LFUN_INDEX_INSERT:
case LFUN_MARGINALNOTE_INSERT:
return new InsetMarginal(buf);
- case LFUN_ARGUMENT_INSERT:
- return new InsetArgument(buf);
+ case LFUN_ARGUMENT_INSERT: {
+ string arg = cmd.getArg(0);
+ if (arg.empty()) {
+ LYXERR0("argument-insert needs an argument!");
+ return 0;
+ }
+ return new InsetArgument(buf, arg);
+ }
case LFUN_FLOAT_INSERT: {
string argument = to_utf8(cmd.argument());
} else if (tmptok == "Newline") {
inset.reset(new InsetNewline);
} else if (tmptok == "Argument") {
- inset.reset(new InsetArgument(buf));
+ inset.reset(new InsetArgument(buf, tmptok));
} else if (tmptok == "Float") {
inset.reset(new InsetFloat(buf, string()));
} else if (tmptok == "Wrap") {
#include "IndicesList.h"
#include "KeyMap.h"
#include "Language.h"
+#include "Layout.h"
#include "Lexer.h"
#include "LyXAction.h"
#include "LyX.h"
/// Words suggested by the spellchecker.
SpellingSuggestions,
/** Used Languages */
- LanguageSelector
+ LanguageSelector,
+ /** This is the list of arguments available
+ for insertion into the current layout. */
+ Arguments
};
explicit MenuItem(Kind kind) : kind_(kind), optional_(false) {}
void expandGraphicsGroups(BufferView const *);
void expandSpellingSuggestions(BufferView const *);
void expandLanguageSelector(Buffer const * buf);
+ void expandArguments(BufferView const *);
///
ItemList items_;
///
md_toolbars,
md_graphicsgroups,
md_spellingsuggestions,
- md_languageselector
+ md_languageselector,
+ md_arguments
};
LexerKeyword menutags[] = {
+ { "arguments", md_arguments },
{ "bookmarks", md_bookmarks },
{ "branches", md_branches },
{ "charstyles", md_charstyles },
add(MenuItem(MenuItem::IndicesListsContext));
break;
+ case md_arguments:
+ add(MenuItem(MenuItem::Arguments));
+ break;
+
case md_optsubmenu:
optional = true;
// fallback to md_submenu
}
}
+
+void MenuDefinition::expandArguments(BufferView const * bv)
+{
+ if (!bv)
+ return;
+
+ Inset const * inset = &bv->cursor().inset();
+ Layout::LaTeXArgMap args;
+ if (inset && bv->cursor().paragraph().layout().latexargs().empty())
+ args = inset->getLayout().latexargs();
+ else
+ args = bv->cursor().paragraph().layout().latexargs();
+ if (args.empty())
+ return;
+ Layout::LaTeXArgMap::const_iterator lait = args.begin();
+ Layout::LaTeXArgMap::const_iterator const laend = args.end();
+ for (; lait != laend; ++lait) {
+ Layout::latexarg arg = (*lait).second;
+ QString item = toqstr(translateIfPossible(arg.labelstring));
+ if (!arg.shortcut.empty())
+ item += "|" + toqstr(arg.shortcut);
+ add(MenuItem(MenuItem::Command, item,
+ FuncRequest(LFUN_ARGUMENT_INSERT,
+ convert<docstring>((*lait).first))));
+ }
+}
+
} // namespace anon
/// Expands some special entries of the menu
/** The entries with the following kind are expanded to a
sequence of Command MenuItems: Lastfiles, Documents,
- ViewFormats, ExportFormats, UpdateFormats, Branches, Indices
+ ViewFormats, ExportFormats, UpdateFormats, Branches,
+ Indices, Arguments
*/
void expand(MenuDefinition const & frommenu, MenuDefinition & tomenu,
BufferView const *) const;
tomenu.expandLanguageSelector(buf);
break;
+ case MenuItem::Arguments:
+ tomenu.expandArguments(bv);
+ break;
+
case MenuItem::Submenu: {
MenuItem item(*cit);
item.setSubmenu(MenuDefinition(cit->submenuname()));
#include "InsetArgument.h"
+#include "InsetList.h"
+#include "Layout.h"
+#include "Lexer.h"
+#include "ParIterator.h"
+
+#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
using namespace std;
namespace lyx {
-InsetArgument::InsetArgument(Buffer * buf)
- : InsetCollapsable(buf)
+InsetArgument::InsetArgument(Buffer * buf, string const & name)
+ : InsetCollapsable(buf), name_(name), labelstring_(docstring())
{}
void InsetArgument::write(ostream & os) const
{
- os << "Argument" << "\n";
+ os << "Argument " << name_ << "\n";
InsetCollapsable::write(os);
}
+void InsetArgument::read(Lexer & lex)
+{
+ lex >> name_;
+ InsetCollapsable::read(lex);
+}
+
+void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
+{
+ Layout::LaTeXArgMap args;
+ bool const insetlayout = &it.inset() && it.paragraph().layout().latexargs().empty();
+ if (insetlayout)
+ args = it.inset().getLayout().latexargs();
+ else
+ args = it.paragraph().layout().latexargs();
+
+ // Handle pre 2.1 ArgInsets (lyx2lyx cannot classify them)
+ if (name_ == "999") {
+ int req = insetlayout ? it.inset().getLayout().requiredArgs()
+ : it.paragraph().layout().requiredArgs();
+ int opts = insetlayout ? it.inset().getLayout().optArgs()
+ : it.paragraph().layout().optArgs();
+ int nr = 0;
+ int ours = 0;
+ InsetList::const_iterator parit = it.paragraph().insetList().begin();
+ InsetList::const_iterator parend = it.paragraph().insetList().end();
+ for (; parit != parend; ++parit) {
+ if (parit->inset->lyxCode() == ARG_CODE) {
+ ++nr;
+ if (parit->inset == this)
+ ours = nr;
+ }
+ }
+ bool done = false;
+ int realopts = 0;
+ if (nr > req) {
+ // We have optional arguments
+ realopts = nr - req;
+ if (ours <= realopts) {
+ name_ = convert<string>(ours);
+ done = true;
+ }
+ }
+ if (!done) {
+ // This is a mandatory argument. We have to consider
+ // non-given optional arguments for the numbering
+ int offset = opts - realopts;
+ ours += offset;
+ name_ = convert<string>(ours);
+ }
+ }
+ Layout::LaTeXArgMap::const_iterator const lait =
+ args.find(convert<unsigned int>(name_));
+ if (lait != args.end()) {
+ labelstring_ = translateIfPossible((*lait).second.labelstring);
+ tooltip_ = translateIfPossible((*lait).second.tooltip);
+ } else {
+ labelstring_ = _("Unknown Argument");
+ tooltip_ = _("Argument not known in this Layout. Will be supressed in the output.");
+ }
+ setButtonLabel();
+ InsetCollapsable::updateBuffer(it, utype);
+}
+
+void InsetArgument::setButtonLabel()
+{
+ setLabel(labelstring_);
+}
+
+docstring InsetArgument::toolTip(BufferView const & bv, int, int) const
+{
+ if (isOpen(bv))
+ return tooltip_;
+ return toolTipText(tooltip_ + from_ascii(":\n"));
+}
+
void InsetArgument::latexArgument(otexstream & os,
- OutputParams const & runparams, bool optional) const
+ OutputParams const & runparams, docstring const & ldelim,
+ docstring const & rdelim) const
{
TexRow texrow;
odocstringstream ss;
otexstream ots(ss, texrow);
InsetText::latex(ots, runparams);
docstring str = ss.str();
- if (optional && str.find(']') != docstring::npos)
+ if (ldelim != "{" && support::contains(str, rdelim))
str = '{' + str + '}';
- os << (optional ? '[' : '{') << str
- << (optional ? ']' : '}');
+ os << ldelim << str << rdelim;
}
* Full author contact details are available in file CREDITS.
*/
-#ifndef INSETOPTARG_H
-#define INSETOPTARG_H
+#ifndef INSETARGUMENT_H
+#define INSETARGUMENT_H
#include "InsetCollapsable.h"
{
public:
///
- InsetArgument(Buffer *);
+ InsetArgument(Buffer *, std::string const &);
/// Outputting the parameter of a LaTeX command
void latexArgument(otexstream &, OutputParams const &,
- bool optional) const;
+ docstring const&, docstring const &) const;
+
+ std::string name() const { return name_; }
/// \name Public functions inherited from Inset class
//@{
InsetCode lyxCode() const { return ARG_CODE; }
///
docstring layoutName() const { return from_ascii("Argument"); }
+ /// Update the label string of this inset
+ void updateBuffer(ParIterator const &, UpdateType);
///
void latex(otexstream &, OutputParams const &) const { }
///
int docbook(odocstream &, OutputParams const &) const { return 0; }
///
docstring xhtml(XHTMLStream &, OutputParams const &) const
- { return docstring(); };
+ { return docstring(); }
///
void write(std::ostream & os) const;
///
+ void read(Lexer & lex);
+ ///
bool neverIndent() const { return true; }
//@}
+ /// \name Public functions inherited from InsetCollapsable class
+ //@{
+ ///
+ void setButtonLabel();
+ //@}
+
+private:
+ ///
+ docstring toolTip(BufferView const & bv, int, int) const;
+ ///
+ std::string name_;
+ ///
+ docstring labelstring_;
+ ///
+ docstring tooltip_;
protected:
/// \name Protected functions inherited from Inset class
} // namespace lyx
-#endif // INSETOPTARG_H
+#endif // INSETARGUMENT_H
status.setEnabled(false);
return true;
- case LFUN_ARGUMENT_INSERT:
- status.setEnabled(cur.paragraph().insetList().find(ARG_CODE) == -1);
- return true;
-
case LFUN_INSET_TOGGLE:
// pass back to owner
cur.undispatched();
// optional argument.
runparams.moving_arg = true;
os << "\\caption";
- latexArgInsets(paragraphs()[0], os, runparams, 0, 1);
+ getOptArg(os, runparams);
os << '{';
InsetText::latex(os, runparams);
os << "}\n";
void InsetCaption::getOptArg(otexstream & os,
OutputParams const & runparams) const
{
- latexArgInsets(paragraphs()[0], os, runparams, 0, 1);
+ latexArgInsets(paragraphs()[0], os, runparams, getLayout().latexargs());
}
#include "InsetLayout.h"
#include "ColorSet.h"
+#include "Layout.h"
#include "Lexer.h"
#include "TextClass.h"
bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
{
enum {
+ IL_ARGUMENT,
IL_BABELPREAMBLE,
IL_BGCOLOR,
IL_CONTENTASLABEL,
LexerKeyword elementTags[] = {
+ { "argument", IL_ARGUMENT },
{ "babelpreamble", IL_BABELPREAMBLE },
{ "bgcolor", IL_BGCOLOR },
{ "contentaslabel", IL_CONTENTASLABEL },
labelfont_ = font_;
break;
}
+ case IL_ARGUMENT:
+ readArgument(lex);
+ break;
case IL_BGCOLOR:
lex >> tmp;
bgcolor_ = lcolor.getFromLyXName(tmp);
return retval;
}
+void InsetLayout::readArgument(Lexer & lex)
+{
+ Layout::latexarg arg;
+ arg.mandatory = false;
+ bool error = false;
+ bool finished = false;
+ unsigned int nr;
+ lex >> nr;
+ while (!finished && lex.isOK() && !error) {
+ lex.next();
+ string const tok = support::ascii_lowercase(lex.getString());
+
+ if (tok.empty()) {
+ continue;
+ } else if (tok == "endargument") {
+ finished = true;
+ } else if (tok == "labelstring") {
+ lex.next();
+ arg.labelstring = lex.getDocString();
+ } else if (tok == "mandatory") {
+ lex.next();
+ arg.mandatory = lex.getBool();
+ } else if (tok == "leftdelim") {
+ lex.next();
+ arg.ldelim = lex.getDocString();
+ } else if (tok == "rightdelim") {
+ lex.next();
+ arg.rdelim = lex.getDocString();
+ } else if (tok == "tooltip") {
+ lex.next();
+ arg.tooltip = lex.getDocString();
+ } else if (tok == "shortcut") {
+ lex.next();
+ arg.shortcut = lex.getString();
+ } else if (tok == "requires") {
+ lex.next();
+ arg.requires = lex.getString();
+ } else {
+ lex.printError("Unknown tag");
+ error = true;
+ }
+ }
+ if (arg.labelstring.empty())
+ LYXERR0("Incomplete Argument definition!");
+ else
+ latexargs_[nr] = arg;
+}
+
+int InsetLayout::optArgs() const
+{
+ int nr = 0;
+ Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
+ for (; it != latexargs_.end(); ++it) {
+ if (!(*it).second.mandatory)
+ ++nr;
+ }
+ return nr;
+}
+
+
+int InsetLayout::requiredArgs() const
+{
+ int nr = 0;
+ Layout::LaTeXArgMap::const_iterator it = latexargs_.begin();
+ for (; it != latexargs_.end(); ++it) {
+ if ((*it).second.mandatory)
+ ++nr;
+ }
+ return nr;
+}
+
} //namespace lyx
#include "ColorCode.h"
#include "FontInfo.h"
+#include "Layout.h"
#include "support/docstring.h"
///
ColorCode bgcolor() const { return bgcolor_; }
///
+ Layout::LaTeXArgMap latexargs() const { return latexargs_; }
+ ///
+ int optArgs() const;
+ ///
+ int requiredArgs() const;
+ ///
docstring preamble() const { return preamble_; }
/// Get language dependent macro definitions needed for this inset
docstring const langpreamble() const { return langpreamble_; }
///
std::string defaultCSSLabelClass() const { return defaultCSSClass() + "_label"; }
///
+ void readArgument(Lexer &);
+ ///
docstring name_;
/**
* This is only used (at present) to decide where to put them on the menus.
bool resetsfont_;
///
bool display_;
+ ///
+ Layout::LaTeXArgMap latexargs_;
};
///
#include "InsetText.h"
#include "insets/InsetArgument.h"
+#include "insets/InsetLayout.h"
#include "buffer_funcs.h"
#include "Buffer.h"
#include "InsetList.h"
#include "Intl.h"
#include "Language.h"
+#include "Layout.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "lyxfind.h"
#include "frontends/alert.h"
#include "frontends/Painter.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
return target_inset;
}
+ case LFUN_ARGUMENT_INSERT: {
+ string const arg = cmd.getArg(0);
+ if (arg.empty()) {
+ status.setEnabled(false);
+ return true;
+ }
+ if (&buffer().inset() == this || !cur.paragraph().layout().latexargs().empty())
+ return text_.getStatus(cur, cmd, status);
+ Layout::LaTeXArgMap args = getLayout().latexargs();
+ Layout::LaTeXArgMap::const_iterator const lait =
+ args.find(convert<unsigned int>(arg));
+ if (lait != args.end()) {
+ status.setEnabled(true);
+ InsetList::const_iterator it = cur.paragraph().insetList().begin();
+ InsetList::const_iterator end = cur.paragraph().insetList().end();
+ for (; it != end; ++it) {
+ if (it->inset->lyxCode() == ARG_CODE) {
+ InsetArgument const * ins =
+ static_cast<InsetArgument const *>(it->inset);
+ if (ins->name() == arg) {
+ // we have this already
+ status.setEnabled(false);
+ return true;
+ }
+ }
+ }
+ } else
+ status.setEnabled(false);
+ return true;
+ }
+
default:
// Dispatch only to text_ if the cursor is inside
// the text_. It is not for context menus (bug 5797).
#include "insets/InsetArgument.h"
#include "support/lassert.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/lstrings.h"
+#include <algorithm>
#include <boost/next_prior.hpp>
#include <list>
if (style.isEnvironment()) {
os << "\\begin{" << from_ascii(style.latexname()) << '}';
- if (style.optargs != 0 || style.reqargs != 0)
- latexArgInsets(*pit, os, runparams, style.reqargs, style.optargs);
+ if (style.latexargs().size() != 0)
+ latexArgInsets(*pit, os, runparams, style.latexargs());
if (style.latextype == LATEX_LIST_ENVIRONMENT) {
os << '{'
<< pit->params().labelWidthString()
void latexArgInsets(Paragraph const & par, otexstream & os,
- OutputParams const & runparams, unsigned int reqargs,
- unsigned int optargs)
+ OutputParams const & runparams, Layout::LaTeXArgMap latexargs)
{
- unsigned int totalargs = reqargs + optargs;
- list<InsetArgument const *> ilist;
+ map<int, InsetArgument const *> ilist;
+ vector<string> required;
InsetList::const_iterator it = par.insetList().begin();
InsetList::const_iterator end = par.insetList().end();
for (; it != end; ++it) {
if (it->inset->lyxCode() == ARG_CODE) {
- if (ilist.size() >= totalargs) {
- LYXERR0("WARNING: Found extra argument inset.");
- continue;
- }
InsetArgument const * ins =
static_cast<InsetArgument const *>(it->inset);
- ilist.push_back(ins);
+ if (ins->name().empty())
+ LYXERR0("Error: Unnamed argument inset!");
+ else {
+ unsigned int const nr = convert<unsigned int>(ins->name());
+ ilist[nr] = ins;
+ Layout::LaTeXArgMap::const_iterator const lit =
+ latexargs.find(nr);
+ if (lit != latexargs.end()) {
+ Layout::latexarg arg = (*lit).second;
+ if (!arg.requires.empty()) {
+ vector<string> req = getVectorFromString(arg.requires);
+ required.insert(required.end(), req.begin(), req.end());
+ }
+ }
+ }
}
}
- if (!reqargs && ilist.empty())
+ unsigned int const argnr = latexargs.size();
+ if (argnr == 0)
return;
- bool const have_optional_args = ilist.size() > reqargs;
- if (have_optional_args) {
- unsigned int todo = ilist.size() - reqargs;
- for (unsigned int i = 0; i < todo; ++i) {
- InsetArgument const * ins = ilist.front();
- ilist.pop_front();
- ins->latexArgument(os, runparams, true);
+ for (unsigned int i = 1; i <= argnr; ++i) {
+ map<int, InsetArgument const *>::const_iterator lit = ilist.find(i);
+ bool inserted = false;
+ if (lit != ilist.end()) {
+ InsetArgument const * ins = (*lit).second;
+ if (ins) {
+ Layout::LaTeXArgMap::const_iterator const lait =
+ latexargs.find(convert<unsigned int>(ins->name()));
+ if (lait != latexargs.end()) {
+ Layout::latexarg arg = (*lait).second;
+ docstring ldelim = arg.mandatory ?
+ from_ascii("{") : from_ascii("[");
+ docstring rdelim = arg.mandatory ?
+ from_ascii("}") : from_ascii("]");
+ if (!arg.ldelim.empty())
+ ldelim = arg.ldelim;
+ if (!arg.rdelim.empty())
+ rdelim = arg.rdelim;
+ ins->latexArgument(os, runparams, ldelim, rdelim);
+ inserted = true;
+ }
+ }
}
- }
-
- // we should now have no more insets than there are required
- // arguments.
- LASSERT(ilist.size() <= reqargs, /* */);
- if (!reqargs)
- return;
-
- for (unsigned int i = 0; i < reqargs; ++i) {
- if (ilist.empty())
- // a required argument wasn't given, so we output {}
- os << "{}";
- else {
- InsetArgument const * ins = ilist.front();
- ilist.pop_front();
- ins->latexArgument(os, runparams, false);
+ if (!inserted) {
+ Layout::LaTeXArgMap::const_iterator lait = latexargs.begin();
+ Layout::LaTeXArgMap::const_iterator const laend = latexargs.end();
+ for (; lait != laend; ++lait) {
+ if ((*lait).first == i) {
+ Layout::latexarg arg = (*lait).second;
+ if (arg.mandatory) {
+ docstring ldelim = arg.ldelim.empty() ?
+ from_ascii("{") : arg.ldelim;
+ docstring rdelim = arg.rdelim.empty() ?
+ from_ascii("}") : arg.rdelim;
+ os << ldelim << rdelim;
+ } else if (find(required.begin(), required.end(),
+ convert<string>((*lait).first)) != required.end()) {
+ docstring ldelim = arg.ldelim.empty() ?
+ from_ascii("[") : arg.ldelim;
+ docstring rdelim = arg.rdelim.empty() ?
+ from_ascii("]") : arg.rdelim;
+ os << ldelim << rdelim;
+ } else
+ break;
+ }
+ }
}
}
}
os << '\\' << from_ascii(style.latexname());
// Separate handling of optional argument inset.
- if (style.optargs != 0 || style.reqargs != 0)
- latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
+ if (style.latexargs().size() != 0)
+ latexArgInsets(par, os, runparams, style.latexargs());
else
os << from_ascii(style.latexparam());
break;
#include <utility>
#include "support/docstream.h"
+#include "Layout.h"
#include "Paragraph.h"
#include "ParIterator.h"
#include "ParagraphList.h"
/// must all come first.
void latexArgInsets(Paragraph const & par,
otexstream & os, OutputParams const & runparams,
- unsigned int reqargs, unsigned int optargs);
+ Layout::LaTeXArgMap latexargs);
/** Export \p paragraphs of buffer \p buf to LaTeX.
Don't use a temporary stringstream for \p os if the final output is
libertine-legacy.sty
445 URW Classico LaTeX font \font_sans uop
\renewcommand{\sffamily}{uop}
+446 Optional and required arguments InsetArgument
+ now numbered by order
General
}
context.check_deeper(os);
context.check_layout(os);
- unsigned int optargs = 0;
- while (optargs < context.layout->optargs) {
+ // FIXME: Adjust to format 446!
+ // Since format 446, layouts do not require anymore all optional
+ // arguments before the required ones. Needs to be implemented!
+ int optargs = 0;
+ while (optargs < context.layout->optArgs()) {
eat_whitespace(p, os, context, false);
if (p.next_token().cat() == catEscape ||
p.next_token().character() != '[')
break;
p.get_token(); // eat '['
- begin_inset(os, "Argument\n");
+ // FIXME: Just a workaround. InsetArgument::updateBuffer
+ // will compute a proper ID for all "999" Arguments
+ // (which is also what lyx2lyx produces).
+ // However, tex2lyx should be able to output proper IDs
+ // itself.
+ begin_inset(os, "Argument 999\n");
os << "status collapsed\n\n";
parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
end_inset(os);
eat_whitespace(p, os, context, false);
++optargs;
}
- unsigned int reqargs = 0;
- while (reqargs < context.layout->reqargs) {
+ int reqargs = 0;
+ while (reqargs < context.layout->requiredArgs()) {
eat_whitespace(p, os, context, false);
if (p.next_token().cat() != catBegin)
break;
p.get_token(); // eat '{'
- begin_inset(os, "Argument\n");
+ // FIXME: Just a workaround. InsetArgument::updateBuffer
+ // will compute a proper ID for all "999" Arguments
+ // (which is also what lyx2lyx produces).
+ // However, tex2lyx should be able to output proper IDs
+ // itself.
+ begin_inset(os, "Argument 999\n");
os << "status collapsed\n\n";
parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context);
end_inset(os);
}
context.check_deeper(os);
// handle known optional and required arguments
- // layouts require all optional arguments before the required ones
+ // FIXME: Since format 446, layouts do not require anymore all optional
+ // arguments before the required ones. Needs to be implemented!
// Unfortunately LyX can't handle arguments of list arguments (bug 7468):
// It is impossible to place anything after the environment name,
// but before the first \\item.
if (context.layout->latextype == LATEX_ENVIRONMENT) {
bool need_layout = true;
- unsigned int optargs = 0;
- while (optargs < context.layout->optargs) {
+ int optargs = 0;
+ while (optargs < context.layout->optArgs()) {
eat_whitespace(p, os, context, false);
if (p.next_token().cat() == catEscape ||
p.next_token().character() != '[')
context.check_layout(os);
need_layout = false;
}
- begin_inset(os, "Argument\n");
+ // FIXME: Just a workaround. InsetArgument::updateBuffer
+ // will compute a proper ID for all "999" Arguments
+ // (which is also what lyx2lyx produces).
+ // However, tex2lyx should be able to output proper IDs
+ // itself.
+ begin_inset(os, "Argument 999\n");
os << "status collapsed\n\n";
parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
end_inset(os);
eat_whitespace(p, os, context, false);
++optargs;
}
- unsigned int reqargs = 0;
- while (reqargs < context.layout->reqargs) {
+ int reqargs = 0;
+ while (reqargs < context.layout->requiredArgs()) {
eat_whitespace(p, os, context, false);
if (p.next_token().cat() != catBegin)
break;
context.check_layout(os);
need_layout = false;
}
- begin_inset(os, "Argument\n");
+ // FIXME: Just a workaround. InsetArgument::updateBuffer
+ // will compute a proper ID for all "999" Arguments
+ // (which is also what lyx2lyx produces).
+ // However, tex2lyx should be able to output proper IDs
+ // itself.
+ begin_inset(os, "Argument 999\n");
os << "status collapsed\n\n";
parse_text_in_inset(p, os, FLAG_BRACE_LAST, outer, context);
end_inset(os);
begin_inset(os, "Caption\n");
Context newcontext(true, context.textclass, 0, 0, context.font);
newcontext.check_layout(os);
+ // FIXME InsetArgument is now properly implemented in InsetLayout
+ // (for captions, but also for others)
if (p.next_token().cat() != catEscape &&
p.next_token().character() == '[') {
p.get_token(); // eat '['
- begin_inset(os, "Argument\n");
+ begin_inset(os, "Argument 1\n");
os << "status collapsed\n";
parse_text_in_inset(p, os, FLAG_BRACK_LAST, outer, context);
end_inset(os);
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 445 // landroni: support for the URW Classico LaTeX font
-#define LYX_FORMAT_TEX2LYX 445 // landroni: support for the URW Classico LaTeX font
+#define LYX_FORMAT_LYX 446 // spitz: InsetArgument revision
+#define LYX_FORMAT_TEX2LYX 446 // landroni: InsetArgument revision
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER