]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/test/test-insets.tex
tex2lyx:
[lyx.git] / src / tex2lyx / test / test-insets.tex
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}
6
7 \setlength{\parindent}{3mm}
8 \usepackage{setspace}
9 \onehalfspacing
10
11 \usepackage{amsmath}
12 \usepackage{url}
13 \usepackage{verbatim}
14 \usepackage[numbers]{natbib}
15 \usepackage{nomencl}
16 % the following is useful when we have the old nomencl.sty package
17 \providecommand{\printnomenclature}{\printglossary}
18 \providecommand{\makenomenclature}{\makeglossary}
19 \usepackage{varioref}
20 \usepackage{prettyref}
21 \usepackage{makeidx}
22
23 \usepackage{graphicx}
24
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
26 \newcommand{\lyxline}[1][1pt]{%
27   \par\noindent%
28   \rule[.5ex]{\linewidth}{#1}\par}
29
30 \newcommand{\lyxarrow}{\leavevmode\,$\triangleright$\,\allowbreak}
31
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
33 \usepackage{subscript} % user specified as long as tex2lyx
34 % produces a format less than 408
35
36 \def\mycommand{\textquestiondown}
37
38 \begin{document}
39
40 \tableofcontents
41
42 \noindent This paragraph is not indented.
43
44 \section{References\index{References}}
45
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
49 quotes too...).
50
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}.
56
57 \section{Cites\index{Cites}}
58
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}
61
62 Now the natbib things:
63
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}
67
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}
71
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}
76
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}
81
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}
86
87 \textbackslash{}citeyear: \citeyear[before][after]{article-crossref}
88
89 \textbackslash{}citeyearpar: \citeyearpar[before][after]{article-crossref} 
90
91 \textbackslash{}nocite: \nocite{article-crossref}
92
93 \bibliographystyle{unsrt}
94 \bibliography{xampl}
95
96 With \textbackslash{}nocite\{{*}\}:
97 \bibliographystyle{unsrt}
98 \nocite{*}
99 \bibliography{xampl}
100
101 \section{Input files\index{Input files}}
102
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
106
107 If you prefer verbatim input, you can choose
108 between~\verbatiminput{foo} or~\verbatiminput*{foo}.
109
110 \section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
111
112 An URL: \url{http://www.lyx.org}
113 \nomenclature{URL2}{uniform resource locator}
114
115 \section{Lists\index{Lists}}
116
117 \listoffigures
118 \listoftables
119
120 \section{Graphics\index{Graphics}}
121
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}.
125
126 \section{Macros}
127
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}
136
137 Now use them all:
138 \macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x}
139
140 \section{Special formattings\index{Special formattings}}
141
142 \subsection{LyX line}
143
144 test
145
146 {\tiny \lyxline{\tiny}}{\tiny \par}
147
148 test {\Huge Test} {\tiny test} test
149
150 \lyxline{\normalsize}
151
152 test
153
154 {\Huge \lyxline{\Huge}}{\Huge \par}
155
156 test
157
158 \subsection{Line breaks}
159
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]
164
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.
168
169 \subsection{Page breaks}
170
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]
174
175 \section{Special characters\index{Special characters}}
176
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 \_\&\#\$\{\}\%.
181
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.
185
186 Test for whitespace handling of commands: The following lines should
187 result in identical output:
188
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
194 {} xx
195
196 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
197 with $a^2+b^2=c^2$ math}.
198
199 \printindex{}
200
201 \printnomenclature{}
202
203 \end{document}