{rules} is about drawing lines (also called rules). Popular packages are {booktabs} (which provides high quality table rules) and {dashrule}.

learn more… | top users | synonyms

97
votes
14answers
31k views

Totally sweet horizontal rules in LaTeX

I have been trying to find a way to easily drop a nice horizontal rule into a LaTeX document. \hline just makes a line across the page. It would seem that some package must provide something that is ...
46
votes
7answers
20k views

Long underscore in LaTeX

In LaTeX, how would I make a long underscore? For example, Name _______ Signature _______
32
votes
3answers
70k views

Horizontal line spanning the entire document in LaTeX

I have used the \hrulefill command to create a horizontal rule, along with some other commands. In each case I have the rules extended up to the margin. I want the rule width to be controllable, i.e. ...
31
votes
2answers
16k views

How can I reproduce this table with thick lines?

I'm trying to reproduce this table: (apologies for the terrible cameraphone pic) I don't know how to get the slightly thicker leftmost and topmost line. Here's a minimal example of what I have so ...
30
votes
3answers
10k views

Why not use vertical lines ('|') in a tabular?

My question is a follow-up to the answer to a follow-up question, to be found here. ;) I'd like to know why one would advise against using vertical lines (via |) in a tabular (i.e. in ...
30
votes
5answers
53k views

LaTeX tables: How do I make bold horizontal lines (typically \hline)?

The title says it all: In LaTeX tables: How do I make bold horizontal lines (typically \hline)?
30
votes
1answer
19k views

How to remove the top horizontal bar in fancyhdr?

When using fancyhdr, how do you remove the top horizontal rule? I do not want a header at all, just a footer. This is what I do now: \documentclass{article} \usepackage{fancyhdr} \pagestyle{fancy} ...
28
votes
3answers
30k views

How can I draw a horizontal line spanning only some of the table cells?

In a table, how can I draw a horizontal line that goes only through some of the cells? I mean a line like the one in the Foo and in the Bar area of this table: +----+-----+ |Foo |1 |2 | | |1 |2 | ...
26
votes
3answers
17k views

What is the \rule equivalent for \hrule?

I've tried to put a rule long as the text in this way: \rule{\textwidth}{0.4mm} but I obtain a rule slightly smaller that the text width. How to obtain the same effect as \hrule?
25
votes
3answers
9k views

Is it normal for BibTeX to replace similar author names with “------”?

