From 41ddac55193c97645bb2e10ac2898c09613d23ea Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Mon, 25 Jun 2018 12:01:44 +0200 Subject: [PATCH] Cmake tests: Added tex2lyx test for xltabular and tabularx --- src/tex2lyx/test/CMakeLists.txt | 1 + src/tex2lyx/test/runtests.py | 1 + src/tex2lyx/test/tabular-x-test.lyx.lyx | 456 ++++++++++++++++++++++++ src/tex2lyx/test/tabular-x-test.tex | 57 +++ 4 files changed, 515 insertions(+) create mode 100644 src/tex2lyx/test/tabular-x-test.lyx.lyx create mode 100644 src/tex2lyx/test/tabular-x-test.tex diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt index 375d1e2aec..f981f8a384 100644 --- a/src/tex2lyx/test/CMakeLists.txt +++ b/src/tex2lyx/test/CMakeLists.txt @@ -16,6 +16,7 @@ set(_tex_tests test.ltx box-color-size-space-align.tex CJK.tex CJKutf8.tex + tabular-x-test.tex test-insets-basic.tex test-insets.tex test-memoir.tex diff --git a/src/tex2lyx/test/runtests.py b/src/tex2lyx/test/runtests.py index 7c82909ded..7bfbfe52e9 100755 --- a/src/tex2lyx/test/runtests.py +++ b/src/tex2lyx/test/runtests.py @@ -78,6 +78,7 @@ def main(argv): 'box-color-size-space-align.tex', \ 'CJK.tex', \ 'CJKutf8.tex', \ + 'tabular-x-test.tex', \ 'test-insets.tex', \ 'test-insets-basic.tex', \ 'test-memoir.tex', \ diff --git a/src/tex2lyx/test/tabular-x-test.lyx.lyx b/src/tex2lyx/test/tabular-x-test.lyx.lyx new file mode 100644 index 0000000000..86d70983f5 --- /dev/null +++ b/src/tex2lyx/test/tabular-x-test.lyx.lyx @@ -0,0 +1,456 @@ +#LyX file created by tex2lyx 2.4 +\lyxformat 554 +\begin_document +\begin_header +\save_transient_properties true +\origin roundtrip +\textclass article +\begin_preamble + + + + + + + +\usepackage[english]{babel} + +\end_preamble +\use_default_options false +\maintain_unincluded_children false +\language english +\language_package default +\inputencoding iso8859-15 +\fontencoding T1 +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 0 +\use_package cancel 0 +\use_package esint 1 +\use_package mathdots 0 +\use_package mathtools 0 +\use_package mhchem 0 +\use_package stackrel 0 +\use_package stmaryrd 0 +\use_package undertilde 0 +\cite_engine biblatex-natbib +\cite_engine_type authoryear +\biblio_style plainnat +\use_bibtopic false +\biblatex_bibstyle authoryear +\biblatex_citestyle authoryear +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 0 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Standard +The first table is configured as longtable first, the selected variable length in second column and set the table width 14cm. +\end_layout + +\begin_layout Standard + +\begin_inset Tabular + + + + + + + + +\begin_inset Text + +\begin_layout Standard +xltabular +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +stretching this column. expecting a line break +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\begin_layout Standard +Left +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +Right1 +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +and this +\end_layout + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\end_inset + + +\end_layout + +\begin_layout Standard +The next table is a normal table, variable length of forth column and width 14cm table with, enclosing paragraph is not indented. +\end_layout + +\begin_layout Standard +\noindent + +\begin_inset Tabular + + + + + + + + + +\begin_inset Text + +\begin_layout Standard +tabularx +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +stretching this column only, expecting a line break, which comes later. The table width seems to be wrong +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\begin_inset Text + +\begin_layout Standard +Left1 +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +Left2 +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +Right1 +\end_layout + +\end_inset + + + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\begin_layout Standard +Left3long +\end_layout + +\end_inset + + +\begin_inset Text + +\end_inset + + +\begin_inset Text + +\end_inset + + + + +\end_inset + + +\begin_inset Note Note +status open +\begin_layout Plain Layout + +\begin_inset CommandInset bibtex +LatexCommand bibtex + +\end_inset + +\end_layout + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/src/tex2lyx/test/tabular-x-test.tex b/src/tex2lyx/test/tabular-x-test.tex new file mode 100644 index 0000000000..c66493c466 --- /dev/null +++ b/src/tex2lyx/test/tabular-x-test.tex @@ -0,0 +1,57 @@ +\documentclass{article} +\usepackage[T1]{fontenc} +\usepackage[latin9]{inputenc} +\PassOptionsToPackage{natbib=true}{biblatex} +\usepackage{tabularx} +\usepackage{xltabular} + +\makeatletter + +\makeatother + +\usepackage[english]{babel} +\usepackage[style=authoryear]{biblatex} +\begin{document} +The first table is configured as longtable first, the selected variable +length in second column and set the table width 14cm. + +\begin{xltabular}[c]{14cm}{|c|>{\centering\arraybackslash}X|c|>{\centering\arraybackslash}X|} +\hline +\hline +\multicolumn{4}{|c|}{xltabular}\tabularnewline +\hline +\hline +\endhead +\hline + & stretching this column. expecting a line break & & \tabularnewline +\hline +Left & & Right1 & \tabularnewline +\hline + & & & and this\tabularnewline +\hline + & & & \tabularnewline +\hline + & & & \tabularnewline +\hline + & & & \tabularnewline +\hline +\end{xltabular} + +The next table is a normal table, variable length of forth column +and width 14cm table with, enclosing paragraph is not indented. + +\noindent % +\begin{tabularx}{14cm}{|c|c|c|>{\raggedright\arraybackslash}X|c|} +\hline +\multicolumn{5}{|c|}{tabularx}\tabularnewline +\hline +\hline + & & & stretching this column only, expecting a line break, which comes later. +The table width seems to be wrong & \tabularnewline +\hline +Left1 & Left2 & & & Right1\tabularnewline +\hline + & & Left3long & & \tabularnewline +\hline +\end{tabularx} +\end{document}