The memman
(memoir manual) says on pages 63/64
The class provides a configurable \maketitle command. The \maketitle command
as defined by the class is essentially
\newcommand{\maketitle}{%
\vspace*{\droptitle}
\maketitlehooka
{\pretitle \title \posttitle}
\maketitlehookb
{\preauthor \author \postauthor}
\maketitlehookc
{\predate \date \postdate}
\maketitlehookd
\thispagestyle{title}
}
However, the real code in memoir.cls
is
\newcommand{\@maketitle}{%
\let\footnote\@mem@titlefootkill
\ifdim\pagetotal>\z@
\newpage
\fi
\null
\vskip 2em%
\vspace*{\droptitle}
\maketitlehooka
{\@bspretitle \@title \@bsposttitle}
\maketitlehookb
{\@bspreauthor \@author \@bspostauthor}
\maketitlehookc
{\@bspredate \@date \@bspostdate}
\maketitlehookd
\par
\vskip 1.5em}
where \@maketitle
is actually called inside \maketitle
.
In fact, \@bspretitle
etc. are used, not \pretitle
etc, which have similar definitions:
\newcommand{\pretitle}[1]{\def\@bspretitle{#1}}
\newcommand{\posttitle}[1]{\def\@bsposttitle{#1}}
\newcommand{\preauthor}[1]{\def\@bspreauthor{#1}}
\newcommand{\postauthor}[1]{\def\@bspostauthor{#1}}
\newcommand{\predate}[1]{\def\@bspredate{#1}}
\newcommand{\postdate}[1]{\def\@bspostdate{#1}}
Now, \pretitle
etc. are macros that use one argument, inside they define something like \@bspretitle
, so \pretitle
etc. can't be used directly without an argument.
Basically, it is sufficient to use \pretitle{something}\posttitle{other thing}
, but this must be handled we care, see for example (also on page 64 of the manual) the default definitions in memoir
are
\pretitle{\begin{center}\LARGE}
\posttitle{\par\end{center}\vskip 0.5em}
\preauthor{\begin{center}
\large \lineskip 0.5em%
\begin{tabular}[t]{c}}
\postauthor{\end{tabular}\par\end{center}}
\predate{\begin{center}\large}
\postdate{\par\end{center}}
where \posttitle{foo}
without adjusting \pretitle
would leave an error, since \pretitle
is defined as \begin{center}
basically, so there would be an unclose center
environment, causing compilation errors.
This code defines a group begun in \pretitle
, with \bfseries
and an ending group in \posttitle
, with some \LARGE
text lead-in.
\documentclass{memoir}
\begin{document}
\pretitle{\begingroup\bfseries}
\posttitle{ \LARGE This is from \textbackslash\texttt{posttitle} \endgroup}
\title{Hello}
%\maketitlehookb{\preauthor \author \postauthor{foobar}}
%\maketitlehookc{\predate \date \postdate{foodate}}
%\maketitlehookd{\thispagestyle{title}}
\maketitle
\vspace*{\droptitle}
\end{document}

Best Answer
The
\begin
macro which starts an environment is "fragile", which means it cannot be used inside a moving argument. The\title
command expands its argument, and therefore fragile commands can't be used inside it.See the following question for an explanation of this.
So the solution is to not use the
{bengali}
environment inside the title.(You could actually "protect" the environment by using
\protect\begin{bengali} .... \protect\end{bengali}
) but there is a simpler solution:Just use
\textbengali{}
: