How to change pelican-bootstrap3 background-color's code background color - twitter-bootstrap-3

My pelican blogs uses theme pelican-bootstrap3, and the color of code is always grey, link below,
I just want it to be
How to change its background-color to other colors.

There are various syntax highlighting styles available for Pygments. The one you are using is the default style. If you have not installed Pygments already, install it by executing:
pip install Pygments
and put:
PYGMENTS_STYLE = 'your_style_here'
in your "pelicanconf.py" and replacing "your_style_here" with your preferred style.

Related

style of asciidoc Admonition missing while using Hugo ? ( syntax not supported? )

I'm using Hugo to generate static pages in Gitlab, seems the syntax of asciidoc not supported well (such as Admonition)? or it's just about the theme I'm using?
for code [TIP]
Expected:
Current:
Please enable font-based icons by adding
:icons: font
to your document. See Font Icon Mode in AsciiDoc docs for details.
Depending on the CSS you use, the tool tip might look different. See below for the "classic" CSS of Asciidoctor.
Once you add the :icons: font, it is a matter of updating the CSS to make it look like your screenshot above.

Using matplotlib with latex mode with non-default fonts

I am using Windows 10 with Anaconda and Spyder 4. When using matplotlib, I would like to use the font Proxima Nova and render with LaTeX.
If in my matplotlibrc file I specify
font.family : Proxima Nova
then the figure renders with the font Proxima Nova. This means that the font is installed on my system (as it is) and matplotlib can use it. However, if in the matplotlibrc file I also specify
text.usetex: True
then, even though I have specified Proxima Nova as the font, the figure renders in the default LaTeX font, which I guess is Computer Modern.
I have tried
matplotlib.font_manager._rebuild()
In the source code file and also have tried specifying the fonts in the source code file and not in the matplotlibrc file. However I always get the same result. I have also followed all the advice on this help page, including making sure that latex, dvipng and ghostscript are all the PATH variable. However nothing seems to work.
I would like to note that I can use Proxima Nova separately when compiling Latex documents, so that should not be an issue either.
How can I get matplotlib to be able to use a non-default font and render with LateX at the same time?
After some further investigation, I was able to get to use Proxima Nova with Latex, although there are still some outstanding issues.
The main issue is that if the font Proxima Nova is used with Latex, one needs to use Lualatex and not plain Latex. Here is the Matplotlib instruction on using matplotlib with Lualatex.
The key to getting things to work was this post.
At the very beginning of my .py file, I have the following code:
import matplotlib as mpl
mpl.use("pgf")
mpl.rcParams.update({
'font.family': 'sans-serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\usepackage{fontspec} \setmainfont{Proxima Nova}',
})
The code above should be placed at the very top of the code, above any other imports.
The problem, however is that this solution works only after performing the following steps:
Delete the .matplotlib/tex.cache folder and restart spyder
Replace 'font.family': 'sans-serif' and \setmainfont{Proxima Nova} with 'font.family': 'serif' and \setmainfont{Times New Roman} respectively. Run python once.
Revert back to 'font.family': 'sans-serif' and
\setmainfont{Proxima Nova} and run python again.
The output with the correct font is produced.
Unless the above 4 steps are performed, the output is compiled with the default DejaVu Sans font and not with Proxima Nova. I am not sure why...
After getting help on the matplotlib github forum, I was pointed to the following solution:
mpl.rcParams.update({
'font.family': 'sans-serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'lualatex',
'pgf.preamble': r'\usepackage{fontspec} \setsansfont{Proxima Nova}',
})
In other words you need to use setsansfont in stead of setmainfont. You can see the matplotlib forum page here.

How to change just the title bar color KDE Plasma

I'm running Pop!_OS 19.10 with KDE Plasma (5.16.5). I am using the Breeze Dark theme (which comes standard with Pop).
I just want to change the title bar color, but I am not sure how this is done. I don't want to break the existing theme, but I'm not sure how to clone an existing theme if that's possible.
Where in the theme file/folder directory is the title bar specified?
The answer referenced by Roj worked for me.
Created: /home/UserA/.local/usera.colors which contains:
[General]
Name=UserA_TitlebarTheme
[WM]
activeBackground=140,69,211
inactiveBackground=80,40,120
Kudos to Roj!

How do install fonts using npm?

I want to install fonts using npm, for example, Open Sans or Roboto.
If I search for Open Sans on npm and filter for packages with over 1000 downloads per month I find a whole list. I am not sure which source to choose here, some are not well maintained and none of them are from the original source of the font, in this case, google.
npm-font-open-sans
typeface-open-sans
open-sans-all
open-sans-fontface
opensans-npm-webfont
I noticed that fonts are often used through a direct link to fonts.googleapis. I would prefer to have a local copy of the font to be able to develop offline. Is there a common way to install fonts through npm? Or is there another automated font download tool that I'm not aware of?
I use typefaces yarn add typeface-roboto
and then just do a require("typeface-roboto") / import "./typeface-roboto" or whatever font you choose.
I hope this is the answer you're looking for?
Use fontsource, typefaces is deprecated now.
yarn add #fontsource/open-sans // npm install #fontsource/open-sans
Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (layout.js), page component (index.js), or gatsby-browser.js.
import "#fontsource/open-sans" // Defaults to weight 400 with all styles included.
Fontsource allows you to select weights and even individual styles, allowing you to cut down on payload sizes to the last byte! Utilizing the CSS unicode-range selector, all language subsets are accounted for.
import "#fontsource/open-sans/500.css"; // All styles included.
import "#fontsource/open-sans/900-normal.css"; // Select either normal or italic.
Alternatively, the same solutions could be imported via SCSS!
#import "~#fontsource/open-sans/index.css";
#import "~#fontsource/open-sans/300-italic.css";
Fontsource
The typefaces project is now deprecated and its successor is fontsource.
Usage
There's no much difference at the point of using it.
Install:
yarn add #fontsource/open-sans // npm install #fontsource/open-sans
Import:
import "#fontsource/open-sans"
Reference:
body {
font-family: "Open Sans";
}

Anaconda matplotlib theme / styling / colorcyle

Does anyone know what a default Anaconda install does to change Matplotlib styling?
For example:
import matplotlib.pyplot as pl
pl.figure()
pl.xlabel('X label')
pl.ylabel('Y label')
pl.plot([1,2,3], [4,5,6])
pl.plot([1,2,3], [6,5,4])
pl.show()
The above code creates a blue and a green line on default matplotlib, but blue and orange when run in Anaconda. The axis labels have also changed from a serif (default) to a sans-serif font (Anaconda).
Is this a matplotlib theme? Custom or available from (free) sources? Is it anaconda itself or some package included in it?
Any hints/answers are much appreciated
-- Update --
I found two matplotlibrc files in the anaconda directory, both simply set a backend and had all other lines commented out.
This has nothing to do with anaconda. You most likely have two different versions of matplotlib installed and the one that anaconda uses is the newer one of them.
The default style of matplotlib changed between versions 1.5 and 2.0. See Changes to the default style.
To revert to the classic style (the one used in version 1.5), you may use
plt.style.use("classic")
For an overview of all available styles, see the style_sheets_reference for 2.0.0.
You may create your own stylesheets as detailed in the Customizing article.