1 %% LyX trick_preamble_code_into_believing_that_this_was_created_by_lyx created this file. For more info, see http://www.lyx.org/.
2 %% Do not edit unless you really know what you are doing.
3 \documentclass[a4paper,12pt]{article}
4 \usepackage[T1]{fontenc}
5 \usepackage[latin9]{inputenc}
7 \setlength{\parindent}{3mm}
14 \usepackage[numbers]{natbib}
16 % the following is useful when we have the old nomencl.sty package
17 \providecommand{\printnomenclature}{\printglossary}
18 \providecommand{\makenomenclature}{\makeglossary}
20 \usepackage{prettyref}
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
26 \newcommand{\lyxline}[1][1pt]{%
28 \rule[.5ex]{\linewidth}{#1}\par}
30 \newcommand{\lyxarrow}{\leavevmode\,$\triangleright$\,\allowbreak}
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
33 \usepackage{subscript} % user specified as long as tex2lyx
34 % produces a format less than 408
36 \def\mycommand{\textquestiondown}
42 \noindent This paragraph is not indented.
44 \section{References\index{References}}
46 Let's start with simple things: a label~\label{lab:test} and a
47 reference~\ref{lab:test}; note that I have tested ``unbreakable
48 space'' without warning (and worse than that, I just tested english
51 Of course there are other kind of references, like page
52 reference~\pageref{lab:test}, but also equation
53 reference~\eqref{lab:test} (from amsmath package), or varioref's
54 equivalents~\vref{lab:test} and~\vpageref{lab:test}, without
55 forgetting pretty references like~\prettyref{lab:test}.
57 \section{Cites\index{Cites}}
59 Let's start with simple things: a \textbackslash{}cite: \cite[after]{article-crossref}
60 and two \textbackslash{}cites: \cite[after]{whole-set,article-crossref}
62 Now the natbib things:
64 \textbackslash{}citet: \citet[before][after]{article-crossref} \textbackslash{}citet{*}:
65 \citet*[before][after]{article-crossref} \textbackslash{}Citet: \Citet[before][after]{article-crossref}
66 \textbackslash{}Citet{*}: \Citet*[before][after]{article-crossref}
68 \textbackslash{}citep: \citep[before][after]{article-crossref} \textbackslash{}citep{*}:
69 \citep*[before][after]{article-crossref} \textbackslash{}Citep: \Citep[before][after]{article-crossref}
70 \textbackslash{}Citep{*}: \Citep*[before][after]{article-crossref}
72 \textbackslash{}citealt: \citealt[before][after]{article-crossref}
73 \textbackslash{}citealt{*}: \citealt*[before][after]{article-crossref}
74 \textbackslash{}Citealt: \Citealt[before][after]{article-crossref}
75 \textbackslash{}Citealt{*}: \Citealt*[before][after]{article-crossref}
77 \textbackslash{}citealp: \citealp[before][after]{article-crossref}
78 \textbackslash{}citealp{*}: \citealp*[before][after]{article-crossref}
79 \textbackslash{}Citealp: \Citep[before][after]{article-crossref}
80 \textbackslash{}Citealp{*}: \Citealp*[before][after]{article-crossref}
82 \textbackslash{}citeauthor: \citeauthor[before][after]{article-crossref}
83 \textbackslash{}citeauthor{*}: \citeauthor*[before][after]{article-crossref}
84 \textbackslash{}Citeauthor: \Citeauthor[before][after]{article-crossref}
85 \textbackslash{}Citeauthor{*}: \Citeauthor*[before][after]{article-crossref}
87 \textbackslash{}citeyear: \citeyear[before][after]{article-crossref}
89 \textbackslash{}citeyearpar: \citeyearpar[before][after]{article-crossref}
91 \textbackslash{}nocite: \nocite{article-crossref}
93 \bibliographystyle{unsrt}
96 With \textbackslash{}nocite\{{*}\}:
97 \bibliographystyle{unsrt}
101 \section{Input files\index{Input files}}
103 We can input files too, like this \input{DummyDocument}, or with the include
104 variant \include{DummyDocument} % unfortunately, including the doc twice
105 % generates a multiply defined label
107 If you prefer verbatim input, you can choose
108 between~\verbatiminput{foo} or~\verbatiminput*{foo}.
110 \section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
112 An URL: \url{http://www.lyx.org}
113 \nomenclature{URL2}{uniform resource locator}
115 \section{Lists\index{Lists}}
120 \section{Graphics\index{Graphics}}
122 There is also some basic support for graphics, in the form
123 \includegraphics{foo.eps}, or the slightly more elaborate
124 \includegraphics[bb=10bp 0bp 96bp 96bp,clip,height=1cm, width=1cm]{foo.eps}.
128 LyX supports several kinds of macros:
129 def \def\macroa#1{a #1 a}
130 global def \global\def\macrob#1{b #1 b}
131 long def \long\def\macroc#1{c #1 c}
132 global long def \global\long\def\macrod#1{d #1 d}
133 providecommand \providecommand{\macroe}[1]{e #1 e}
134 newcommand \newcommand{\macrof}[1]{f #1 f}
135 renewcommand \renewcommand{\macrof}[1]{g #1 g}
138 \macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x}
140 \section{Special formattings\index{Special formattings}}
142 \subsection{LyX line}
146 {\tiny \lyxline{\tiny}}{\tiny \par}
148 test {\Huge Test} {\tiny test} test
150 \lyxline{\normalsize}
154 {\Huge \lyxline{\Huge}}{\Huge \par}
158 \subsection{Line breaks}
160 They can also or be broken by a newline\\
161 or a newline command \newline
162 or by a line break \linebreak
163 or by a defined line break \linebreak[4]
165 There are even newlines with weird arguments, but these are not
166 handled by LyX\\*[1cm]
167 so we try to use ERT in this case.
169 \subsection{Page breaks}
171 They can also or be broken by a newpage \newpage
172 or by a page break \pagebreak
173 or by a defined page break \pagebreak[4]
175 \section{Special characters\index{Special characters}}
177 Then one has those macros with a long name for a short meaning, like
178 \textasciitilde, \textasciicircum{} or \textbackslash{}, \slash{},
179 \nobreakdash and the characters
180 that LaTeX wants to espace because they are active, like \_\&\#\$\{\}\%.
182 And what about special characters like hyphe\-nation mark,
183 ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
184 separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
186 Test for whitespace handling of commands: The following lines should
187 result in identical output:
189 builtin \textasciicircum{} unicodesymbols \j{} user \mycommand{} xx\par
190 builtin \textasciicircum {} unicodesymbols \j {} user \mycommand{} xx\par
191 builtin \textasciicircum % with a comment
192 {} unicodesymbols \j % and a second one
193 {} user \mycommand % and another
196 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
197 with $a^2+b^2=c^2$ math}.