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:
@@ -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
|
Report problems (or send patches) to the author; accepted changes are
|
||||||
applied to the development tree and appear in a following snapshot.
|
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
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -135,3 +135,9 @@ only makes some vertical space. @@
|
|||||||
*s*
|
*s*
|
||||||
\end{multicols}
|
\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*}
|
||||||
|
@@
|
||||||
|
|||||||
@@ -2,12 +2,8 @@
|
|||||||
\usepackage{titletoc}
|
\usepackage{titletoc}
|
||||||
\usepackage{ifthen}
|
\usepackage{ifthen}
|
||||||
|
|
||||||
%% \pretolerance 1000
|
\widowpenalty=10000
|
||||||
%% \tolerance 2000
|
\clubpenalty=10000
|
||||||
%% \exhyphenpenalty 0
|
|
||||||
%% \clubpenalty 5000
|
|
||||||
%% \widowpenalty 5000
|
|
||||||
%% \displaywidowpenalty 5000
|
|
||||||
|
|
||||||
\setlength{\hoffset}{-1in}
|
\setlength{\hoffset}{-1in}
|
||||||
\setlength{\voffset}{-1in}
|
\setlength{\voffset}{-1in}
|
||||||
|
|||||||
@@ -81,9 +81,12 @@ class Define(klammer_base.Klammer_base):
|
|||||||
'c' : r'\normalfont\ttfamily',
|
'c' : r'\normalfont\ttfamily',
|
||||||
's' : r'\normalfont\sffamily'}[self.font]
|
's' : r'\normalfont\sffamily'}[self.font]
|
||||||
return f"{font} {s}"
|
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])
|
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
|
return result
|
||||||
|
|
||||||
# Needs to be implemented:
|
# Needs to be implemented:
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def offset_space(offset):
|
|||||||
length = offset_length(offset)
|
length = offset_length(offset)
|
||||||
return "" if length == "0pt" else f"\\hspace*{{{length}}}"
|
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
|
# 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
|
# 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.
|
# full-width minipage; \hfill on the empty side pushes it into place.
|
||||||
|
|||||||
Reference in New Issue
Block a user