X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftest%2Ftest-insets.tex;h=b3e7795d95f01888ed2d7d06ccae8756fbd9bfd0;hb=d3c63f97c4fce4e091277ced6c1829473c311231;hp=ce9477ce2232595960f5e7693797b62fe74f8b6c;hpb=190ab4774db9d24dcebb29274c019e06f5c1a61c;p=lyx.git diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index ce9477ce22..b3e7795d95 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -18,15 +18,31 @@ \providecommand{\makenomenclature}{\makeglossary} \makenomenclature \usepackage{varioref} -\usepackage{prettyref} -\usepackage{makeidx} \usepackage{splitidx} \makeindex - +\newindex[Index]{idx} +\newindex[new]{new} +\newindex{test} \usepackage{graphicx} \usepackage{longtable} \usepackage{xargs} \usepackage{subscript} +\usepackage{rotating} +\usepackage{listings} +\usepackage{hyperref} +\usepackage{array} +\usepackage{booktabs} +\usepackage{multirow} +\usepackage{hhline} +\usepackage{dcolumn} +\usepackage{pdfpages} +\usepackage{textcomp} +\usepackage{amssymb} +\usepackage{color} +\usepackage[ps,mover]{lyxskak} +\usepackage{tipa} +\usepackage{tipx} +\usepackage{tone} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. \providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@} @@ -38,11 +54,25 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. +% Load refstyle before prettyref so that prettyref wins. +% The real refstyle tests are in test-refstyle-theorems.tex. +\usepackage{refstyle} +\AtBeginDocument{\providecommand\secref[1]{\ref{sec:#1}}} +\usepackage{prettyref} + \def\mycommand{\textquestiondown} \begin{document} +\title{Title} + +\date %stupid stuff +{two days ago} + +\maketitle + \tableofcontents +\lstlistoflistings \noindent This paragraph is not indented. @@ -57,7 +87,10 @@ Of course there are other kind of references, like page reference~\pageref{lab:test}, but also equation reference~\eqref{lab:test} (from amsmath package), or varioref's equivalents~\vref{lab:test} and~\vpageref{lab:test}, without -forgetting pretty references like~\prettyref{lab:test}. +forgetting pretty references like~\prettyref{lab:test} as well as textual +references like~\nameref{lab:test}. +The command \secref{lab:test} will be parsed in ERT, since LyX +does not support refstyle and prettyref natively at the same time. \section{Cites\index{Cites}} @@ -108,6 +141,8 @@ 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[M\"{o}stl et~al.(2010)]{Mostl2010} Gürkan, M.~A., Freitag, +M., \& Rasio, F.~A. 2004, ApJ, 604, 632 \bibitem[{{G\"{u}rkan et~al.}(2004)}]{gur+04} Gürkan, M.~A., Freitag, M., \& Rasio, F.~A. 2004, ApJ, 604, 632\end{thebibliography} @@ -115,7 +150,18 @@ 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 (tests quoting as well): +\include{\string"Dummy\space Document\string".tex} +\include{\string"Dummy Document\string".tex} +\include{\string"Dummy\string~Document\string"} +\include{\string"Dummy\string~Document\string".tex} +File names containg double quotes are not legal on windows, so no test file +is provided. Nevertheless, they are legal on unix, so we test at least the +parsing. File names containing spaces can not be handled by automake +(make dist would fail), so no test file is provided as well. +Since the files do not exist, the variants without extension would +not work (tex2lyx can't deduce the correct extension of nonexisting files). +\include{\string"Dummy\string"Document\string".tex} We can also import chess diagrams: @@ -123,7 +169,11 @@ We can also import chess diagrams: Spreadsheets: -\def\inputGnumericTable{}\input{../../../lib/examples/longsheet.gnumeric} +\def\inputGnumericTable{}\input{../../../lib/examples/longsheet.tex} + +XFig drawings: + +\input{xfigtest.pstex_t} and PDF pages: @@ -137,6 +187,8 @@ between~\verbatiminput{foo} or~\verbatiminput*{foo}. An URL: \url{http://www.lyx.org} \nomenclature{URL2}{uniform resource locator} +An URL with strange characters: \url{http://www.lyx.org/percent%dollar$} + link:\href{http://www.test.test}{www.test.test} link2:\href{http://www.test.test}{http://www.test.test} @@ -149,6 +201,10 @@ ftp:\href{ftp://www.test.test}{ftp://www.test.test} ftp2:\href{ftp://www.test.test}{www.test.test} +parser test (stupid, but valid):\href{http://www.test.test}{\}} + +parser test (escaped):\href{http://www.test.test}{a brace \} and another one \{ and something} + \section{Lists\index{Lists}} @@ -156,6 +212,42 @@ ftp2:\href{ftp://www.test.test}{www.test.test} \listoftables +\section{Listings} + +Inline: \lstinline[language={C++},keywordstyle={\color{green}}]!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 @@ -191,10 +283,13 @@ KILLED & LINE!!!! \kill \textbf{First}&\textbf{Second}\\ \hline\hline \endhead +\caption* +{standard foot}\\ \hline This goes at the&bottom.\\ \hline \endfoot +\caption*{(last foot)}\\ \hline These lines will&appear\\ in place of the & usual foot\\ @@ -331,7 +426,7 @@ A table*: \begin{tabular*} % some comment {0.8\columnwidth}[b]{lr} two\\ -lonely&lines +\begin{turn}{-50}lonely\end{turn}&\begin{sideways}lines\end{sideways} \end{tabular*} A booktabs table: @@ -360,6 +455,36 @@ in \% of pixel size & 76.3 & 95.9 & 92.3\tabularnewline \end{tabular} \end{table} +A table using dcolumn: + +\begin{table} +\begin{tabular}{ccddd} +One&Two& +\multicolumn{1}{c}{\textrm{Three}}& +\multicolumn{1}{c}{\textrm{Four}}& +\multicolumn{1}{c}{\textrm{Five}}\\ +\hline +one&two&\mbox{three}&\mbox{four}&\mbox{five}\\ +He&2& 2.77234 & 45672. & 0.69 \\ +C\footnote{Some tables require footnotes.} +&C\footnote{Some tables need more than one footnote.} +& 12537.64 & 37.66345 & 86.37 \\ +\end{tabular} +\end{table} + + +A table using decimal alignment: + +\begin{table} +\begin{tabular}{ccr@{\extracolsep{0pt}.}lr@{\extracolsep{0pt}.}lr@{\extracolsep{0pt}.}l} +One & Two & \multicolumn{2}{c}{Three} & \multicolumn{2}{c}{Four} & \multicolumn{2}{c}{Five}\tabularnewline +\hline +one & two & \multicolumn{2}{c}{three} & \multicolumn{2}{c}{four} & \multicolumn{2}{c}{five}\tabularnewline +He & 2 & 2&77234 & 45672& & 0&69 \tabularnewline +C & C & 12537&64 & 37&66345 & 86&37 \tabularnewline +\end{tabular} +\end{table} + \section{Macros} @@ -409,7 +534,11 @@ test {\Huge \lyxline{\Huge}}{\Huge \par} -\subsection{rules} +\subsection{Rules} + +test + +{\tiny \rule[0.5ex]{1\linewidth}{1pt}}{\tiny \par} test\rule[0.001\textwidth]{1\columnwidth}{0.05\textheight} @@ -440,6 +569,80 @@ test\phantom{\textcolor{green}{W}\mathbf{ow}\textsuperscript{Wow}}test $test\vphantom{Wow\&\%}test$ +\subsection{TIPA} + +\begin{IPA} +\textsubring{e} +\r{e} +\textsubwedge{e} +\textsubumlaut{e} +\textsubtilde{e} +\textseagull{e} +\textsubbridge{e} +\textinvsubbridge{e} +\textsubsquare{e} +e\textsuperscript{h} +\textsubrhalfring{e} +\textsublhalfring{e} +\textsubplus{e} +\=*{e} +(don't mix up with \b{e}) +\"{e} +\textovercross{e} +\s{e} +\textsyllabic{e} +\textsubarch{e} +e\textrhoticity +e\textsuperscript{w} +e\textsuperscript{j} +e\textsuperscript{\textgamma} +e\textsuperscript{\textrevglotstop} +\textsuperimposetilde{e} +\textraising{e} +\textlowering{e} +\textadvancing{e} +\textretracting{e} +\~{e} +e\textsuperscript{n} +e\textsuperscript{l} +e\textcorner{} +\H{e} + +\`{e} +\={e} +\'{e} +\textdoublegrave{e} +\v{e} +\^{e} +\texthighrise{e} +\textlowrise{e} +\textrisefall{e} +\u{e} +\end{IPA} + +\textipa{pbtd\:t\:dc\textbardotlessj k\textscriptg q\;G} +\textipa{PmMn\:n\textltailn N\;N\;Br\;RR} +\textipa{\:rFBfvTDszSZ\:s} +\textipa{\:zçJxGXK\textcrh QhH\textbeltl{}} +\textipa{\textlyoghlig V\*r\:Rh\textturnmrleg l\:lL\;L} + +\textipa{\!o|!\textdoublebarpipe ||\!b\!d\!j\!g\!Ge'} + +\textipa{iy1\textbaru W\textcolor{red}{uIY}Ueø987o@E½3\textcloserevepsilon 2Oæ5a\textscoelig A6} + +\textipa{\*ww4\;H\textbarrevglotstop\textbarglotstop C\textctz\textturnlonglegr\texththeng \texttoptiebar{ar}\textbottomtiebar{tz}} + +\textipa{:;e\textprimstress\textsecstress \textvertline{}\textdoublevertline{}.\t*{ }} + +\textipa{\tone{55}\tone{44}\tone{33}\tone{22}\tone{11}\textdownstep\textupstep \tone{15}\tone{51}\tone{45}\tone{12}\tone{454}\textglobrise \textglobfall{}} + +TIPA code in math: +$\textipa{\tone{55}|\text{\!b{}\!d{}\!g{}\!G{}\textglobfall{}\textvertline{}\textdoublevertline{}}}$ + +\subsection{Other symbols} +All three should be converted to U+00C5: \AA{} \r A \r{A} (not U+212B). +All three should be converted to U+00E5: \aa{} \r a \r{a}. + \subsection{Line breaks\sindex[breaks]{Line breaks}} They can also or be broken by a newline\\ @@ -462,6 +665,7 @@ or by a page break \pagebreak or by a defined page break \pagebreak % again with a comment [4] + \section{Special characters\index{Special characters}} Then one has those macros with a long name for a short meaning, like @@ -473,6 +677,10 @@ And what about special characters like hyphe\-nation mark, ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break. +There are dashes: endash in short form -- and long form \textendash, +emdash is alike: --- and \textemdash. If we really want several hyphens +in a row, we need to separate them: -{}-, -{}-{}-, -{}-{}-{}- etc. + 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) @@ -491,12 +699,87 @@ builtin \textasciicircum % with a comment A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script with $a^2+b^2=c^2$ math}. +latex2writer outputs quotes in braces like {\textquoteright}. We swallow the, +but this was one broken (bug 8903). + + +\section{Mathematics\index{Mathematics}} + +Let $f:\left[ a,b\right] \rightarrow% +%TCIMACRO{\U{211d} }% +%BeginExpansion +\mathbb{R} +%EndExpansion +$. + +\[ +\begin{array}{rclccc} +1 + 2 & = & 3 +\multicolumn{3}{c}{4 < 5 \leq 6 } +\end{array} +\] + + +\section{Lists/Indices} + +single \textbackslash{}addcontentsline: \addcontentsline{toc}{section}{test} + +with \textbackslash{}addcontentsline and \textbackslash{}phantomsection: + +\bibliographystyle{test} +\phantomsection\addcontentsline{toc}{section}{\refname}\bibliography{xampl} + + +normal: + +\bibliographystyle{test} +\bibliography{xampl} + + +with wrong \textbackslash{}addcontentsline: + +\bibliographystyle{test} \addcontentsline{toc}{section}{test} \bibliographystyle{test} +\bibliography{xampl} + + +with \textbackslash{}addcontentsline and \textbackslash{}nocite\{{*}\}: + +\bibliographystyle{test} +\addcontentsline{toc}{section}{\refname}\nocite{*} +\bibliography{xampl} + + +undefined index: + \printindex{} +index "idx": + +\printindex[idx]{} + +index "new": + +\printindex[new]{} + +subindex "new": + +\printsubindex[idx]{} + +index of all indices: + +\printindex*{} + +subindex of all indices: + +\printsubindex*{} + +normal nomenclature: + \printnomenclature hello -\settowidth{\nomlabelwidth}{URL2} -\printnomenclature{} +manually set width: \settowidth{\nomlabelwidth}{URL2} \printnomenclature{} + +nomenclature with set width: \printnomenclature[0.02\linewidth]{}