How to change the font style (not the size but the style) of algorithimc packageHow do I change the standard “math font”?Change font size in arabtex packageAll ttfamily font change font sizeUnderbar changing the style of font but bar not, why?Font Size and Font StyleHow to change font style of all algorithm/algpseudocode keywords?Change font size with fontspec packageChange texttt font-sizeWho changed my Chinese character?How recognize and change to unknown font?

Why are off grid solar setups only 12, 24, 48 VDC?

Anybody know what this small Nintendo stand is for?

Why does RPM for a fixed-pitch propeller change with an aircraft's pitch?

When going by a train from Paris to Düsseldorf (Thalys), can I hop off in Köln and then hop on again?

Why are so many countries still in the Commonwealth?

What is the lowest-speed bogey a jet fighter can intercept/escort?

"I you already know": is this proper English?

Iterate over non-const variables in C++

How could a thief buying plane tickets with stolen credit card details benefit personally?

Character is called by their first initial. How do I write it?

Unethical behavior : should I report it?

Is my employer paying me fairly? Going from 1099 to W2

How can I receive packages while in France?

How much were the LMs maneuvered to their landing points?

Commercial jet accompanied by small plane near Seattle

Request for a Latin phrase as motto "God is highest/supreme"

Assuring luggage isn't lost with short layover

What is the difference between 1/3, 1/2, and full casters?

What to do when you reach a conclusion and find out later on that someone else already did?

How do I address my Catering staff subordinate seen eating from a chafing dish before the customers?

Marrying a second woman behind your wife's back: is it wrong and can Quran/Hadith prove this?

Is it normal practice to screen share with a client?

What is AM-CM inequality?

How acidic does a mixture have to be for milk to curdle?



How to change the font style (not the size but the style) of algorithimc package


How do I change the standard “math font”?Change font size in arabtex packageAll ttfamily font change font sizeUnderbar changing the style of font but bar not, why?Font Size and Font StyleHow to change font style of all algorithm/algpseudocode keywords?Change font size with fontspec packageChange texttt font-sizeWho changed my Chinese character?How recognize and change to unknown font?






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








2















I would like to change the font of the algorithm package. It's currently using serif and I would like to try either sans serif or typewritter font. I have tried to use the following code (which I adapted from this link) by simply using the ttdefault at line 5 but it does not work. How can I achieve my aim?



documentclassarticle
usepackagealgpseudocode,algorithm

makeatletter
algrenewcommandALG@beginalgorithmicttdefault
makeatother

begindocument
beginalgorithm
captionEuclid’s algorithmlabeleuclid
beginalgorithmic[1]
ProcedureEuclid$a,b$CommentThe g.c.d. of $a$ and $b$
State $r gets a bmod b$
While$r not= 0$CommentWe have the answer if $r$ is 0
State $a gets b$
State $b gets r$
State $r gets a bmod b$
EndWhilelabeleuclidendwhile
State textbfreturn $b$CommentThe gcd is $b$
EndProcedure
endalgorithmic
endalgorithm
enddocument









share|improve this question






















  • There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

    – barbara beeton
    7 hours ago











  • Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

    – S12000
    7 hours ago











  • While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

    – barbara beeton
    6 hours ago











  • OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

    – S12000
    5 hours ago











  • UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

    – barbara beeton
    5 hours ago

















2















I would like to change the font of the algorithm package. It's currently using serif and I would like to try either sans serif or typewritter font. I have tried to use the following code (which I adapted from this link) by simply using the ttdefault at line 5 but it does not work. How can I achieve my aim?



documentclassarticle
usepackagealgpseudocode,algorithm

makeatletter
algrenewcommandALG@beginalgorithmicttdefault
makeatother

