.png)
날짜로 시작하는 섹션 유형에 대한 매크로를 만들고 싶습니다. 나는 여기까지 왔다:
\documentclass[a5paper, 11pt]{memoir}
\usepackage{ebgaramond}
\usepackage{lipsum}
\setsecheadstyle{\Large\scshape\memRTLraggedright}
\newcommand{\dateSection}[2]{\section*{#1}{\vspace{-1\baselineskip}\hfill \small #2}\noindent}
\begin{document}
\dateSection{Lorem ipsum}{Monday Mars 21}
\lipsum[1-2]
\end{document}
하지만 그 뒤에 들여쓰기가 생기고 \noindent
내가 추가한 내용이 도움이 되지 않습니다.
매크로에서 이 문제를 해결하려면 어떻게 해야 합니까?
답변1
들여쓰기 상자를 집어삼킬 다음 단락을 설정합니다.
\documentclass[a5paper, 11pt]{memoir}
\usepackage{ebgaramond}
\usepackage{lipsum}
\setsecheadstyle{\Large\scshape\memRTLraggedright}
\makeatletter
\newcommand{\dateSection}[2]{%
\section*{#1}%
{\vspace{-1\baselineskip}\hfill \small #2\par\nobreak}%
\@afterindentfalse % don't indent the next paragraph
\@afterheading % don't break pages too early
}
\makeatother
\begin{document}
\dateSection{Lorem ipsum}{Monday Mars 21}
\lipsum[1-2]
\end{document}
이렇게 하면 명령 뒤에 빈 줄이 있는지 여부는 관련이 없습니다 \dateSection
.
섹션 제목 및 날짜와 함께 다음 단락에는 최소한 두 줄이 있습니다.
답변2
\raisebox
매크로 정의에 추가 :
\documentclass[a5paper, 11pt]{memoir}
\usepackage{ebgaramond}
\usepackage{lipsum}
\setsecheadstyle{\Large\scshape\memRTLraggedright}
\newcommand{\dateSection}[2]{\section*{#1\hfill\raisebox{-0.6\baselineskip}[0pt][0pt]{\upshape\small#2}}}
\begin{document}
\dateSection{Lorem ipsum}{Monday Mars 21}
\lipsum[1-2]
\end{document}