]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/test/test-insets.tex
tex2lyx/table.cpp: please Vincent as discussed
[lyx.git] / src / tex2lyx / test / test-insets.tex
index efaf11f5dfaa6169e9436cf2ac7c89d000828fd4..222e41c4d2c83f33285b8f05d281a28c6c493d66 100644 (file)
 \usepackage{varioref}
 \usepackage{prettyref}
 \usepackage{makeidx}
+\usepackage{splitidx}
 \makeindex
 
 \usepackage{graphicx}
 \usepackage{longtable}
 \usepackage{xargs}
 \usepackage{subscript}
+\usepackage{rotating}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
 \providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
 
 \begin{document}
 
+\title{Title}
+
+\date %stupid stuff
+{two days ago}
+
+\maketitle
+
 \tableofcontents
+\lstlistoflistings
 
 \noindent This paragraph is not indented.
 
@@ -114,17 +124,39 @@ M., \& Rasio, F.~A. 2004, ApJ, 604, 632\end{thebibliography}
 \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
+variant \include{DummyDocument} % unfortunately, including the doc twice generates a multiply defined label
+
+We can also import chess diagrams:
+
+\loadgame{../../../lib/examples/iecc05}\showboard
+
+Spreadsheets:
+
+\def\inputGnumericTable{}\input{../../../lib/examples/longsheet.gnumeric}
+
+and PDF pages:
+
+\includepdf[pages=-,angle=22,origin=Bl,width=5cm,height=40mm,keepaspectratio]{../../../lib/examples/beamer-icsi-logo}
 
 If you prefer verbatim input, you can choose
 between~\verbatiminput{foo} or~\verbatiminput*{foo}.
 
 
