How to draw rule from left text edge to right paper edge without overfull?
up vote
2
down vote
favorite
I'm currently using the following instruction to draw a horizontal rule from the left edge of the text body to the right edge of the paper:
rule{paperwidth}{2pt}
This works, but it results in an overfull warning:
Overfull hbox (232.295pt too wide) in paragraph at lines 12--13
The proper way to do this is probably to calculate the actual length, but I don't know how to do this. I read about an addtolength instruction but am not sure what I can add together. Can someone advise?
rules width layout
add a comment |
up vote
2
down vote
favorite
I'm currently using the following instruction to draw a horizontal rule from the left edge of the text body to the right edge of the paper:
rule{paperwidth}{2pt}
This works, but it results in an overfull warning:
Overfull hbox (232.295pt too wide) in paragraph at lines 12--13
The proper way to do this is probably to calculate the actual length, but I don't know how to do this. I read about an addtolength instruction but am not sure what I can add together. Can someone advise?
rules width layout
1
For oneside you can usenoindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}
– John Kormylo
Dec 4 at 15:19
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm currently using the following instruction to draw a horizontal rule from the left edge of the text body to the right edge of the paper:
rule{paperwidth}{2pt}
This works, but it results in an overfull warning:
Overfull hbox (232.295pt too wide) in paragraph at lines 12--13
The proper way to do this is probably to calculate the actual length, but I don't know how to do this. I read about an addtolength instruction but am not sure what I can add together. Can someone advise?
rules width layout
I'm currently using the following instruction to draw a horizontal rule from the left edge of the text body to the right edge of the paper:
rule{paperwidth}{2pt}
This works, but it results in an overfull warning:
Overfull hbox (232.295pt too wide) in paragraph at lines 12--13
The proper way to do this is probably to calculate the actual length, but I don't know how to do this. I read about an addtolength instruction but am not sure what I can add together. Can someone advise?
rules width layout
rules width layout
edited Dec 4 at 16:46
Werner
434k619531639
434k619531639
asked Dec 4 at 15:03
Roxy
3465
3465
1
For oneside you can usenoindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}
– John Kormylo
Dec 4 at 15:19
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57
add a comment |
1
For oneside you can usenoindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}
– John Kormylo
Dec 4 at 15:19
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57
1
1
For oneside you can use
noindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}– John Kormylo
Dec 4 at 15:19
For oneside you can use
noindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}– John Kormylo
Dec 4 at 15:19
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
Without any package:
documentclass{article}
begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
noindentmakebox[0pt][l]{rule{paperwidth}{2pt}}par
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
end{document}

add a comment |
up vote
1
down vote
You can also use tikz package.
documentclass{article}
usepackage{tikz}
usepackage{lipsum}
begin{document}
lipsum[1]
noindentbegin{tikzpicture}[remember picture,overlay]
draw [line width=2pt] (0,0) -- (paperwidth, 0);
end{tikzpicture}
lipsum[2]
end{document}

add a comment |
up vote
0
down vote
Under onside (the default) mode in article, the length from the left side of the text block to the right side of the page is given by
paperwidth - oddsidemargin - 1in - hoffset
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% left margin
To see this, load the layout package and issue layout to see what lengths are at work:

However, as long as the length is longer than the above length, it'll stretch all the way to the right side of the page. So, you can just use paperwidth. Here's a macro version that allows some adjustment of the width via an optional argument:

