documentation of new argument syntax

This commit is contained in:
Juergen Spitzmueller 2012-11-23 15:37:30 +01:00
parent 29d48665fa
commit 9e8bfb4597

View File

@ -1,5 +1,5 @@
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 444
\lyxformat 446
\begin_document
\begin_header
\textclass scrbook
@ -5422,7 +5422,7 @@ name "cha:Installing-New-Document"
\end_inset
\begin_inset Argument
\begin_inset Argument 1
status collapsed
\begin_layout Plain Layout
@ -10212,8 +10212,473 @@ block
(Some LaTeX styles prohibit certain alignments, since those wouldn't make
sense.
For example a right-aligned or centered enumeration isn't possible.)
\change_inserted -712698321 1353679769
\end_layout
\begin_layout Description
\change_inserted -712698321 1353680268
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353679781
Argument
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353679772
int
\end_layout
\end_inset
] Defines argument number <int> of a command\SpecialChar \slash{}
environment associated with
the current style.
This is useful for things like section headings, and only makes sense with
LaTeX.
Every (optional or required) argument of a command or environment -- except
for the required argument that is associated with the content of the paragraph
itself -- has a separate definition, where the number specifies the order
of the arguments.
The definition must end with
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680069
EndArgument
\end_layout
\end_inset
.
So a command with two optional arguments has:
\end_layout
\begin_deeper
\begin_layout Quote
\change_inserted -712698321 1353680127
\family typewriter
Argument 1
\end_layout
\begin_layout Quote
\change_inserted -712698321 1353680195
\family typewriter
...
\end_layout
\begin_layout Quote
\change_inserted -712698321 1353680135
\family typewriter
EndArgument
\end_layout
\begin_layout Quote
\change_inserted -712698321 1353680140
\family typewriter
Argument 2
\end_layout
\begin_layout Quote
\change_inserted -712698321 1353680197
\family typewriter
...
\end_layout
\begin_layout Quote
\change_inserted -712698321 1353680147
\family typewriter
EndArgument
\end_layout
\begin_layout Standard
\change_inserted -712698321 1353680528
Inside the
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680412
Argument
\end_layout
\end_inset
definition, the following specifications are possible:
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353680612
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680543
LabelString
\change_unchanged
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680567
[string]
\end_layout
\end_inset
The string that will appear both in the menu (to insert this argument)
and on the argument inset button
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353680665
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680616
Tooltip
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680623
[string]
\end_layout
\end_inset
A longer explanatory text that appears in the tooltip when hovering over
the argument inset.
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353680719
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680677
Shortcut
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680681
[character]
\end_layout
\end_inset
An accelerator for quick access in the menu.
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353680874
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680732
Mandatory
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680738
[int=0]
\end_layout
\end_inset
Declare if this is a mandatory or an optional argument.
Mandatory arguments will be output empty if not given, while optional arguments
will not be output at all.
By default, mandatory arguments are delimited by
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680808
{...}
\change_unchanged
\end_layout
\end_inset
, while optional arguments are delimited by
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680833
[...]
\end_layout
\end_inset
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353681232
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680879
Requires
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680874
[int=0]
\end_layout
\end_inset
defines another argument (by its number) which this argument requires to
be output if it is itself output.
E.
\begin_inset space \thinspace{}
\end_inset
g., in LaTeX commands, optional arguments often require previous optional
arguments to be output (at least empty), as in
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353680979
\backslash
command[][arg}{text}
\change_unchanged
\end_layout
\end_inset
.
This can be achieved by the statement
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681031
Requires 1
\change_unchanged
\end_layout
\end_inset
within
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681045
Argument 2
\change_unchanged
\end_layout
\end_inset
.
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353681145
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681072
LeftDelim
\change_unchanged
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681067
[string]
\end_layout
\end_inset
defines a custom left delimiter (instead of
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681127
{
\change_unchanged
\end_layout
\end_inset
or
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681133
[
\change_unchanged
\end_layout
\end_inset
).
\end_layout
\begin_layout Itemize
\change_inserted -712698321 1353681155
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681149
RightDelim
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681146
[string]
\end_layout
\end_inset
defines a custom right delimiter (instead of
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681158
}
\end_layout
\end_inset
or
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681161
]
\end_layout
\end_inset
).
\change_unchanged
\end_layout
\end_deeper
\begin_layout Description
\begin_inset Flex Code
status collapsed
@ -12389,6 +12854,8 @@ ObsoletedBy
\end_layout
\begin_layout Description
\change_deleted -712698321 1353679722
\begin_inset Flex Code
status collapsed
@ -12419,23 +12886,33 @@ int=0
\begin_deeper
\begin_layout LyX-Code
\change_deleted -712698321 1353679722
\backslash
mycmd[opt1]{req1}{contents of paragraph}
\end_layout
\begin_layout Standard
\change_deleted -712698321 1353679722
but one cannot have things like:
\end_layout
\begin_layout LyX-Code
\change_deleted -712698321 1353679722
\backslash
mycmd[opt1]{req1}[opt2]{contents of paragraph}
\end_layout
\begin_layout Standard
\change_deleted -712698321 1353679722
at least, not without ERT (with which you can have anything).
\change_unchanged
\end_layout
\end_deeper
@ -12773,6 +13250,8 @@ string
\end_layout
\begin_layout Description
\change_deleted -712698321 1353681258
\begin_inset Flex Code
status collapsed
@ -12813,6 +13292,8 @@ OptionalArgs
\end_inset
tag above for more information.
\change_unchanged
\end_layout
\begin_layout Description
@ -14766,6 +15247,62 @@ InsetLayout
\begin_layout Description
\change_inserted -712698321 1353681390
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681344
Argument
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681344
int
\end_layout
\end_inset
] Defines argument number <int> of a command\SpecialChar \slash{}
environment associated with
the current layout.
The definition must end with
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\change_inserted -712698321 1353681344
EndArgument
\end_layout
\end_inset
.
See section
\begin_inset space ~
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:Paragraph-Styles"
\end_inset
for details.
\end_layout
\begin_layout Description
\change_inserted -195340706 1333913893
\begin_inset Flex Code
status collapsed