![Названия теорем на внешних полях (четные/нечетные страницы)](https://rvso.com/image/391714/%D0%9D%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F%20%D1%82%D0%B5%D0%BE%D1%80%D0%B5%D0%BC%20%D0%BD%D0%B0%20%D0%B2%D0%BD%D0%B5%D1%88%D0%BD%D0%B8%D1%85%20%D0%BF%D0%BE%D0%BB%D1%8F%D1%85%20(%D1%87%D0%B5%D1%82%D0%BD%D1%8B%D0%B5%2F%D0%BD%D0%B5%D1%87%D0%B5%D1%82%D0%BD%D1%8B%D0%B5%20%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D1%8B).png)
Я бы хотел, чтобы в списке отображались метки теоремы / определения / и т. д.внешнийполя страницы (учитывая четные и нечетные страницы). Сначала я попытался использовать пакет thmtools
(код и изображение ниже). Однако мне удалось разместить метку только на левом поле. В частности, я понятия не имею, как объединить thmtools
с ifoddpage
.
Далее я попробовал ntheorem
(код и изображение ниже). С ntheorem
, размещение метки работало как надо, но я не смог изменить стиль шрифта заголовка теоремы («Some Important Theorem» на изображениях ниже) и поместить его на отдельную строку. Кроме того, я не смог избавиться от отступа. Наконец, это также сломало мои autoref
ссылки.
Кподведем итог: Я ищу среду для работы с теоремами, которая позволяет
- этикетки ввнешнийполя страницы (четные/нечетные страницы)
- полный контроль над стилем меток, заголовка и текста
autoref
совместимость (в частности, я хотел бы использовать один счетчик для различных сред теорем, таких как Теорема, Определение и т. д.)
Я уже почти сдаюсь, поэтому очень надеюсь, что кто-нибудь мне поможет.
Код для 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}
Код для 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}
решение1
Я продолжил искать ответ, и следующее мне помогло (я думал, что уже пробовал это раньше, но оно не скомпилировалось...):
\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}