mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
tex2lyx: use the same test files as in trunk to uncover bugs that are only in branch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@25920 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0a263166c3
commit
282f58b796
5
src/tex2lyx/DummyDocument.tex
Normal file
5
src/tex2lyx/DummyDocument.tex
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
\subsection{\label{sub:External-Subsection}External Subsection}
|
||||
|
||||
This is a small dummy child document to show how files can be inserted
|
||||
to another document.
|
306
src/tex2lyx/box-color-size-space-align.tex
Normal file
306
src/tex2lyx/box-color-size-space-align.tex
Normal file
@ -0,0 +1,306 @@
|
||||
\documentclass[b4paper,twoside, twocolumn,12pt]{article}
|
||||
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[latin9]{inputenc}
|
||||
|
||||
\usepackage{geometry}
|
||||
\geometry{verbose,landscape,b4paper,tmargin=1cm,bmargin=2cm,lmargin=3cm,rmargin=4cm,headheight=6cm,headsep=5cm,footskip=7cm,columnsep=8cm}
|
||||
|
||||
\usepackage{amsmath}
|
||||
\usepackage{color}
|
||||
|
||||
\setlength{\parskip}{3mm}
|
||||
\setlength{\parindent}{0sp}
|
||||
\usepackage{setspace}
|
||||
\setstretch{1.2}
|
||||
|
||||
\setlength{\fboxsep}{3mm}
|
||||
|
||||
\definecolor{darkgreen}{cmyk}{0.5, 0, 1, 0.5}
|
||||
|
||||
\usepackage{ifpdf} % part of the hyperref bundle
|
||||
\ifpdf % if pdflatex is used
|
||||
|
||||
% set fonts for nicer pdf view
|
||||
\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
|
||||
|
||||
% link all cross references and URLs in pdf output
|
||||
\usepackage[colorlinks=true, bookmarks, bookmarksnumbered,
|
||||
bookmarksopen, bookmarksopenlevel=2,
|
||||
linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,
|
||||
pdfpagelayout=OneColumn, pdfnewwindow=true,
|
||||
pdfstartview=XYZ, plainpages=false, pdfpagelabels,
|
||||
pdfauthor={LyX Team}, pdftex,
|
||||
pdftitle={tex2lyx testcase},pdfsubject={tex2lyx},
|
||||
pdfkeywords={LyX, tex2lyx}]{hyperref}
|
||||
|
||||
\else % if dvi or ps is produced
|
||||
|
||||
% link all cross references and URLs in dvi output
|
||||
\usepackage[ps2pdf]{hyperref}
|
||||
|
||||
\fi % end if pdflatex is used
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
\section{Boxes}
|
||||
|
||||
\subsection{Frameless Boxes}
|
||||
|
||||
blabla \mbox{mbox} blabla
|
||||
|
||||
blabla \makebox{makebox 1} blabla
|
||||
|
||||
blabla \makebox[3cm]{makebox 2} blabla
|
||||
|
||||
blabla \makebox[3cm][l]{makebox 3} blabla
|
||||
|
||||
\begin{figure}[ht]
|
||||
\centering
|
||||
\setlength{\unitlength}{.2in}
|
||||
|
||||
\begin{picture}(8,6)
|
||||
\put(0,0){\makebox(0,0)[tr]{AAA}}
|
||||
\put(8,0){\makebox(0,0){BBB}}
|
||||
\put(1,0){\line(1,0){6}}
|
||||
\end{picture}
|
||||
|
||||
\end{figure}
|
||||
|
||||
\raisebox {8.5mm}{test}\raisebox {-6.5mm}{tset}
|
||||
|
||||
\subsection{Framed Boxes}
|
||||
|
||||
blabla \fbox{fbox} blabla
|
||||
|
||||
blabla \framebox{framebox 1} blabla
|
||||
|
||||
blabla \framebox[3cm]{framebox 2} blabla
|
||||
|
||||
blabla \framebox[3cm][l]{framebox 3} blabla
|
||||
|
||||
Dies ist ein Beispieltext. %
|
||||
\framebox{%
|
||||
\begin{minipage}[c][1\totalheight][s]{0.2\columnwidth}%
|
||||
\begin{center}
|
||||
Der Boxinhalt
|
||||
\par\end{center}
|
||||
|
||||
\begin{center}
|
||||
ist über die
|
||||
\par\end{center}
|
||||
|
||||
\begin{center}
|
||||
Boxhöhe
|
||||
\par\end{center}
|
||||
|
||||
\begin{center}
|
||||
gleichmäßig verteilt.
|
||||
\par\end{center}%
|
||||
\end{minipage}}
|
||||
Dies ist ein Beispieltext.
|
||||
|
||||
$\boxed{\int A=B}$
|
||||
|
||||
\section{Colors}
|
||||
|
||||
\subsection{Predefined Colors}
|
||||
|
||||
test \textcolor{blue}{blue} test \textcolor{red}{red red red} test \textcolor{green}{bla}\textcolor{magenta}{blub}
|
||||
test
|
||||
\textcolor{green}{c}%
|
||||
\textcolor{red}{o}%
|
||||
\textcolor{blue}{l}%
|
||||
\textcolor{green}{o}%
|
||||
\textcolor{red}{r}
|
||||
|
||||
\subsection{Custom Colors}
|
||||
|
||||
test \textcolor{darkgreen}{dark green} test
|
||||
|
||||
\definecolor{violet}{rgb}{0.5, 0, 1}
|
||||
|
||||
test \textcolor{violet}{violet} test
|
||||
|
||||
\section{Font sizes}
|
||||
|
||||
\Huge Huge text
|
||||
|
||||
\huge huge text
|
||||
|
||||
\LARGE LARGE text
|
||||
|
||||
\Large Large text
|
||||
|
||||
\large large text
|
||||
|
||||
\normalsize normalsize text
|
||||
|
||||
\small small text
|
||||
|
||||
\footnotesize footnotesize text
|
||||
|
||||
\scriptsize scriptsize text
|
||||
|
||||
\tiny tiny text
|
||||
|
||||
\Huge Huge text \huge huge text \LARGE LARGE text \Large Large text
|
||||
\large large text \normalsize normalsize text \small small text
|
||||
\footnotesize footnotesize text \scriptsize scriptsize text \tiny tiny text
|
||||
|
||||
\normalsize Font size switches don't affect section headings!
|
||||
|
||||
\scriptsize bla blub
|
||||
|
||||
\section{Font size dummy 1}
|
||||
|
||||
bla blub
|
||||
|
||||
bla blub
|
||||
|
||||
\section*{Font size dummy 2}
|
||||
|
||||
bla blub
|
||||
\normalsize
|
||||
|
||||
\section{Paragraph spacing}
|
||||
|
||||
bla
|
||||
|
||||
\begin{singlespace}
|
||||
singlespace single singlespace single singlespace single singlespace single
|
||||
singlespace single singlespace single singlespace single singlespace single
|
||||
\end{singlespace}
|
||||
|
||||
\begin{onehalfspace}
|
||||
onehalfspace 1 onehalfspace 1 onehalfspace 1 onehalfspace 1 onehalfspace 1
|
||||
onehalfspace 1 onehalfspace 1 onehalfspace 1 onehalfspace 1 onehalfspace 1
|
||||
|
||||
onehalfspace 2 onehalfspace 2 onehalfspace 2 onehalfspace 2 onehalfspace 2
|
||||
onehalfspace 2 onehalfspace 2 onehalfspace 2 onehalfspace 2 onehalfspace 2
|
||||
\end{onehalfspace}
|
||||
|
||||
blub
|
||||
|
||||
\begin{onehalfspace}
|
||||
onehalfspace single onehalfspace single onehalfspace single onehalfspace single
|
||||
onehalfspace single onehalfspace single onehalfspace single onehalfspace single
|
||||
\end{onehalfspace}
|
||||
|
||||
blablub
|
||||
|
||||
\begin{doublespace}
|
||||
doublespace single doublespace single doublespace single doublespace single
|
||||
doublespace single doublespace single doublespace single doublespace single
|
||||
\end{doublespace}
|
||||
|
||||
\begin{spacing}{1.2}
|
||||
1.2 spacing single 1.2 spacing single 1.2 spacing single 1.2 spacing single
|
||||
1.2 spacing single 1.2 spacing single 1.2 spacing single 1.2 spacing single
|
||||
\end{spacing}
|
||||
|
||||
\section{Paragraph alignment}
|
||||
|
||||
bla
|
||||
|
||||
\begin{center}
|
||||
center single center single center single center single center single
|
||||
center single center single center single center single center single
|
||||
\end{center}
|
||||
|
||||
blabla
|
||||
|
||||
\begin{flushleft}
|
||||
flushleft 1 flushleft 1 flushleft 1 flushleft 1 flushleft 1 flushleft 1
|
||||
flushleft 1 flushleft 1 flushleft 1 flushleft 1 flushleft 1 flushleft 1
|
||||
|
||||
flushleft 2 flushleft 2 flushleft 2 flushleft 2 flushleft 2 flushleft 2
|
||||
flushleft 2 flushleft 2 flushleft 2 flushleft 2 flushleft 2 flushleft 2
|
||||
\end{flushleft}
|
||||
|
||||
blub
|
||||
|
||||
\begin{flushleft}
|
||||
flushleft single flushleft single flushleft single flushleft single
|
||||
flushleft single flushleft single flushleft single flushleft single
|
||||
\end{flushleft}
|
||||
|
||||
blablub
|
||||
|
||||
\begin{flushright}
|
||||
flushright single flushright single flushright single flushright single
|
||||
flushright single flushright single flushright single flushright single
|
||||
\end{flushright}
|
||||
|
||||
bla
|
||||
|
||||
\centering
|
||||
centering single centering single centering single centering single
|
||||
centering single centering single centering single centering single
|
||||
|
||||
blabla
|
||||
|
||||
\raggedright
|
||||
raggedright 1 raggedright 1 raggedright 1 raggedright 1 raggedright 1
|
||||
raggedright 1 raggedright 1 raggedright 1 raggedright 1 raggedright 1
|
||||
|
||||
raggedright 2 raggedright 2 raggedright 2 raggedright 2 raggedright 2
|
||||
raggedright 2 raggedright 2 raggedright 2 raggedright 2 raggedright 2
|
||||
|
||||
\raggedleft
|
||||
raggedleft 1 raggedleft 1 raggedleft 1 raggedleft 1 raggedleft 1
|
||||
raggedleft 1 raggedleft 1 raggedleft 1 raggedleft 1 raggedleft 1
|
||||
|
||||
raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2
|
||||
raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2
|
||||
|
||||
%set back to justified
|
||||
\raggedright{}
|
||||
|
||||
\subsection{Horizontal spaces}
|
||||
|
||||
Lines can have an hfill \hfill in the middle.
|
||||
Lines can have a protected hfill \hspace*{\fill} in the middle.
|
||||
Lines can have space \hspace{2cm} in the middle.
|
||||
Lines can have protected space \hspace*{2cm} in the middle.
|
||||
|
||||
We also handle defined spaces:
|
||||
|
||||
Interword\ a
|
||||
|
||||
Thin\,a
|
||||
|
||||
NegThin\negthinspace{}a
|
||||
|
||||
enskip\enskip{}a
|
||||
|
||||
quad\quad{}a
|
||||
|
||||
qquad\qquad{}a
|
||||
|
||||
\subsection{Vertical spaces}
|
||||
|
||||
Lines can have an vfill \vfill in the middle.
|
||||
Lines can have a protected vfill \vspace*{\fill} in the middle.
|
||||
Lines can have vertical space \vspace{2cm} in the middle.
|
||||
Lines can have protected vertical space \vspace*{2cm} in the middle.
|
||||
|
||||
We also handle skips:
|
||||
|
||||
bigskip 1:\bigskip
|
||||
|
||||
bigskip 2:\vspace{\bigskipamount}
|
||||
|
||||
medskip 1:\medskip
|
||||
|
||||
medskip 2:\vspace{\medskipamount}
|
||||
|
||||
smallskip 1:\smallskip
|
||||
|
||||
smallskip 2:\vspace{\smallskipamount}
|
||||
|
||||
|
||||
\end{document}
|
@ -1,11 +1,34 @@
|
||||
\documentclass{article}
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[latin9]{inputenc}
|
||||
|
||||
\setlength{\parindent}{3mm}
|
||||
\usepackage{setspace}
|
||||
\onehalfspacing
|
||||
|
||||
\usepackage{amsmath}
|
||||
|
||||
\usepackage{verbatim}
|
||||
|
||||
\usepackage{varioref}
|
||||
\usepackage{prettyref}
|
||||
|
||||
\usepackage{graphicx}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
|
||||
\newcommand{\lyxline}[1][1pt]{%
|
||||
\par\noindent%
|
||||
\rule[.5ex]{\linewidth}{#1}\par}
|
||||
|
||||
\newcommand{\lyxarrow}{\leavevmode\,$\triangleright$\,\allowbreak}
|
||||
|
||||
\begin{document}
|
||||
|
||||
This document contains all sorts of insets we are supposed to
|
||||
support.
|
||||
\tableofcontents
|
||||
|
||||
\section{Things that work}
|
||||
\noindent This paragraph is not indented.
|
||||
|
||||
\section{References}
|
||||
|
||||
Let's start with simple things: a label~\label{lab:test} and a
|
||||
reference~\ref{lab:test}; note that I have tested ``unbreakable
|
||||
@ -18,54 +41,69 @@ 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}.
|
||||
|
||||
We can input files too, like this \input{foo}, or with the include
|
||||
variant \include{foo}
|
||||
\section{Input files}
|
||||
|
||||
We can input files too, like this \input{DummyDocument}, or with the include
|
||||
variant \include{DummyDocument}
|
||||
|
||||
If you prefer verbatim input, you can choose
|
||||
between~\verbatiminput{foo} or~\verbatiminput*{foo}.
|
||||
|
||||
If you like tables of contents, you will be happy to learn that
|
||||
the following ones are supported:
|
||||
\tableofcontents
|
||||
\section{Lists}
|
||||
|
||||
\listoffigures
|
||||
\listoftables
|
||||
|
||||
\section{Graphics}
|
||||
|
||||
There is also some basic support for graphics, in the form
|
||||
\includegraphics{foo.eps}, or the slightly more elaborate
|
||||
\includegraphics[height=1cm, width=1cm]{foo.eps}.
|
||||
\includegraphics[bb=10bp 0bp 96bp 96bp,clip,height=1cm, width=1cm]{foo.eps}.
|
||||
|
||||
Lines can have an \hfill in the middle, or be broken by a newline\\
|
||||
there are even newlines with weird arguments, but these are not
|
||||
\section{Special formattings}
|
||||
|
||||
\subsection{LyX line}
|
||||
|
||||
test
|
||||
|
||||
{\tiny \lyxline{\tiny}}{\tiny \par}
|
||||
|
||||
test {\Huge Test} {\tiny test} test
|
||||
|
||||
\lyxline{\normalsize}
|
||||
|
||||
test
|
||||
|
||||
{\Huge \lyxline{\Huge}}{\Huge \par}
|
||||
|
||||
test
|
||||
|
||||
\subsection{Line breaks}
|
||||
|
||||
They can also or be broken by a newline\\
|
||||
or a newline command \newline
|
||||
or by a line break \linebreak
|
||||
or by a defined line break \linebreak[4]
|
||||
|
||||
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}
|
||||
|
||||
They can also or be broken by a newpage \newpage
|
||||
or by a page break \pagebreak
|
||||
or by a defined page break \pagebreak[4]
|
||||
|
||||
\section{Special characters}
|
||||
|
||||
Then one has those macros with a long name for a short meaning, like
|
||||
\textasciitilde, \textasciicircum{} or \textbackslash{}, and the characters
|
||||
that LaTeX wants to espace because they are active, like \_\&\#\$\{\}\%.
|
||||
|
||||
And what about special characters like hyphe\-nation mark,
|
||||
ellipsis\ldots, and end-of-sentence\@. LyX also sports a menu
|
||||
separator\lyxarrow and a spif\textcompwordmark fy ligature break.
|
||||
|
||||
What else? Maybe minipages, like this:
|
||||
\begin{minipage}{10cm}
|
||||
Hi there, I am a minipage!
|
||||
\end{minipage}
|
||||
|
||||
There is also an option to align vertically the minipage:
|
||||
\begin{minipage}[t]{0.3\columnwidth}
|
||||
Actually, it is also possible to set the height and the inner position
|
||||
of the minipage, but the LyX GUI does not use or allow to modify this
|
||||
information. Nevertheless, tex2lyx converts it as faithfully as possible.
|
||||
\end{minipage}
|
||||
|
||||
|
||||
\section{Things that do not work (yet)}
|
||||
|
||||
\vspace*{1cm}
|
||||
LyX can do vertical spacing, even with the nifty 'keep' option
|
||||
\bigskip
|
||||
|
||||
ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
|
||||
separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
|
||||
|
||||
|
||||
\end{document}
|
||||
|
@ -1,4 +1,4 @@
|
||||
\documentclass{article}
|
||||
\documentclass[legalpaper]{article}
|
||||
|
||||
\newenvironment{foo}{==[}{]==}
|
||||
|
||||
@ -117,4 +117,16 @@ or even bibliography
|
||||
\bibitem{FOO} Edward Bar. \emph{The Foo Book}. (1999)
|
||||
\end{thebibliography}
|
||||
|
||||
\appendix
|
||||
|
||||
\section{This is the Appendix}
|
||||
|
||||
\noindent blabla bla bla
|
||||
|
||||
|
||||
\section{Another Appendix section}
|
||||
|
||||
blub
|
||||
|
||||
|
||||
\end{document}
|
||||
|
Loading…
x
Reference in New Issue
Block a user