在下面的範例中,如何在正文中隱藏聖經章節的第一節(或第 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
after的第一次使用\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}
...