DocBook: implement CALS tables
Thibaut Cuvelier
tcuvelier at lyx.org
Wed Jul 15 18:47:18 UTC 2020
On Wed, 15 Jul 2020 at 18:15, Richard Kimberly Heck <rikiheck at lyx.org>
wrote:
> On 7/15/20 10:20 AM, Thibaut Cuvelier wrote:
>
> From 39389b2776315b3414015de5265bab2c4e3d9087 Mon Sep 17 00:00:00 2001
> From: Thibaut Cuvelier <tcuvelier at lyx.org> <tcuvelier at lyx.org>
> Date: Mon, 13 Jul 2020 03:31:48 +0200
> Subject: [PATCH] Add support for CALS tables in DocBook.
>
> ---
> development/FORMAT | 4 +
> lib/lyx2lyx/lyx_2_4.py | 19 +++-
> src/BufferParams.cpp | 7 ++
> src/BufferParams.h | 9 ++
> src/frontends/qt/GuiDocument.cpp | 11 +++
> src/frontends/qt/ui/OutputUi.ui | 154 ++++++++++++++++++++++---------
> src/insets/InsetTabular.cpp | 135 ++++++++++++++++++++++++---
> src/insets/InsetTabular.h | 9 +-
> src/tex2lyx/Preamble.cpp | 2 +
> src/tex2lyx/Preamble.h | 1 +
> src/version.h | 4 +-
> 11 files changed, 291 insertions(+), 64 deletions(-)
>
> diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
> index c4d63cab14..bdf5118dbf 100644
> --- a/lib/lyx2lyx/lyx_2_4.py
> +++ b/lib/lyx2lyx/lyx_2_4.py
> @@ -3922,6 +3922,19 @@ def revert_libertinus_sftt_fonts(document):
> add_to_preamble(document,
> ["\\renewcommand*{\\LibertinusMono at scale}{" + str(tt_scale / 100.0) +
> "}"])
>
>
> +def convert_docbook_table_output(document):
> + if find_token(document.header, '\\docbook_table_output 0') == -1 and \
> + find_token(document.header, '\\docbook_table_output 1') == -1:
> + document.append_local_layout('\\docbook_table_output 0')
>
> This is wrong: You're appending to the 'local layout' information, which
> is why we are then seeing a failure to convert that. (The tag is invalid,
> as layout.) You want to append to the preamble, so:
>
> append_to_preamble(document, '\\docbook_table_output 0')
>
> though, since we have already checked whether it is there (add_to_preamble
> checks that), probably just:
>
> document.preamble.append('\\docbook_table_output 0')
>
> Probably add_to_preamble should be a method of the document object, but
> the lyx2lyx code does not always make a lot of sense.
>
> Riki
>
Thanks, it looks so dumb! I attached the new version of the patch, is it
OK to push it as is?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200715/400b8484/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-CALS-tables-in-DocBook.patch
Type: application/x-patch
Size: 22451 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200715/400b8484/attachment-0001.bin>
More information about the lyx-devel
mailing list