You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exporting tables in RTF using landscape, the resulting RTF is not correctly recognized by some RTF viewers (at least MS Word). This results in them considering the document to have a custom size. This seems to be due to the following option being missing in the resulting RTF file:
Page orientation is in landscape format. To mix portrait and landscape sections within a document, the \landscape control should not be used so that the default for a section is portrait, which may be overridden by the \lndscpsxn control.
The following example can be used to generate two RTF files: one in portrait and another one in landscape. They both are A4.
By opening the portrait file, we can see that Word correctly recognizes it as an A4 in portrait mode. On the other hand, if we open the landscape file, we can see that word does not recognize its size as A4 anymore. At this point, if we add \lndscpsxn before declaring the size of the document (\lndscpsxn\paperw16834\paperh11909), and we open the new file, we can see that word recognizes the size of the document correctly as A4 and its orientation as landscape.
R session info
R version 4.4.3 (2025-02-28)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.4.1
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] C/UTF-8/C/C/C/C
time zone: Europe/Madrid
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.4.3
OS / Environment
OS: MacOS Sequoia 15.4.1
The text was updated successfully, but these errors were encountered:
Summary
When exporting tables in RTF using landscape, the resulting RTF is not correctly recognized by some RTF viewers (at least MS Word). This results in them considering the document to have a custom size. This seems to be due to the following option being missing in the resulting RTF file:
\lndscpsxn
According to the RTF spec (https://www.biblioscape.com/rtf15_spec.htm), that option is defined as:
The following example can be used to generate two RTF files: one in portrait and another one in landscape. They both are A4.
By opening the portrait file, we can see that Word correctly recognizes it as an A4 in portrait mode. On the other hand, if we open the landscape file, we can see that word does not recognize its size as A4 anymore. At this point, if we add
\lndscpsxn
before declaring the size of the document (\lndscpsxn\paperw16834\paperh11909
), and we open the new file, we can see that word recognizes the size of the document correctly as A4 and its orientation as landscape.R session info
OS / Environment
The text was updated successfully, but these errors were encountered: