I thought my previous problem on placing names, numbers and notes of theorems in the margin column had been solved.
In fact, the code proposed in my answer works as expected:
\documentclass[fontsize=11pt, paper=a4, DIV=classic]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xpatch}
\usepackage{ragged2e}
\usepackage{changepage}
\usepackage{blindtext}
\KOMAoption{mpinclude}{true}
\recalctypearea
\setlength{\marginparsep}{2em}
\setlength{\marginparwidth}{10em}
\makeatletter
\newcommand{\RaggedOuter}%
{%
\if@twoside%
\checkoddpage%
\ifoddpage%
\RaggedRight%
\else%
\RaggedLeft%
\fi%
\else%
\RaggedRight%
\fi%
}
\newcommand{\cl@ThmMarginCaption}%
{
\leavevmode%
\marginpar%
{%
\RaggedOuter%
\hbadness=10000%
\the\thm@headfont\thmt@thmname~\thechapter.\arabic{\thmt@envname}\\%
\the\thm@notefont\thmt@optarg%
}%
}
\declaretheoremstyle%
[%
spaceabove={\parskip},%
spacebelow=0pt,%
headindent=0pt,%
postheadspace=0pt,%
headformat={},%
headpunct={},%
headfont=\sffamily\bfseries\small,%
notefont=\rmfamily\mdseries\small,%
bodyfont=\normalfont,%
preheadhook={},%
postheadhook={\cl@ThmMarginCaption},%
]%
{thmmcaption}
\newcommand{\DeclareTheorem}[2][]%
{%
\declaretheorem[#1]{#2}%
\expandafter\let\csname cl@orig@#2\expandafter\endcsname\csname#2\endcsname%
\expandafter\let\csname cl@orig@end#2\expandafter\endcsname\csname end#2\endcsname%
\renewenvironment{#2}[1][]%
{\csname cl@orig@#2\endcsname[##1]\ignorespaces}%
{\csname cl@orig@end#2\endcsname}%
}
\DeclareTheorem[name=Definition, numberwithin=chapter, style=thmmcaption]{definition}
\DeclareTheorem[name=Satz, numberwithin=chapter, style=thmmcaption]{theorem}
\makeatother
\begin{document}
\chapter{Theorems with margin captions}
\blindtext
\begin{definition}[Kellerautomat (KA)\\pushdown automaton (PDA)]
Eine ganz wichtige Definition, die natürlich länger als eine Zeile sein sollte, um sehen zu können, ob alles funktioniert wie gewünscht.
\end{definition}
\blindtext
\clearpage
\blindtext
\begin{theorem}[Satz von Radó]
Die Radó-Funktion ist nicht berechenbar.
\end{theorem}
\blindtext
\end{document}
The margin note containing the theorem information is placed at the desired position.
As soon as I started mixing this solution with other code, the option strict for package changepage became mandatory. Using this option, the margin note gets shifted down, as you can see here.
Adding % at the end of each line of changepage.sty when it was not present did not help at all.
Why does the option strict have an effect on my definition of \RaggedOuter?


%here!\hbadness=10000%or if you must, use\hbadness=10000 %` – David Carlisle Nov 02 '17 at 20:57%character. The vertical shift of the margin note, however, remains unchanged. – Matthias Nov 02 '17 at 21:01