How do I set the Verbatim font (or the mono font) to bold by default?Using `mathbb` fonts from other packagesSet the “font-weight: lighter/ bolder”Bold font errorSet the default font narrowerBold weight for custom fontHow to set the default typewriter font?Courier font just not workingSet font family default after loading it

How does kinetic energy work in braking a vehicle?

How can I more clearly ask people to accomodate for my autism?

Is there a more elegant way to express ((x == a and y == b) or (x == b and y == a))?

What does exhaust smell on oil and transmission dipstick mean?

Why am I having wrong IPs in my DNS?

Is the ''yoi'' meaning ''ready'' when doing karate the same as the ''yoi'' which means nice/good?

Why is Eastern Switzerland called Suisse orientale in French?

Take-Home Examination on Ordinary Differential Equations?

"traversal failed: u: Bad message" when deleting an extremely large directory in Linux

As tourist in China do I have to fear consequences for having publicly liked South Park?

How much caffeine would there be if I reuse tea leaves in a second brewing?

How do the other crew members know the xenomorph is "big", if they haven't seen it?

How can I get a "RedLevel" instead of GrayLevel when drawing a densityplot?

How to play a devious character when you are not personally devious?

What can I use for input conversion instead of scanf?

Why is a Lockheed MC-130J Commando II creating such a loud droning sound?

A word/phrase means "a small amount" (of a color)

Is there any algorithm that runs faster in Mathematica than in C or FORTRAN?

Would the professor leave the classroom if only 1 student use cellphone during classes?

What is the proper way to allow the user of a plugin to modify settings?

Why do some web servers still provide information on vendor and version in the HTTP response headers

What do you call this when cats hunch their backs and their fur stands on end?

What elements would be created in a star composed entirely of gold?

Why do Climate activists attack public transport?



How do I set the Verbatim font (or the mono font) to bold by default?


Using `mathbb` fonts from other packagesSet the “font-weight: lighter/ bolder”Bold font errorSet the default font narrowerBold weight for custom fontHow to set the default typewriter font?Courier font just not workingSet font family default after loading it






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









5

















I'm using the fancyvrb package and the Verbatim (with an uppercase V) environment. However, the font I'm using is to light for my taste, so I'd like to make it bold without having to write textbf on every line.



My code looks like this:



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Ligatures=NoRequired,NoCommon,NoContextual,Numbers=Lining,Monospaced,Scale=0.8]Courier New
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of the preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


I've tried adding something like Uppercase=Bold,Lowercase=Bold,Numbers=Bold to the setmonofont options, but I haven't been able to get it to work. I've also tried using the command verbatimfont, but that didn't work for me either.



Thnks in advance for any help.










share|improve this question




























  • Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

    – Steven B. Segletes
    May 29 at 17:58











  • I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

    – Rain
    May 29 at 18:04











  • You need a bold mo,o font. cm-unicode and Latin Modern have.

    – Bernard
    May 29 at 18:12

















5

















I'm using the fancyvrb package and the Verbatim (with an uppercase V) environment. However, the font I'm using is to light for my taste, so I'd like to make it bold without having to write textbf on every line.



My code looks like this:



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Ligatures=NoRequired,NoCommon,NoContextual,Numbers=Lining,Monospaced,Scale=0.8]Courier New
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of the preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


I've tried adding something like Uppercase=Bold,Lowercase=Bold,Numbers=Bold to the setmonofont options, but I haven't been able to get it to work. I've also tried using the command verbatimfont, but that didn't work for me either.



Thnks in advance for any help.










share|improve this question




























  • Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

    – Steven B. Segletes
    May 29 at 17:58











  • I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

    – Rain
    May 29 at 18:04











  • You need a bold mo,o font. cm-unicode and Latin Modern have.

    – Bernard
    May 29 at 18:12













5












5








5








I'm using the fancyvrb package and the Verbatim (with an uppercase V) environment. However, the font I'm using is to light for my taste, so I'd like to make it bold without having to write textbf on every line.



My code looks like this:



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Ligatures=NoRequired,NoCommon,NoContextual,Numbers=Lining,Monospaced,Scale=0.8]Courier New
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of the preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


I've tried adding something like Uppercase=Bold,Lowercase=Bold,Numbers=Bold to the setmonofont options, but I haven't been able to get it to work. I've also tried using the command verbatimfont, but that didn't work for me either.



Thnks in advance for any help.










share|improve this question

















I'm using the fancyvrb package and the Verbatim (with an uppercase V) environment. However, the font I'm using is to light for my taste, so I'd like to make it bold without having to write textbf on every line.



