I use the theme Solarized Dark on RStudio. I'm writing lecture notes using RMarkdown/bookdown. I like it in general, but there is one issue I have with it:
it colours all quotes, overriding most of the other colours.
Hopefully the following picture illustrates this.
I am writing maths lecture notes, so I use $...$ a lot. It's annoying to have it all the same colour, with only the emphasised text or footnotes standing out.
Can I customise the theme so that writing > doesn't make this switch?
Eg, in VSCode, the > is coloured green, but then nothing after it is coloured.
I've had a look at customising the themes, but haven't found how to do this. I can change the colour, or even delete the colour for string, but then everything is the plain white colour, including stuff between $...$. I want > not to overwrite the other highlighting.
An alternative solution, which I'd be very happy with would be to define some wrapper to make this go in a quote. The LaTeX equivalent would be the following.
This last part seems like much more of a big deal, but would be helpful as I wouldn't have to keep writing > for multi-line quotes.
Related
This is a two-part question, both parts are probably simple:
Why do my comments appear between the code and the output? I'd rather it display as I type it. For instance:
Gives the output:
But I would prefer the "We have 7 classes of data..." line to go above the code in the PDF.
Using the second picture from above, why does the gray box containing the code in have a larger border above the code than below? I'd rather the top have the same size border as the bottom.
I'm assuming this is an easy setting to change but I can't figure it out.
I'm using R Studio's Cobalt theme, and I have found one case where in-line output in Rmd files is invisible (i.e. font is white on a white background). I would like to edit that font colour to anything visible.
Reproducible example below:
First set Editor Theme to Cobalt:
Then, a simple example of using str_view() from Hadley's R4DS, in an Rmd file:
x <- c("apple", "banana", "pear")
stringr::str_view(x, "an")
The output will render to visible HTML no problem, and the Viewer window also shows visible output:
But when if you run it as an in-line chunk (i.e. how a lot of my debugging takes place), we get some of the output as a white font on white background:
How can I edit that font colour for that particular output, so that it is visible?
I have already tried editing Cobalt here:
https://tmtheme-editor.herokuapp.com/#!/editor/theme/Cobalt
Following the advice from here:
https://towardsdatascience.com/customize-your-rstudio-theme-914cca8b04b1
Maybe it's late but i've a solution with same problem.You need to change foreground color of your preferred theme(or change html background)
Here is you can edit your preferred theme : https://tmtheme-editor.herokuapp.com
As you wrote upward,in most of dark themes foregrounds are whitish . Where you can edit in general tab .You should choose a bit darker foreground (for ex:#BEC0C2).
or
i couldn't find how to change html background in Cobalt theme but some other (ex: Material) theme allow us to change colors of popup Css
Sorry for my photo edits :D
Hopefully it will work ...
For anyone looking at this question, I've tried a lot of things, and honestly the easiest answer was to move the output of chunks out of the inline document, and move it to the console. Everything works after that:
In CSS or SVG, is it possible to warp text so it looks like it is written on a sphere or looked at using a magnifier?
Something similar to this
I have been look over the internet but could not find any guides.
All of the comments telling that it can't be done are wrong. YES IT CAN BE DONE. Well, it's not easy but possible. Let's start from the beginning.
1. Don't even think about writing the code. You need a vector graphics software. I used Corel Draw to this project.
2. You need to create all text, apply all transformation, style each letter, add shadow, background or whatever you need.
This is a simple project I created. It's a fast draft, but you can style the text exactly as on your photo. You can easily make all letters in the middle bigger than the others.
(sorry it's not in English!)
3. Force Corel Draw or any other program to save svg with fonts not curves.
4. I analyzed the code and I see that each letter is saved separetly as a glyph:
<glyph horiz-adv-x="222" unicode="l"><path d="m63.876 0.23623l-2.504 715.49 87.971 0.33072 2.504-715.49-87.971-0.33072z"/></glyph>
Some other letters are saved as text and transformations are applied:
<text class="fil1 fnt0" x="1045" y="1269"><tspan rotate="335">L</tspan></text>
5. FULL CODE looks like this. It's long. I minified it a little bit.
FIDDLE: https://jsfiddle.net/ubw1rdq7/
SOLUTION 2 - MUCH EASIER
It's not fun if you have each letter saved separetly because the file may be huge. You can save your text as a curve and have only one path. This will behave like an image but you can inline the code into your html.
Here is a fiddle:
https://jsfiddle.net/wyfhfjo4/
In both cases all code is over 30kb in size and I made only simple transformations. i hope I gave you some idea how you can achieve desired effect. 99% of the project is to work in vector editing software like Corel Draw and apply all transformation to the text.
For any 3d transformation it's better to transform the text to curves as it will definitely be easier. As an output you will get a path not glyphs.
It is possible to do this using an feDisplacementMap in SVG, but this is currently bugged in current Chrome, so not very useful to you.
I want to change the font color of the code output of knitr to black for the whole output. The standard output has a grey background and different colors are used in the output for different types of expressions like functions, objects, etc.
My goal is to have a white background and the code should be all black. I already solved the background color problem with the chunk option background='#FFFFFF', but I couldn't find a solution for the font color of the code...
Who can help me?
Thank you very much in advance for your valuabe help!!
Sincerely yours,
broesel
If you are talking about Rnw/LaTeX documents, you can turn off syntax highlighting using the chunk option highlight=FALSE. See documentation.
The stylesheet for my blog is fairly simple. It consists of white or grey text on a black background. I'm thinking about, eventually, giving the user the ability to "turn on the lights," so to speak, and invert the colors.
It got me thinking that I'm unaware of a way to simply swap two values (say, #fff and #000). I obviously know about find and replace functions in most text editors, but if I ever need to do something like this, I end up doing a multistep thing where I replace the first value with a slightly weird version of the second (e.g., swapping #fff for #00$ instead of #000), then the second value with the actual first, and finally the weird value with the actual second.
Know a quicker way? I use TextMate on the Mac, and I'm pretty sure it doesn't have this functionality, but I'm willing to use another app just for this.
Thanks!