How to quote what's left of the remaining horizontal space?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I'm trying to come up with my own command to fill what's left of the horizontal space with dots but I want the dots slightly lowered relative to the text. Here's my code :



newcommandansfillraisebox-.2baselineskipmakebox[linewidth]dotfill


This works fine when there's nothing on my line



ansline


but goes into hbox overfull error when I add anything as the box from makebox is always linewidth.



e.g.



Example Text ansfill


gives me an overfull hbox error.



I need a parameter that changes depending on what's left of the horizontal space. Something like :



newcommandansfillraisebox-.2baselineskipmakebox[whatever-that-is-left]dotfill


Thanks.







share|improve this question




















  • Why don't you simply remove that box? dotfill will fill the remaining line for you.
    – TeXnician
    Aug 27 at 11:13










  • I'm trying to get it to be lower relative to the text.
    – Chung Ren Khoo
    Aug 27 at 11:14















up vote
2
down vote

favorite












I'm trying to come up with my own command to fill what's left of the horizontal space with dots but I want the dots slightly lowered relative to the text. Here's my code :



newcommandansfillraisebox-.2baselineskipmakebox[linewidth]dotfill


This works fine when there's nothing on my line



ansline


but goes into hbox overfull error when I add anything as the box from makebox is always linewidth.



e.g.



Example Text ansfill


gives me an overfull hbox error.



I need a parameter that changes depending on what's left of the horizontal space. Something like :



newcommandansfillraisebox-.2baselineskipmakebox[whatever-that-is-left]dotfill


Thanks.







share|improve this question




















  • Why don't you simply remove that box? dotfill will fill the remaining line for you.
    – TeXnician
    Aug 27 at 11:13










  • I'm trying to get it to be lower relative to the text.
    – Chung Ren Khoo
    Aug 27 at 11:14













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm trying to come up with my own command to fill what's left of the horizontal space with dots but I want the dots slightly lowered relative to the text. Here's my code :



newcommandansfillraisebox-.2baselineskipmakebox[linewidth]dotfill


This works fine when there's nothing on my line



ansline


but goes into hbox overfull error when I add anything as the box from makebox is always linewidth.



e.g.



Example Text ansfill


gives me an overfull hbox error.



I need a parameter that changes depending on what's left of the horizontal space. Something like :



newcommandansfillraisebox-.2baselineskipmakebox[whatever-that-is-left]dotfill


Thanks.







share|improve this question












I'm trying to come up with my own command to fill what's left of the horizontal space with dots but I want the dots slightly lowered relative to the text. Here's my code :



newcommandansfillraisebox-.2baselineskipmakebox[linewidth]dotfill


This works fine when there's nothing on my line



ansline


but goes into hbox overfull error when I add anything as the box from makebox is always linewidth.



e.g.



Example Text ansfill


gives me an overfull hbox error.



I need a parameter that changes depending on what's left of the horizontal space. Something like :



newcommandansfillraisebox-.2baselineskipmakebox[whatever-that-is-left]dotfill


Thanks.









share|improve this question











share|improve this question




share|improve this question










asked Aug 27 at 11:08









Chung Ren Khoo

1077




1077











  • Why don't you simply remove that box? dotfill will fill the remaining line for you.
    – TeXnician
    Aug 27 at 11:13










  • I'm trying to get it to be lower relative to the text.
    – Chung Ren Khoo
    Aug 27 at 11:14

















  • Why don't you simply remove that box? dotfill will fill the remaining line for you.
    – TeXnician
    Aug 27 at 11:13










  • I'm trying to get it to be lower relative to the text.
    – Chung Ren Khoo
    Aug 27 at 11:14
















Why don't you simply remove that box? dotfill will fill the remaining line for you.
– TeXnician
Aug 27 at 11:13




Why don't you simply remove that box? dotfill will fill the remaining line for you.
– TeXnician
Aug 27 at 11:13