begindocument
beginalgorithm
captionEuclid’s algorithmlabeleuclid
beginalgorithmic[1]
ProcedureEuclid$a,b$CommentThe g.c.d. of $a$ and $b$
State $r gets a bmod b$
While$r not= 0$CommentWe have the answer if $r$ is 0
State $a gets b$
State $b gets r$
State $r gets a bmod b$
EndWhilelabeleuclidendwhile
State textbfreturn $b$CommentThe gcd is $b$
EndProcedure
endalgorithmic
endalgorithm
enddocument









share|improve this question






















  • There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

    – barbara beeton
    7 hours ago











  • Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

    – S12000
    7 hours ago











  • While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

    – barbara beeton
    6 hours ago











  • OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

    – S12000
    5 hours ago











  • UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

    – barbara beeton
    5 hours ago













2












2








2








I would like to change the font of the algorithm package. It's currently using serif and I would like to try either sans serif or typewritter font. I have tried to use the following code (which I adapted from this link) by simply using the ttdefault at line 5 but it does not work. How can I achieve my aim?



documentclassarticle
usepackagealgpseudocode,algorithm

makeatletter
algrenewcommandALG@beginalgorithmicttdefault
makeatother

begindocument
beginalgorithm
captionEuclid’s algorithmlabeleuclid
beginalgorithmic[1]
ProcedureEuclid$a,b$CommentThe g.c.d. of $a$ and $b$
State $r gets a bmod b$
While$r not= 0$CommentWe have the answer if $r$ is 0
State $a gets b$
State $b gets r$
State $r gets a bmod b$
EndWhilelabeleuclidendwhile
State textbfreturn $b$CommentThe gcd is $b$
EndProcedure
endalgorithmic
endalgorithm
enddocument









share|improve this question














I would like to change the font of the algorithm package. It's currently using serif and I would like to try either sans serif or typewritter font. I have tried to use the following code (which I adapted from this link) by simply using the ttdefault at line 5 but it does not work. How can I achieve my aim?



documentclassarticle
usepackagealgpseudocode,algorithm

makeatletter
algrenewcommandALG@beginalgorithmicttdefault
makeatother

begindocument
beginalgorithm
captionEuclid’s algorithmlabeleuclid
beginalgorithmic[1]
ProcedureEuclid$a,b$CommentThe g.c.d. of $a$ and $b$
State $r gets a bmod b$
While$r not= 0$CommentWe have the answer if $r$ is 0
State $a gets b$
State $b gets r$
State $r gets a bmod b$
EndWhilelabeleuclidendwhile
State textbfreturn $b$CommentThe gcd is $b$
EndProcedure
endalgorithmic
endalgorithm
enddocument






fonts algorithms typewriter sans-serif






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









S12000S12000

6847 silver badges24 bronze badges




6847 silver badges24 bronze badges












  • There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

    – barbara beeton
    7 hours ago











  • Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

    – S12000
    7 hours ago











  • While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

    – barbara beeton
    6 hours ago











  • OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

    – S12000
    5 hours ago











  • UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

    – barbara beeton
    5 hours ago

















  • There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

    – barbara beeton
    7 hours ago











  • Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

    – S12000
    7 hours ago











  • While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

    – barbara beeton
    6 hours ago











  • OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

    – S12000
    5 hours ago











  • UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

    – barbara beeton
    5 hours ago
















There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

– barbara beeton
7 hours ago





There are several packages for algorithms, and I believe they all use bold for keywords. There are very few typewriter fonts available with a matching bold, so you would most likely lose that.

– barbara beeton
7 hours ago













Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

– S12000
7 hours ago





Hello Barbara the aim is to convert the font family witouth loosing the bold for the keyword. Look at the answer of Zarko, he provided the right solution to my problem.

– S12000
7 hours ago













While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

– barbara beeton
6 hours ago





While ttfamily as suggested by @Zarko is certainly a good solution in most ways, I've just checked the cmtt fonts available in TeX Live. Someone has provided cmbtt fonts in several sizes, but only from Metafont source, so they will be bitmap fonts, an won't scale well. I'd be very happy to be shown to be wrong. (I once had to provide a bold version of cmtt, and the only way I could do it well was to create a lighter version of the original cmtt and then a bolder version; that was in the days when bitmap fonts were still the standard.

