GeneralLanguage selection

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
gowtham7
Posts: 1
Joined: Mon Nov 25, 2019 3:24 pm

Language selection

Post by gowtham7 »

I want to change languages at certain places which is not happening through Overleaf online latex editor.

I've the following code:

Code: Select all

%% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper,ngerman,english,intoc,bibtotoc,idxtotoc,BCOR10mm,titlepage,tablecaptionabove,fleqn]{scrbook}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{babel}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature
\usepackage[unicode=true, 
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Your Title},
 pdfauthor={Your Name},
 pdfsubject={Dissertation zur Erlangung des Doktorgrades der Technischen Fakultät der Albert-Ludwigs-Universität Freiburg im Breisgau},
 pdfkeywords={Ph.D. thesis},
 pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\DeclareRobustCommand*{\lyxarrow}{%
\@ifstar
{\leavevmode\,$\triangleleft$\,\allowbreak}
{\leavevmode\,$\triangleright$\,\allowbreak}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% print no date
\date{}

% increase link area for cross-references and autoname them
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\newlength{\abc}
\settowidth{\abc}{\space}
\addto\extrasenglish{
 \renewcommand{\equationautorefname}{\hspace{-\abc}}
 \renewcommand{\sectionautorefname}{sec.\negthinspace}
 \renewcommand{\subsectionautorefname}{sec.\negthinspace}
 \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}
 \renewcommand{\figureautorefname}{Fig.\negthinspace}
 \renewcommand{\tableautorefname}{Tab.\negthinspace}
}

% in case somebody want to have the label "equation"
%\renewcommand{\eqref}[1]{equation~(\negthinspace\autoref{#1})}

% that links to image floats jumps to the beginning
% of the float and not to its caption
\usepackage[figure]{hypcap}

% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
  \frontmatter
  \pdfbookmark[1]{\contentsname}{}
  \myTOC
  \mainmatter }

% make caption labels bold
\setkomafont{captionlabel}{\bfseries}
\setcapindent{1em}

% enable calculations
\usepackage{calc}

% fancy page header/footer settings
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
%\lhead[\fancyplain{}{}]{\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{}}
\lfoot[\thepage]{}
\rfoot[]{\thepage}
\cfoot{}

% increase the bottom float placement fraction
\renewcommand{\bottomfraction}{0.5}

% avoid that floats are placed above its sections
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}

% widen the space for the nomenclature entry labels
\renewcommand{\nomlabelwidth}{2.5cm}

\makeatother

\begin{document}
\selectlanguage{ngerman}%

\subject{Dissertation zur Erlangung des Doktorgrades der Technischen Fakultät
der Albert-Ludwigs-Universität Freiburg im Breisgau}

\selectlanguage{english}%

\title{Title}


\author{Your name}


\date{Date}

\selectlanguage{ngerman}%

\publishers{\includegraphics[width=0.4\columnwidth]{images/Uni_Logo-Grundversion_E1_A4_CMYK}\vspace{\baselineskip}\\
Albert-Ludwigs-Universität Freiburg im Breisgau\\
Technische Fakultät\\
Institut für zzz\vspace{-3cm}
}


\lowertitleback{\textbf{Dekan}\smallskip{}
\\
Prof. Dr. xxx yyy\bigskip{}
\\
\textbf{Referenten}\smallskip{}
\\
Prof. Dr. aaa bbb\smallskip{}
\\
Prof. Dr. xxx yyy\bigskip{}
\\
\textbf{Datum der Promotion (only necessary for final publication)}\smallskip{}
\\
xx.yy.zzzz}

\selectlanguage{english}%

\dedication{Dedication, cite from a famous person, or whatever you like (is of
course optional)}

\maketitle
\cleardoublepage{}

\lhead[\fancyplain{}{}]{\fancyplain{}{\rightmark}}

\tableofcontents{}

\cleardoublepage{}

\pagestyle{plain}

\include{Summary}

\include{Zusammenfassung}

\cleardoublepage{}

\pagestyle{fancy}\lhead[\fancyplain{}{\chaptername\;\thechapter}]{\fancyplain{}{\rightmark}}

\include{chapter-1}

\include{chapter-2}

\cleardoublepage{}

\lhead[\fancyplain{}{}]{\fancyplain{}{Acknowledgments}}

\rhead[\fancyplain{}{Acknowledgments}]{\fancyplain{}{}}



\include{Appendix}

\cleardoublepage{}

\lhead[\fancyplain{}{}]{\fancyplain{}{\rightmark}}

\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{}}

\bibliographystyle{biblio/alpha}
\bibliography{biblio/Plasma}


\cleardoublepage{}

\lhead[\fancyplain{}{}]{\fancyplain{}{Nomenclature}}
\rhead[\fancyplain{}{Nomenclature}]{\fancyplain{}{}}

\printnomenclature{}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Language selection

Post by Johannes_B »

Welcome to the forum, you simply cannot use a two-langauge title the way you are trying.

Can you prepare a minimal working example so we can see the problem in more detail? Your document is cluttered with old, not-up-to-date, obsolete stuff.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply