How should I use the fbox command correctly to avoid producing a Bad Box message?












2















I come from this link and the response that is given is very good.



I have this MWE:



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

begin{document}

vspace{5mm}
fbox{begin{minipage}{30em}
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.
end{minipage}}
vspace{5mm}

end{document}


where I modify the fbox value (which is 30em) manually. But that is not the correct width of box (according to the margins of the document). So I change 30emfor textwidth value, and when I compile it says that there is an Bad Box (I clarify that approximately from 31em onwards the Bad Box message appears). How can I avoid that message?



Using a measure versus not using it



Should I manually enter the value or is there some (easy) way to not have to worry about every box in my document?



Thanks!










share|improve this question


















  • 1





    There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

    – Johannes_B
    Jan 22 '18 at 7:16






  • 2





    What you really should do: Create semantic markup, instead of doing the layout each and every time.

    – Johannes_B
    Jan 22 '18 at 7:17






  • 3





    To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

    – Peter Grill
    Jan 22 '18 at 7:37













  • @Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

    – manooooh
    Jan 22 '18 at 20:38











  • @PeterGrill I'm going to take your recommendation about that alternative that you propose.

    – manooooh
    Jan 22 '18 at 20:38
















2















I come from this link and the response that is given is very good.



I have this MWE:



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

begin{document}

vspace{5mm}
fbox{begin{minipage}{30em}
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.
end{minipage}}
vspace{5mm}

end{document}


where I modify the fbox value (which is 30em) manually. But that is not the correct width of box (according to the margins of the document). So I change 30emfor textwidth value, and when I compile it says that there is an Bad Box (I clarify that approximately from 31em onwards the Bad Box message appears). How can I avoid that message?



Using a measure versus not using it



Should I manually enter the value or is there some (easy) way to not have to worry about every box in my document?



Thanks!










share|improve this question


















  • 1





    There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

    – Johannes_B
    Jan 22 '18 at 7:16






  • 2





    What you really should do: Create semantic markup, instead of doing the layout each and every time.

    – Johannes_B
    Jan 22 '18 at 7:17






  • 3





    To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

    – Peter Grill
    Jan 22 '18 at 7:37













  • @Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

    – manooooh
    Jan 22 '18 at 20:38











  • @PeterGrill I'm going to take your recommendation about that alternative that you propose.

    – manooooh
    Jan 22 '18 at 20:38














2












2








2








I come from this link and the response that is given is very good.



I have this MWE:



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

begin{document}

vspace{5mm}
fbox{begin{minipage}{30em}
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.
end{minipage}}
vspace{5mm}

end{document}


where I modify the fbox value (which is 30em) manually. But that is not the correct width of box (according to the margins of the document). So I change 30emfor textwidth value, and when I compile it says that there is an Bad Box (I clarify that approximately from 31em onwards the Bad Box message appears). How can I avoid that message?



Using a measure versus not using it



Should I manually enter the value or is there some (easy) way to not have to worry about every box in my document?



Thanks!










share|improve this question














I come from this link and the response that is given is very good.



I have this MWE:



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

begin{document}

vspace{5mm}
fbox{begin{minipage}{30em}
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.
end{minipage}}
vspace{5mm}

end{document}


where I modify the fbox value (which is 30em) manually. But that is not the correct width of box (according to the margins of the document). So I change 30emfor textwidth value, and when I compile it says that there is an Bad Box (I clarify that approximately from 31em onwards the Bad Box message appears). How can I avoid that message?



Using a measure versus not using it



Should I manually enter the value or is there some (easy) way to not have to worry about every box in my document?



Thanks!







boxes unit-of-measure






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 22 '18 at 7:10









manoooohmanooooh

1,1641517




1,1641517








  • 1





    There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

    – Johannes_B
    Jan 22 '18 at 7:16






  • 2





    What you really should do: Create semantic markup, instead of doing the layout each and every time.

    – Johannes_B
    Jan 22 '18 at 7:17






  • 3





    To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

    – Peter Grill
    Jan 22 '18 at 7:37













  • @Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

    – manooooh
    Jan 22 '18 at 20:38











  • @PeterGrill I'm going to take your recommendation about that alternative that you propose.

    – manooooh
    Jan 22 '18 at 20:38














  • 1





    There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

    – Johannes_B
    Jan 22 '18 at 7:16






  • 2





    What you really should do: Create semantic markup, instead of doing the layout each and every time.

    – Johannes_B
    Jan 22 '18 at 7:17






  • 3





    To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

    – Peter Grill
    Jan 22 '18 at 7:37













  • @Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

    – manooooh
    Jan 22 '18 at 20:38











  • @PeterGrill I'm going to take your recommendation about that alternative that you propose.

    – manooooh
    Jan 22 '18 at 20:38








