text-coloring

knitr kable: Text color in PDF from RNW is grey

↘锁芯ラ 提交于 2021-01-27 07:05:52
问题 When I create a table using the knitr::kable function within a RNW file, the text color of the table items in the PDF appears to be grey. I would like to change this to black. How can I do this? 回答1: \documentclass{article} \begin{document} <<>>= knitr::kable(cars[1:10,]) # grey @ <<results="asis">>= knitr::kable(cars[1:10,]) # black @ \end{document} By default, the output of kable will be wrapped in a knitrout environment where the text color ( fgcolor ) is set to grey ( rgb: 0.345, 0.345, 0

ANSI Coloring in Compilation Mode

情到浓时终转凉″ 提交于 2019-12-28 11:43:14
问题 Have anyone added support for ansi-color in compilation-mode Emacs? If so what property/attribute does the color-writing program have to check for in order to make sure its active terminal supports ANSI-escape coloring. 回答1: There's already a function for applying color to comint buffers. You simply need to enable it on compilation buffers: (require 'ansi-color) (defun colorize-compilation-buffer () (toggle-read-only) (ansi-color-apply-on-region compilation-filter-start (point)) (toggle-read

Can I merge Syntax coloring and Folding? OR Projection colored from master document info

让人想犯罪 __ 提交于 2019-12-25 04:37:21
问题 Example. I have an XML document: <document> <region type="type1">text of region1 </region> some simple text <region type="type2">text of region2 </region> And I want it to be presented as text of region1 some simple text text of region2 The basic Eclipse coloring works independent from folding, as I know. But I need text to be colored depending on the xml info. Or maybe I need something other, than folding? It's probably easier to just manipulate StyledText, but I need other Eclipse Editor

Coloring NSTableView Text per row

允我心安 提交于 2019-12-21 05:11:09
问题 I have a NSTableView that is displaying an array of objects I have. For each of these objects (rows) I would like to change the color of the text displayed depending on the results of a function I run on each object; So for example all the object in the table that exist in another list (or some other requirement) I want to display them in green text, and objects that don't exist display in red. How would I go about doing this? 回答1: Assuming that you have NSTextFieldCell in your table (for

Changing a single strings color within a QTextEdit

隐身守侯 提交于 2019-12-19 07:56:13
问题 I am working on a GUI developed via PyQt and Qt4. Within my GUI I have a QTextEdit that has various data written to. Is there a way in which I can manipulate the color of one word within the QTextEdit? For example redText = "I want this text red" self.myTextEdit.write(redText) blackText = "And this text black" self.myTextEdit.append(blackText) Is this possible? If so, how could I do this? Regards, sudo!! 回答1: You should provide a rich text for it. It can be done by creating a <span> tag and

Disable NSTextField without changing color of multi-colored text

拈花ヽ惹草 提交于 2019-12-12 01:33:02
问题 Whenever I disable an NSTextField the text loses its color and changes to gray. How can I disable the text field and keep the text color? In my particular situation some words are colored red. I'd like those words to stay red when I disable. 回答1: You need to subclass NSTextField to do that. See this CocoaBuilder thread: - (void)setEnabled:(BOOL)flag { [super setEnabled:flag]; if (!flag) { [self setTextColor:[NSColor secondarySelectedControlColor]]; } else { [self setTextColor:[NSColor

Multiple Colors In TextBlock

无人久伴 提交于 2019-11-29 04:28:41
Is it possible to add dynamic colors to a TextBlock ..i.e. have one character in one color and the next in another color. <TextBlock Text="{Binding no}" TextWrapping="Wrap" Margin="10,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}" FontSize="40" Foreground="#A400C4FF" > // Can we add something here to specify what colours for what chars </TextBlock> Basically I input a dynamic 4 character sequence from no. I've bound it to this TextBlock inside a ListBox. Is it possible to have the characters in different colors. If so is it possible to add these colors dynamically for eg. If I click a

Matplotlib: coloring axis/tick labels

家住魔仙堡 提交于 2019-11-28 09:56:23
How would one color y-axis label and tick labels in red? So for example the "y-label" and values 0 through 40, to be colored in red. import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) ax.set_ylabel("y-label") for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$' % i) ax.legend() plt.show() label = plt.ylabel("y-label") label.set_color("red") similarly, you can obtain and modify the tick labels: [i.set_color("red") for i in plt.gca().get_xticklabels()] The xlabel can be colorized when setting it, ax.set_xlabel("x-label", color="red")

Multiple Colors In TextBlock

老子叫甜甜 提交于 2019-11-27 18:22:06
问题 Is it possible to add dynamic colors to a TextBlock ..i.e. have one character in one color and the next in another color. <TextBlock Text="{Binding no}" TextWrapping="Wrap" Margin="10,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}" FontSize="40" Foreground="#A400C4FF" > // Can we add something here to specify what colours for what chars </TextBlock> Basically I input a dynamic 4 character sequence from no. I've bound it to this TextBlock inside a ListBox. Is it possible to have the

Matplotlib: coloring axis/tick labels

只谈情不闲聊 提交于 2019-11-27 03:16:12
问题 How would one color y-axis label and tick labels in red? So for example the "y-label" and values 0 through 40, to be colored in red. import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) ax.set_ylabel("y-label") for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$' % i) ax.legend() plt.show() 回答1: label = plt.ylabel("y-label") label.set_color("red") similarly, you can obtain and modify the tick labels: [i.set_color("red") for i in plt