I'm trying to get it to be lower relative to the text.
– Chung Ren Khoo
Aug 27 at 11:14





I'm trying to get it to be lower relative to the text.
– Chung Ren Khoo
Aug 27 at 11:14











2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










You can emulate the definition of dotfill. I also add an optional argument to set a minimum width for the dots. The last example shows what would happen without the [8em].



documentclassarticle

newcommandansfill[1][0pt]%
leavevmode
leaders
hbox to 0.44emhssraisebox-2pt.hss%
hskip #1 plus 1fill
kern0pt


begindocument

Here's a question. ansfill

Here's another longer question for which we need at least eight ems
of space for the answer. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill % <--- Uh, oh!

enddocument


enter image description here






share|improve this answer




















  • This works exactly as expected for me. Thanks.
    – Chung Ren Khoo
    Aug 27 at 11:36

















up vote
3
down vote













The dimension linegoal defined by the package of the same name is probably the right thing here:



documentclass[12pt]article
usepackagelinegoal

newcommandansfillraisebox-.2baselineskipmakebox[linegoal]dotfill

begindocument

This is something ansfill

enddocument





share|improve this answer




















  • I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
    – Chung Ren Khoo
    Aug 27 at 11:20










  • No such message at my end (pdflatex, TeXLive-2018).
    – AlexG
    Aug 27 at 11:22










  • Hmm odd. Must be conflicting with some of my packages then.
    – Chung Ren Khoo
    Aug 27 at 11:25










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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f447956%2fhow-to-quote-whats-left-of-the-remaining-horizontal-space%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










You can emulate the definition of dotfill. I also add an optional argument to set a minimum width for the dots. The last example shows what would happen without the [8em].



documentclassarticle

newcommandansfill[1][0pt]%
leavevmode
leaders
hbox to 0.44emhssraisebox-2pt.hss%
hskip #1 plus 1fill
kern0pt


begindocument

Here's a question. ansfill

Here's another longer question for which we need at least eight ems
of space for the answer. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill % <--- Uh, oh!

enddocument


enter image description here






share|improve this answer




















  • This works exactly as expected for me. Thanks.
    – Chung Ren Khoo
    Aug 27 at 11:36














up vote
5
down vote



accepted










You can emulate the definition of dotfill. I also add an optional argument to set a minimum width for the dots. The last example shows what would happen without the [8em].



documentclassarticle

newcommandansfill[1][0pt]%
leavevmode
leaders
hbox to 0.44emhssraisebox-2pt.hss%
hskip #1 plus 1fill
kern0pt


begindocument

Here's a question. ansfill

Here's another longer question for which we need at least eight ems
of space for the answer. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill % <--- Uh, oh!

enddocument


enter image description here






share|improve this answer




















  • This works exactly as expected for me. Thanks.
    – Chung Ren Khoo
    Aug 27 at 11:36












up vote
5
down vote



accepted







up vote
5
down vote



accepted






You can emulate the definition of dotfill. I also add an optional argument to set a minimum width for the dots. The last example shows what would happen without the [8em].



documentclassarticle

newcommandansfill[1][0pt]%
leavevmode
leaders
hbox to 0.44emhssraisebox-2pt.hss%
hskip #1 plus 1fill
kern0pt


begindocument

Here's a question. ansfill

Here's another longer question for which we need at least eight ems
of space for the answer. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill % <--- Uh, oh!

enddocument


enter image description here






share|improve this answer












You can emulate the definition of dotfill. I also add an optional argument to set a minimum width for the dots. The last example shows what would happen without the [8em].



documentclassarticle

newcommandansfill[1][0pt]%
leavevmode
leaders
hbox to 0.44emhssraisebox-2pt.hss%
hskip #1 plus 1fill
kern0pt


begindocument

Here's a question. ansfill

Here's another longer question for which we need at least eight ems
of space for the answer. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill[8em]