1




1





There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

– Johannes_B
Jan 22 '18 at 7:16





There is a little bit white space (fboxsep) on all sides of the box to the text. This space is added to the linewidth, hence the whole box needs more space and creates a warning.

– Johannes_B
Jan 22 '18 at 7:16




2




2





What you really should do: Create semantic markup, instead of doing the layout each and every time.

– Johannes_B
Jan 22 '18 at 7:17





What you really should do: Create semantic markup, instead of doing the layout each and every time.

– Johannes_B
Jan 22 '18 at 7:17




3




3





To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

– Peter Grill
Jan 22 '18 at 7:37







To resolve you immediate issue instead of textwidth use begin{minipage}{textwidth-2fboxsep} and include usepackage{calc}. Also, you need a noindent before the fbox{}. But, yes defintly do as @Johannes_B recommends and define a custom environment instead of tweaking every use of this. I'd recomment looking into tcolorbox (there are numerous examples on this site). Also, adding the showframe package will clearly show you what is happening with you add the noindent and the -2fboxsep.

– Peter Grill
Jan 22 '18 at 7:37















@Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

– manooooh
Jan 22 '18 at 20:38





@Johannes_B Thanks for your explanation! I am a beginner with LaTeX, so I have to learn a lot about programming (even if I'm studying a career in Computer Science haha).

– manooooh
Jan 22 '18 at 20:38













@PeterGrill I'm going to take your recommendation about that alternative that you propose.

– manooooh
Jan 22 '18 at 20:38





@PeterGrill I'm going to take your recommendation about that alternative that you propose.

– manooooh
Jan 22 '18 at 20:38










1 Answer
1






active

oldest

votes


















3














Here is a "changed" fbox called myfbox and expecting as arguments an optional for width and a mandatory (its content)



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

newlength{mywidth}%

makeatletter
newcommandmyfbox[2][linewidth]{%
xdefmysep{dimexpr 1dimexprf@size ptrelaxrelax}%
setlength{fboxsep}{mysep}%
setlength{mywidth}{dimexpr#1-2fboxsep-2fboxrulerelax}%
noindentfbox{begin{minipage}[inner sep=0]{mywidth}#2end{minipage}}%
}%
makeatother

begin{document}

Large

myfbox[linewidth]{
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}


Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones:

normalsize

myfbox[textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}

scriptsize

begin{center}
myfbox[0.7textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}
end{center}
end{document}


Output:



enter image description here



PS: Source: https://tex.stackexchange.com/a/102739/120578 from @GonzaloMedina



PS2: May be is not good idea to include the noindent command in my definition of the box (You can remove it from there and use it whenever needed)






share|improve this answer
























  • Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

    – manooooh
    Jan 22 '18 at 20:46











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%2f411485%2fhow-should-i-use-the-fbox-command-correctly-to-avoid-producing-a-bad-box-message%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









3














Here is a "changed" fbox called myfbox and expecting as arguments an optional for width and a mandatory (its content)



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

newlength{mywidth}%

makeatletter
newcommandmyfbox[2][linewidth]{%
xdefmysep{dimexpr 1dimexprf@size ptrelaxrelax}%
setlength{fboxsep}{mysep}%
setlength{mywidth}{dimexpr#1-2fboxsep-2fboxrulerelax}%
noindentfbox{begin{minipage}[inner sep=0]{mywidth}#2end{minipage}}%
}%
makeatother

begin{document}

Large

myfbox[linewidth]{
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}


Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones:

normalsize

myfbox[textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}

scriptsize

begin{center}
myfbox[0.7textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}
end{center}
end{document}


Output:



enter image description here



PS: Source: https://tex.stackexchange.com/a/102739/120578 from @GonzaloMedina



PS2: May be is not good idea to include the noindent command in my definition of the box (You can remove it from there and use it whenever needed)






share|improve this answer
























  • Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

    – manooooh
    Jan 22 '18 at 20:46
















3














Here is a "changed" fbox called myfbox and expecting as arguments an optional for width and a mandatory (its content)



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

newlength{mywidth}%

makeatletter
newcommandmyfbox[2][linewidth]{%
xdefmysep{dimexpr 1dimexprf@size ptrelaxrelax}%
setlength{fboxsep}{mysep}%
setlength{mywidth}{dimexpr#1-2fboxsep-2fboxrulerelax}%
noindentfbox{begin{minipage}[inner sep=0]{mywidth}#2end{minipage}}%
}%
makeatother

begin{document}

Large

myfbox[linewidth]{
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}


Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones:

normalsize

myfbox[textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}

scriptsize

begin{center}
myfbox[0.7textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}
end{center}
end{document}


Output:



enter image description here



PS: Source: https://tex.stackexchange.com/a/102739/120578 from @GonzaloMedina



PS2: May be is not good idea to include the noindent command in my definition of the box (You can remove it from there and use it whenever needed)






share|improve this answer
























  • Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

    – manooooh
    Jan 22 '18 at 20:46














3












3








3







Here is a "changed" fbox called myfbox and expecting as arguments an optional for width and a mandatory (its content)



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

newlength{mywidth}%

makeatletter
newcommandmyfbox[2][linewidth]{%
xdefmysep{dimexpr 1dimexprf@size ptrelaxrelax}%
setlength{fboxsep}{mysep}%
setlength{mywidth}{dimexpr#1-2fboxsep-2fboxrulerelax}%
noindentfbox{begin{minipage}[inner sep=0]{mywidth}#2end{minipage}}%
}%
makeatother

begin{document}

Large

myfbox[linewidth]{
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}


Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones:

normalsize

myfbox[textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}

scriptsize

begin{center}
myfbox[0.7textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}
end{center}
end{document}


Output:



enter image description here



PS: Source: https://tex.stackexchange.com/a/102739/120578 from @GonzaloMedina



PS2: May be is not good idea to include the noindent command in my definition of the box (You can remove it from there and use it whenever needed)






share|improve this answer













Here is a "changed" fbox called myfbox and expecting as arguments an optional for width and a mandatory (its content)



documentclass[11pt]{article}
usepackage{amsmath}
usepackage{amssymb}

newlength{mywidth}%

makeatletter
newcommandmyfbox[2][linewidth]{%
xdefmysep{dimexpr 1dimexprf@size ptrelaxrelax}%
setlength{fboxsep}{mysep}%
setlength{mywidth}{dimexpr#1-2fboxsep-2fboxrulerelax}%
noindentfbox{begin{minipage}[inner sep=0]{mywidth}#2end{minipage}}%
}%
makeatother

begin{document}

Large

myfbox[linewidth]{
underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}


Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones:

normalsize

myfbox[textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}

scriptsize

begin{center}
myfbox[0.7textwidth]{underline{textbf{NOTACI'ON}}: Dada (f:Dsubseteq mathbb Rrightarrow mathbb R) con (y=f(x)) para denotar la funci'on derivada se puede encontrar en la bibliograf'ia disponible de la materia las siguientes notaciones: [begin{array}{cccc}f'(x), & D_xf, & dfrac{df}{dx}, & dfrac{dy}{dx}end{array}.] Todas ellas son equivalentes y que utilizaremos indistintamente en lo sucesivo.}
end{center}
end{document}


Output:



enter image description here



PS: Source: https://tex.stackexchange.com/a/102739/120578 from @GonzaloMedina



PS2: May be is not good idea to include the noindent command in my definition of the box (You can remove it from there and use it whenever needed)







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 22 '18 at 8:20









koleygrkoleygr

13.3k11038




13.3k11038













  • Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

    – manooooh
    Jan 22 '18 at 20:46



















  • Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

    – manooooh
    Jan 22 '18 at 20:46

















Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

– manooooh
Jan 22 '18 at 20:46





Many thanks! It is fine with noident command :). The only thing I have to add was the vertical spacing up and down the custom box you created so that the text is not so close to it. I should learn all the commands that you use in your code. What draws my attention is the meaning of the relax command and all that ... I'm passionate about LaTex!

– manooooh
Jan 22 '18 at 20:46


















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%2f411485%2fhow-should-i-use-the-fbox-command-correctly-to-avoid-producing-a-bad-box-message%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

Lallio

Unable to find Lightning Node

Futebolista