[Tex/LaTex] How to edit LaTeX preamble in source pane under LyX

lyxpreamble

I want to add some lines in LyX preamble but not finding how to do that. If anyone help that would be much appreciated.

See this is my preamble:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{float}
\usepackage{amsmath}
\usepackage{setspace}
\doublespacing

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}

\@ifundefined{date}{}{\date{}}
\makeatother

\usepackage{babel}
\begin{document}

Now I want to add some lines between last two lines;

\usepackage{babel}
**I want to put some lines here**
\begin{document}

Kindly help; how can I do that?

PS: when I go Document > Settings… > LaTeX preamble; that put those required lines before \usepackage{babel} which I don't want.

Best Answer

Another way would be to tell LyX to not load babel, instead loading it 'manually':

  1. Document --> Settings --> Language: For Language package select None.

    enter image description here

  2. In the LaTeX preamble, also in the document settings, add e.g.

    \usepackage[british]{babel}
    

    followed by whatever you need.