[Tex/LaTex] How to resolve the error in LaTeX: Option clash for package inputenc. \usepackage

errorsinput-encodingspackages

This is my document

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsopn}
\usepackage[utf8]{inputenc}
\usepackage[ngerman] {babel} 
\usepackage[T1]{fontenc}
\usepackage{textcomp} 
\usepackage{latexsym} 
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm]{geometry}

\newtheorem{name}{Printed Output}
\newtheoremstyle{dotless}{}{}{\itshape}{}{\bfseries}{}{ }{} 
\theoremstyle{dotless} 
\newtheorem{thm}{Proposition} 
\newtheorem{defi}[thm]{Definition} 
\newtheorem{sat}[thm]{Satz} 
\newtheorem{bem}[thm]{Bemerkung} 
\newtheorem*{bemo}{Bemerkung} 
\newtheorem{lem}[thm]{Lemma} 

\renewcommand{\contentsname}{Inthaltsverzeichnis}
\renewcommand{\abstractname}{Abstrakt}

\newcommand{\KK}{\mathbb{K}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\uu}{ü}
\newcommand{\aaa}{ä}
\newcommand{\oo}{ö}
\newcommand{\sss}{ß}

\titleformat{\chapter}{\normalfont\Large\scshape}{\thechapter}{1em}{} \vspace{6pt}
\newpage
\begin{document}

        \title{Das Sekretärinnenproblem}

        \author{Polina Nazarova}
        \date{\today}
        \maketitle

        \begin{abstract}
        \begin{center}
            Korrigiert ung beaufsichtigt von Prof. Peter Pickl
        \end{center}
        \end{abstract}

        \tableofcontents{Inthaltsverzeichnis}
        \newpage

\section{Motivation}
\subsection{Einleitung zum Sekretärinnenproblem}

It says the error is in line 7, so with the \usepackege[ngerman]{babel}

Best Answer

The preamble contains:

...
\usepackage[latin1]{inputenc}
...
\usepackage[utf8]{inputenc}

This is a contradiction, because latin is a 8-bit input encoding and utf8 is a multi-byte encoding.

Package inputenc should be loaded with the correct option for the input encoding. If the input encoding is not clear, take a look at package selinput.