Text Formatting ⇒ putting a word between lines
putting a word between lines
------------
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?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
putting a word between lines
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}
Re: putting a word between lines
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}
- 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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10