Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

first of all sorry if the question seems repetitive: I have tried to find a solution in previously asked questions but none of the hints provided seems to work for me.

Here is my situation. I am writing a new class to typeset my thesis (and hopefully help other students who would like to use LaTeX instead of Hangul) by customizing the memoir package.

Everything ran smoothly until I became stuck in this: I have a number of custom commands that define variables which are then output by the command \prelims (see code below).

\newcommand*{\supervisor}[1]{\gdef\KNUsupervisor{#1}}
\newcommand*{\department}[1]{\gdef\KNUdepartment{#1}}
\newcommand*{\major}[1]{\gdef\KNUmajor{#1}}
\newcommand*{\degree}[1]{\gdef\KNUdegree{#1}}

%%% \asbtractEN
\newcommand*{\abstractEN}[1]
{
  \gdef\KNUabstractEN
  {
    {
      \begin{center}
      \@title
      \vspace{1em}

      \@author
      \vspace{1em}

      School of \KNUdepartment \\
      Major in \KNUmajor \\
      The Graduate School \\
      (Supervised by Professor \KNUsupervisor)
      \end{center}
      \vspace{2em}

      (Abstract)
      \vspace{1em}

     \mbox{#1}
    }
  }
}

\newcommand{\prelims}{
\frontmatter
\tableofcontents \newpage
\listoffigures \newpage
\listoftables \newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Abstract}
\KNUabstractEN

\mainmatter
\setcounter{secnumdepth}{2}
}

My problem is that when specifying an abstract consisting of multiple paragraphs, such as

\abstractEN{
Par1

Par2
}

the compiler kindly spits at me with the "usual" Paragraph ended before \abstractEN was complete.

I have tried putting the argument in a separate block, in a box, and even in a minipage, but the error persists.

Any helpful soul around?

P.S. Any errors in English in the abstract command are strictly required by our University's template -.-

share|improve this question
3  
Remove the * from \newcommand*{\abstractEN}. See What's the difference between \newcommand and \newcommand*? –  cyberSingularity Dec 3 '12 at 12:58
    
Oh my... can't believe I didn't spot it. Thanks, and please post the comment as an answer so that I can upvote it. –  NeXuS Dec 3 '12 at 13:02
    
This also teaches a lesson: too much copy and paste ruins your life! :) –  NeXuS Dec 3 '12 at 13:04
    
You also need \long before your \gdef –  Andrew Swann Dec 3 '12 at 13:06
    
@NeXuS: I have added an answer. And welcome to TeX.SX! –  cyberSingularity Dec 3 '12 at 13:18

1 Answer 1

In TeX terminology, this is because your commands are not defined as \long so do not permit paragraph breaks in their arguments, because you have defined them with \newcommand* instead of \newcommand.

If using \def and variants to define commands that take arguments (and want them to accept paragraph breaks also), one needs to use the \long prefix. Andrew Swann pointed out that you use \gdef so should be aware of this, but none of the commands defined with \gdef in your example appear to take arguments, so do not require this.

Solution: Remove the * from \newcommand*{\abstractEN}.

See What's the difference between \newcommand and \newcommand*? The answers to that question explain why the non-\long form can be useful.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.