3

I want to connect

===================================

in order to form a solid line. How can I do it?

There is a word before the equal signs, like

word ==============================

Hence having the same position of the equal signs (but just as solid line) would be nice.

3
  • 1
    Do they need to be equal signs? Or do you just want horizontal lines across the width of the page?
    – bonk
    Commented Jan 4 at 20:24
  • I kind of need the placement of the equal signs. (look at my comment on the answer)
    – Leon
    Commented Jan 4 at 21:29
  • 1
    Your question might be easier to understand if you would ask for something like "How to fill the rest of the line with a double rule" Commented Jan 5 at 9:54

2 Answers 2

8

You might need to adjust the negative space, depending on the font

\documentclass{article}

\begin{document}
% 

 word \leaders\hbox{\kern-.1em=\kern-.1em}\hfill\mbox{}

% 
\end{document}

enter image description here

5

Following the comment, horizontal lines across the page can be drawn with \rule{length}{height}. The line created by \rule is set in an (invisible) box that has the height of a regular line of text, so if you want two of them close together vertically you should add some negative space to move the second line up.

Make sure you start the code for the lines after an empty line in the source document, otherwise the lines will start directly after the previous text. However, now the first horizontal line is the start of the paragraph, and will be indented, which you can prevent with \noindent. If you want to continue the next line of text without indent then you can write the following text directly after, if you do want an indent then you also need a blank line after.

Example, using the \textwidth command to create a line that has the same length as the text, and a line height of 1pt:

\documentclass{article}
\begin{document}
first paragraph indented

\noindent\rule{\textwidth}{1pt}\vspace{-8pt}
\rule{\textwidth}{1pt}
no indent directly after

\noindent\rule{\textwidth}{1pt}\vspace{-8pt}
\rule{\textwidth}{1pt}

new paragraph, also indented
\end{document}

enter image description here


If you want the double lines to follow a word then David's solution is easier, because the two lines in my solution are on two separate lines of the text so only the upper line would actually follow the word and the lower line would be on the next line of text.

However, with a bit of extra trouble you can set it in a tabular with a paragraph column in the middle and reduced horizontal padding. You also need to raise up the first line a few pts as a \rule is normally on the baseline.

\documentclass{article}
\begin{document}
\bgroup
\setlength{\tabcolsep}{1pt}
\begin{tabular}{lp{8cm}l}
word & \vspace{-4pt}\rule{8cm}{1pt}\vspace{-9pt} \rule{8cm}{1pt} & other word\\
\end{tabular}
\egroup
\end{document}

enter image description here


2
  • Thanks for your reply. Unfortunately it's not that easy in my case, since I have got a word before the equality symbol. I should have mentioned that. It's like Word == Hence I need something else.
    – Leon
    Commented Jan 4 at 21:27
  • Thanks for the extra effort and editing your answer to my needs! :)
    – Leon
    Commented Jan 5 at 10:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .