% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
+\makenomenclature
\usepackage{varioref}
\usepackage{prettyref}
\usepackage{makeidx}
+\makeindex
\usepackage{graphicx}
\usepackage{longtable}
+\usepackage{xargs}
+\usepackage{subscript}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
+\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
\newcommand{\lyxline}[1][1pt]{%
\par\noindent%
\rule[.5ex]{\linewidth}{#1}\par}
\newcommand{\lyxarrow}{\leavevmode\,$\triangleright$\,\allowbreak}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
-\usepackage{doc}
-\usepackage{subscript} % user specified as long as tex2lyx
-% produces a format less than 408
\def\mycommand{\textquestiondown}
\textbackslash{}nocite: \nocite{article-crossref}
-\bibliographystyle{unsrt}
-\bibliography{xampl}
+% Remove duplicate call of \bibliography since LaTeX throws an error.
+%\bibliographystyle{unsrt}
+% \bibliography{xampl}
With \textbackslash{}nocite\{{*}\}:
\bibliographystyle{unsrt}
\nocite{*}
\bibliography{xampl}
+From bug 7306:
+\citet{gur+04} have demonstrated that authors should not have umlauts
+in their names. It's OK to use them in the man\"{u}script, though.
+\begin{thebibliography}{References}
+\bibitem[{{G\"{u}rkan et~al.}(2004)}]{gur+04} Gürkan, M.~A., Freitag,
+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}}
-An URL: \url{http://www.lyx.org}
-\nomenclature{URL2}{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}
+
+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}}
\listoffigures
\listoftables
+
\section{Graphics\index{Graphics}}
There is also some basic support for graphics, in the form
\section{Tables\index{Tables}}
The following example is stolen from the longtable documentation.
+Since tex2lyx does not understand the special verbatim code that
+was used in the original some lines have been rewritten using
+\textbackslash textbackslash etc.
\let\package\textsf
\let\env\textsf
+\let\code\texttt
\providecommand\finalclearpage{\clearpage}
-\DeleteShortVerb{\|}
-\MakeShortVerb{\"}
-\def\v{\char`}
\begin{longtable}{@{*}r||p{1in}@{*}}
KILLED & LINE!!!! \kill
\endlastfoot
\env{longtable} columns are specified& in the \\
same way as in the \env{tabular}& environment.\\
-"@{*}r||p{1in}@{*}"& in this case.\\
-Each row ends with a& "\\" command.\\
-The "\\" command has an& optional\\
+\code{@\{*\}r||p\{1in\}@\{*\}}& in this case.\\
+Each row ends with a& \code{\textbackslash\textbackslash} command.\\
+The \code{\textbackslash\textbackslash} command has an& optional\\
argument, just as in& the\\
\env{tabular}&environment.\\[10pt]
-See the effect of "\\[10pt]"&?\\
+See the effect of \code{\textbackslash\textbackslash[10pt]}&?\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
-Also "\hline" may be used,& as in \env{tabular}.\\
+Also \code{\textbackslash hline} may be used,& as in \env{tabular}.\\
\hline
-That was a "\hline"&.\\
+That was a \code{\textbackslash hline}&.\\
\hline\hline
-That was "\hline\hline"&.\\
+That was \code{\textbackslash hline\textbackslash hline}&.\\
\multicolumn{2}{||c||}%
-{This is a \ttfamily\v\\multicolumn\v{2\v}\v{||c||\v}}\\
-If a page break occurs at a "\hline" then& a line is drawn\\
+{This is a \code{\textbackslash multicolumn\{2\}\{||c||\}}}\\
+If a page break occurs at a \code{\textbackslash hline} then& a line is drawn\\
at the bottom of one page and at the& top of the next.\\
\hline
-The "[t] [b] [c]" argument of \env{tabular}& can not be used.\\
-The optional argument may be one of& "[l] [r] [c]"\\
+The \code{[t] [b] [c]} argument of \env{tabular}& can not be used.\\
+The optional argument may be one of& \code{[l] [r] [c]}\\
to specify whether the table should be& adjusted\\
to the left, right& or centrally.\\
\hline\hline
\raggedleft This last column is a ``p'' column so this
``row'' of the table can take up several lines. Note however that
\TeX\ will never break a page within such a row. Page breaks only
- occur between rows of the table or at "\hline" commands.
+ occur between rows of the table or at \code{\textbackslash hline} commands.
\tabularnewline
Lots of lines& like this.\\
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\\
+lonely&lines
+\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:
long def \long\def\macroc#1{c #1 c}
global long def \global\long\def\macrod#1{d #1 d}
providecommand \providecommand{\macroe}[1]{e #1 e}
-newcommand \newcommand{\macrof}[1]{f #1 f}
-renewcommand \renewcommand{\macrof}[1]{g #1 g}
+providecommand* \providecommand*{\macrof}[1]{f #1 f}
+newcommand \newcommand{\macrog}[1]{g #1 g}
+renewcommand \renewcommand{\macrog}[1]{h #1 h}
+newcommand* \newcommand*{\macroi}[1]{i #1 i}
+renewcommand* \renewcommand*{\macroi}[1]{j #1 j}
+providecommandx \providecommandx{\macrok}[1]{k #1 k}
+providecommandx* \providecommandx*{\macrok}[1]{l #1 l}
+newcommandx \newcommandx{\macrom}[1]{m #1 m}
+renewcommandx \renewcommandx{\macrom}[1]{n #1 n}
+newcommandx* \newcommandx*{\macroo}[1]{o #1 o}
+renewcommandx* \renewcommandx*{\macroo}[1]{p #1 p}
+DeclareRobustCommand \DeclareRobustCommand{\macroq}[1]{q #1 q}
+DeclareRobustCommand* \DeclareRobustCommand*{\macror}[1]{r #1 r}
+DeclareRobustCommandx \DeclareRobustCommandx{\macros}[1]{s #1 s}
+DeclareRobustCommandx* \DeclareRobustCommandx*{\macrot}[1]{t #1 t}
Now use them all:
-\macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x}
+\macroa{x} \macrob{x} \macroc{x} \macrod{x} \macroe{x} \macrof{x} \macrog{x}
+\macroi{x} \macrok{x} \macrom{x} \macroo{x} \macroq{x} \macror{x}
+The following tow don't work, but they should???
+%\macros{x} \macrot{x}
+
\section{Special formattings\index{Special formattings}}
{\Huge \lyxline{\Huge}}{\Huge \par}
+
+\subsection{rules}
+
+test\rule[0.001\textwidth]{1\columnwidth}{0.05\textheight}
+
test
+\rule[0.5ex]{1\columnwidth}{1pt}
+
+\noindent \rule{1ex}{0.5cc}test
+
+\textcolor{red}{\rule[-4ex]{5in}{1cm}}
+
+
+\subsection{Phantoms}
+
+test\phantom{Wow}test
+
+test\hphantom{\textcolor{green}{W}\textbf{ow}\textsuperscript{Wow}}test
+
+test\vphantom{Wow\textbackslash{}\&\%}test
+
+$test\hphantom{Wow}test$
+
+\[
+test\phantom{\textcolor{green}{W}\mathbf{ow}\textsuperscript{Wow}}test
+\]
+
+
+$test\vphantom{Wow\&\%}test$
+
+
\subsection{Line breaks}
They can also or be broken by a newline\\
-or a newline command \newline
+or by a starred newline \\*
+or by a newline with space, comment and argument \\ %hu
+[3cm]
+or by a newline command \newline
or by a line break \linebreak
-or by a defined line break \linebreak[4]
+or by a defined line break \linebreak % again with a comment
+ [4]
There are even newlines with weird arguments, but these are not
handled by LyX\\*[1cm]
They can also or be broken by a newpage \newpage
or by a page break \pagebreak
-or by a defined page break \pagebreak[4]
+or by a defined page break \pagebreak % again with a comment
+ [4]
\section{Special characters\index{Special characters}}
ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
+LyX translates the phrases LyX, TeX, LaTeX2e and LaTeX
+to the commands \LyX{}, \TeX{}, \LaTeXe{} and \LaTeX{}.
+If these phrases occur as part of other words (like 1LyX or aTeX or LaTeX3)
+they should not be put into ERT.
+
Test for whitespace handling of commands: The following lines should
result in identical output:
\printindex{}
+\printnomenclature hello
+
+\settowidth{\nomlabelwidth}{URL2}
\printnomenclature{}
+\printnomenclature[0.02\linewidth]{}
+
\end{document}