In my .bib file, I have two entries with exactly the same author names: @article{Seshadrinathan2010A-Subjective-St, Author = {K. Seshadrinathan and R. Soundararajan and A. C. Bovik and L. K. ...
25
votes
3answers
2k views

Best way to insert a horizontal cut line with a scissor symbol

What's the best way to insert a horizonal dashed line with a scissor symbol to indicate that the paper should be cut with a scissor along this line? If you have multiple layout alternatives without ...
25
votes
1answer
347 views

Using elastic lengths — when do they work?

I was wondering why elastic lengths like \fill seem to work only under certain conditions. For instance if I write A \hspace{\fill} B I get A left aligned, B right aligned as wanted. If however ...
24
votes
2answers
884 views

Two rules directly under each other

I'm trying to make two rules of different length (fatness) directly under each other, something like: -------------------- ==================== Where = is a fatter line than -. The vertical space ...
23
votes
2answers
673 views

Add a rule underneath “Figure 1”

I want to add a line beneath the figure caption such as Figure 1 Figure caption text here.... I managed to include a newline, change the color and look of the caption via caption package: ...
22
votes
1answer
19k views

Can a table include a horizontal dashed line?

In a normal table, you can use the \hline command to draw a horizontal line. I am trying to make this line a dashed horizontal line. I have found the package dashrule via this answer, but this only ...
22
votes
3answers
805 views

What is the best way to draw two lines in LaTeX?

Bill Bryson's book, The lost continent: travels in small-town America  has an unusual first paragraph opening style. It has the equivalent of a long equal sign, followed by the first three words ...
21
votes
3answers
1k views

Can LaTeX be used to make a sheet of blank lines?

Specifically, a bunch of them; for a sign-in sheet, list of signatures for a petition or a worksheet with short answer essay style questions.
21
votes
3answers
15k views

How can I make a horizontal dashed line?

How can I make a horizontal dashed line in LaTeX? Just writing lots of single dashes results in a continuous horizontal line.
19
votes
2answers
14k views

How to change line color in tabular?

How can I change the color of the lines (the frame) in a tabular environment? In the following MWE: \begin{tabular}{c|c|c} a&b&c \\ \hline d&e&f \\ \hline g&h&i \end{tabular} ...
19
votes
3answers
1k views

How to make continuous (but breakable) vertical rule along left side of paragraph?

I'm looking for a way in Plain TeX to make a continuous vertical rule along the left side of a paragraph (or arbitrary block of text), such that it observes normal page-break rules. I started with the ...
19
votes
1answer
406 views

Strange disappearing colored rules in beamer

I have received a booktabs bug report of \cmidrules that disappear when coloured rules are used inside beamer (together with colortbl). The problem can be illustrated with the following simple code ...
17
votes
3answers
2k views

Can I have the \overfullrule rule colored in pdfLaTeX?

I know that I can use \overfullrule=5pt to get overfull lines marked with a black marker. I am using pdfLaTeX. Is there a way I can get this marker or something similar in magenta instead?
17
votes
4answers
4k views

Putting a bar in the margin

I sometimes want to give examples in a document I am writing. Because these examples are quite general it could be difficult for readers to see the difference between the examples and the theoretical ...
17
votes
1answer
2k views

How can I make a bold horizontal rule under each section title?

I want to place a long bold \hrule-type line under the \section to make it more distinctive. How can I do that?
17
votes
2answers
369 views

prevent “action” if top of page

I have a manual list of stuff that are sometimes separated by an hrule(or my own custom ruler) for visual purposes. Sometimes the hrule ends at the top or bottom of a page which makes it useless. Is ...
16
votes
3answers
2k views

How can I know the default PGF line width?

Is there some macro that will tell me what the default PGF line width is? I have tried creating my own macro by cloning \pgflinewidth before it has been modified, i.e. ...
15
votes
3answers
2k views

How can I put a line above a section heading and prevent a page break between?

We have designed a class for some journal. We wanted our section titles to be separated by a horizontal line from the previous line. Here is the code: \def\section{% \vskip 1.2\@bls% \hrule ...
15
votes
3answers
8k views

Dynamic signature/date line

I'm trying to create a signature and date line in a document. I need the date line to always be in the same spot on the page no matter what name is under the signature line, such as: ...
15
votes
1answer
7k views

What is the thickness of \hrulefill

This seems like a simple question ... I know from this question that \hrule and presumably \hrulefill have a thickness of 0.4pt. I think \hrule is a primitive, so does that mean that you cannot ...
14
votes
5answers
2k views

How can i add a “field” for handwritten text?

I need to add a bunch of fields for a handwritten text to my document that look like this: Your Name ___________ Your Age ___________ As an example, I can show you the form that I have to ...
14
votes
4answers
2k views

Draw a line through one column of a matrix

I'd like to "cancel" (draw a line through) a column of a matrix (using \begin{pmatrix}..\end{pmatrix}). How can I do this?
14
votes
2answers
580 views

Inserting a line to separate the text and the margin note

How can I insert a vertical line through a whole page to separate the text and the margin notes?
14
votes
1answer
804 views

How to draw a simple but beautiful decorative head-rule?

The picture shown below is the desired simple head-rule, but the rule width should be much thinner like 1pt. Real one: So how to use Tikz or other packages to draw this kind of line as a ...
14
votes
1answer
626 views

\cmidrule with booktabs in beamer does not show up

I am trying to use a coloured \cmidrule in a table in beamer - however, it does not show up. I have read Strange disappearing colored rules in beamer which indicates that this is a bug and discusses ...
13
votes
1answer
6k views

How to add a horizontal line above the footer with fancyhdr?

How to add a horizontal line above the footer using fancyhdr, just like the line present below the header?
13
votes
2answers
512 views

How to draw horizontal line with rubber length?

The \hrulefill command could draw rubber length underlines, like abc___def. I just want to draw line in the vertical centre of a text, like abc---def. Thanks.
13
votes
1answer
4k views

A Matrix with labels, dashed lines

I'm trying to TeX the following matrix, from Guillemin and Pollack (1.4 #13) The best I've been able to do is get the dashed lines with \[ \left( \begin{array}{c:c} B & C \\ \hdashline D ...
12
votes
1answer
3k views

Horizontal line below figure caption

I would like to draw a horizontal line/rule beneath my multi-line caption to separate the caption more clearly from the rest of the text. A quick example: \begin{figure}[tb] \begin{center} ...
12
votes
1answer
1k views

Use of \midrule in booktabs table

Are there any formal guidelines/suggestions on the use of \midrule inside a booktabs table with just rows of identically formatted data? The booktabs manual is very specific about vertical rules, ...
11
votes
4answers
449 views

How to construct a logic argument with colored hline with length under control?

How to construct a logic argument like this one? I can construct it like this: Latex of my argument: \documentclass[10pt]{article} \usepackage{newtxtext} \usepackage{newtxmath} ...
11
votes
3answers
7k views

Headrule length in fancyhdr

Using the fancyhdr package, is it possible to change(increase or decrease) the headrule length without changing the header length? In the picture related, one can see that the headrule rectangle(in ...
11
votes
2answers
631 views

Creating lists with items separated by a rule

How can I create a list in which a rule is automatically inserted between each pair of items?
11
votes
1answer
955 views

how to change the color of the rule (vertical line) in twocolumn document?

I'd like to make the rule between the 2 columns very thin. I found that no matter how small of width I made it, the line was not thin enough for my liking (unless I make it zero, then it will ...
11
votes
2answers
3k views

Highlight table cells using thick, colored border

I'd like to highlight certain cells of my table. In particular, I'd like to set the border of these sells colored and thick. These cells should also have a background color. Here's a minimal example ...
11
votes
1answer
107 views

Two rules between multicols

I'd like to add two rules between two columns of a multicols environment. For adding one I used \setlength{\columnseprule}{0.2pt} but how can I add two?
11
votes
1answer
210 views

Alignment rules

I find myself quite frequently in the need to check whether some elements on my page are aligned exactly as intended. As a result, I usually end up magnifying the output 400% and using a rule over my ...
11
votes
1answer
456 views

Two-column layout with thick vertical rule in ConTeXt

Background I would like to add a thick rule centered between two columns. Example Code A minimum working example that illustrates the issue: \setupcolors[state=start] ...
10
votes
4answers
2k views

Vertically centered horizontal rule filling the rest of a line?

I'd like to have a horizontal line extending from the end of the text on a line to the right margin. So far I've found \hrulefill and \leaders\hrule\hfill, but these draw a line that's flush with the ...
10
votes
3answers
426 views

Retrieve length of a character

I'm creating a custom command which basically prints an horizontal line, a character and another horizontal line. The code would be ...
10
votes
2answers
3k views

Footnote separator

How can I remove the separator line between the footnotes and the text?