我想获得这样的东西:
到目前为止我有这个:
我的 MWE:
\documentclass[article]{memoir}
\usepackage{lipsum}
% Layout
\settrims{0pt}{0pt}
\settypeblocksize{562pt}{330pt}{*}
\setlrmargins{200pt}{*}{*}
\setulmargins{114pt}{*}{*}
\setheadfoot{12pt}{24pt}
\setheaderspaces{*}{24pt}{*}
\checkandfixthelayout
% Remove chapter number
\renewcommand*\printchapternum{}
% From p.96 - Memoir Manual
\newcommand{\marginbox}[1]{%
\parbox[t][0pt]{10em}{\upshape\sffamily\raggedright\mbox{} #1}}
\newcommand{\marginhead}[1]{%
{\llap{\marginbox{#1}\kern3em}}}
\setsecindent{0em}
\setaftersecskip{0em}
\setsecheadstyle{\marginhead}
\setaftersecskip{0em}
\setsechook{\setsecnumformat{\csname the##1\endcsname\ }}
\begin{document}
\chapter{Introduccion}
\section{Objeto}
\lipsum[4]
\section{Comitente}
\lipsum[4]
\end{document}
更新: 回忆录手册第 96 页上的选项是用于段落的。我将它们改为节。节号后面的行不是必需的,但我想获取节号、换行符和节标题,如第一张图片所示。
答案1
您即将到达:
\documentclass[article]{memoir}
\usepackage{lipsum}
% Layout
\settrims{0pt}{0pt}
\settypeblocksize{562pt}{330pt}{*}
\setlrmargins{200pt}{*}{*}
\setulmargins{114pt}{*}{*}
\setheadfoot{12pt}{24pt}
\setheaderspaces{*}{24pt}{*}
\checkandfixthelayout
% Remove chapter number
\renewcommand*\printchapternum{}
% From p.96 - Memoir Manual
\newcommand{\marginbox}[1]{%
\parbox[t][0pt]{10em}{%
\upshape\sffamily\raggedright\mbox{}#1}%
}
\newcommand{\marginhead}[1]{%
\smash{\raisebox{\baselineskip}{\llap{\marginbox{#1}\kern3em}}}%
}
\setsecindent{0em}
\setsecheadstyle{\marginhead}
\setbeforesecskip{1em}
\setaftersecskip{0em}
\setsechook{%
\setsecnumformat{\csname the##1\endcsname\enspace\par\nobreak}%
}
\begin{document}
\chapter{Introduccion}
\section{Objeto}
\lipsum[4]
\section{Comitente}
\lipsum[4]
\section{A test section with a longer title}
\lipsum[4]
\end{document}
规则如下:
\documentclass[article]{memoir}
\usepackage{lipsum}
\usepackage{tikzpagenodes}
\usetikzlibrary{tikzmark}
% Layout
\settrims{0pt}{0pt}
\settypeblocksize{562pt}{330pt}{*}
\setlrmargins{200pt}{*}{*}
\setulmargins{114pt}{*}{*}
\setheadfoot{12pt}{24pt}
\setheaderspaces{*}{24pt}{*}
\checkandfixthelayout
% Remove chapter number
\renewcommand*\printchapternum{}
% From p.96 - Memoir Manual
\newcommand{\marginbox}[1]{%
\parbox[t][0pt]{10em}{%
\upshape\sffamily\raggedright\mbox{}#1}%
}
\newcommand{\marginhead}[1]{%
\smash{\raisebox{\baselineskip}{\llap{\marginbox{#1}\kern3em}}}%
}
\newcounter{tmp}
\setsecindent{0em}
\setbeforesecskip{1em}
\setaftersecskip{0em}
\setsechook{\stepcounter{tmp}%
\setsecnumformat{\csname the##1\endcsname\enspace\tikzmark{\thetmp}\par\nobreak%
}\begin{tikzpicture}[remember picture,overlay]
\draw ([yshift=1ex]pic cs:\thetmp) -- ([yshift=1ex]current page text area.east|-{pic cs:\thetmp});
\end{tikzpicture}%
}
\setsecheadstyle{\marginhead}
\begin{document}
\chapter{Introduccion}
\section{Objeto}
\lipsum[4]
\section{Comitente}
\lipsum[4]
\section{A test section with a longer title}
\lipsum[4]
\end{document}
答案2
这是一个选项
它使用以下内容(我仅显示对您的 MWE 的更改):
% From p.96 - Memoir Manual
\newcommand{\marginbox}[1]{%
\parbox[t][0pt]{10em}{\upshape\sffamily\raggedright #1}}
%...
\setsechook{\setsecnumformat{\csname the##1\endcsname\par}}
另外一个选择:
% From p.96 - Memoir Manual
\newcommand{\marginbox}[1]{%
\parbox[b]{10em}{\upshape\sffamily\raggedright #1}}
%...
\setsechook{\setsecnumformat{\csname the##1\endcsname\par}}