我插入了一个章节目录作为边注。
有没有办法将边注和章节标题对齐?我尝试按照建议在章节标题中插入边注定义这里,但它似乎干扰了目录并且文件无法编译。
梅威瑟:
\documentclass[a4paper, 10pt, oneside]{memoir}
% Page layout
\setlrmarginsandblock{1.7cm}{8.5cm}{*}
\setulmarginsandblock{1.7cm}{2.5cm}{*}
\setmarginnotes{0.5cm}{\dimexpr(\stockwidth-\textwidth-4.4cm)}{1em}
\checkandfixthelayout
\chapterstyle{bianchi}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{marginnote}
\newcommand{\chaptoc}{
\startcontents[chapters]
\marginnote{
{
\large
\bfseries
\sffamily
OUTLINE
}
\vspace{0.5em}
\hrule
\printcontents[chapters]{}{1}[1]{}
\hrule
}}
\begin{document}
\chapter{Example Chapter}
{\chaptoc\section{Example Section}}
\lipsum
\section{Example Section II}
\lipsum
\subsection{Example Subsection}
\lipsum
{\chaptoc\chapter{Example Chapter}}
\section{Example Section III}
\lipsum
\section{Example Section IV}
\lipsum
\subsection{Example Subsection}
\lipsum
\end{document}
谢谢你!
答案1
以下是对齐的一种方法minipage
:
\documentclass[a4paper, 10pt, oneside]{memoir}
% Page layout
\setlrmarginsandblock{1.7cm}{8.5cm}{*}
\setulmarginsandblock{1.7cm}{2.5cm}{*}
\setmarginnotes{0.5cm}{\dimexpr(\stockwidth-\textwidth-4.4cm)}{1em}
\checkandfixthelayout
\chapterstyle{bianchi}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{marginnote}
\newcommand{\chaptoc}{
\startcontents[chapters]
\marginnote{
\begin{minipage}[b,inner sep=0,outer sep=0]{\linewidth}
{ \large
\bfseries
\sffamily
OUTLINE
}
\vspace{0.5em}
\hrule
\printcontents[chapters]{}{1}{}
\hrule
\end{minipage}
}}
\begin{document}
\chapter{Example Chapter}
{\chaptoc\noindent\begin{minipage}[inner sep=0,outer sep=0]{0.9\linewidth}\section{Example Section}\end{minipage}}
\lipsum
\section{Example Section II}
\lipsum
\subsection{Example Subsection}
\lipsum
{\chaptoc\chapter{Example Chapter}}
\section{Example Section III}
\lipsum
\section{Example Section IV}
\lipsum
\subsection{Example Subsection}
\lipsum
\end{document}