建立一個完全模仿回憶錄的section*指令且前面沒有空格的新指令?

建立一個完全模仿回憶錄的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*類似\section*但沒有前置空格的新指令?我不想意外更改其他指令的\section格式\section*

答案1

不確定這是否是您想要的,但根據對問題的評論,我提供了這個答案;\qrr定義如下\sectionmemoir.cls唯一的變化是0pt標題之前的空格和6等級):

\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}

在此輸入影像描述

相關內容