From 1b45c9a8c92e6ecc21e083dd6ed96ffe01e8728d Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 21 Mar 2017 12:13:09 +0100 Subject: [PATCH 1/1] tabelka for one-page tables --- librarian/pdf.py | 3 ++- librarian/pdf/wl2tex.xslt | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/librarian/pdf.py b/librarian/pdf.py index c8af03b..927b50d 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -18,6 +18,7 @@ from tempfile import mkdtemp, NamedTemporaryFile import re from copy import deepcopy from subprocess import call, PIPE +from itertools import chain from Texml.processor import process from lxml import etree @@ -102,7 +103,7 @@ def fix_tables(doc): if kol.tail is not None: if not kol.tail.strip(): kol.tail = None - for table in doc.iter(tag='tabela'): + for table in chain(doc.iter(tag='tabela'), doc.iter(tag='tabelka')): if table.get('ramka') == '1' or table.get('ramki') == '1': table.set('_format', '|' + 'X|' * len(table[0])) else: diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index d39dea5..c3054d2 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -472,7 +472,13 @@ 1em - to \textwidth + + + + longtabu + tabu + + to \textwidth @@ -484,7 +490,7 @@ - + 1em -- 2.20.1