From f0e10602c24f1a040baf8f0213e54a70bd24c22f Mon Sep 17 00:00:00 2001 From: Shun Wang Date: Mon, 25 Sep 2023 15:59:48 +0800 Subject: [PATCH] Bugfix: handle wide table and Rsyntax printing (#5248) * Bugfix: fix export width table of PDF This will unify the width of the tables in the PDF, not a perfect solution, but for now it can handle with wide tables of about <30 columns. * adjust syntax display and print style * Reference A4 paper size --- Desktop/html/css/jasp.css | 4 ++++ Desktop/html/css/printing.css | 38 ++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Desktop/html/css/jasp.css b/Desktop/html/css/jasp.css index 0c6fdccddb..c85ce4288a 100644 --- a/Desktop/html/css/jasp.css +++ b/Desktop/html/css/jasp.css @@ -584,6 +584,10 @@ pre { border-style: ridge; } +.jasp-rsyntax-container pre { + white-space: pre-wrap; +} + /*.jasp-indent { margin-left: .5em ; padding-left: 0.8em ; diff --git a/Desktop/html/css/printing.css b/Desktop/html/css/printing.css index 8b5e9d4368..417fb6361e 100644 --- a/Desktop/html/css/printing.css +++ b/Desktop/html/css/printing.css @@ -1,24 +1,30 @@ @media only print { - #results { display: block; } + #results { display: block; } .jasp-toolbar h1, .jasp-toolbar h2, .jasp-toolbar h3, .jasp-toolbar h4, .jasp-toolbar h5, .jasp-toolbar h6, .jasp-toolbar div , .jasp-toolbar span - { display: block !important; } - .toolbar-button { display: none !important; visibility: hidden; } - .jasp-menu { display: none !important; visibility: hidden; } - .jasp-menu-selected { display: none !important; visibility: hidden; } - .jaspReportTop { display: none !important; visibility: hidden; } - body { float: none !important; } + { display: block !important; } + .toolbar-button { display: none !important; visibility: hidden; } + .jasp-menu { display: none !important; visibility: hidden; } + .jasp-menu-selected { display: none !important; visibility: hidden; } + .jaspReportTop { display: none !important; visibility: hidden; } + body { float: none !important; } + + .jasp-toolbar { page-break-after: avoid; } + .jasp-analysis { page-break-after: always; } + .jasp-collection { page-break-inside: avoid; } + .hidden-collection { page-break-inside: auto; } + .object-body { page-break-inside: auto; } + .object-body .hidden-collection { page-break-inside: auto; } + .jasp-image { page-break-inside: avoid; } + .jasp-notes { page-break-inside: avoid; } + + .jasp-table-primitive { page-break-inside: avoid; } + .jasp-table table { table-layout:fixed !important; width: 20cm !important; } + .jasp-table table td { white-space: pre-wrap !important; word-wrap: break-all !important; } + + .jasp-rsyntax-container { max-width: 20cm !important; } - .jasp-toolbar { page-break-after: avoid; } - .jasp-analysis { page-break-after: always; } - .jasp-collection { page-break-inside: avoid; } - .hidden-collection { page-break-inside: auto; } - .object-body { page-break-inside: auto; } - .object-body .hidden-collection { page-break-inside: auto; } - .jasp-image { page-break-inside: avoid; } - .jasp-notes { page-break-inside: avoid; } - .jasp-table-primitive { page-break-inside: avoid; } } @page { margin: 1cm; }