2

I have the following written in my permeable for my dedication page:

\newcommand{\dedicationpage}{
   \newpage \thispagestyle{plain} 
   \font\chan=pzcmi at 12pt
   \vspace*{\fill}
   \begin{center}
   \scshape 
   \chan \input{frontmatter/dedication}
   \vspace*{\fill} \newpage \rm
   \end{center}
}

And my dedication page has the following:

{\textbf{Dedicated \protect\\ to}}
\newline
\vspace{10mm}
{this is the first line \protect\\ and this is the second line}

And it turns out only "this is the first line and this is the second line" works in the designed font, but not the ”Dedicated to“ part. Could you help point out what the problem is here? Thanks!

Yvonne
  • 41
  • 1
    Whoever suggested you to use \font should be banished from using LaTeX. ;-) – egreg Dec 18 '16 at 17:22
  • i got it from here: http://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document. down at this page, there are a few lines of code.... – Yvonne Dec 18 '16 at 17:31
  • 1
    It is worth underlining that \textbf{} isn't like the little B button in Microsoft Word and does not, by default, fake bold. What it does is use the typeface that is specified as bold, so you have to use a font which has a bold version, or you must declare some other bold face for use by \textbf{}. – Au101 Dec 18 '16 at 17:32
  • That's code for Plain TeX, not for LaTeX. – egreg Dec 18 '16 at 17:33

1 Answers1

4

I don't know where you found out that code; but \font should never ever be used in a LaTeX document.

\documentclass{book}

\newcommand{\dedicationpage}{%
  \clearpage
  \thispagestyle{plain}% better empty
  \vspace*{\fill}
  \begin{center}
  \usefont{\encodingdefault}{pzc}{m}{n}
%  \input{frontmatter/dedication}
  %% here I insert directly the code
  Dedicated \\ to \\[10mm]
  this is the first line \\
  and this is the second line
  %%
  \end{center}
  \vspace*{\fill}
  \clearpage
}

\begin{document}

\dedicationpage

\end{document}

Here I type the text in the command definition just not having to create directories and files. Note that \textbf is meaningless in that context, because Zapf Chancery has no boldface version.

The input file, if you want to use it, should be

Dedicated \\ to \\[10mm]
this is the first line \\
and this is the second line

and, in this case, the definition would be

\newcommand{\dedicationpage}{%
  \clearpage
  \thispagestyle{plain}% better empty
  \vspace*{\fill}
  \begin{center}
  \usefont{\encodingdefault}{pzc}{m}{n}
  \input{frontmatter/dedication}
  \end{center}
  \vspace*{\fill}
  \clearpage
}

enter image description here

egreg
  • 1,121,712
  • i don't know why but when I copy your code and past in my file, I didn't get what you get, but just plain default font on my page... – Yvonne Dec 18 '16 at 17:40
  • @Yvonne Check for warning in the log file. What TeX distribution are you running? – egreg Dec 18 '16 at 17:41
  • overleaf online...I downloaded this thesis template from Harvard here: https://www.overleaf.com/latex/templates/tagged/harvard#.WFbMU7YrJPU – Yvonne Dec 18 '16 at 17:50
  • i just change your code "\usefont{\encodingdefault}{pzc}{m}{n}" into "\usefont{OT1}{pzc}{m}{n}", and it worked! – Yvonne Dec 18 '16 at 23:07