1

If a marginal note in KOMA-script is near the page end, KOMA-script just splits the note in whatever place it decides and moves the tail to the margin of the next page. For short notes it creates really confusing lines of text alone on the page.

I would rather prefer to shift the whole note up one line instead of splitting it, or let it spill a little bit below bottom text margin. Unfortunately, adding \vspace{-\baselineskip} to \makenote command doesn't help: it shifts only the content of the second page. See example below, it moved the second line above the first.

Any idea how to let the note spill down or shift it up in KOMA-script?

MWE (sorry for a lot of text):

enter image description here

\documentclass[12pt, oneside, paper = A4]{scrbook}

\usepackage{fontspec}
\usepackage{scrlayer-notecolumn}
\usepackage{scrlayer-scrpage}

\setkomafont{notecolumn.marginpar}{\scriptsize}

\setmainfont{Libertinus Serif}

\pagestyle{scrheadings}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget,
consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi
tristique senectus et netus et malesuada fames ac turpisegestas. Mauris ut leo. Cras viverra metus
rhoncus sem. Nulla et lectus vestibulumurna fringilla ultrices. Phasellus eu tellus sit amet tortor
gravida placerat. Integersapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem
vel leo ultricesbibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac,
nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congueeu, accumsan
eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.

Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor loremnon justo.
Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donecaliquet, tortor sed
accumsan bibendum, erat ligula aliquet magna, vitae ornare odiometus a mi. Morbi ac orci et nisl
hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque
penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla
ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.

Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunttristique,
libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus adipiscing
semper elit. Proin fermentum massa ac quam. Sed diam turpis, molestie vitae, placerat a, molestie
nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna. Nunceleifend consequat lorem. Sed lacinia nulla vitae enim.
Pellentesque tincidunt purus velmagna. Integer non enim. Praesent euismod nunc eu purus. Donec
bibendum quamin tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam vulputate metus eu enim.
Vestibulum pellentesque felis eu massa.

Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus tinciduntultrices. Lorem
ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasseplatea dictumst. Integer tempus
convallis augue. Etiam facilisis. Nunc elementumfermentum wisi. Aenean placerat. Ut imperdiet, enim
sed gravida sollicitudin, felis odioplacerat quam, ac pulvinar elit purus eget enim. Nunc vitae
tortor. Proin tempus nibhsit amet nisl. Vivamus quis tortor vitae risus porta vehicula.

Fusce mauris. Vestibulum luctus nibh at lectus. Sed bibendum, nulla a faucibus sem-per, leo velit
ultricies tellus, ac venenatis arcu wisi vel nisl. Vestibulum diam. Aliquampellentesque, augue quis
sagittis posuere, turpis lacus congue quam, in hendrerit risuseros eget felis. Maecenas eget erat in
sapien mattis porttitor. Vestibulum porttitor. Nulla facilisi. Sed a turpis eu lacus commodo
facilisis. Morbi fringilla, wisi in dignissiminterdum, justo lectus sagittis dui, et vehicula libero
dui cursus dui. Mauris temporligula sed lacus. Duis cursus enim ut augue. Cras ac magna. Cras nulla.
Nulla egestas. Curabitur a leo. Quisque egestas wisi eget nunc. Nam feugiat lacus vel est.
Curabiturconsectetuer.

Suspendisse vel felis. Ut lorem lorem, interdum eu, tincidunt sit amet, laoreet vitae, arcu. Aenean
faucibus pede eu ante. Praesent enim elit, rutrum at, molestie non, nonummy vel, nisl. Ut lectus
eros, malesuada sit amet, fermentum eu, sodales cursus, magna. Donec eu purus. Quisque vehicula,
urna sed ultricies auctor, pede lorem egestasdui, et convallis elit erat sed nulla. Donec luctus.
Curabitur et nunc. Aliquam dolorodio, commodo pretium, ultricies non, pharetra in, velit. Integer
\makenote{\vspace{-2\baselineskip}first line\\second line} arcu est, nonummy in, fermentum faucibus,
egestas vel, odio.

Sed commodo posuere pede. Mauris ut est. Ut quis purus. Sed ac odio. Sed vehiculahendrerit sem. Duis
non odio. Morbi ut dui. Sed accumsan risus eget odio. In hac habitasseplatea dictumst. Pellentesque
non elit. Fusce sed justo eu urna porta tincidunt. Mauris felisodio, sollicitudin sed, volutpat a,
ornare ac, erat. Morbi quis dolor. Donec pellentesque, eratac sagittis semper, nunc dui lobortis
purus, quis congue purus metus ultricies tellus. Proinet quam. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptoshymenaeos. Praesent sapien turpis, fermentum vel,
eleifend faucibus, vehicula eu, lacus.

\end{document}
9
  • put the text into something that can't break, e.g. \begin{tabular}{@{}l}first line\\second line\end{tabular} Commented Mar 4, 2021 at 9:18
  • @UlrikeFischer It's a nice workaround. It's just the behavior of KOMA-script in this case becomes unpredictable. Sometimes it leaves the whole comment on the first page, sometimes moves it to the second. So it requires manual tuning of each case individually. For the lack of anything else it will do at the final step of the editing. If reformatting occurs, all pages must be verified.
    – facetus
    Commented Mar 5, 2021 at 9:27
  • well the code simply splits the column, and it is as predicable as the way tex splits the main page. You could also try first line\\*second line. And perhaps one can add widowpenalty there. But in the end you always have to check page breaks if you want a good document, every automatism can go wrong. Commented Mar 5, 2021 at 9:36
  • What's wrong with following automatism: KOMA-script, please, always leave the whole note on the page where \makenote is, not just the first line?
    – facetus
    Commented Mar 5, 2021 at 16:42
  • the main point of scrlayer-notecolumn is to allow page breaks inside a note. If you don't want this, then using this package is pointless, then you can stick to \marginpar. Commented Mar 5, 2021 at 16:52

1 Answer 1

0

I found a workaround. You need to add this to your preamble:

\makeatletter
\ModifyLayer[
    contents = {%
        \textheight = 2\textheight%
        \slnc@processnotes{marginpar}%
      }
  ]{notecolumn.marginpar}
\makeatother

notecolumn uses \textheight to judge if it should split the note box. The above code temporarily makes \textheight 2 times larger, preventing splitting ever to happen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .