]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/test/test-insets.tex
Increase tex2lyx output format to 310.
[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 \section{Input files\index{Input files}}
97
98 We can input files too, like this \input{DummyDocument}, or with the include
99 variant \include{DummyDocument} % unfortunately, including the doc twice
100 % generates a multiply defined label
101
102 If you prefer verbatim input, you can choose
103 between~\verbatiminput{foo} or~\verbatiminput*{foo}.
104
105 \section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
106
107 An URL: \url{http://www.lyx.org}
108 \nomenclature{URL2}{uniform resource locator}
109
110 \section{Lists\index{Lists}}
111
112 \listoffigures
113 \listoftables
114
115 \section{Graphics\index{Graphics}}
116
117 There is also some basic support for graphics, in the form
118 \includegraphics{foo.eps}, or the slightly more elaborate
119 \includegraphics[bb=10bp 0bp 96bp 96bp,clip,height=1cm, width=1cm]{foo.eps}.
120
121 \section{Macros}
122
123 LyX supports several kinds of macros:
124 def \def\macroa#1{a #1 a}
125 global def \global\def\macrob#1{b #1 b}
126 long def \long\def\macroc#1{c #1 c}
127 global long def \global\long\def\macrod#1{d #1 d}
128 providecommand \providecommand{\macroe}[1]{e #1 e}
129 newcommand \newcommand{\macrof}[1]{f #1 f}
130 renewcommand \renewcommand{\macrof}[1]{g #1 g}
131
132 Now use them all:
133 \macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x}
134
135 \section{Special formattings\index{Special formattings}}
136
137 \subsection{LyX line}
138
139 test
140
141 {\tiny \lyxline{\tiny}}{\tiny \par}
142
143 test {\Huge Test} {\tiny test} test
144
145 \lyxline{\normalsize}
146
147 test
148
149 {\Huge \lyxline{\Huge}}{\Huge \par}
150
151 test
152
153 \subsection{Line breaks}
154
155 They can also or be broken by a newline\\
156 or a newline command \newline
157 or by a line break \linebreak
158 or by a defined line break \linebreak[4]
159
160 There are even newlines with weird arguments, but these are not
161 handled by LyX\\*[1cm]
162 so we try to use ERT in this case.
163
164 \subsection{Page breaks}
165
166 They can also or be broken by a newpage \newpage
167 or by a page break \pagebreak
168 or by a defined page break \pagebreak[4]
169
170 \section{Special characters\index{Special characters}}
171
172 Then one has those macros with a long name for a short meaning, like
173 \textasciitilde, \textasciicircum{} or \textbackslash{}, \slash{},
174 \nobreakdash and the characters
175 that LaTeX wants to espace because they are active, like \_\&\#\$\{\}\%.
176
177 And what about special characters like hyphe\-nation mark,
178 ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
179 separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
180
181 Test for whitespace handling of commands: The following lines should
182 result in identical output:
183
184 builtin \textasciicircum{} unicodesymbols \j{} user \mycommand{} xx\par
185 builtin \textasciicircum {} unicodesymbols \j {} user \mycommand{} xx\par
186 builtin \textasciicircum % with a comment
187 {} unicodesymbols \j % and a second one
188 {} user \mycommand % and another
189 {} xx
190
191 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
192 with $a^2+b^2=c^2$ math}.
193
194 \printindex{}
195
196 \printnomenclature{}
197
198 \end{document}