An ascii example of the desired output:
------------------------- A Few Words of Text -------------------------
The dashed lines are, of course, supposed to be solid lines.
I tried this:
\begin{center}
\hrulefill A Few Words of Text{}\hrulefill
\end{center}
which almost does what I want, but the rules are positioned vertically
on the baseline, so the output looks like this:
_________________________ A Few Words of Text _________________________
I need the rule to size itself (like \hrulefill) since I will be
automatically generating the output (i.e., no absolute length, unless
these can be easily calculated).
There seems to be no way to move the \hrulefill output to the vertical
middle of the line. I tried playing with \raisebox and \rule with no
luck.
Any suggestions?
-- Mike
To reply via email, remove NOSPAM from above email address.
\begin{center}
\hrulefill \raisebox{-.5ex}{A Few Words of Text} \hrulefill
\end{center}
Greetz,
Wald
"mjs" <mj...@NOSPAM.ptd.net> wrote in message
news:ZuTo8.1296$bg.1...@nnrp1.ptd.net...
> \hrulefill A Few Words of Text{}\hrulefill
>
> which almost does what I want, but the rules are positioned vertically
> on the baseline,
Look at the definition of \hrulefill. Change \hrule to
\hrule height xxx depth -yyy
where xxx is, say, .3ex and yyy is 0.4pt less
Donald Arseneau as...@triumf.ca
-- Mike
To reply via email, remove NOSPAM from above email address.
Wald <arnout.s...@nospam.agr.kuleuven.ac.be> wrote:
: Why don't you just lower the text instead of raising the \hrulefill's ?
I have tetex 1.0.7 running on Linux.
-- Mike
To reply via email, remove NOSPAM from above email address.
Donald Arseneau <as...@triumf.ca> wrote:
> Exposing further ignorance (newbie alert) ... where is the definition?
> Do I need to recompile TeX itself or is this in a configuration file?
>
Standard latex-Definition are in latex.ltx, sometimes in one of the
class- files or in the .clo-files. \hrulefill is in latex.ltx.
Don't change latex.ltx!!! Copy the definition in your document,
surrounded by \makeatletter .. \makeatother and change it there.
Ulrike Fischer
\makeatletter
\def\hrulefill{\leavevmode\leaders\hrule height 4pt depth -3pt\hfill\kern\z@}
\makeatother
\hrulefill this is simply the middle{}\hrulefill
-- Mike
To reply via email, remove NOSPAM from above email address.
mjs <mj...@nospam.ptd.net> wrote:
: I would like to display an arbitrary line of text with a horizontal
> Thanks to everyone who responded. This is what I came up with:
>
> \makeatletter
> \def\hrulefill{\leavevmode\leaders\hrule height 4pt depth -3pt\hfill\kern\z@}
> \makeatother
>
> \hrulefill this is simply the middle{}\hrulefill
It is a very bad idea to redefine a command like that since you never
know where in the internals of TeX/LaTeX or other packages it might
also be used. It would be much saner to define a macro \crulefill
instead (for centered rule fill), or any other name that has not yet
been taken.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David....@t-online.de
I am new to TeX/LaTeX, so was happy to just get the results I wanted. My
first attempt at defining a new command failed (I had thought of that,
actually), but with Donald Arseneau's assistance (I'm taking no credit
for the following code), this gives the same results:
\makeatletter
\newcommand\centrulefill{\leavevmode
\begingroup % local length assignments!
\setlength{\dimen@}{0.5ex}% or whatever positioning
\addtolength{\dimen@}{0.4pt}% or whatever thickness
\leaders\hrule height\dimen@ depth -.5ex \hfill
\endgroup
\kern\z@}
\centrulefill this is simply the middle{}\centrulefill
-- Mike
To reply via email, remove NOSPAM from above email address.
David Kastrup <David....@t-online.de> wrote: