Названия теорем на внешних полях (четные/нечетные страницы)

Названия теорем на внешних полях (четные/нечетные страницы)

Я бы хотел, чтобы в списке отображались метки теоремы / определения / и т. д.внешнийполя страницы (учитывая четные и нечетные страницы). Сначала я попытался использовать пакет 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}

Связанный контент