# Changing concrete preamble from pdfLatex to Lua(la)tex

I got an example handout which was written for pdflatex but since I use lualatex i'm pretty sure that I have to make some changes to the preamble.

From there Frequently loaded packages: Differences between pdfLaTeX and XeLaTeX i already know that i have to change from

\usepackage[utf8]{inputenc}

to

\usepackage{fontspec}

and from

\usepackage[german]{babel}

to

\usepackage{polyglossia}
\setdefaultlanguage{german}

but as soon as kick out inputenc it removes "ä" and "ü" from

{\sstenbx Fakultät für } \\[-1mm]

in the final output. I assume it happens because

\font\ssten=cmss10
\font\sstenbx=cmssbx10

only works when inputenc is loaded with utf-8? Everwhere else(besides that header part) there are no problems with those characters...

The other problem I am facing is that according to the link i have to replace amssymb with unicode-math but as soon as i do so the defined environments aren't found anymore... so i assume that any part of the definition of the theorems depends on amssymb...

My concrete question is now what exactly do i have to change when moving from inputenc to fontspec, from babel to polyglossia and from amssymb to unicode-math in order to achieve the same output?

theorems.sty

\usepackage[framed,amsmath,thmmarks,hyperref]{ntheorem}
\usepackage{framed}

\theorembodyfont{\normalfont}

\theoremstyle{nonumberbreak}
\theoremseparator{:}

\newframedtheorem{satz}{Satz}
\newframedtheorem{lemma}{Lemma}
\newframedtheorem{krl}{Korollar}
\newtheorem{defn}{Definition}
\newtheorem{bsp}{Beispiel}
\newtheorem{bem}{Bemerkung}

\theoremsymbol{\ensuremath{_\blacksquare}}
\newtheorem{bew}{Beweis}

Handout.tex

\documentclass[12pt]{article}

% useful packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[german]{babel}
\usepackage{epsfig}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{theorems}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\voffset=-2cm
\hoffset=-0.75cm
\textheight=22cm
\textwidth=15cm
\footskip=1.5cm
% w/o page numbers
\pagestyle{empty}
% w/ page numbers
% \pagestyle{plain}
\unitlength1cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% different font style for the upper box
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\font\ssten=cmss10
\font\sstenbx=cmssbx10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\parskip0pt
\parindent0pt
\hspace*{0.1cm}

\begin{picture}(4,2)
\put(0,0){\includegraphics[width=4cm]{pic}}
\end{picture}
\hspace{6cm}\begin{minipage}{7cm}
\vspace*{-16mm}
\begin{tabular}{l}
{\sstenbx Fakultät für } \\[-1mm]
{\sstenbx Institute of } \\
{\ssten Name} \\
{\ssten Date}
\end{tabular}
\end{minipage}
\normalsize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vskip1cm
\begin{center}
{\bf\large Topic \\
\vskip0.4cm Lecture title}
\end{center}
\vskip0.4cm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% given environments, examples
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Normal text

\begin{defn}
definitions
\end{defn}

\begin{lemma}
lemmas
\end{lemma}

\begin{bsp}
examples
\begin{itemize}
\item first
\item 2nd
\end{itemize}
\end{bsp}

\begin{satz}
Sätze(theorem)
\end{satz}

\begin{bew}
proof
\end{bew}

