Width and height argtypes, kdesc --argtypes from ref/, txt @define/@left_right/@columns, kdiag --check value validation (from dev d6993110e9b3)
Also: the klammertext argtype (descriptions kept as source), txt table wrapping and :hpos/:offset, @c between ‹ ›, txt section headings, the ktext newline-only trim, capitalize(), and the argtype test suite. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b0d0d7897
commit
0ead40f272
39 files changed
+734
-158
No files matched your search
@@ -81,9 +81,9 @@ def minipage(content, width="\\textwidth", vertical="c", center=True, vmargin=""
|
||||
|
||||
def offset_length(offset):
|
||||
r"""An :offset as a LaTeX length, or "0pt" when there is none."""
|
||||
if not offset or offset in ("0", "0pt"):
|
||||
if not offset or offset in ("0", "0pt", "0.0"):
|
||||
return "0pt"
|
||||
return kutil.parse_length("tex", offset, 1)[0]
|
||||
return kutil.parse_width("tex", offset)[0]
|
||||
|
||||
def offset_space(offset):
|
||||
r"""An :offset as an \hspace*, or "" when there is none."""
|
||||
@@ -111,7 +111,7 @@ def caption_wrapper(element, hpos, bottom_margin=0, offset=None):
|
||||
return minipage("\\hfill" + element + inset, vmargin=vmargin, center=False)
|
||||
if hpos == "none":
|
||||
return element
|
||||
length, _, _ = kutil.parse_length("tex", hpos, 1)
|
||||
length, _, _ = kutil.parse_width("tex", hpos)
|
||||
return minipage(f"\\hspace*{{{length}}}" + element + "\\hfill",
|
||||
vmargin=vmargin, center=False)
|
||||
|
||||
|
||||
Reference in new issue
Block a user