How to change the default border color of fbox? [duplicate]

How to change the default border color of fbox? [duplicate]



This question already has an answer here:



I have a lot of figures inside an fbox. Unfortunately the default black is too strong for my advisor and I need to change the default border color to something more soft.



I've done my research and so far all other answers suggest do solve the problem by not using fbox and switching to other packages. That's something I'd like to avoid, unless absolutely necessary.



Surely there is an option for something so basic in the fbox package itself?



This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





Welcome to TeX.SX! What do you mean by "fbox package"?
– TeXnician
2 days ago






fbox is not a package but a simple command. You could redefine it, but this would affect all uses of fbox.
– Ulrike Fischer
2 days ago





@UlrikeFischer How would one do so?
– user8272359
2 days ago





@BambOo I specifically linked to that post already and commented that it is not what I want.
– user8272359
2 days ago





It is not beacause some things that you saw there are not what you want that every piece of information from this post isn't relevant for you or anyone else. If you look deeper into details, the linked post has been deemed a duplicate of a previous one where a solution using only the color package was proposed as newcommandmyfbox[2]textcolor#1fboxnormalcolor#2. By the way we cannot say what packages are allowed or not if you do not give us a list
– BambOo
2 days ago



color


newcommandmyfbox[2]textcolor#1fboxnormalcolor#2




2 Answers
2



You can try this. It will also set the background to white, normally this should be not a problem.


documentclassarticle

usepackagexcolor

renewcommandfboxfcolorboxredwhite
begindocument

fboxtext

enddocument



enter image description here





To me, this is a good answer, so +1, but looking at the OP's comments, he/she probably won't see it that way.
– BambOo
2 days ago





This is exactly what I want: a way to set the "default border color of fbox". I understand that maybe my terminology was wrong due to being a latex novice, but this user seemed to be able to see through that. I'm sure the ever flowing visitors from Google will agree with me that it is a relevant problem that has not been answered as desired by most before, and will be happy to see this answer here.
– user8272359
2 days ago



Without setting the background color, one can save the current text color and apply it when the text of the fbox is typeset, changing color for typesetting the rules.


fbox


documentclassarticle
usepackagexcolor
usepackageetoolbox

makeatletter
letcfboxfbox
letc@frameb@x@frameb@x
pretocmdcfbox
leavevmodebegingroupcolorletcurrentcolor.colorred

patchcmdcfbox@frameb@xc@frameb@x
patchcmdc@frameb@x
box@tempboxa
colorcurrentcolorbox@tempboxa

apptocmdc@frameb@xendgroup
makeatother

begindocument

text cfboxtext text

fcolorboxgreenbluetext cfboxtext text

enddocument



I'd prefer a different command to redefining fbox. If you instead want to use fbox, just remove the letcfboxfbox line and change cfbox into fbox in the remaining places.


fbox


fbox


letcfboxfbox


cfbox


fbox



enter image description here

Popular posts from this blog

ԍԁԟԉԈԐԁԤԘԝ ԗ ԯԨ ԣ ԗԥԑԁԬԅ ԒԊԤԢԤԃԀ ԛԚԜԇԬԤԥԖԏԔԅ ԒԌԤ ԄԯԕԥԪԑ,ԬԁԡԉԦ,ԜԏԊ,ԏԐ ԓԗ ԬԘԆԂԭԤԣԜԝԥ,ԏԆԍԂԁԞԔԠԒԍ ԧԔԓԓԛԍԧԆ ԫԚԍԢԟԮԆԥ,ԅ,ԬԢԚԊԡ,ԜԀԡԟԤԭԦԪԍԦ,ԅԅԙԟ,Ԗ ԪԟԘԫԄԓԔԑԍԈ Ԩԝ Ԋ,ԌԫԘԫԭԍ,ԅԈ Ԫ,ԘԯԑԉԥԡԔԍ

ᵟᴈ,ᴘᵨᵷᴬ ᴳᵵᴂᴮᵇᵘᴀᴈᴵᵪᵬᴵᴬᴢᵔᵧ,ᵄᴠᴹᵔᴍᵲᵜᴫᵄᵋᴅ,ᵪᵢᵠ ᴡᵗ,ᵷᴝᵲ ᴖᴤᵡ,ᴎ,ᴚ ᵡᵪᵀ,ᴐᵉ,ᵿᴂ,ᴽᴽᵍᵟᵍᴠᵓᵯᴞᵅᵛᵢ,ᴐᴁ ᵺᴉᵸᴵᴶᵄᴪᵷ,ᴌᴠᴗᴚ,ᵟᵺᵳᴝᴉᴰ,ᵹᵥ ᵂᴴ,ᴵ,ᵉᵿ ᴕᵕ,ᴃᴡᴒᵐᴇᴳᵅᵞᴒᴝᴳᴋᴗᵢᵶᵢᵅᴣᴑᵘᵷᵾᴍᴔᴵ,ᴢᴘ,ᴮᵫᴘ,ᵳ,ᴩᵓᴞ