Hello, I'm trying to put a word like this:
------------
this is text
------------
but with the "------" being a full line.
(so basicly putting it in a box without right and left side.)
What command can I use for this?
Text Formatting ⇒ putting a word between lines
NEW: TikZ book now 40% off at Amazon.com for a short time.

putting a word between lines
Hi,
you could use something like this:
you could use something like this:
Code: Select all
\documentclass{article}
\begin{document}
\noindent\hrulefill\par
\centering Some text\\[-.5\baselineskip]
\hrulefill\par
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: putting a word between lines
Thats seems to work, but it's not rly doing what I'm looking for.
If i use your way, it fills the whole line with a line. and i only mean it to draw a line as big as the text.
Any more ideas?
If i use your way, it fills the whole line with a line. and i only mean it to draw a line as big as the text.
Any more ideas?
putting a word between lines
Code: Select all
\documentclass{article}
\newlength\mylen
\settowidth\mylen{Some text}
\newcommand*\myrule{\rule{\mylen}{0.4pt}}
\begin{document}
\noindent\myrule\\
Some text\\[-.5\baselineskip]
\myrule
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
putting a word between lines
Code: Select all
\documentclass{article}
\begin{document}
\begin{tabular}{@{}c@{}}\hline
Words between lines \\ \hline
\end{tabular}
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10