페이지 교대로 단락 번호 매기기

페이지 교대로 단락 번호 매기기

나는 현재 문단 번호를 매겨야 하는 논문을 준비 중입니다. 아래는 내 목적에 맞게 잘 작동합니다.

\documentclass[12pt, twoside]{book} 

\newcounter{chapcount}[chapter]
\newcounter{parnum}
\newlength{\parnumwidth}
\setlength{\parnumwidth}{4em}
\newcommand{\N}{%
\noindent\refstepcounter{chapcount}%
\makebox[0pt][r]{\makebox[\parnumwidth][l]{\textbf{\arabic{chapter}-
\arabic{chapcount}}}}%
\hspace*{\parindent}\ignorespaces}
\setlength{\parindent}{0em}

\begin{document}
\chapter{Introduction}
\N This is a numbered paragraph. 
\N This is another paragraph.
\end{document}

하지만 왼쪽 페이지의 왼쪽 여백과 오른쪽 페이지의 오른쪽 여백에 번호를 매기는 것이 가능한지 궁금합니다. 이는 교과서 등에서 상당히 일반적인 레이아웃입니다.

왼쪽 번호오른쪽 번호

답변1

\marginpar이 기능이 내장되어 있는 것을 사용할 수 있습니다 .

여기에 이미지 설명을 입력하세요

\documentclass[12pt, twoside]{book} 

\newcounter{chapcount}[chapter]
\renewcommand\thechapcount{\thechapter.\arabic{chapcount}}

\newcommand{\N}{%
\par
\noindent\refstepcounter{chapcount}%
\marginpar[\raggedleft \textbf{\thechapcount}]{\raggedright \textbf{\thechapcount}}}

\setlength{\parindent}{0em}

\begin{document}
\chapter{Introduction}
\N This is a numbered paragraph. 
\N This is another paragraph.


\clearpage

\N This is a numbered paragraph. 
\N This is another paragraph.


\end{document}

관련 정보