Me gustaría que las etiquetas de teorema/definición/etc. aparecieran en elexteriormargen de página (teniendo en cuenta las páginas pares e impares). Primero, intenté usar el thmtools
paquete (código e imagen a continuación). Sin embargo, sólo logré colocar la etiqueta siempre en el margen izquierdo. En particular, no tengo idea de cómo thmtools
combinarlo ifoddpage
.
A continuación, lo intenté ntheorem
(código e imagen a continuación). Con ntheorem
, la ubicación de la etiqueta funcionó como debería, pero no pude cambiar el estilo de fuente del título del teorema ("Algún teorema importante" en las imágenes a continuación) y colocarlo en una línea propia. Además, no pude deshacerme de la sangría. Finalmente, también rompió mis autoref
referencias.
Aresumir: Lo que estoy buscando es un entorno de teoremas que permita
- etiquetas enexteriormárgenes de página (páginas pares/impares)
- control total de estilo para etiquetas, título y cuerpo
autoref
compatibilidad (en particular, me gustaría usar un único contador para diferentes entornos de teoremas, como teorema, definición, etc.)
Estoy a punto de rendirme, así que realmente espero que alguien pueda ayudarme con esto.
Código para 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}
Código para 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}
Respuesta1
Continué buscando una respuesta y lo siguiente funcionó para mí (pensé que lo había probado antes y no compiló...):
\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}