Jean-Marc Lasgouttes writes:
> >>>>> "John" == John Weiss <[EMAIL PROTECTED]> writes:
>
> John> Jean-Marc Lasgouttes writes:
> >> It occured to me that, since floats all share similar properties,
> >> they could be defined in textclasses, so that adding new ones is
> >> easy. This could be done with a FloatStyle...End construct similar
> >> to the following:
>
> John> [fine example snipped]
>
> John> This is an idea I also mentioned, and some time ago. So
> John> obviously I think it's a Fine Idea. :)
>
> Sorry, I missed it at the time...
[Larry: Take note]
Basic idea was this:
In addition to displaying text/evironments as a plain paragraph with
certain marigns, etc., there'd be two other ways of displaying them:
- Tabular
- Collapsable [i.e. Inset]
The first one, "Tabular", would be used [probably almost exclusively]
for environment arguments. I.e., for the "short form" of a Section
Heading, for the label of a "Display" or "List" environment, etc. The
second, the Collapsable/Inset kind, could also be used for
environment/command arguments, or could be used for a paragraph
proper.
Example:
Suppose the optional argument to a \section[]{} command were in a
Collapsable. The heading would look like:
1) [arg] This is the Long Form of Section One of This Example.
Clicking on [arg] would open it into an inlined box:
1) |_Section One: Example_| This is the Long Form of Section One of
This Example.
...where "|_" and "_|" indicate the box. One could also make the
Collapsable open in its own paragraph [i.e. there'd be an "Inlined"
attribute]. Good for ERT. :)
For the "Tabular", the arguments to a command are separated by the
<Tab> key. The idea here is that you'd use <Tab> --- *not* <Space>
--- move out of that field/arg. Here's the example, with the "<Tab>"
stuck in [remove it mentally]:
First Word<Tab> This is the first item in a "List"
environment.
Second Place<Tab> Here's another item.
*This* *example*<Tab> is of a "Description" environment. The "*"
are supposed to indicate bolding.
*And* *here's* *another*<Tab> example of the use of "Tabular" display
descriptions. [Okay, I've decided to call these things "display
descriptions".]
You get the idea. Now, these *are* only examples... whatever the
implementation looks like, it should be highly flexible.
Now, change of topic: Footnote/Margin Note, Table/Figure Float, and
Argument Handling.
First, I envision a very flexible way of handling arguments. There'd
be 3 ways of doing them.
Style CmdWArgs
:
:
LatexType Command
LatexCommand foo[\ha]{\hi}{\hu}
DisplayType Plain|Collapsable
ParagraphArg \hu
# DisplayType == Plain
DisplayOrder 3 [Last|First|1|2|3] # For more args, add
# more
numbers.
Align Left|Right|Center|Block
AlignPossible Left|Right|Center|Block
LeftMarginSep # Same value as LabelSep
RightMarginSep # Same value as LabelSep
LabelType None|String
LabelString #
LabelSize # I.e. a font size
EndArg
TabbingArg \hi
#DisplayType == Tabbing
#
# Same attributes as "ParagraphArg", with the addition of:
#
IndentType First|Bibtype|None # Bibtype==indent all but 1st
FixedWidth True|False
IndentWidth # Default 0
DefaultWidth # A string of characters. This would appear
# in the "Paragraph" popup [or a subpopup].
WidthDescr # A fixed-length string describing what this
# width is for.
EndArg
CollapsingArg \ha
#DisplayType == Collapsable
#
# Same attributes as "ParagraphArg", with the addition of:
#
InlineOpen True|False # Inline when open or put in its
# own paragraph?
ClosedLabel # A string to show in the little box when it's
# closed.
BoxColor # Valid color spec.
EndArg
PopupArg \ha # I'm just reusing it in this example.
PositionHint [1|2|3|4|5|6|7|8|9|First|Last|Next]
LabelString # a string with a fixed width
HelpString "Unlimited length help string, \
can span multiple lines."
DefaultContents # Optional. Defaults to ""
EndArg
End
Basically, for "PopupArg", there would be a separate subpopup/tab in the
Paragraph Popup. There would be 9 greyed-out rows, each row
containing a label [default string "N/A"], a text-entry box, and a "?"
button. Hitting the "?" button brings up the "HelpString" [default
"D'oh! Not Documented."] when a row is active. "PositionHint" is
where in the list the thing should go: "First" means top of the list
[a.k.a. row #1], "Last" means bottom of the list [not necessarily row
#9], "Next" means the next empty slot that isn't "Last", and a number
indicates which row. Empty rows are removed [I forsee the internal
storage as a linked list, one of whose attributes is an "isEmpty"
flag.]
As for the "DefaultWidth" attribute in "TabbingArg", that would
probably also be in a subpopup/tab with a set of rows. This time,
each row contains just a label "WidthDescr" and a text-entry box.
Again, there'd be 9 of these, with inactive ones greyed out.
ALT: Instead of having 9 fixed rows, some of which are greyed out, we
could add/remove the extra rows. This could happen for
"DefaultWidth", "ParagraphArg", or both.
For Footnote/MarginPar/Table/Figure Floats, we could have this
attribute:
InsetType Foot|Figure|Math|Plain
# This next one is "None" by default for Math|Plain
MarginMarker Left|Right|None
# This next one is "None" by default for Foot|Figure
NumberVar # a valid counter name or "None"
MarkerChar # a single character, \0 by default [==None]
MenuEntry # A fixed-length string label to go in a submenu of
# the "Insert" menu.
A Margin Note would use "InsetType==Foot" and a Table would use
"InsetType==Figure". This way, we could reuse common code.
--
John Weiss