– barbara beeton
6 hours ago













OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

– S12000
5 hours ago





OK I see. In fact in my case I am using xelatex with UbuntuMono as a typewritter font and it works very fine (no scaling issues).

– S12000
5 hours ago













UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

– barbara beeton
5 hours ago





UbuntuMono sounds like it's designed for such things, I'm glad it works. (Since no specific font was indicated in the question, I just assumed CM.)

– barbara beeton
5 hours ago










1 Answer
1






active

oldest

votes


















4














If I'm not wrong, you should just use usepackagealgpseudocode because it seems to re-implement algorithms and it's the one that defines things like State, etc.



There doesn't appear to be a single, simple way to change the font (maybe you should consider a different code package?).



The keywords in the code are defined in the package like this:



algnewcommandalgorithmicfunctiontextbffunction


and you can change that to



algrenewcommandalgorithmicfunctiontextttfunction


You can make similar changes to some of the other keywords. This won't change the other text though, like "Euclid" and the text in the comments. You can change some of this by wrapping algorithm in a group with a font declaration.



documentclassarticle
usepackagealgpseudocode
algrenewcommandalgorithmicproceduretextttprocedure
begindocument
tt
beginalgorithmic
ProcedureEuclida,b
State $ABC$ ABC Commentthis is a test
EndProcedure
endalgorithmic

enddocument


But this still won't change the font for the math part. To change that font, either don't put it in math, or look at a package like mathastext that redefines the math fonts.






share|improve this answer


















  • 2





    instead TeX tt you should use LaTeX command ttfamily :-)

    – Zarko
    7 hours ago











  • Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

    – S12000
    7 hours ago











  • Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

    – S12000
    7 hours ago













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/3.0/"u003ecc by-sa 3.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%2f501739%2fhow-to-change-the-font-style-not-the-size-but-the-style-of-algorithimc-package%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














If I'm not wrong, you should just use usepackagealgpseudocode because it seems to re-implement algorithms and it's the one that defines things like State, etc.



There doesn't appear to be a single, simple way to change the font (maybe you should consider a different code package?).



The keywords in the code are defined in the package like this:



algnewcommandalgorithmicfunctiontextbffunction


and you can change that to



algrenewcommandalgorithmicfunctiontextttfunction


You can make similar changes to some of the other keywords. This won't change the other text though, like "Euclid" and the text in the comments. You can change some of this by wrapping algorithm in a group with a font declaration.



documentclassarticle
usepackagealgpseudocode
algrenewcommandalgorithmicproceduretextttprocedure
begindocument
tt
beginalgorithmic
ProcedureEuclida,b
State $ABC$ ABC Commentthis is a test
EndProcedure
endalgorithmic

enddocument


But this still won't change the font for the math part. To change that font, either don't put it in math, or look at a package like mathastext that redefines the math fonts.






share|improve this answer


















  • 2





    instead TeX tt you should use LaTeX command ttfamily :-)

    – Zarko
    7 hours ago











  • Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

    – S12000
    7 hours ago











  • Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

    – S12000
    7 hours ago















4














If I'm not wrong, you should just use usepackagealgpseudocode because it seems to re-implement algorithms and it's the one that defines things like State, etc.



There doesn't appear to be a single, simple way to change the font (maybe you should consider a different code package?).



The keywords in the code are defined in the package like this:



algnewcommandalgorithmicfunctiontextbffunction


and you can change that to



algrenewcommandalgorithmicfunctiontextttfunction


You can make similar changes to some of the other keywords. This won't change the other text though, like "Euclid" and the text in the comments. You can change some of this by wrapping algorithm in a group with a font declaration.



