Cmake tests: Added tex2lyx test for xltabular and tabularx

This commit is contained in:
Kornel Benko 2018-06-25 12:01:44 +02:00
parent 21005cbd6f
commit 41ddac5519
4 changed files with 515 additions and 0 deletions

View File

@ -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

View File

@ -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', \

View File

@ -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
<lyxtabular version="3" rows="7" columns="4">
<features rotate="0" islongtable="true" longtabularalignment="center" tabularwidth="14cm">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top" varwidth="true">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top" varwidth="true">
<row endhead="true">
<cell multicolumn="1" alignment="none" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none" special="c">
\begin_inset Text
\begin_layout Standard
xltabular
\end_layout
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
stretching this column. expecting a line break
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Left
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Right1
\end_layout
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
and this
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
</lyxtabular>
\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
<lyxtabular version="3" rows="4" columns="5">
<features rotate="0" tabularvalignment="middle" tabularwidth="14cm">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="left" valignment="top" varwidth="true">
<column alignment="center" valignment="top">
<row>
<cell multicolumn="1" alignment="none" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none" special="c">
\begin_inset Text
\begin_layout Standard
tabularx
\end_layout
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" rightline="true" usebox="none">
\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
</cell>
<cell alignment="none" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Left1
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Left2
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Right1
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
Left3long
\end_layout
\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
<cell alignment="none" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
\begin_inset Text
\end_inset
</cell>
</row>
</lyxtabular>
\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

View File

@ -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}