My code looks like this:



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Ligatures=NoRequired,NoCommon,NoContextual,Numbers=Lining,Monospaced,Scale=0.8]Courier New
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of the preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


I've tried adding something like Uppercase=Bold,Lowercase=Bold,Numbers=Bold to the setmonofont options, but I haven't been able to get it to work. I've also tried using the command verbatimfont, but that didn't work for me either.



Thnks in advance for any help.







fonts formatting fontspec bold






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited May 29 at 18:11









Alan Munn

170k30 gold badges443 silver badges733 bronze badges




170k30 gold badges443 silver badges733 bronze badges










asked May 29 at 17:55









RainRain

18911 bronze badges




18911 bronze badges















  • Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

    – Steven B. Segletes
    May 29 at 17:58











  • I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

    – Rain
    May 29 at 18:04











  • You need a bold mo,o font. cm-unicode and Latin Modern have.

    – Bernard
    May 29 at 18:12

















  • Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

    – Steven B. Segletes
    May 29 at 17:58











  • I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

    – Rain
    May 29 at 18:04











  • You need a bold mo,o font. cm-unicode and Latin Modern have.

    – Bernard
    May 29 at 18:12
















Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

– Steven B. Segletes
May 29 at 17:58





Are you tied to fancyvrb for other reasons than shown in your MWE? For example, you make no use of commandchars, etc.

– Steven B. Segletes
May 29 at 17:58













I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

– Rain
May 29 at 18:04





I use Verbatim for computer code. I want to be able to display normal code in black and comments in grey so the reader doesn't have to be familiar with the specific language's comment delimiters and can just differentiate code and comments without any extra effort. If there's another package that can do that in a simple way, I'm not tied to fancyvrb.

– Rain
May 29 at 18:04













You need a bold mo,o font. cm-unicode and Latin Modern have.

– Bernard
May 29 at 18:12





You need a bold mo,o font. cm-unicode and Latin Modern have.

– Bernard
May 29 at 18:12










2 Answers
2






active

oldest

votes


















5


















Just load the Courier New Bold font as the mono font. I've removed your Ligatures and Numbers options since these aren't available in this font (they produce warnings.)



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Scale=0.8]Courier New Bold
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of eh preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


output of code






share|improve this answer


























  • Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

    – Rain
    May 29 at 18:06






  • 1





    Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

    – Alan Munn
    May 29 at 18:09












  • Will do, thanks for the pointer!

    – Rain
    May 29 at 18:09


















4


















An alternative version that loads the Black (or ExtraBold, etc.) weight as “bold”, and also sets up italics:



setmonofontSome Font[
Scale = MatchLowercase ,
UprightFont = * Bold ,
ItalicFont = * Bold Italic ,
BoldFont = * Black ,
BoldItalicFont = * Black Italic ]


Change this to match the names of your font files. For example, if you have Some Font-Bold.otf and Some Font-ExtraBold.otf on your system, you would instead load UprightFont = *-Bold, BoldFont = *-ExtraBold, and Extension = .otf.






share|improve this answer




























  • Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

    – Rain
    May 30 at 12:49












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493248%2fhow-do-i-set-the-verbatim-font-or-the-mono-font-to-bold-by-default%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5


















Just load the Courier New Bold font as the mono font. I've removed your Ligatures and Numbers options since these aren't available in this font (they produce warnings.)



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Scale=0.8]Courier New Bold
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of eh preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


output of code






share|improve this answer


























  • Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

    – Rain
    May 29 at 18:06






  • 1





    Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

    – Alan Munn
    May 29 at 18:09












  • Will do, thanks for the pointer!

    – Rain
    May 29 at 18:09















5


















Just load the Courier New Bold font as the mono font. I've removed your Ligatures and Numbers options since these aren't available in this font (they produce warnings.)



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Scale=0.8]Courier New Bold
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of eh preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


output of code






share|improve this answer


























  • Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

    – Rain
    May 29 at 18:06






  • 1





    Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

    – Alan Munn
    May 29 at 18:09












  • Will do, thanks for the pointer!

    – Rain
    May 29 at 18:09













5














5










5









Just load the Courier New Bold font as the mono font. I've removed your Ligatures and Numbers options since these aren't available in this font (they produce warnings.)



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Scale=0.8]Courier New Bold
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of eh preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


output of code






share|improve this answer














Just load the Courier New Bold font as the mono font. I've removed your Ligatures and Numbers options since these aren't available in this font (they produce warnings.)



