How can I draw this horizontal line like this picture in Latex? Thanks for your help.
[Tex/LaTex] Draw a horizontal line in latex
rules
Related Question
- [Tex/LaTex] Horizontal line spanning the entire document in LaTeX
- [Tex/LaTex] How to draw horizontal line with rubber length
- [Tex/LaTex] How to draw a horizontal line at the end of proofs
- [Tex/LaTex] Draw Horizontal line between rows in latex table
- Draw a horizontal line between row after utilizing makecell
Best Answer
I see two choices, one using
\rule
(as suggested by @John Kormylo) and one using\hrule
. I'll describe them both and give an example at the endThe
\rule
command constructs a box, which is treated like a character and has the following syntax\rule[h]{w}{t}
whereh
w
andt
are lengths and represent respectively:the height above the baseline to which raise the box (defaults at 0)
the width of the box
the thickness of the rule
In your case
should do the trick.
The
\hrule
command is a TeX primitive and is a bit more complicated to use because it suppresses the interline spacing. Its full syntax is as follows:where
h
,d
andw
should be substituted with the appropriate lengths (height is the thickness of the rule). Any order ofheight
depth
andwidth
are supported, and any or all of them can be left out, which will make TeX use the following defaults:height
will be0.4 pt
depth
will be0pt
width
will make the rule extend to the boundary of the outer box.Usually
hrule
is to be used between paragraphs, otherwise it will start or stop a paragraph. The\relax
is not always needed, but it prevents the misinterpretation of following words and numbers when there is ambiguityNote sometimes it's useful to use
\vspace
before or after the\hrule
to space it from the previous and next paragraphs. In this case I don't know the specifics of the problem to determine the proper spacing of the rule suitable for you.Example (the
\vspace
s are random)