Improve formatting of lists

List layout adjustments in the SKS LaTeX path: list item spacing and the
surrounding document style tuned in list.py, latex_util.py,
document.sty, and block.k.

Assembled from dev commit f34e66a4dbfb.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 00:28:09 +02:00
parent bd39d9a369
commit d982c0d6cc
5 changed files with 15 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ are regenerated on each release — patches cannot be merged directly.
Report problems (or send patches) to the author; accepted changes are
applied to the development tree and appear in a following snapshot.
This snapshot was assembled from development commit `071b1b183de4`.
This snapshot was assembled from development commit `f34e66a4dbfb`.
## License

View File

@@ -135,3 +135,9 @@ only makes some vertical space. @@
*s*
\end{multicols}
@@
@@left_right.k left | right : Text left- and right- justified on one line @@
@@left_right.tex ::
\makebox[\dimexpr\linewidth+\labelindent\relax]{*left*\hfill *right*}
@@

View File

@@ -2,12 +2,8 @@
\usepackage{titletoc}
\usepackage{ifthen}
%% \pretolerance 1000
%% \tolerance 2000
%% \exhyphenpenalty 0
%% \clubpenalty 5000
%% \widowpenalty 5000
%% \displaywidowpenalty 5000
\widowpenalty=10000
\clubpenalty=10000
\setlength{\hoffset}{-1in}
\setlength{\voffset}{-1in}

View File

@@ -81,9 +81,12 @@ class Define(klammer_base.Klammer_base):
'c' : r'\normalfont\ttfamily',
's' : r'\normalfont\sffamily'}[self.font]
return f"{font} {s}"
result = "\n\n".join([f"\\item[{fontify(term)}]\\hfill\n\\newline {definition}"
# The "\hfill\newline" was to force the description to the next line even if the item was small:
# result = "\n\n".join([f"\\item[{{{fontify(term)}}}]\\hfill\n\\newline {definition}"
strut = r"\rule[-8pt]{0pt}{8pt}"
result = "\n\n".join([f"\\item[{{{fontify(term)}{strut}}}] {definition}"
for term,definition in self.items])
result = f"\\begin{{description}}[labelindent=12pt,nosep,itemsep=6pt]\n{result}\n\\end{{description}}"
result = f"\\begin{{description}}[labelindent=12pt,nosep,itemsep=6pt,parsep=.5\parskip,style=nextline]\n{result}\n\\end{{description}}"
return result
# Needs to be implemented:

View File

@@ -90,7 +90,7 @@ def offset_space(offset):
length = offset_length(offset)
return "" if length == "0pt" else f"\\hspace*{{{length}}}"
def caption_wrapper(element, hpos, bottom_margin=.67, offset=None):
def caption_wrapper(element, hpos, bottom_margin=0, offset=None):
# hpos is left, center, right, none (no wrapper), or a length, which
# becomes the left margin. The element is a box on a line inside a
# full-width minipage; \hfill on the empty side pushes it into place.