Bug 399427 - How to configure the fonts and background color of the "preview of rendered R Markdown"
Summary: How to configure the fonts and background color of the "preview of rendered R...
Status: RESOLVED NOT A BUG
Alias: None
Product: rkward
Classification: Applications
Component: User Interface (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-06 02:05 UTC by Adley
Modified: 2018-10-20 15:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adley 2018-10-06 02:05:22 UTC
SUMMARY

My desktop environment is GNOME and using the dark themes "Adwaita-dark". I found that, the results of the function "preview R markdown" can't read. It is because the themes "Adwaita-dark" forces all the background to black. However, the default font color of the preview also in black. 

Are there any ways to configure the font color of the "preview R markdown" ?

Thanks.



STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
---Problem description---
Please fill in the missing bits *in English*.

Please give a brief summary on the problem:
###Please fill in###

What - in detail - did you do directly before you encountered this problem?
###Please fill in###

When you try to repeat the above, does the problem occur again (no, sometimes, always)?
###Please fill in###

If applicable: When doing the same thing in an R session outside of RKWard, do you see the same problem?
###Please fill in###

Do you have any further information that might help us to track this problem down? In particular, if applicable, can you provide sample data and sample R code to reproduce this problem?
###Please fill in###

RKWard is available in many different packagings, and sometimes problems are specific to one method of installation. How did you install RKWard (which file(s) did you download)?
###Please fill in###


---Session Info---
-- Frontend --
RKWard version: 0.7.0z+0.7.1+devel1
KDE Frameworks version (runtime): 5.48.0
KDE Frameworks version (compile time): 5.48.0
Qt version (runtime): 5.11.1
Local config directory: /home//.config
RKWard storage directory: /home//.rkward/
Backend version (as known to the frontend): 3.5.1

Debug message file (this may contain relevant diagnostic output in case of trouble):
/tmp/rkward.frontend

-- Backend --
Debug message file (this may contain relevant diagnostic output in case of trouble):
/tmp/rkward.rbackend

R version (compile time): 3.5.1  (2018-07-02 r74947)
R runtime session info:
R version 3.5.1 (2018-07-02)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 28 (Workstation Edition)

Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_US.UTF-8           LC_COLLATE=en_US.UTF-8       
 [5] LC_MONETARY=en_US.UTF-8       LC_MESSAGES=en_US.UTF-8      
 [7] LC_PAPER=en_US.UTF-8          LC_NAME=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rkward_0.7.1

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1
Comment 1 Thomas Friedrichsmeier 2018-10-07 07:01:14 UTC
Well, this is a partial answer at best, but you can influence the text colors of the output by adding meta and style information at the top of the .Rmd. E.g.:

---
title: "Habits"
output:
  html_document:
    highlight: espresso
---
<style type="text/css">
body p {
  color: #CCCCCCCC;
}
</style>

The "highlight" affects the R highlighting colors, only, while to change the default text color, apparently you have to use CSS. (It would be possible to control both via CSS).

I do not really have an idea on how this could be handled automatically from within RKWard. I suppose we could add a setting to specify a custom CSS for .Rmd previews, but that would both need manual action, _and_ it would override whatever is specified in the .Rmd header.

Let me know, if anybody has a good idea on this.
Comment 2 Adley 2018-10-08 11:00:16 UTC
It's work, Thanks.