Here's another longer question for which we need at least eight ems
of space for the answer, even though the line would be almost filled up
with text. ansfill % <--- Uh, oh!

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 27 at 11:26









egreg

680k8318083056




680k8318083056











  • This works exactly as expected for me. Thanks.
    – Chung Ren Khoo
    Aug 27 at 11:36
















  • This works exactly as expected for me. Thanks.
    – Chung Ren Khoo
    Aug 27 at 11:36















This works exactly as expected for me. Thanks.
– Chung Ren Khoo
Aug 27 at 11:36




This works exactly as expected for me. Thanks.
– Chung Ren Khoo
Aug 27 at 11:36










up vote
3
down vote













The dimension linegoal defined by the package of the same name is probably the right thing here:



documentclass[12pt]article
usepackagelinegoal

newcommandansfillraisebox-.2baselineskipmakebox[linegoal]dotfill

begindocument

This is something ansfill

enddocument





share|improve this answer




















  • I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
    – Chung Ren Khoo
    Aug 27 at 11:20










  • No such message at my end (pdflatex, TeXLive-2018).
    – AlexG
    Aug 27 at 11:22










  • Hmm odd. Must be conflicting with some of my packages then.
    – Chung Ren Khoo
    Aug 27 at 11:25














up vote
3
down vote













The dimension linegoal defined by the package of the same name is probably the right thing here:



documentclass[12pt]article
usepackagelinegoal

newcommandansfillraisebox-.2baselineskipmakebox[linegoal]dotfill

begindocument

This is something ansfill

enddocument





share|improve this answer




















  • I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
    – Chung Ren Khoo
    Aug 27 at 11:20










  • No such message at my end (pdflatex, TeXLive-2018).
    – AlexG
    Aug 27 at 11:22










  • Hmm odd. Must be conflicting with some of my packages then.
    – Chung Ren Khoo
    Aug 27 at 11:25












up vote
3
down vote










up vote
3
down vote









The dimension linegoal defined by the package of the same name is probably the right thing here:



documentclass[12pt]article
usepackagelinegoal

newcommandansfillraisebox-.2baselineskipmakebox[linegoal]dotfill

begindocument

This is something ansfill

enddocument





share|improve this answer












The dimension linegoal defined by the package of the same name is probably the right thing here:



documentclass[12pt]article
usepackagelinegoal

newcommandansfillraisebox-.2baselineskipmakebox[linegoal]dotfill

begindocument

This is something ansfill

enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 27 at 11:16









AlexG

30.9k475137




30.9k475137











  • I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
    – Chung Ren Khoo
    Aug 27 at 11:20










  • No such message at my end (pdflatex, TeXLive-2018).
    – AlexG
    Aug 27 at 11:22










  • Hmm odd. Must be conflicting with some of my packages then.
    – Chung Ren Khoo
    Aug 27 at 11:25
















  • I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
    – Chung Ren Khoo
    Aug 27 at 11:20










  • No such message at my end (pdflatex, TeXLive-2018).
    – AlexG
    Aug 27 at 11:22










  • Hmm odd. Must be conflicting with some of my packages then.
    – Chung Ren Khoo
    Aug 27 at 11:25















I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
– Chung Ren Khoo
Aug 27 at 11:20




I'm getting an error saying "Extended allocation already in use" and the line appears to be slightly shorter than expected.
– Chung Ren Khoo
Aug 27 at 11:20












No such message at my end (pdflatex, TeXLive-2018).
– AlexG
Aug 27 at 11:22




No such message at my end (pdflatex, TeXLive-2018).
– AlexG
Aug 27 at 11:22












Hmm odd. Must be conflicting with some of my packages then.
– Chung Ren Khoo
Aug 27 at 11:25




Hmm odd. Must be conflicting with some of my packages then.
– Chung Ren Khoo
Aug 27 at 11:25

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447956%2fhow-to-quote-whats-left-of-the-remaining-horizontal-space%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery