我正在尝试使用以下代码来制作titlePM
格式的标题页。但以下代码不起作用。我该如何摆脱这个问题?
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{url}
\usepackage[svgnames]{xcolor}
\usepackage{pdfcolmk}
%% check if using xelatex rather than pdflatex
%%\usepackage{hyperref}
%% drawing package
\usepackage{tikz}
%% for dingbats
\usepackage{pifont}
\providecommand{\HUGE}{\Huge}% if not using memoir
\newlength{\drop}% for my convenience
%% specify the Webomints family
\newcommand*{\wb}[1]{\fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}}
%% select a (FontSite) font by its font family ID
\newcommand*{\FSfont}[1]{\fontencoding{T1}\fontfamily{#1}\selectfont}
%% if you don’t have the FontSite fonts either \renewcommand*{\FSfont}[1]{}
%% or use your own choice of family.
%% select a (TeX Font) font by its font family ID
\newcommand*{\TXfont}[1]{\fontencoding{T1}\fontfamily{#1}\selectfont}
%% Generic publisher’s logo
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}}
%% Some shades
%\defincolor{Dark}{gray}{0.2}
%\defincolor{MedDark}{gray}{0.4}
\defincolor{Medium}{gray}{0.6}
%\defincolor{Light}{gray}{0.8}
%%%% Additional font series macros
\makeatletter
%%%% light series
%% e.g., kernel doc, section s: line 12 or thereabouts
\DeclareRobustCommand\ltseries
{\not@math@alphabet\ltseries\relax
\fontseries\ltdefault\selectfont}
%% e.g., kernel doc, section t: line 32 or thereabouts
\newcommand{\ltdefault}{l}
%% e.g., kernel doc, section v: line 19 or thereabouts
\DeclareTextFontCommand{\textlt}{\ltseries}
% heavy(bold) series
\DeclareRobustCommand\hbseries
{\not@math@alphabet\hbseries\relax
\fontseries\hbdefault\selectfont}
\newcommand*{\titlePM}{\begingroup% \titleGM with Ornaments
\drop = 0.1\textheight
\vspace*{\baselineskip}
\vfill
\hbox{%
\hspace*{0.1\textwidth}%
{\wb{18pt}{18pt}
\begin{picture}(0,0)
\multiput(0,0)(0,20){22}{\textcolor{Medium}{Q}}
\end{picture}
}
% \rule{1pt}{\textheight}
\hspace*{0.15\textwidth}%
\parbox[b]{0.75\textwidth}{
\vbox{%
\vspace{\drop}
{\noindent\HUGE\bfseries Some\\[0.5\baselineskip]
Conundrums}\\[2\baselineskip]
{\Large\itshape Puzzles for the Mind}\\[4\baselineskip]
{\Large THE AUTHOR}\par
\vspace{0.5\textheight}
{\noindent The Publisher}\\[\baselineskip]
}}}% ends of vbox/parbox/hbox
\vfill
\null
\endgroup}
\begin{document}
\pagestyle{empty}
\titlePM
\clearpage
\end{document}
答案1
有两个主要错误。你有
\newcommand*{\wb}[1]{\fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}}
而且应该是
\newcommand*{\wb}[2]{\fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}}
(该命令有两个参数)。还有这个拼写错误:
\defincolor{Medium}{gray}{0.6}
应该缺少一个“e”:
\definecolor{Medium}{gray}{0.6}
(还有一些其他的\defincolor
拼写错误,但它们已被注释掉;请确保你纠正它们;否则,当你取消注释它们时,它们会引发错误)。
修复上述问题后的结果(使用 xelatex):