![바깥쪽 여백에 정리 제목(짝수/홀수 페이지)](https://rvso.com/image/391714/%EB%B0%94%EA%B9%A5%EC%AA%BD%20%EC%97%AC%EB%B0%B1%EC%97%90%20%EC%A0%95%EB%A6%AC%20%EC%A0%9C%EB%AA%A9(%EC%A7%9D%EC%88%98%2F%ED%99%80%EC%88%98%20%ED%8E%98%EC%9D%B4%EC%A7%80).png)
정리/정의/등의 라벨을밖의페이지 여백(짝수 및 홀수 페이지 고려) 먼저 thmtools
패키지(아래 코드 및 이미지)를 사용해 보았습니다 . 하지만 라벨은 항상 왼쪽 여백에만 배치할 수 있었습니다. 특히 thmtools
.ifoddpage
다음으로 시도해 보았습니다 ntheorem
(아래 코드 및 이미지). 를 사용하면 ntheorem
레이블 배치가 제대로 작동했지만 정리 제목(아래 이미지의 "중요한 정리")의 글꼴 스타일을 변경하여 자체 줄에 배치할 수 없었습니다. 게다가 들여쓰기를 없앨 수도 없었습니다. 마지막으로 내 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}