Skip to content

Commit

Permalink
Bugfix: handle wide table and Rsyntax printing (#5248)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shun2wang authored Sep 25, 2023
1 parent fe19a0c commit 883b250
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
4 changes: 4 additions & 0 deletions Desktop/html/css/jasp.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
38 changes: 22 additions & 16 deletions Desktop/html/css/printing.css
Original file line number Diff line number Diff line change
@@ -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; }

0 comments on commit 883b250

Please sign in to comment.