앞에 공백 없이 memoir의 section* 명령을 정확하게 모방하는 새 명령을 만드시겠습니까?

앞에 공백 없이 memoir의 section* 명령을 정확하게 모방하는 새 명령을 만드시겠습니까?

나는 사용하고 memoir있으며 현재 \section*명령은 내가 원하는 모든 것을 수행합니다. 단, 어떤 경우에는 그 앞에 공백이 필요하지 않습니다.

\documentclass[12pt]{memoir}
\begin{document}
\section{No Space, top of page}
\section*{Space}
\section*{No space above here, please}
\end{document}

간격이 있는 예

앞에 공백이 없지만 \qrr*비슷한 새 명령을 어떻게 만들 수 있습니까 ? 실수로 other 및 명령 \section*의 형식을 변경하고 싶지 않습니다 .\section\section*

답변1

이것이 당신이 원하는 것인지 확실하지 않지만 질문에 대한 의견을 바탕으로 이 답변을 제공합니다. 다음 과 \qrr같이 정의됩니다 (유일한 변경 사항은 제목 앞의 공간과 레벨에 대한 것입니다).\sectionmemoir.cls0pt6

\documentclass{memoir}
\usepackage{lipsum}
\usepackage{mdframed}

\makeatletter
\newcommand{\qrr}{%
  \sechook%
  \@startsection{section}{6}%  level 1
      {\secindent}%            heading indent
      {0pt}%        skip before the heading
      {\aftersecskip}%         skip after the heading
      {\normalfont\secheadstyle}} % font
\makeatother

\begin{document}
\section{No Space, top of page}
\lipsum[4]
\section*{Space}
\lipsum[4]
\begin{mdframed}
\qrr*{No space above here, please}
\lipsum[4]
\end{mdframed}

\end{document}

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

관련 정보