How can I make a coloured footrule using fancyhdr?
up vote
1
down vote
favorite
I found this on the Internet:
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
So I was wondering if there are any other solutions, that are more simple or just more understandable.
MWE:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
color fancyhdr
New contributor
add a comment |
up vote
1
down vote
favorite
I found this on the Internet:
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
So I was wondering if there are any other solutions, that are more simple or just more understandable.
MWE:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
color fancyhdr
New contributor
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I found this on the Internet:
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
So I was wondering if there are any other solutions, that are more simple or just more understandable.
MWE:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
color fancyhdr
New contributor
I found this on the Internet:
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
So I was wondering if there are any other solutions, that are more simple or just more understandable.
MWE:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
renewcommand{footrule}{hbox to headwidth{color{red}leadershrule height footrulewidthhfill}}
color fancyhdr
color fancyhdr
New contributor
New contributor
edited 19 hours ago
New contributor
asked 19 hours ago
Vlashious
83
83
New contributor
New contributor
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago
add a comment |
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
19 hours ago
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Not sure if this is really easier than to just add the colour to the definition of the footline, but another method could be patch the command by adding the red colour before and switching back to black afterwards:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{xpatch}
xapptocmd{footrule}{color{black}}{}{}
xpretocmd{footrule}{color{red}}{}{}
begin{document}
x
newpage
x
end{document}
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
add a comment |
up vote
2
down vote
The definition you are using for the footrule
is actually a little different to the default one contained in fancyhdr.sty
, which is:
deffootrule{{if@fancyplainletfootrulewidthplainfootrulewidthfi
vskip-footruleskipvskip-footrulewidth
hrule@widthheadwidth@heightfootrulewidthvskipfootruleskip}}
It's not really necessary to understand this to use it. That's half the point of a package.
To make it coloured, you want to put color{red}
at the start of the command, but after the brace that is immediately before if@fancyplain
. Puting it within the group will ensure that the colour does not continue beyond the rule.
I would do this by patching footnoterule
using the etoolbox
package. Something like this (I also prefer xcolor
to color
—nicer features):
documentclass[11pt]{article}
usepackage{xcolor}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{etoolbox}
makeatletter
patchcmd{footrule}
{if@fancyplain}
{color{red}if@fancyplain}
{}
{}
makeatother
begin{document}
null
end{document}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Not sure if this is really easier than to just add the colour to the definition of the footline, but another method could be patch the command by adding the red colour before and switching back to black afterwards:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{xpatch}
xapptocmd{footrule}{color{black}}{}{}
xpretocmd{footrule}{color{red}}{}{}
begin{document}
x
newpage
x
end{document}
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
add a comment |
up vote
2
down vote
accepted
Not sure if this is really easier than to just add the colour to the definition of the footline, but another method could be patch the command by adding the red colour before and switching back to black afterwards:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{xpatch}
xapptocmd{footrule}{color{black}}{}{}
xpretocmd{footrule}{color{red}}{}{}
begin{document}
x
newpage
x
end{document}
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Not sure if this is really easier than to just add the colour to the definition of the footline, but another method could be patch the command by adding the red colour before and switching back to black afterwards:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{xpatch}
xapptocmd{footrule}{color{black}}{}{}
xpretocmd{footrule}{color{red}}{}{}
begin{document}
x
newpage
x
end{document}
Not sure if this is really easier than to just add the colour to the definition of the footline, but another method could be patch the command by adding the red colour before and switching back to black afterwards:
documentclass[11pt]{article}
usepackage{color}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{xpatch}
xapptocmd{footrule}{color{black}}{}{}
xpretocmd{footrule}{color{red}}{}{}
begin{document}
x
newpage
x
end{document}
answered 19 hours ago
samcarter
82.3k793263
82.3k793263
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
add a comment |
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
Thank you for the response. You said I can add the colour to the defenition of the footline. Could you tell me more about this? @samcarter
– Vlashious
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
@Vlashious Adding the colour directly to the footrule definition is what you do in the code in your question
– samcarter
18 hours ago
add a comment |
up vote
2
down vote
The definition you are using for the footrule
is actually a little different to the default one contained in fancyhdr.sty
, which is:
deffootrule{{if@fancyplainletfootrulewidthplainfootrulewidthfi
vskip-footruleskipvskip-footrulewidth
hrule@widthheadwidth@heightfootrulewidthvskipfootruleskip}}
It's not really necessary to understand this to use it. That's half the point of a package.
To make it coloured, you want to put color{red}
at the start of the command, but after the brace that is immediately before if@fancyplain
. Puting it within the group will ensure that the colour does not continue beyond the rule.
I would do this by patching footnoterule
using the etoolbox
package. Something like this (I also prefer xcolor
to color
—nicer features):
documentclass[11pt]{article}
usepackage{xcolor}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{etoolbox}
makeatletter
patchcmd{footrule}
{if@fancyplain}
{color{red}if@fancyplain}
{}
{}
makeatother
begin{document}
null
end{document}
add a comment |
up vote
2
down vote
The definition you are using for the footrule
is actually a little different to the default one contained in fancyhdr.sty
, which is:
deffootrule{{if@fancyplainletfootrulewidthplainfootrulewidthfi
vskip-footruleskipvskip-footrulewidth
hrule@widthheadwidth@heightfootrulewidthvskipfootruleskip}}
It's not really necessary to understand this to use it. That's half the point of a package.
To make it coloured, you want to put color{red}
at the start of the command, but after the brace that is immediately before if@fancyplain
. Puting it within the group will ensure that the colour does not continue beyond the rule.
I would do this by patching footnoterule
using the etoolbox
package. Something like this (I also prefer xcolor
to color
—nicer features):
documentclass[11pt]{article}
usepackage{xcolor}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{etoolbox}
makeatletter
patchcmd{footrule}
{if@fancyplain}
{color{red}if@fancyplain}
{}
{}
makeatother
begin{document}
null
end{document}
add a comment |
up vote
2
down vote
up vote
2
down vote
The definition you are using for the footrule
is actually a little different to the default one contained in fancyhdr.sty
, which is:
deffootrule{{if@fancyplainletfootrulewidthplainfootrulewidthfi
vskip-footruleskipvskip-footrulewidth
hrule@widthheadwidth@heightfootrulewidthvskipfootruleskip}}
It's not really necessary to understand this to use it. That's half the point of a package.
To make it coloured, you want to put color{red}
at the start of the command, but after the brace that is immediately before if@fancyplain
. Puting it within the group will ensure that the colour does not continue beyond the rule.
I would do this by patching footnoterule
using the etoolbox
package. Something like this (I also prefer xcolor
to color
—nicer features):
documentclass[11pt]{article}
usepackage{xcolor}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{etoolbox}
makeatletter
patchcmd{footrule}
{if@fancyplain}
{color{red}if@fancyplain}
{}
{}
makeatother
begin{document}
null
end{document}
The definition you are using for the footrule
is actually a little different to the default one contained in fancyhdr.sty
, which is:
deffootrule{{if@fancyplainletfootrulewidthplainfootrulewidthfi
vskip-footruleskipvskip-footrulewidth
hrule@widthheadwidth@heightfootrulewidthvskipfootruleskip}}
It's not really necessary to understand this to use it. That's half the point of a package.
To make it coloured, you want to put color{red}
at the start of the command, but after the brace that is immediately before if@fancyplain
. Puting it within the group will ensure that the colour does not continue beyond the rule.
I would do this by patching footnoterule
using the etoolbox
package. Something like this (I also prefer xcolor
to color
—nicer features):
documentclass[11pt]{article}
usepackage{xcolor}
usepackage{fancyhdr}
pagestyle{fancy}
renewcommand{footrulewidth}{1pt}
usepackage{etoolbox}
makeatletter
patchcmd{footrule}
{if@fancyplain}
{color{red}if@fancyplain}
{}
{}
makeatother
begin{document}
null
end{document}
answered 19 hours ago
David Purton
8,3361834
8,3361834
add a comment |
add a comment |
Vlashious is a new contributor. Be nice, and check out our Code of Conduct.
Vlashious is a new contributor. Be nice, and check out our Code of Conduct.
Vlashious is a new contributor. Be nice, and check out our Code of Conduct.
Vlashious is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461675%2fhow-can-i-make-a-coloured-footrule-using-fancyhdr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
19 hours ago
@samcarter I don't have some problems. I just want to know how to make a colored footrule, and I found the code that works for me, but I want to know if there are any other options.
– Vlashious
19 hours ago
If you would add a small minimal working example (MWE) to your question, it would make it much easier to work on alternative ways too change the footrule colour.
– samcarter
19 hours ago
@samcarter Okay, I added MWE to the question :)
– Vlashious
19 hours ago