documentclassarticle
usepackagealgpseudocode
algrenewcommandalgorithmicproceduretextttprocedure
begindocument
tt
beginalgorithmic
ProcedureEuclida,b
State $ABC$ ABC Commentthis is a test
EndProcedure
endalgorithmic

enddocument


But this still won't change the font for the math part. To change that font, either don't put it in math, or look at a package like mathastext that redefines the math fonts.






share|improve this answer


















  • 2





    instead TeX tt you should use LaTeX command ttfamily :-)

    – Zarko
    7 hours ago











  • Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

    – S12000
    7 hours ago











  • Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

    – S12000
    7 hours ago













4












4








4







If I'm not wrong, you should just use usepackagealgpseudocode because it seems to re-implement algorithms and it's the one that defines things like State, etc.



There doesn't appear to be a single, simple way to change the font (maybe you should consider a different code package?).



The keywords in the code are defined in the package like this:



algnewcommandalgorithmicfunctiontextbffunction


and you can change that to



algrenewcommandalgorithmicfunctiontextttfunction


You can make similar changes to some of the other keywords. This won't change the other text though, like "Euclid" and the text in the comments. You can change some of this by wrapping algorithm in a group with a font declaration.



documentclassarticle
usepackagealgpseudocode
algrenewcommandalgorithmicproceduretextttprocedure
begindocument
tt
beginalgorithmic
ProcedureEuclida,b
State $ABC$ ABC Commentthis is a test
EndProcedure
endalgorithmic

enddocument


But this still won't change the font for the math part. To change that font, either don't put it in math, or look at a package like mathastext that redefines the math fonts.






share|improve this answer













If I'm not wrong, you should just use usepackagealgpseudocode because it seems to re-implement algorithms and it's the one that defines things like State, etc.



There doesn't appear to be a single, simple way to change the font (maybe you should consider a different code package?).



The keywords in the code are defined in the package like this:



algnewcommandalgorithmicfunctiontextbffunction


and you can change that to



algrenewcommandalgorithmicfunctiontextttfunction


You can make similar changes to some of the other keywords. This won't change the other text though, like "Euclid" and the text in the comments. You can change some of this by wrapping algorithm in a group with a font declaration.



documentclassarticle
usepackagealgpseudocode
algrenewcommandalgorithmicproceduretextttprocedure
begindocument
tt
beginalgorithmic
ProcedureEuclida,b
State $ABC$ ABC Commentthis is a test
EndProcedure
endalgorithmic

enddocument


But this still won't change the font for the math part. To change that font, either don't put it in math, or look at a package like mathastext that redefines the math fonts.







share|improve this answer












share|improve this answer



share|improve this answer










answered 7 hours ago









Ethan DuckworthEthan Duckworth

926 bronze badges




926 bronze badges







  • 2





    instead TeX tt you should use LaTeX command ttfamily :-)

    – Zarko
    7 hours ago











  • Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

    – S12000
    7 hours ago











  • Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

    – S12000
    7 hours ago












  • 2





    instead TeX tt you should use LaTeX command ttfamily :-)

    – Zarko
    7 hours ago











  • Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

    – S12000
    7 hours ago











  • Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

    – S12000
    7 hours ago







2




2





instead TeX tt you should use LaTeX command ttfamily :-)

– Zarko
7 hours ago





instead TeX tt you should use LaTeX command ttfamily :-)

– Zarko
7 hours ago













Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

– S12000
7 hours ago





Hello Zarko you are right if I replace ttdefault by ttfamily it works like a charm. I would use as a accepted answer. Could you please put your comment as answer?

– S12000
7 hours ago













Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

– S12000
7 hours ago





Hello Ethan, thanks a lot for all the explanations I understand more the background of the package now. However, I think the solution of Zarko is more simple.

– S12000
7 hours ago

















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%2f501739%2fhow-to-change-the-font-style-not-the-size-but-the-style-of-algorithimc-package%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

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單