documentclass[11pt,oneside]book
% preamble
usepackagefontspec
setmonofont[Scale=0.8]Courier New Bold
% more preamble
usepackageverbatim
usepackagefancyvrb
% final part of eh preamble
begindocument
beginVerbatim[commandchars=\]
this text is in a monospace font
endVerbatim
enddocument


output of code







share|improve this answer













share|improve this answer




share|improve this answer










answered May 29 at 18:03









Alan MunnAlan Munn

170k30 gold badges443 silver badges733 bronze badges




170k30 gold badges443 silver badges733 bronze badges















  • Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

    – Rain
    May 29 at 18:06






  • 1





    Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

    – Alan Munn
    May 29 at 18:09












  • Will do, thanks for the pointer!

    – Rain
    May 29 at 18:09

















  • Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

    – Rain
    May 29 at 18:06






  • 1





    Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

    – Alan Munn
    May 29 at 18:09












  • Will do, thanks for the pointer!

    – Rain
    May 29 at 18:09
















Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

– Rain
May 29 at 18:06





Well, this works and is trivial to implement. Thanks a lot. :) Just out of academic interest, will this work for any font that has a defined bold version? And if a font doesn't have a bold version then how can I enforce a textbf equivalent?

– Rain
May 29 at 18:06




1




1





Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

– Alan Munn
May 29 at 18:09






Yes (same for italics, italic bold etc); basically any face that the font has. If a font doesn't have a bold face, then no, it won't work. It's possible (but not recommended) to use FakeBold. See the fontspec documentation for details.

– Alan Munn
May 29 at 18:09














Will do, thanks for the pointer!

– Rain
May 29 at 18:09





Will do, thanks for the pointer!

– Rain
May 29 at 18:09













4


















An alternative version that loads the Black (or ExtraBold, etc.) weight as “bold”, and also sets up italics:



setmonofontSome Font[
Scale = MatchLowercase ,
UprightFont = * Bold ,
ItalicFont = * Bold Italic ,
BoldFont = * Black ,
BoldItalicFont = * Black Italic ]


Change this to match the names of your font files. For example, if you have Some Font-Bold.otf and Some Font-ExtraBold.otf on your system, you would instead load UprightFont = *-Bold, BoldFont = *-ExtraBold, and Extension = .otf.






share|improve this answer




























  • Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

    – Rain
    May 30 at 12:49















4


















An alternative version that loads the Black (or ExtraBold, etc.) weight as “bold”, and also sets up italics:



setmonofontSome Font[
Scale = MatchLowercase ,
UprightFont = * Bold ,
ItalicFont = * Bold Italic ,
BoldFont = * Black ,
BoldItalicFont = * Black Italic ]


Change this to match the names of your font files. For example, if you have Some Font-Bold.otf and Some Font-ExtraBold.otf on your system, you would instead load UprightFont = *-Bold, BoldFont = *-ExtraBold, and Extension = .otf.






share|improve this answer




























  • Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

    – Rain
    May 30 at 12:49













4














4










4









An alternative version that loads the Black (or ExtraBold, etc.) weight as “bold”, and also sets up italics:



setmonofontSome Font[
Scale = MatchLowercase ,
UprightFont = * Bold ,
ItalicFont = * Bold Italic ,
BoldFont = * Black ,
BoldItalicFont = * Black Italic ]


Change this to match the names of your font files. For example, if you have Some Font-Bold.otf and Some Font-ExtraBold.otf on your system, you would instead load UprightFont = *-Bold, BoldFont = *-ExtraBold, and Extension = .otf.






share|improve this answer
















An alternative version that loads the Black (or ExtraBold, etc.) weight as “bold”, and also sets up italics:



setmonofontSome Font[
Scale = MatchLowercase ,
UprightFont = * Bold ,
ItalicFont = * Bold Italic ,
BoldFont = * Black ,
BoldItalicFont = * Black Italic ]


Change this to match the names of your font files. For example, if you have Some Font-Bold.otf and Some Font-ExtraBold.otf on your system, you would instead load UprightFont = *-Bold, BoldFont = *-ExtraBold, and Extension = .otf.







share|improve this answer















share|improve this answer




share|improve this answer








edited May 29 at 21:48

























answered May 29 at 21:39









DavislorDavislor

11k1 gold badge21 silver badges40 bronze badges




11k1 gold badge21 silver badges40 bronze badges















  • Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

    – Rain
    May 30 at 12:49

















  • Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

    – Rain
    May 30 at 12:49
















Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

– Rain
May 30 at 12:49





Thanks, I'll give this a try late tonight; I like the idea of having italics as well.

– Rain
May 30 at 12:49


















draft saved

draft discarded















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493248%2fhow-do-i-set-the-verbatim-font-or-the-mono-font-to-bold-by-default%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?