我陷入了一个“新手”问题:
\documentclass[dvipsnames,a5paper,twoside,openright,italian,12pt]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{verse}
\usepackage{background}
\usepackage[object=vectorian]{pgfornament}
\ifpdf
\usepackage{pdfcolmk}
\fi
\usepackage{tikz}
\ifxetex
\usepackage{fontspec}
\fi
\DeclareRobustCommand\ltseries
{\not@math@alphabet\ltseries\relax
\fontseries\ltdefault\selectfont}
\newcommand{\ltdefault}{l}
\DeclareTextFontCommand{\textlt}{\ltseries}
\DeclareRobustCommand\hbseries
{\not@math@alphabet\hbseries\relax
\fontseries\hbdefault\selectfont}
\newcommand{\hbdefault}{hb}
\DeclareTextFontCommand{\texthb}{\hbseries}
\makeatother
\newcommand*{\FSfont}[1]{%
\fontencoding{T1}\fontfamily{#1}\selectfont}
\newcommand*{\labelit}[1]{\phantomsection\label{#1}}
\makeatletter
\newcommand*{\boxminipage}{%
\@ifnextchar [%]
\@ibxminipage
{\@iiibxminipage c\relax[s]}}
\def\@ibxminipage[#1]{%
\@ifnextchar [%]
{\@iibxminipage{#1}}%
{\@iiibxminipage{#1}\relax[s]}}
\def\@iibxminipage#1[#2]{%
\@ifnextchar [%]
{\@iiibxminipage{#1}{#2}}%
{\@iiibxminipage{#1}{#2}[#1]}}
\let\@bxminto\@empty
\def\@iiibxminipage#1#2[#3]#4{%
\ifx\relax#2\else
\setlength\@tempdimb{#2}%
\def\@bxminto{to\@tempdimb}%
\fi
\leavevmode
\@pboxswfalse
\if #1b\vbox
\else
\if #1t\vtop
\else
\ifmmode \vcenter
\else \@pboxswtrue $\vcenter
\fi
\fi
\fi
\bgroup
\hsize #4
\hrule\@height\fboxrule
\hbox\bgroup
\vrule\@width\fboxrule \hskip\fboxsep
\vbox \@bxminto
\bgroup
\vskip\fboxsep
\advance\hsize -2\fboxrule \advance\hsize -2\fboxsep
\textwidth\hsize \columnwidth\hsize
\@parboxrestore
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\let\@footnotetext\@mpfootnotetext
\let\@listdepth\@mplistdepth \@mplistdepth\z@
\@minipagerestore\@minipagetrue
\everypar{\global\@minipagefalse\everypar{}}}
\def\endboxminipage{%
\par\vskip-\lastskip
\ifvoid\@mpfootins\else
\vskip\skip\@mpfootins\footnoterule\unvbox\@mpfootins\fi
\vskip\fboxsep
\egroup
\hskip\fboxsep \vrule\@width\fboxrule
\egroup
\hrule\@height\fboxrule
\egroup
\if@pboxsw $\fi}
\makeatother
\newlength{\tpheight}\setlength{\tpheight}{0.9\textheight}
\newlength{\txtheight}\setlength{\txtheight}{0.9\tpheight}
\newlength{\tpwidth}\setlength{\tpwidth}{0.9\textwidth}
\newlength{\txtwidth}\setlength{\txtwidth}{0.9\tpwidth}
\newlength{\drop}
\newenvironment{showtitle}{%
\begin{boxminipage}[c][\tpheight]{\tpwidth}
\centering\begin{vplace}\begin{minipage}[c][\txtheight]{\txtwidth}}%
{\end{minipage}\end{vplace}\end{boxminipage}}
\newcommand{\editor}[1]{\def\@editor{#1}}
\author{Author}
\date{2016}
\title{BookTitle}
\editor{Editor}
\newcommand*{\titleRF}{\begingroup
\thispagestyle{empty}
\FSfont{5bo}
\drop = 0.2\txtheight
\centering
\vfill
{\Huge BookTitle}\\[\baselineskip]
{\large Author}\\[0.5\drop]
{\Large Ed. Editor}\par
{\large\scshape 2016}\par
\vfill\null
\endgroup}
\usetikzlibrary{calc}
\backgroundsetup{%
contents={\ifnum\value{page}=1 \else \eachpageornament \thepage\fi},%
position=current page.north east,%
firstpage=false,
angle=0,%
scale=1,%
opacity=0.5%
}
\newcommand{\eachpageornament}{%
\begin{tikzpicture}[remember picture, overlay,color=Brown]
\node[anchor=north west](CNW) at (current page.north west){%
\pgfornament[width=2cm]{61}};
\node[anchor=north east](CNE) at (current page.north east){%
\pgfornament[width=2cm,symmetry=v]{61}};
\node[anchor=south west](CSW) at (current page.south west){%
\pgfornament[width=2cm,symmetry=h]{61}};
\node[anchor=south east](CSE) at (current page.south east){%
\pgfornament[width=2cm,symmetry=c]{61}};
\pgfornamenthline{CNW}{CNE}{north}{87}
\pgfornamenthline{CSW}{CSE}{south}{87}
\pgfornamentvline{CNW}{CSW}{west}{87}
\pgfornamentvline{CNE}{CSE}{east}{87}
\end{tikzpicture}
}
\pagestyle{plain}
\renewcommand{\poemtitlefont}{\normalfont\large\itshape\centering}
\begin{document}
\begin{showtitle}
\titleRF
\end{showtitle}
\newpage
\tableofcontents
\include{Section1}
\include{Section1}
\include{Section2}
\end{document}
典型的“SectionX”文件:
\section*{SectionX}
\addcontentsline{toc}{section}{SectionX}
\poemtitle{Poem1}
\begin{verse}
row1 \\
row2
\end{verse}
除了生成之外,一切正常目录... 渲染结果没有我预期的偏移。结果如下:
Indice 2
Section1 3
Subsection1 4
虽然我期待着这样的事情:
Indice 2
Section1 3
Subsection1 4
诗包建议使用这个命令:
\renewcommand{\poemtoc}{subsection}%
但使用它只是“删除”子部分目录。
我面临的另一个问题是标题、索引和序言部分使用“罗马”页面符号...我尝试了几种方法,但总是发现第 1 页的背景被删除(这不是我需要的标题页)。
导致此类问题的指令是这样的:
contents={\ifnum\value{page}=1 \else \eachpageornament \thepage\fi},%
在\backgroundsetup
指令中。将“1”更改为“i”或“I”会导致编译错误。