How to stretch table or minipage to fill remaining space?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I am trying to make a document like this:
Since there's quite a lot of such sections, I want to make a new command like textwithline
so I can then type
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
in my document.
Note the important features:
- The line must fill all available remaining space
- The text above and below the line must be centered on the line
- The text on the left is variable length (or may be blank)
What is a good way of making such a command? I have tried:
tabular
withhfill
but it doesn't actually stretch the tabletabular*
but it doesn't "give room" to the text on the leftminipage
but that requires me to hard code width every timeulinehfill Billy Willy hfillhfill First name, Last name hfill
withcentering
but then text below line is not centered on the line, but on the page
formatting
add a comment |Â
up vote
3
down vote
favorite
I am trying to make a document like this:
Since there's quite a lot of such sections, I want to make a new command like textwithline
so I can then type
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
in my document.
Note the important features:
- The line must fill all available remaining space
- The text above and below the line must be centered on the line
- The text on the left is variable length (or may be blank)
What is a good way of making such a command? I have tried:
tabular
withhfill
but it doesn't actually stretch the tabletabular*
but it doesn't "give room" to the text on the leftminipage
but that requires me to hard code width every timeulinehfill Billy Willy hfillhfill First name, Last name hfill
withcentering
but then text below line is not centered on the line, but on the page
formatting
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am trying to make a document like this:
Since there's quite a lot of such sections, I want to make a new command like textwithline
so I can then type
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
in my document.
Note the important features:
- The line must fill all available remaining space
- The text above and below the line must be centered on the line
- The text on the left is variable length (or may be blank)
What is a good way of making such a command? I have tried:
tabular
withhfill
but it doesn't actually stretch the tabletabular*
but it doesn't "give room" to the text on the leftminipage
but that requires me to hard code width every timeulinehfill Billy Willy hfillhfill First name, Last name hfill
withcentering
but then text below line is not centered on the line, but on the page
formatting
I am trying to make a document like this:
Since there's quite a lot of such sections, I want to make a new command like textwithline
so I can then type
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
in my document.
Note the important features:
- The line must fill all available remaining space
- The text above and below the line must be centered on the line
- The text on the left is variable length (or may be blank)
What is a good way of making such a command? I have tried:
tabular
withhfill
but it doesn't actually stretch the tabletabular*
but it doesn't "give room" to the text on the leftminipage
but that requires me to hard code width every timeulinehfill Billy Willy hfillhfill First name, Last name hfill
withcentering
but then text below line is not centered on the line, but on the page
formatting
asked Aug 8 at 19:40
Imsong
161
161
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58
add a comment |Â
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
6
down vote
documentclassarticle
newcommandtextwithline[2]%
setlengthparfillskip0pt%
hrulefill
raisebox5ptmakebox[0pt]#1%
raisebox-12ptmakebox[0pt]#2%
hrulefill
par
bigskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
add a comment |Â
up vote
3
down vote
Here is an option using linegoal
to calculate the remaining width of the line (given by linegoal
).
documentclassarticle
usepackagelinegoal
newcommandtextwithline[2]%
beginminipage[t]linegoal
centeringstrut #1 \[-.7baselineskip]
hrulefill \[-.1baselineskip]
centeringsmallfootnotesize #2
endminipagepar
addvspace.5baselineskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
Since linegoal
uses a label-ref-like system (thanks to zref
), any changes in width would require you to compile at least twice before the width settles.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
documentclassarticle
newcommandtextwithline[2]%
setlengthparfillskip0pt%
hrulefill
raisebox5ptmakebox[0pt]#1%
raisebox-12ptmakebox[0pt]#2%
hrulefill
par
bigskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
add a comment |Â
up vote
6
down vote
documentclassarticle
newcommandtextwithline[2]%
setlengthparfillskip0pt%
hrulefill
raisebox5ptmakebox[0pt]#1%
raisebox-12ptmakebox[0pt]#2%
hrulefill
par
bigskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
add a comment |Â
up vote
6
down vote
up vote
6
down vote
documentclassarticle
newcommandtextwithline[2]%
setlengthparfillskip0pt%
hrulefill
raisebox5ptmakebox[0pt]#1%
raisebox-12ptmakebox[0pt]#2%
hrulefill
par
bigskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
documentclassarticle
newcommandtextwithline[2]%
setlengthparfillskip0pt%
hrulefill
raisebox5ptmakebox[0pt]#1%
raisebox-12ptmakebox[0pt]#2%
hrulefill
par
bigskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
answered Aug 8 at 20:04
David Carlisle
462k3810851803
462k3810851803
add a comment |Â
add a comment |Â
up vote
3
down vote
Here is an option using linegoal
to calculate the remaining width of the line (given by linegoal
).
documentclassarticle
usepackagelinegoal
newcommandtextwithline[2]%
beginminipage[t]linegoal
centeringstrut #1 \[-.7baselineskip]
hrulefill \[-.1baselineskip]
centeringsmallfootnotesize #2
endminipagepar
addvspace.5baselineskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
Since linegoal
uses a label-ref-like system (thanks to zref
), any changes in width would require you to compile at least twice before the width settles.
add a comment |Â
up vote
3
down vote
Here is an option using linegoal
to calculate the remaining width of the line (given by linegoal
).
documentclassarticle
usepackagelinegoal
newcommandtextwithline[2]%
beginminipage[t]linegoal
centeringstrut #1 \[-.7baselineskip]
hrulefill \[-.1baselineskip]
centeringsmallfootnotesize #2
endminipagepar
addvspace.5baselineskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
Since linegoal
uses a label-ref-like system (thanks to zref
), any changes in width would require you to compile at least twice before the width settles.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Here is an option using linegoal
to calculate the remaining width of the line (given by linegoal
).
documentclassarticle
usepackagelinegoal
newcommandtextwithline[2]%
beginminipage[t]linegoal
centeringstrut #1 \[-.7baselineskip]
hrulefill \[-.1baselineskip]
centeringsmallfootnotesize #2
endminipagepar
addvspace.5baselineskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
Since linegoal
uses a label-ref-like system (thanks to zref
), any changes in width would require you to compile at least twice before the width settles.
Here is an option using linegoal
to calculate the remaining width of the line (given by linegoal
).
documentclassarticle
usepackagelinegoal
newcommandtextwithline[2]%
beginminipage[t]linegoal
centeringstrut #1 \[-.7baselineskip]
hrulefill \[-.1baselineskip]
centeringsmallfootnotesize #2
endminipagepar
addvspace.5baselineskip
begindocument
Author: textwithlineJoe ShmoeFirst name, Last name
This author's editor: textwithlineBilly WillyFirst name, Last name
enddocument
Since linegoal
uses a label-ref-like system (thanks to zref
), any changes in width would require you to compile at least twice before the width settles.
answered Aug 8 at 19:56
Werner
418k579081572
418k579081572
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445211%2fhow-to-stretch-table-or-minipage-to-fill-remaining-space%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Related: How to calculate width of remaining part of line
â Werner
Aug 8 at 19:58