documentclass{article}
newcommand{fullrule}[1][2pt]{%
parnobreaknoindent
makebox[0pt][l]{%
rule[.5ex]{paperwidth}{#1}}par
}
usepackage{lipsum}
begin{document}
sloppylipsum[1]
fullrule
lipsum[2]
fullrule[.4pt]
lipsum[3]
end{document}
Note that we place the rule inside a zero-width box to avoid any warnings about an overfull hbox.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Without any package:
documentclass{article}
begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
noindentmakebox[0pt][l]{rule{paperwidth}{2pt}}par
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
end{document}

add a comment |
up vote
1
down vote
accepted
Without any package:
documentclass{article}
begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
noindentmakebox[0pt][l]{rule{paperwidth}{2pt}}par
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
end{document}

add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Without any package:
documentclass{article}
begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
noindentmakebox[0pt][l]{rule{paperwidth}{2pt}}par
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
end{document}

Without any package:
documentclass{article}
begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
noindentmakebox[0pt][l]{rule{paperwidth}{2pt}}par
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
end{document}

answered Dec 4 at 16:06
Bernard
164k769192
164k769192
add a comment |
add a comment |
up vote
1
down vote
You can also use tikz package.
documentclass{article}
usepackage{tikz}
usepackage{lipsum}
begin{document}
lipsum[1]
noindentbegin{tikzpicture}[remember picture,overlay]
draw [line width=2pt] (0,0) -- (paperwidth, 0);
end{tikzpicture}
lipsum[2]
end{document}

add a comment |
up vote
1
down vote
You can also use tikz package.
documentclass{article}
usepackage{tikz}
usepackage{lipsum}
begin{document}
lipsum[1]
noindentbegin{tikzpicture}[remember picture,overlay]
draw [line width=2pt] (0,0) -- (paperwidth, 0);
end{tikzpicture}
lipsum[2]
end{document}

add a comment |
up vote
1
down vote
up vote
1
down vote
You can also use tikz package.
documentclass{article}
usepackage{tikz}
usepackage{lipsum}
begin{document}
lipsum[1]
noindentbegin{tikzpicture}[remember picture,overlay]
draw [line width=2pt] (0,0) -- (paperwidth, 0);
end{tikzpicture}
lipsum[2]
end{document}

You can also use tikz package.
documentclass{article}
usepackage{tikz}
usepackage{lipsum}
begin{document}
lipsum[1]
noindentbegin{tikzpicture}[remember picture,overlay]
draw [line width=2pt] (0,0) -- (paperwidth, 0);
end{tikzpicture}
lipsum[2]
end{document}

answered Dec 4 at 16:24
javadr
1,303313
1,303313
add a comment |
add a comment |
up vote
0
down vote
Under onside (the default) mode in article, the length from the left side of the text block to the right side of the page is given by
paperwidth - oddsidemargin - 1in - hoffset
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% left margin
To see this, load the layout package and issue layout to see what lengths are at work:

However, as long as the length is longer than the above length, it'll stretch all the way to the right side of the page. So, you can just use paperwidth. Here's a macro version that allows some adjustment of the width via an optional argument:

documentclass{article}
newcommand{fullrule}[1][2pt]{%
parnobreaknoindent
makebox[0pt][l]{%
rule[.5ex]{paperwidth}{#1}}par
}
usepackage{lipsum}
begin{document}
sloppylipsum[1]
fullrule
lipsum[2]
fullrule[.4pt]
lipsum[3]
end{document}
Note that we place the rule inside a zero-width box to avoid any warnings about an overfull hbox.
add a comment |
up vote
0
down vote
Under onside (the default) mode in article, the length from the left side of the text block to the right side of the page is given by
paperwidth - oddsidemargin - 1in - hoffset
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% left margin
To see this, load the layout package and issue layout to see what lengths are at work:

However, as long as the length is longer than the above length, it'll stretch all the way to the right side of the page. So, you can just use paperwidth. Here's a macro version that allows some adjustment of the width via an optional argument:

documentclass{article}
newcommand{fullrule}[1][2pt]{%
parnobreaknoindent
makebox[0pt][l]{%
rule[.5ex]{paperwidth}{#1}}par
}
usepackage{lipsum}
begin{document}
sloppylipsum[1]
fullrule
lipsum[2]
fullrule[.4pt]
lipsum[3]
end{document}
Note that we place the rule inside a zero-width box to avoid any warnings about an overfull hbox.
add a comment |
up vote
0
down vote
up vote
0
down vote
Under onside (the default) mode in article, the length from the left side of the text block to the right side of the page is given by
paperwidth - oddsidemargin - 1in - hoffset
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% left margin
To see this, load the layout package and issue layout to see what lengths are at work:

However, as long as the length is longer than the above length, it'll stretch all the way to the right side of the page. So, you can just use paperwidth. Here's a macro version that allows some adjustment of the width via an optional argument:

documentclass{article}
newcommand{fullrule}[1][2pt]{%
parnobreaknoindent
makebox[0pt][l]{%
rule[.5ex]{paperwidth}{#1}}par
}
usepackage{lipsum}
begin{document}
sloppylipsum[1]
fullrule
lipsum[2]
fullrule[.4pt]
lipsum[3]
end{document}
Note that we place the rule inside a zero-width box to avoid any warnings about an overfull hbox.
Under onside (the default) mode in article, the length from the left side of the text block to the right side of the page is given by
paperwidth - oddsidemargin - 1in - hoffset
% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% left margin
To see this, load the layout package and issue layout to see what lengths are at work:

However, as long as the length is longer than the above length, it'll stretch all the way to the right side of the page. So, you can just use paperwidth. Here's a macro version that allows some adjustment of the width via an optional argument:

documentclass{article}
newcommand{fullrule}[1][2pt]{%
parnobreaknoindent
makebox[0pt][l]{%
rule[.5ex]{paperwidth}{#1}}par
}
usepackage{lipsum}
begin{document}
sloppylipsum[1]
fullrule
lipsum[2]
fullrule[.4pt]
lipsum[3]
end{document}
Note that we place the rule inside a zero-width box to avoid any warnings about an overfull hbox.
answered Dec 4 at 16:44
Werner
434k619531639
434k619531639
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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%2f463160%2fhow-to-draw-rule-from-left-text-edge-to-right-paper-edge-without-overfull%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
1
For oneside you can use
noindentrlap{rule{dimexpr paperwidth - 1in - oddsidemargin}{2pt}}– John Kormylo
Dec 4 at 15:19
Use a TikZ picture.
– JouleV
Dec 4 at 15:28
@DũngVũ Seems like overkill.
– Roxy
Dec 4 at 19:57