在以下示例中,我怎样才能在正文中隐藏圣经章节的第一节(或 1-2 节)的编号,而不在标题中隐藏它?(这是基于在这里。
\documentclass[12pt,openany,final]{memoir}
\usepackage{libertine}
\usepackage{xcolor}
\usepackage{lettrine}
\usepackage{lipsum}
%%% headers
\makeoddhead{headings}{\rightmark}{}{\thepage}
\makeevenhead{headings}{\thepage}{}{\leftmark}
%remove the marks set by \section.
\addtopsmarks{headings}{}{%
\renewcommand\sectionmark[1]{}
}
%%%%chapter format
\newcommand{\chaplabel}{}
\newcommand{\gnumChapters}{0}
\newcommand{\gChapter}[1]{\lettrine[lines=2,nindent=.5em,findent=0em]{{\textcolor{black}{#1}}}{}\markboth{\chaplabel\ #1:1}{\chaplabel\ #1:1}\renewcommand{\gnumChapters}{#1}}
%%%%verse format
\makeatletter
% define a 'smaller textsuperscript' macro
\DeclareRobustCommand*\textsmallsuperscript[1]{%
\@textsmallsuperscript{\selectfont#1}}
\def\@textsmallsuperscript#1{%
{\m@th\ensuremath{^{\mbox{\fontsize\ssf@size\z@#1}}}}}
\makeatletter
\newcommand{\gverse}[1]{{\textsmallsuperscript{#1}\hspace*{.1em}\ignorespaces\markboth{\chaplabel\ \gnumChapters:#1}{\chaplabel\gnumChapters:#1}}\ignorespaces}
\begin{document}
\gChapter{1}
\gverse{1-2}\lipsum[2]
\gverse{3}\lipsum[3]
\end{document}
答案1
一种方法是在宏中设置一个标志\gchapter
,然后测试检测第一次使用\gverse
之后\gchapter
。
注意,重置标志已完成外部你加倍了{{...}}
,\gverse
否则它只会影响标志的本地副本,这是行不通的!
...
%%%%chapter format
\newcommand{\chaplabel}{}
\newcommand{\gnumChapters}{0}
\newif\ifshowverseno
\newcommand{\gChapter}[1]{\showversenofalse\lettrine[lines=2,nindent=.5em,findent=0em]{{\textcolor{black}{#1}}}{}\markboth{\chaplabel\ #1:1}{\chaplabel\ #1:1}\renewcommand{\gnumChapters}{#1}}
%%%%verse format
\makeatletter
% define a 'smaller textsuperscript' macro
\DeclareRobustCommand*\textsmallsuperscript[1]{%
\@textsmallsuperscript{\selectfont#1}}
\def\@textsmallsuperscript#1{%
{\m@th\ensuremath{^{\mbox{\fontsize\ssf@size\z@#1}}}}}
\makeatletter
\newcommand{\gverse}[1]{{\ifshowverseno\textsmallsuperscript{#1}\hspace*{.1em}\ignorespaces \fi%
\markboth{\chaplabel\ \gnumChapters:#1}{\chaplabel\gnumChapters:#1}}\showversenotrue\ignorespaces}
\begin{document}
...