From 82e997fd5f840f69da646e5c821386a920fa7967 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Tue, 25 Oct 2011 22:38:50 +0000 Subject: [PATCH] backporting tex2lyx: the TeX testfiles git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39980 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../test/box-color-size-space-align.tex | 11 +++ src/tex2lyx/test/test-insets.tex | 92 +++++++++++++++++++ src/tex2lyx/test/test-structure.tex | 9 ++ 3 files changed, 112 insertions(+) diff --git a/src/tex2lyx/test/box-color-size-space-align.tex b/src/tex2lyx/test/box-color-size-space-align.tex index 6c529326b9..33d76cd008 100644 --- a/src/tex2lyx/test/box-color-size-space-align.tex +++ b/src/tex2lyx/test/box-color-size-space-align.tex @@ -10,6 +10,10 @@ \usepackage{amsmath} \usepackage{color} +\definecolor{page_backgroundcolor}{rgb}{1, 0.3359375, 0} +\pagecolor{page_backgroundcolor} +\definecolor{document_fontcolor}{rgb}{0.66796875, 1, 0} +\color{document_fontcolor} \definecolor{note_fontcolor}{rgb}{0, 0, 1} \definecolor{shadecolor}{rgb}{1, 0, 0} \usepackage{framed} @@ -140,6 +144,11 @@ $\boxed{\int A=B}$ \begin{shaded}% Shaded background box\end{shaded} +\begin{minipage}[c]{1\columnwidth}% +\begin{shaded}% +Shaded background box, with inner minipage\end{shaded}% +\end{minipage} + \section{Colors} \subsection{Predefined Colors} @@ -313,6 +322,8 @@ We also handle defined spaces: Interword\ a +Visible\textvisiblespace{}a + Thin\,a Medium\:a diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index a6a5cdfe3a..efaf11f5df 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -110,6 +110,7 @@ in their names. It's OK to use them in the man\"{u}script, though. \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 @@ -119,16 +120,19 @@ variant \include{DummyDocument} % unfortunately, including the doc twice 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{Lists\index{Lists}} \listoffigures \listoftables + \section{Graphics\index{Graphics}} There is also some basic support for graphics, in the form @@ -273,6 +277,7 @@ Now use them all: The following tow don't work, but they should??? %\macros{x} \macrot{x} + \section{Special formattings\index{Special formattings}} \subsection{LyX line} @@ -289,8 +294,90 @@ test {\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{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\phantom{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\\ @@ -344,6 +431,11 @@ with $a^2+b^2=c^2$ math}. \printindex{} +\printnomenclature hello + +\settowidth{\nomlabelwidth}{URL2} \printnomenclature{} +\printnomenclature[0.02\linewidth]{} + \end{document} diff --git a/src/tex2lyx/test/test-structure.tex b/src/tex2lyx/test/test-structure.tex index 95d5be3f8e..b79e7ab53f 100644 --- a/src/tex2lyx/test/test-structure.tex +++ b/src/tex2lyx/test/test-structure.tex @@ -17,12 +17,21 @@ \renewcommand{\makelabel}[1]{##1\hfil}}} {\end{list}} +% LyX will also recognize this command: +% \@ifundefined{date}{}{\date{}} +% and also this: +% \date{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \newenvironment{foo}{==[}{]==} \begin{document} +\title{Title} + +\date{} + +\maketitle This document contains all sorts of layouts we are supposed to support, along with weird nestings. -- 2.39.5