]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/test/test-refstyle-references.tex
tex2lyx tests:
[lyx.git] / src / tex2lyx / test / test-refstyle-references.tex
1 \documentclass[english]{book}
2 \usepackage[T1]{fontenc}
3 \usepackage[latin9]{inputenc}
4 \usepackage{refstyle}
5 \usepackage{float}
6 \usepackage{amsthm}
7
8 \makeatletter
9
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
11
12 \AtBeginDocument{\providecommand\partref[1]{\ref{part:#1}}}
13 \AtBeginDocument{\providecommand\chapref[1]{\ref{chap:#1}}}
14 \AtBeginDocument{\providecommand\secref[1]{\ref{sec:#1}}}
15 \AtBeginDocument{\providecommand\subref[1]{\ref{sub:#1}}}
16 \AtBeginDocument{\providecommand\parref[1]{\ref{par:#1}}}
17 \AtBeginDocument{\providecommand\figref[1]{\ref{fig:#1}}}
18 \AtBeginDocument{\providecommand\tabref[1]{\ref{tab:#1}}}
19 \AtBeginDocument{\providecommand\algref[1]{\ref{alg:#1}}}
20 \AtBeginDocument{\providecommand\fnref[1]{\ref{fn:#1}}}
21 \AtBeginDocument{\providecommand\enuref[1]{\ref{enu:#1}}}
22 \AtBeginDocument{\providecommand\eqref[1]{\ref{eq:#1}}}
23 \AtBeginDocument{\providecommand\lemref[1]{\ref{lem:#1}}}
24 \AtBeginDocument{\providecommand\thmref[1]{\ref{thm:#1}}}
25 \AtBeginDocument{\providecommand\corref[1]{\ref{cor:#1}}}
26 \AtBeginDocument{\providecommand\propref[1]{\ref{prop:#1}}}
27 \floatstyle{ruled}
28 \newfloat{algorithm}{tbp}{loa}[chapter]
29 \providecommand{\algorithmname}{Algorithm}
30 \floatname{algorithm}{\protect\algorithmname}
31 \RS@ifundefined{subref}
32   {\def\RSsubtxt{section~}\newref{sub}{name = \RSsubtxt}}
33   {}
34 \RS@ifundefined{thmref}
35   {\def\RSthmtxt{theorem~}\newref{thm}{name = \RSthmtxt}}
36   {}
37 \RS@ifundefined{lemref}
38   {\def\RSlemtxt{lemma~}\newref{lem}{name = \RSlemtxt}}
39   {}
40
41
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
43 \theoremstyle{plain}
44 \newtheorem{thm}{\protect\theoremname}
45 \theoremstyle{plain}
46 \newtheorem{lem}[thm]{\protect\lemmaname}
47 \theoremstyle{plain}
48 \newtheorem{cor}[thm]{\protect\corollaryname}
49 \theoremstyle{plain}
50 \newtheorem{prop}[thm]{\protect\propositionname}
51 \theoremstyle{plain}
52 \newtheorem{conjecture}[thm]{\protect\conjecturename}
53 \theoremstyle{plain}
54 \newtheorem{fact}[thm]{\protect\factname}
55 \theoremstyle{definition}
56 \newtheorem{defn}[thm]{\protect\definitionname}
57 \theoremstyle{definition}
58 \newtheorem{example}[thm]{\protect\examplename}
59 \theoremstyle{definition}
60 \newtheorem{problem}[thm]{\protect\problemname}
61 \theoremstyle{definition}
62 \newtheorem{xca}[thm]{\protect\exercisename}
63 \theoremstyle{remark}
64 \newtheorem{rem}[thm]{\protect\remarkname}
65 \theoremstyle{remark}
66 \newtheorem{claim}[thm]{\protect\claimname}
67 \ifx\proof\undefined
68 \newenvironment{proof}[1][\protect\proofname]{\par
69 \normalfont\topsep6\p@\@plus6\p@\relax
70 \trivlist
71 \itemindent\parindent
72 \item[\hskip\labelsep\scshape #1]\ignorespaces
73 }{%
74 \endtrivlist\@endpefalse
75 }
76 \providecommand{\proofname}{Proof}
77 \fi
78
79 \makeatother
80
81 \usepackage{babel}
82 \providecommand{\claimname}{Claim}
83 \providecommand{\conjecturename}{Conjecture}
84 \providecommand{\corollaryname}{Corollary}
85 \providecommand{\definitionname}{Definition}
86 \providecommand{\examplename}{Example}
87 \providecommand{\exercisename}{Exercise}
88 \providecommand{\factname}{Fact}
89 \providecommand{\lemmaname}{Lemma}
90 \providecommand{\problemname}{Problem}
91 \providecommand{\propositionname}{Proposition}
92 \providecommand{\remarkname}{Remark}
93 \providecommand{\theoremname}{Theorem}
94
95 \begin{document}
96
97 \part{part\label{part:part}}
98
99 \partref{part}
100
101
102 \chapter{chapter\label{chap:chapter}}
103
104 \chapref{chapter}
105
106
107 \section{Section\label{sec:Section}}
108
109 \secref{Section}
110
111
112 \subsection{Subsection\label{sub:subsection}}
113
114 Ref to \subref{subsection}.
115
116
117 \subsubsection{Subsubsection\label{sub:Subsubsection}}
118
119 Ref to \subref{Subsubsection}.
120
121
122 \paragraph{paragraph\label{par:paragraph}}
123
124 \parref{paragraph}
125
126
127 \subparagraph{subparagraph\label{par:subparagraph}}
128
129 \parref{subparagraph}
130
131 \begin{figure}
132 \protect\caption{figure\label{fig:figure}}
133 \end{figure}
134
135
136 \figref{figure}
137
138 \begin{table}
139 \protect\caption{table\label{tab:table}}
140 \end{table}
141
142
143 \tabref{table}
144
145 \begin{algorithm}
146 \protect\caption{algorithm\label{alg:algorithm}}
147 \end{algorithm}
148
149
150 \algref{algorithm}
151
152 \footnote{foot\label{fn:foot}%
153 }
154
155 \fnref{foot}
156
157 \marginpar{margin\label{margin}}
158
159 \ref{margin}
160 \begin{enumerate}
161 \item item\label{enu:item}
162 \end{enumerate}
163 \enuref{item}
164
165 \begin{equation}
166 A=B\label{eq:A=00003DB}
167 \end{equation}
168
169
170 \eqref{A=00003DB}
171 \begin{lem}
172 lemma\label{lem:lemma}
173
174 \lemref{lemma}\end{lem}
175 \begin{thm}
176 theorem\label{thm:theorem}
177
178 \thmref{theorem}\end{thm}
179 \begin{cor}
180 corollary\label{cor:corollary}
181
182 \corref{corollary}\end{cor}
183 \begin{prop}
184 proposition\label{prop:proposition}
185
186 \propref{proposition}\end{prop}
187 \begin{conjecture}
188 conjecture\label{conjecture}
189
190 \ref{conjecture}\end{conjecture}
191 \begin{fact}
192 fact\label{fact}
193
194 \ref{fact}\end{fact}
195 \begin{defn}
196 definition\label{definition}
197
198 \ref{definition}\end{defn}
199 \begin{example}
200 example\label{example}
201
202 \ref{example}\end{example}
203 \begin{problem}
204 problem\label{problem}
205
206 \ref{problem}\end{problem}
207 \begin{xca}
208 exercise\label{exercise}
209
210 \ref{exercise}\end{xca}
211 \begin{rem}
212 remark\label{remark}
213
214 \ref{remark}\end{rem}
215 \begin{claim}
216 claim\label{claim}
217
218 \ref{claim}\end{claim}
219 \begin{proof}
220 proof\label{proof}
221
222 \ref{proof}\end{proof}
223
224 \end{document}