Files
klammertext/sks/kutil/kutil.k

64 lines
1.7 KiB
Plaintext
Raw Normal View History

@@show s : @eval :cpp show show @ @@
@@caption_arguments :
:caption
:number.bool true
:caption_side.side bottom
:caption_font.font i
:caption_font_size.float .9
@@
@@reference spec | name :
__REF__*spec*__*name*__
@@
@@@argtype number | a number
:pattern 'float'^|'int'
:python_cast (lambda s: float(s))
@@@
@@@argtype length | a length specifier
#:pattern f^|none^|'float'w^|'float'h^|'int'px^|'float'em^|'int'pt
# The last pattern is a string, used where possible to determine its length
:pattern f^|none^|'float'w^|'float'h^|'int'px^|'float'em^|'int'pt^|"[^^"]+"^|'float'pw^|'float'ph
# :python_cast (lambda s : __import__("kutil").parse_length("tex", s))
@@@
@@@argtype lengths | a list of lengths
:pattern ('length'^|\s+)*
#:python_cast (lambda s : [__import__("kutil").parse_length("tex", e) for e in s.split()])
@@@
@@@argtype side | a side of a box
:pattern top^|right^|bottom^|left
@@@
@@@argtype hpos | horizontal position
:pattern left^|center^|right^|none
@@@
@@@argtype figure_id |
an identifier for a figure.
The identifier can be in one of six forms:
before
before <offset-to-figure>
after
after <offset-to-figure>
<image-basename>
<id>
The "before" value means the figure before this place in the text;
the number indicates the number of figures behind that place in the
text. This means that "before" is equivalent to "before 1". The
"after" value uses an offset in the same way but counting forewards.
For images, the <image-basename> argument is the basename argument to
the ^@image klammer and can be used as an identifier.
An <id> is the value of the ^:id argument for an image.
^:pattern before(?^:\s+\d+)?^|after(?^:\s+\d+)?^|[-\w]+
@@@