我想知道如何将 titlepage 包与 memoir 包一起使用。我想知道我做错了什么。
该代码来自 titlepages.pdf 第 48-49 页的 \titleHGP
\documentclass[a4paper, 11pt, openright]{memoir}
\usepackage{titlepages}
\newcommand*{\titleHGP}{\begingroup% Handy Guide to Papermaking
\drop=0.1\txtheight
\begin{minipage}[t]{0.05\txtwidth}
\color{Red}
\rule{6pt}{\txtheight}
\end{minipage}
\hspace{0.05\txtwidth}
\begin{minipage}[t]{0.6\txtwidth}
\vspace*{\drop}
{\Large THE AUTHOR} \\
\rule{0.9\txtwidth}{1pt} \par
\vspace{3\baselineskip}
{\noindent\Huge\bfseries CONUNDRUMS} \par
\vspace{2\baselineskip}
{\Large\itshape A Handy Guide to Puzzles and Enigmas} \par
\vspace{6.5\baselineskip}
{\scshape after the foreign edition of year \\
translated by} \par
\vspace{0.1\baselineskip}
{\Large THE TRANSLATOR} \par
\vspace{\baselineskip}
\rule{0.9\txtwidth}{1pt} \par
\vspace{\baselineskip}
{\Large THE PUBLISHER}
\end{minipage}
\hfill
\begin{minipage}[t]{0.15\txtwidth}
{\color{Red}
\FSfont{5fh}% FontSite Fette Gotisch
\HUGE
\vspace{3.3\baselineskip}
H \\[1.15\baselineskip]
G \\[1.15\baselineskip]
P \\[1.15\baselineskip]
E
}\par
\vspace{4\baselineskip}
{\Large YEAR}
\end{minipage}
\endgroup}
\pagestyle{empty}
\begin{document}
\titleHGP
\end{document}
答案1
titlepages
CTAN 上的并不是一个包;它只是其他人所做工作的展示。
它提供了其他人使用的代码。不幸的是,它把这些代码断章取义了,并没有告诉你最初创建标题页的人使用了哪些软件包、页面几何形状等。你或多或少得需要自己弄清楚这些事情。
为了重现这个特定的样本,我必须定义一些额外的长度,根据 a4 的回忆录使用更大的页面这一事实进行缩放,并且我必须下载字体ds-fette-gotisch.ttf 来自这里。由于这是 truetype 字体,因此要使用它,我必须加载 fontspec 包,这意味着您必须使用 xelatex 而不是 pdflatex 来编译此代码。但您可以修改它以使用其他黑体字体。有关选项,请参阅LaTeX 字体目录。
我做了一些其他的小修改,试图与原版相匹配。
%xelatex
\documentclass[a4paper, 11pt, openright]{memoir}
\usepackage[dvipsnames]{xcolor}
\newlength{\drop}
\newlength{\txtwidth}
\setlength{\txtwidth}{0.95\textwidth}
\newlength{\txtheight}
\setlength{\txtheight}{0.95\textheight}
\usepackage{fontspec}
\newcommand{\FSfont}[1]{\fontspec[Extension=.ttf,Scale=1.6]{ds-fette-gotisch.regular}}
\newcommand*{\titleHGP}{\begingroup% Handy Guide to Papermaking
\drop=0.1\txtheight
\noindent\begin{minipage}[t]{0.05\txtwidth}
\color{Red}
\rule{6pt}{\txtheight}
\end{minipage}
\hspace{0.05\txtwidth}
\begin{minipage}[t]{0.6\txtwidth}
\vspace*{\drop}
{\Large THE AUTHOR} \\
\rule{0.9\txtwidth}{1pt} \par
\vspace{3\baselineskip}
{\noindent\Huge\bfseries CONUNDRUMS} \par
\vspace{2\baselineskip}\raggedright
{\Large\itshape A Handy Guide to Puzzles and Enigmas} \par
\vspace{6.5\baselineskip}
{\scshape\fontsize{14pt}{16pt}\selectfont after the foreign edition of year \\
translated by} \par
\vspace{0.2\baselineskip}
{\Large THE TRANSLATOR} \par
\vspace{\baselineskip}
\rule{0.9\txtwidth}{1pt} \par
\vspace{\baselineskip}
{\Large THE PUBLISHER}
\end{minipage}
%\hfill
\hspace{0.6in}
\begin{minipage}[t]{0.15\txtwidth}
{\color{Red}
\FSfont{5fh}% FontSite Fette Gotisch
\HUGE
\vspace{3.9\baselineskip}
H \\[1.15\baselineskip]
G \\[1.15\baselineskip]
P \\[1.15\baselineskip]
E
}\par
\vspace{4\baselineskip}
{\Large YEAR}
\end{minipage}
\endgroup}
\pagestyle{empty}
\begin{document}
\titleHGP
\end{document}
如果您想尝试重新创建另一个示例,请告诉我们。
答案2
titlepages 不是一个包,而是一个示例文档。如果您想使用它定义的其中一个 titlepages,您还必须从文档中复制所有需要的定义。例如
\documentclass[a4paper, 11pt, openright]{memoir}
\usepackage[svgnames]{xcolor}
\newcommand*{\FSfont}[1]{%
\fontencoding{T1}\fontfamily{#1}\selectfont}
\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}
\newcommand*{\titleHGP}{\begingroup% Handy Guide to Papermaking
\drop=0.1\txtheight
\begin{minipage}[t]{0.05\txtwidth}
\color{Red}
\rule{6pt}{\txtheight}
\end{minipage}
\hspace{0.05\txtwidth}
\begin{minipage}[t]{0.6\txtwidth}
\vspace*{\drop}
{\Large THE AUTHOR} \\
\rule{0.9\txtwidth}{1pt} \par
\vspace{3\baselineskip}
{\noindent\Huge\bfseries CONUNDRUMS} \par
\vspace{2\baselineskip}
{\Large\itshape A Handy Guide to Puzzles and Enigmas} \par
\vspace{6.5\baselineskip}
{\scshape after the foreign edition of year \\
translated by} \par
\vspace{0.1\baselineskip}
{\Large THE TRANSLATOR} \par
\vspace{\baselineskip}
\rule{0.9\txtwidth}{1pt} \par
\vspace{\baselineskip}
{\Large THE PUBLISHER}
\end{minipage}
\hfill
\begin{minipage}[t]{0.15\txtwidth}
{\color{Red}
\FSfont{5fh}% FontSite Fette Gotisch
\HUGE
\vspace{3.3\baselineskip}
H \\[1.15\baselineskip]
G \\[1.15\baselineskip]
P \\[1.15\baselineskip]
E
}\par
\vspace{4\baselineskip}
{\Large YEAR}
\end{minipage}
\endgroup}
\pagestyle{empty}
\begin{document}
\titleHGP
\end{document}
答案3
这至少可以编译。它看起来不太正确,但它看起来与titlepages.tex
在现代 LaTeX 上编译时相同,并且记得重新定义,\FSfont
因为它引用了商业内容。
\documentclass{memoir}
\usepackage[T1]{fontenc}
\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}
\usepackage{xcolor}
\colorlet{Red}{red}
\newcommand*{\FSfont}[1]{}
\pagestyle{empty}
\begin{document}
\begin{titlingpage}
\drop=0.1\txtheight
\begin{minipage}[t]{0.05\txtwidth}
\color{Red}
\rule{6pt}{\txtheight}
\end{minipage}
\hspace{0.05\txtwidth}
\begin{minipage}[t]{0.6\txtwidth}
\vspace*{\drop}
{\Large THE AUTHOR} \\
\rule{0.9\txtwidth}{1pt} \par
\vspace{3\baselineskip}
{\noindent\Huge\bfseries CONUNDRUMS} \par
\vspace{2\baselineskip}
{\Large\itshape A Handy Guide to Puzzles and Enigmas} \par
\vspace{6.5\baselineskip}
{\scshape after the foreign edition of year \\
translated by} \par
\vspace{0.1\baselineskip}
{\Large THE TRANSLATOR} \par
\vspace{\baselineskip}
\rule{0.9\txtwidth}{1pt} \par
\vspace{\baselineskip}
{\Large THE PUBLISHER}
\end{minipage}
\hfill
\begin{minipage}[t]{0.15\txtwidth}
{\color{Red}
\FSfont{5fh}% FontSite Fette Gotisch
\HUGE
\vspace{3.3\baselineskip}
H \\[1.15\baselineskip]
G \\[1.15\baselineskip]
P \\[1.15\baselineskip]
E
}\par
\vspace{4\baselineskip}
{\Large YEAR}
\end{minipage}
\end{titlingpage}
\end{document}