-\section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
+\section{URLs and Hyperlinks\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
+
+An URL: \url{http://www.lyx.org} \nomenclature{URL2}{uniform resource locator}
+
+link:\href{http://www.test.test}{www.test.test}
+
+link2:\href{http://www.test.test}{http://www.test.test}
 
-An URL: \url{http://www.lyx.org}
-\nomenclature{URL2}{uniform resource locator}
+mail:\href{mailto:www.test.test}{name}
+
+file:\href{file:www.test.test}{www.test.test}
+
+ftp:\href{ftp://www.test.test}{ftp://www.test.test}
+
+ftp2:\href{ftp://www.test.test}{www.test.test}
 
 
 \section{Lists\index{Lists}}
@@ -133,6 +165,42 @@ An URL: \url{http://www.lyx.org}
 \listoftables
 
 
+\section{Listings}
+
+Inline: \lstinline[language={C++}]!int a=5;!\\
+Float:
+
+\begin{lstlisting}[caption={Example Listing float},label={lst:Example-Listing},language=Python]
+# Example listing float
+def func(param):
+    'this is a python function'
+    pass
+\end{lstlisting}
+
+Here is an example listing with left line numbering, step ``3'',
+language ``Python'', options ``Extended character table'' and
+``Space~as~symbol'', range lines 3\,-\,8:
+
+\begin{lstlisting}[extendedchars=true,firstline=3,language=Python,lastline=8,numbers=left,showspaces=true,stepnumber=3]
+def func(param):
+    'this is a python function'
+    pass
+def func(param):
+'This is a German word: Tschüß'
+pass
+def func(param):
+'this is a python function'
+pass
+\end{lstlisting}
+
+Special cases:
+\begin{lstlisting}[abovecaptionskip=2em,basicstyle={\large\ttfamily},breaklines=true,extendedchars=true,firstline=2,float=h,language={[R/3 3.1]ABAP},lastline=5,numbers=left,numberstyle={\scriptsize},showspaces=true,showstringspaces=false,stepnumber=3,tabsize=4]
+hello
+\end{lstlisting}
+
+\lstinline[language=TeX]!\begin{centering} hello!
+
+
 \section{Graphics\index{Graphics}}
 
 There is also some basic support for graphics, in the form
@@ -247,6 +315,97 @@ Lots of lines& like this.\\
 Lots of lines& like this.
 \end{longtable}
 
+From bug 7412 another example with more captions (can currently not produced in LyX):
+\begin{longtable}{|l|l|}
+\caption{A long table}
+\endfirsthead
+\caption{A long table -- continued}
+\endhead
+\multicolumn{2}{r}{{Continued on next page}}
+\tabularnewline
+\endfoot
+\endlastfoot
+\hline
+\multicolumn{1}{|c|}{Something} & \multicolumn{1}{c|}{Description}\tabularnewline
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline Lots of lines& like this.\\
+\hline
+\end{longtable}
+
+A table*:
+
+\begin{tabular*} % some comment
+{0.8\columnwidth}[b]{lr}
+two\\
+\begin{turn}{-50}lonely\end{turn}&\begin{sideways}lines\end{sideways}
+\end{tabular*}
+
+A booktabs table:
+
+\begin{table}[h]
+\caption{\label{tab:Special-booktabs-table}Special booktabs-table}
+
+
+\centering{}%
+\begin{tabular}{cccc}
+\toprule 
+System & Chip\,1 & \multicolumn{2}{c}{Chip\,2}\tabularnewline
+\cmidrule(r){2-2}\cmidrule(l){3-4}\morecmidrules \cmidrule{2-4}Detector
+thickness in \textmu{}m & 300 & 300 & 700\tabularnewline
+\midrule 
+Edge angle in \textdegree{} & 3.55 & 2.71 & 7.99\tabularnewline
+\addlinespace
+Spatial resolution in \textmu{}m & 4.26 & 10.17 & 10.56\tabularnewline
+\addlinespace
+MTF at $f_{\mathrm{max}}$ & 0.53 & 0.37 & 0.39\tabularnewline
+\midrule 
+\morecmidrules \cmidrule{3-4}LSF-spatial resolution &  &  & \tabularnewline
+in \textmu{}m & 129.7 & 52.75 & 50.78\tabularnewline
+in \% of pixel size & 76.3 & 95.9 & 92.3\tabularnewline
+\bottomrule
+\end{tabular}
+\end{table}
+
+
 \section{Macros}
 
 LyX supports several kinds of macros:
@@ -308,65 +467,13 @@ test
 \textcolor{red}{\rule[-4ex]{5in}{1cm}}
 
 
-\subsection{Spaces}
-
-simple: a\ b
-
-simple, protected: a~b
-
-thin: a\,b
-
-medium: a\negthinspace{}b
-
-thick: a\negmedspace{}b
-
-negative thin: a\negthinspace{}b
-
-negative meduim: a\negmedspace{}b
-
-negative thick: a\negthickspace{}b
-
-half quad: a\enskip{}b
-
-half quad, protected: a\enspace{}b
-
-a\quad{}b
-
-a\qquad{}b
-
-hfill: a\hfill{}b
-
-hfill, protected: a\hspace*{\fill}b
-
-custom,: a\hspace{1cm}b
-
-custom, protected: a\hspace*{1cm}b
-
-visible: a\textvisiblespace{}b
-
-
-\subsubsection*{now some math examples:}
-
-$a\hfill b$
-
-$a\hspace*{2cm}b$
-
-$a\hspace{1cm}b$
-
-$a\hspace*{\fill} b$
-
-$a\enskip b$
-
-$a\enspace b$
-
-
 \subsection{Phantoms}
 
 test\phantom{Wow}test
 
-test\phantom{\textcolor{green}{W}\textbf{ow}\textsuperscript{Wow}}test
+test\hphantom{\textcolor{green}{W}\textbf{ow}\textsuperscript{Wow}}test
 
-test\phantom{Wow\textbackslash{}\&\%}test
+test\vphantom{Wow\textbackslash{}\&\%}test
 
 $test\hphantom{Wow}test$
 
@@ -378,7 +485,7 @@ test\phantom{\textcolor{green}{W}\mathbf{ow}\textsuperscript{Wow}}test
 $test\vphantom{Wow\&\%}test$
 
 
-\subsection{Line breaks}
+\subsection{Line breaks\sindex[breaks]{Line breaks}}
 
 They can also or be broken by a newline\\
 or by a starred newline \\*
@@ -393,7 +500,7 @@ 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}
+\subsection{Page breaks\sindex[breaks]{Page breaks}}
 
 They can also or be broken by a newpage \newpage
 or by a page break \pagebreak
@@ -429,6 +536,15 @@ builtin \textasciicircum % with a comment
 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
 with $a^2+b^2=c^2$ math}.
 
+\section{Mathematics\index{Mathematics}}
+
+Let $f:\left[  a,b\right]  \rightarrow%
+%TCIMACRO{\U{211d} }%
+%BeginExpansion
+\mathbb{R}
+%EndExpansion
+$.
+
 \printindex{}
 
 \printnomenclature hello