\begin{krl}
corollary
\end{krl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
• Hi and welcome, that document should get a few updates to be proper LaTeX2e, right now, there is a lot of 2.09 stuff going on that went obsolete 20 years ago. – Johannes_B May 5 '15 at 14:32
• well i'd be pretty happy to get someone to help me/explain me how to make it being an up-to-date tex-file. Currently i'm in the 2nd term/semester, studying mathematics but i only am able to write plain formulas o.O – rapus95 May 5 '15 at 14:35
• Ditch the \font declarations. Then replace the occurences where you use them, e.g., write: {\footnotesize\textsf{\textbf{Fakultät für}}} or {\footnotesize\textsf{Name}} – tg85 May 5 '15 at 14:46
• ntheorem uses \Box from amssymb for the end-of-proof marker. amsthm makes no assumption that the amsfonts package is loaded, but draws an open box with rules. might be worth mentioning that to the maintainer of ntheorem. – barbara beeton May 5 '15 at 14:48
• As a general piece of advice, I'd recommend against adopting a preamble from someone else if you don't understand what it is doing. – Sverre May 5 '15 at 15:47

There are things in your current document, that are valid in TeX or valid in LaTeX2.09, but obsolete in current LaTeX, LaTeX2e.

Following an example using current KOMA-script to set up the document. As this seems to be some kind of lecture notes, which are intended to have the same appearance, it is adviced to write a short wrapper class.

This is the header of the output, we can see that the author and the date would be printed twice. That can be dealt with in a wrapper class.

In the document that did not work with LuaLaTeX, old TeX-font commands have been used, whereas LuaTeX uses a completely different font handling system. The margins were set by hand. In the example below, (relatively narrow) margins are set using the capabilities of package typearea. If the need for specific margins exists, package geometry can be of help.

I left the theorem stuff mostly untouched, but changed the filename to the ending tex and used regular input to read the file.

\begin{filecontents}{\jobname-theorems.tex}
\usepackage[framed,amsmath,thmmarks,hyperref]{ntheorem}
\usepackage{framed}

\theorembodyfont{\normalfont}

\theoremstyle{nonumberbreak}
\theoremseparator{:}

\newframedtheorem{satz}{Satz}
\newframedtheorem{lemma}{Lemma}
\newframedtheorem{krl}{Korollar}
\newtheorem{defn}{Definition}
\newtheorem{bsp}{Beispiel}
\newtheorem{bem}{Bemerkung}

%   \theoremsymbol{\ensuremath{_\blacksquare}}
\newtheorem{bew}{Beweis}
\end{filecontents}

\usepackage{mwe}%for this mwe
\usepackage{fontspec}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{scrlayer-scrpage}
\ohead*{Fakultät für Sonnenschein\\Institute of rainbows\\Name \\ Date}
\usepackage[ngerman]{babel}
\usepackage{microtype}
\input{\jobname-theorems}

\title{This lectures topic}
\author{rapus}

\begin{document}
\maketitle

Normal text \blindtext

\begin{defn}
definitions
\end{defn}

\begin{lemma}
lemmas
\end{lemma}

\begin{bsp}
examples
\begin{itemize}
\item first
\item 2nd
\end{itemize}
\end{bsp}

\begin{satz}
Sätze(theorem)
\end{satz}

\begin{bew}
proof
\end{bew}

\begin{krl}
corollary
\end{krl}

\end{document}
• Any morequestions? Feel free to ask. As you are writing in german, you are very welcome to ask questions over at TeXwelt.de or golatex.de :-) – Johannes_B May 5 '15 at 15:17
• you used amsfonts where but anywhere else i read that fontspec is all you need instead so why you used it here, are there any advantages? – rapus95 May 5 '15 at 15:26
• @rapus95 My bad, should be amssymb to make the blacksquare available. This on the other hand load amsfonts. – Johannes_B May 5 '15 at 15:45
• Everything said privately is lost for others looking for solutions. You will soon have enough reputation to koin us in chat on-site, we can also create our own chat room. You can also use github (for example) to get user input and improvement suggestions. The format of this site, Question-Answer, isn't well suited for discussion. – Johannes_B May 5 '15 at 16:03
• We all started at some time and we all were confused first. I was forced to read lshort (l2kurz) and l2tabu and everything (naja, most of it) has been quite simple since. LaTeX for complete novices is also great, wish i had this in the beginning. dickimaw-books.com/latex/novices/index.html – Johannes_B May 5 '15 at 16:15