[Tex/LaTex] Abstract page of babel[magyar] undefined

abstractbabelenvironments

I am working on a document that uses a custom class. I want to change the class so that it would use the babel[magyar] instead of the english version.

However, when I try to do so, I get the following error message:

E: …/Tester.tex:10 Undefined control sequence \begin{abstract}

My document uses a custom definition for the abstract environment, which works properly if babel is imported using:

\RequirePackage{babel}

Whenever I change this to:

\def\magyarOptions{defaults=safest}
\RequirePackage[magyar]{babel}

then compilation fails and I get the shown error message.

Can someone tell me how does this happens?

Update:
I was asked to provide a minimum working example instead of the specification, here I used the article class, and replaced newenvironment with renewenvironment.

\documentclass{article}

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\def\magyarOptions{defaults=safest}
\RequirePackage[magyar]{babel}

\renewenvironment{abstract}{
    \checktoopen
    \tttypeout{\abstractname}
    \null\vfil
    \thispagestyle{plain}
    \begin{center}
    {\huge\textit{\abstractname} \par}
    \bigskip
    \end{center}
}

\begin{document}{}

\begin{abstract}

    The Thesis Abstract is written here (and usually kept to just this page). The page is kept centered vertically so can expand into the blank space above the title too\ldots
    %% TODO: megírni

\end{abstract}

\section{asda}

This is a test document.

\end{document}

Best Answer

It is better to ask template question by using the ask a question button, where you can be sure that someone familiar with the templates handles your question.

The language definition file for hungarian does not define a hungarian string for abstract. You gotta define one yourself.

\def\magyarOptions{defaults=safest}
\documentclass[magyar]{MastersDoctoralThesis}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\providecaptionname{magyar}{\abstractname}{abstractname magyar}
\renewenvironment{abstract}{
    \checktoopen
    \tttypeout{\abstractname}
    \null\vfil
    \thispagestyle{plain}
    \begin{center}
        {\huge\textit{\abstractname} \par}
        \bigskip
    \end{center}
}{\cleardoublepage}

\begin{document}{}

\begin{abstract}

    The Thesis Abstract is written here (and usually kept to just this page). The page is kept centered vertically so can expand into the blank space above the title too\ldots
                            %% TODO: megírni

\end{abstract}

\section{asda}

This is a test document.

\end{document}
Related Question