开发者

Undefined control sequence

开发者 https://www.devze.com 2022-12-27 05:06 出处:网络
I am making my Master\'s Thesis with LaTeX, but I can\'t get the provided style to work. Specifically, I get the error \'Undefined control sequence\' when using the function makeformaltitlepages, whic

I am making my Master's Thesis with LaTeX, but I can't get the provided style to work. Specifically, I get the error 'Undefined control sequence' when using the function makeformaltitlepages, which is defined in mscthesis.sty. On the internet, the only answer I could find is the straightforward 'you probably made a typo', or 'you probably forgot to include the package', but I have reason to believe neither of those apply to me.

In the preamble, I set several variables using macros defined in the style file, such as my name and the company information of the company that provided the assignment. After the beginning of the document, the function maket开发者_StackOverflow中文版itlepages is called from the style file, which creates several title pages matching the university style.

[edit]

After finding the solution, I now know where the error comes from. Below is a small style file and a small document that can be compiled to recreate the error. In a nutshell, I used includegraphics to include an image file whose filename contained a space.

example.sty:

\def\company#1{\gdef\@company{#1}}

\def\maketitlepages
{\begingroup
    \newpage
    \noindent
    \begin{center}
        \vskip 0em \rule{\textwidth}{1.5pt}
        \vskip 1em {\Huge \@title \par}
        \vskip 1em \rule{\textwidth}{1.5pt} \par \nobreak
        \vskip 4em {\large A DOCUMENT}
        \vskip 2em by
        \vskip 2em {\large \@author}
        \vfill
        \@company
    \end{center}
    \newpage
\endgroup}

document.tex:

\documentclass{article}
\usepackage{url}
\usepackage{example}
\usepackage[dvips]{graphicx}
\usepackage[dvips]{color}

\author{Your name}

\company{
  \includegraphics[width=4cm]{company logo.eps}\\
  A Company\\
  Addressline 1\\
  Addressline 2\\
  Country\\
  \url{www.acompany.com}
}

\title{Undefined control sequence}

\begin{document}

\pagestyle{empty}
\maketitlepages


Can we see the relevant part of mscthesis.sty? My (otherwise uninformed) guess is that's where the error is -- I suspect that when it defines \makeformaltitlepages, it uses that command.


What we need is a complete example showing the problem (i.e. starting with \documentclass{...} and going through to \end{document}). Quite possibly one of your "gibberish lines" are important. (This is probably better answered somewhere like The LaTeX Community forums.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号