![Theoremtitel in den Außenrändern (gerade / ungerade Seiten)](https://rvso.com/image/391714/Theoremtitel%20in%20den%20Au%C3%9Fenr%C3%A4ndern%20(gerade%20%2F%20ungerade%20Seiten).png)
Ich möchte, dass die Beschriftungen für Theoreme/Definitionen/usw. in deräußereSeitenrand (unter Berücksichtigung gerader und ungerader Seiten). Zuerst habe ich versucht, das Paket zu verwenden (Code und Bild unten). Ich habe es jedoch nur geschafft, das Etikett immer im linken Rand zu platzieren. Insbesondere habe ich keine Ahnung, wie ich es mit thmtools
kombinieren kann .thmtools
ifoddpage
Als nächstes habe ich Folgendes versucht ntheorem
(Code und Bild unten). Mit ntheorem
funktionierte die Platzierung der Beschriftung wie vorgesehen, aber ich konnte den Schriftstil des Titels des Theorems („Some Important Theorem“ in den Bildern unten) nicht ändern und ihn in eine eigene Zeile setzen. Außerdem konnte ich die Einrückung nicht entfernen. Schließlich wurden dadurch auch meine autoref
Referenzen beschädigt.
Zuzusammenfassen: Was ich suche, ist eine Theoremumgebung, die es erlaubt
- Etiketten inäußereSeitenränder (ungerade / gerade Seiten)
- volle Kontrolle über das Styling von Beschriftungen, Titeln und Text
autoref
Kompatibilität (insbesondere möchte ich einen einzigen Zähler für verschiedene Theoremumgebungen wie Theorem, Definition usw. verwenden)
Ich bin kurz davor aufzugeben und hoffe wirklich, dass mir jemand dabei helfen kann.
Code für thmtools
:
\documentclass[10pt, a4paper, twoside]{article}
\usepackage[a4paper, inner=1.25in, outer=1.25in]{geometry}
\usepackage{color}
\usepackage{amsthm}
\usepackage{thmtools}
\newlength{\spaceblength}
\settowidth{\spaceblength}{\bfseries\ }
\declaretheoremstyle[
headfont=\bfseries,
notefont=\bfseries,
notebraces={}{\\[\parskip]}, % Braces for additional text
bodyfont=\normalfont\itshape,
headpunct={},
headformat={%
\makebox[0pt][r]{\color{red}\NAME\ \NUMBER\ \ }\hskip-\spaceblength{\NOTE}%
}
]{boxstyle}
\declaretheorem[style=boxstyle,numberwithin=section]{theorem}
\begin{document}
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\newpage
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\end{document}
Code für ntheorem
:
\documentclass[10pt, a4paper, twoside]{article}
\usepackage[a4paper, inner=1.25in, outer=1.25in]{geometry}
\usepackage{color}
\usepackage{ifoddpage}
\usepackage{ntheorem}
\makeatletter%
\newtheoremstyle{nonumoutermargin}%
{\item[\checkoddpage\ifoddpageoroneside\rlap{\hskip\linewidth\theorem@headerfont {\hskip18pt##1}}%
\else\llap{\theorem@headerfont{##1}\hskip6pt}\fi]}%
{\item[\checkoddpage\ifoddpageoroneside\rlap{\hskip\linewidth\theorem@headerfont {\hskip18pt##1}}%
\else\llap{\theorem@headerfont{##1}\hskip6pt}\fi##3]}
\newtheoremstyle{outermargin}%
{\item[\checkoddpage\ifoddpageoroneside\rlap{\hskip\linewidth\theorem@headerfont {\hskip18pt##1\hskip\labelsep##2}}%
\else\llap{\theorem@headerfont{##1\hskip\labelsep##2}\hskip6pt}\fi]}%
{\item[\checkoddpage\ifoddpageoroneside\rlap{\hskip\linewidth\theorem@headerfont{\hskip18pt##1\hskip\labelsep##2}}%
\else\llap{\theorem@headerfont{##1\hskip\labelsep##2}\hskip6pt}\fi##3]}
\makeatother
\theoremindent=0pt
\theoremheaderfont{\upshape\bfseries\color{red}}
\theoremstyle{outermargin}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\newpage
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\end{document}
Antwort1
Ich habe weiter nach einer Antwort gesucht und das Folgende hat bei mir funktioniert (ich dachte, ich hätte das schon einmal probiert und es wurde nicht kompiliert ...):
\documentclass[10pt, a4paper, twoside]{article}
\usepackage[a4paper, inner=1.25in, outer=1.25in]{geometry}
\usepackage{color}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{ifoddpage}
\newlength{\spaceblength}
\settowidth{\spaceblength}{\bfseries\ }
\declaretheoremstyle[
headfont=\bfseries,
notefont=\bfseries,
notebraces={}{\\[\parskip]}, % Braces for additional text
bodyfont=\normalfont\itshape,
headpunct={},
headformat={%
\checkoddpage\ifoddpage\rlap{\hskip\textwidth\color{red}\ \ \ \NAME\ \NUMBER}\hskip-\spaceblength{\NOTE}%
\else\makebox[0pt][r]{\color{red}\NAME\ \NUMBER\ \ \ }\hskip-\spaceblength{\NOTE}\fi%
},
]{boxstyle}
\declaretheorem[style=boxstyle,numberwithin=section]{theorem}
\begin{document}
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\newpage
\begin{theorem}[Some Important Theorem]
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
This is a theorem. This is a theorem. This is a theorem. This is a theorem. This is a theorem.
\end{theorem}
\end{document}