[Tex/LaTex] Any other way than Babel package

babellanguagespolish

I have a complex PhD thesis temlate. I need to include a polish (second) abstract, but the hyphenation look terrbile. All the rest of the document is in english. When I try Babel package, Im getting an option clash.

\PassOptionsToPackage{english,polish}{babel}

is also not working:

"! LaTeX Error: Command `\lll' already defined."

Best Answer

For mysterious reasons, polish.ldf has

\let\lll=\l \let\LLL=\L
\def\plll{\lll}
\def\pLLL{\LLL}

and, of course, this should be something like

\let\polish@l=\l \let\polish@L=\L
\def\plll{\polish@l}
\def\pLLL{\polish@L}

This is used in some places in order to restore the meaning in case something changed it.

Solution for your problem:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}

\makeatletter
\let\polish@l=\lll \let\polish@L=\LLL
\let\lll\relax \let\LLL\relax % undefine them
\def\plll{\polish@l}
\def\pLLL{\polish@L}
\makeatother

\usepackage{amssymb}

In your case, the babel package is loaded by the class, so the language options must be given to \documentclass:

\documentclass[
        12pt, % The default document font size, options: 10pt, 11pt, 12pt
        english, % ngerman for German
        polish,
        singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
        headsepline, % Uncomment to get a line under the header
]{MastersDoctoralThesis} % The class file specifying the document structure

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\setcounter{secnumdepth}{4}

\makeatletter
\let\polish@l=\lll \let\polish@L=\LLL
\let\lll\relax \let\LLL\relax % undefine them
\def\plll{\polish@l}
\def\pLLL{\polish@L}
\makeatother

The rest is the same as in your code.