%% LyX trick_preamble_code_into_believing_that_this_was_created_by_lyx created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\setlength{\parindent}{3mm}
\usepackage{setspace}
\onehalfspacing

\usepackage{amsmath}
\usepackage{url}
\usepackage{verbatim}
\usepackage[numbers]{natbib}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\usepackage{varioref}
\usepackage{prettyref}
\usepackage{makeidx}

\usepackage{graphicx}
\usepackage{longtable}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
\newcommand{\lyxline}[1][1pt]{%
  \par\noindent%
  \rule[.5ex]{\linewidth}{#1}\par}

\newcommand{\lyxarrow}{\leavevmode\,$\triangleright$\,\allowbreak}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{doc}
\usepackage{subscript} % user specified as long as tex2lyx
% produces a format less than 408

\def\mycommand{\textquestiondown}

\begin{document}

\tableofcontents

\noindent This paragraph is not indented.

\section{References\index{References}}

Let's start with simple things: a label~\label{lab:test} and a
reference~\ref{lab:test}; note that I have tested ``unbreakable
space'' without warning (and worse than that, I just tested english
quotes too...).

Of course there are other kind of references, like page
reference~\pageref{lab:test}, but also equation
reference~\eqref{lab:test} (from amsmath package), or varioref's
equivalents~\vref{lab:test} and~\vpageref{lab:test}, without
forgetting pretty references like~\prettyref{lab:test}.

\section{Cites\index{Cites}}

Let's start with simple things: a \textbackslash{}cite: \cite[after]{article-crossref}
and two \textbackslash{}cites: \cite[after]{whole-set,article-crossref}

Now the natbib things:

\textbackslash{}citet: \citet[before][after]{article-crossref} \textbackslash{}citet{*}:
\citet*[before][after]{article-crossref} \textbackslash{}Citet: \Citet[before][after]{article-crossref}
\textbackslash{}Citet{*}: \Citet*[before][after]{article-crossref}

\textbackslash{}citep: \citep[before][after]{article-crossref} \textbackslash{}citep{*}:
\citep*[before][after]{article-crossref} \textbackslash{}Citep: \Citep[before][after]{article-crossref}
\textbackslash{}Citep{*}: \Citep*[before][after]{article-crossref}

\textbackslash{}citealt: \citealt[before][after]{article-crossref}
\textbackslash{}citealt{*}: \citealt*[before][after]{article-crossref}
\textbackslash{}Citealt: \Citealt[before][after]{article-crossref}
\textbackslash{}Citealt{*}: \Citealt*[before][after]{article-crossref}

\textbackslash{}citealp: \citealp[before][after]{article-crossref}
\textbackslash{}citealp{*}: \citealp*[before][after]{article-crossref}
\textbackslash{}Citealp: \Citep[before][after]{article-crossref}
\textbackslash{}Citealp{*}: \Citealp*[before][after]{article-crossref}

\textbackslash{}citeauthor: \citeauthor[before][after]{article-crossref}
\textbackslash{}citeauthor{*}: \citeauthor*[before][after]{article-crossref}
\textbackslash{}Citeauthor: \Citeauthor[before][after]{article-crossref}
\textbackslash{}Citeauthor{*}: \Citeauthor*[before][after]{article-crossref}

\textbackslash{}citeyear: \citeyear[before][after]{article-crossref}

\textbackslash{}citeyearpar: \citeyearpar[before][after]{article-crossref} 

\textbackslash{}nocite: \nocite{article-crossref}

\bibliographystyle{unsrt}
\bibliography{xampl}

With \textbackslash{}nocite\{{*}\}:
\bibliographystyle{unsrt}
\nocite{*}
\bibliography{xampl}

\section{Input files\index{Input files}}

We can input files too, like this \input{DummyDocument}, or with the include
variant \include{DummyDocument} % unfortunately, including the doc twice
% generates a multiply defined label

If you prefer verbatim input, you can choose
between~\verbatiminput{foo} or~\verbatiminput*{foo}.

\section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}

An URL: \url{http://www.lyx.org}
\nomenclature{URL2}{uniform resource locator}

\section{Lists\index{Lists}}

\listoffigures
\listoftables

\section{Graphics\index{Graphics}}

There is also some basic support for graphics, in the form
\includegraphics{foo.eps}, or the slightly more elaborate
\includegraphics[bb=10bp 0bp 96bp 96bp,clip,height=1cm, width=1cm]{foo.eps}.

\section{Tables\index{Tables}}

The following example is stolen from the longtable documentation.
\let\package\textsf
\let\env\textsf
\providecommand\finalclearpage{\clearpage}
\DeleteShortVerb{\|}
\MakeShortVerb{\"}
\def\v{\char`}

\begin{longtable}{@{*}r||p{1in}@{*}}
KILLED & LINE!!!! \kill
\caption
[An optional table caption (used in the list of tables)]
{A long table\label{long}}\\
\hline\hline
\multicolumn{2}{@{*}c@{*}}%
     {This part appears at the top of the table}\\
\textsc{First}&\textsc{Second}\\
\hline\hline
\endfirsthead
\caption[]{(continued)}\\
\hline\hline
\multicolumn{2}{@{*}c@{*}}%
      {This part appears at the top of every other page}\\
\textbf{First}&\textbf{Second}\\
\hline\hline
\endhead
\hline
This goes at the&bottom.\\
\hline
\endfoot
\hline
These lines will&appear\\
in place of the & usual foot\\
at the end& of the table\\
\hline
\endlastfoot
\env{longtable}  columns  are specified& in the \\
same way as  in the \env{tabular}& environment.\\
"@{*}r||p{1in}@{*}"& in this case.\\
Each row ends with a& "\\" command.\\
The "\\"  command  has an& optional\\
argument, just as in& the\\
 \env{tabular}&environment.\\[10pt]
See the  effect  of "\\[10pt]"&?\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Also  "\hline"  may be used,&  as in \env{tabular}.\\
\hline
That  was a "\hline"&.\\
\hline\hline
That  was "\hline\hline"&.\\
\multicolumn{2}{||c||}%
{This is a \ttfamily\v\\multicolumn\v{2\v}\v{||c||\v}}\\
If a  page break  occurs at a "\hline" then& a line is drawn\\
at the bottom of one  page  and at the& top of the next.\\
\hline
The  "[t] [b] [c]"  argument of \env{tabular}& can  not be used.\\
The optional argument may be  one of& "[l] [r] [c]"\\
to specify whether  the  table  should be& adjusted\\
to the  left, right& or centrally.\\
\hline\hline
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Some lines may take up a lot of space, like this: &
    \raggedleft This last column is a ``p'' column so this
    ``row'' of the table can take up several lines. Note however that
    \TeX\ will  never break a page within such a row. Page breaks only
    occur between rows of the table or at "\hline" commands.
    \tabularnewline
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
\hline
Lots\footnote{This is a footnote.} of lines& like this.\\
Lots   of   lines& like this\footnote{\env{longtable} takes special
    precautions, so that footnotes may also be used in `p' columns.}\\
\hline
Lots of lines& like this.\\
Lots of lines& like this.
\end{longtable}

\section{Macros}

LyX supports several kinds of macros:
def \def\macroa#1{a #1 a}
global def \global\def\macrob#1{b #1 b}
long def \long\def\macroc#1{c #1 c}
global long def \global\long\def\macrod#1{d #1 d}
providecommand \providecommand{\macroe}[1]{e #1 e}
newcommand \newcommand{\macrof}[1]{f #1 f}
renewcommand \renewcommand{\macrof}[1]{g #1 g}

Now use them all:
\macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x}

\section{Special formattings\index{Special formattings}}

\subsection{LyX line}

test

{\tiny \lyxline{\tiny}}{\tiny \par}

test {\Huge Test} {\tiny test} test

\lyxline{\normalsize}

test

{\Huge \lyxline{\Huge}}{\Huge \par}

test

\subsection{Line breaks}

They can also or be broken by a newline\\
or a newline command \newline
or by a line break \linebreak
or by a defined line break \linebreak[4]

There are even newlines with weird arguments, but these are not
handled by LyX\\*[1cm]
so we try to use ERT in this case.

\subsection{Page breaks}

They can also or be broken by a newpage \newpage
or by a page break \pagebreak
or by a defined page break \pagebreak[4]

\section{Special characters\index{Special characters}}

Then one has those macros with a long name for a short meaning, like
\textasciitilde, \textasciicircum{} or \textbackslash{}, \slash{},
\nobreakdash- and the characters
that LaTeX wants to espace because they are active, like \_\&\#\$\{\}\%.

And what about special characters like hyphe\-nation mark,
ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.

LyX translates the phrases LyX, TeX, LaTeX2e and LaTeX
to the commands \LyX{}, \TeX{}, \LaTeXe{} and \LaTeX{}.
If these phrases occur as part of other words (like 1LyX or aTeX or LaTeX3)
they should not be put into ERT.

Test for whitespace handling of commands: The following lines should
result in identical output:

builtin \textasciicircum{} unicodesymbols \j{} user \mycommand{} xx\par
builtin \textasciicircum {} unicodesymbols \j {} user \mycommand{} xx\par
builtin \textasciicircum % with a comment
{} unicodesymbols \j % and a second one
{} user \mycommand % and another
{} xx

A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
with $a^2+b^2=c^2$ math}.

\printindex{}

\printnomenclature{}

\end{document}
