Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rules]

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

4
votes
4answers
171 views

How can I make a vertical rule that extends to the edges of an fbox?

Consider the following MWE: \documentclass{minimal} \begin{document} \fbox{some text \vrule{} more text} \fbox{some text \vrule{} more deep text} \fbox{some text \vrule{} more $\int$ tall text} \end{...
1
vote
1answer
37 views

How to stop `hrule` from breaking centering of text inside `center` environment?

For some reason, placing \hrule above center environment makes text in that environment to appear left-aligned. Why? \documentclass[margin=5mm,varwidth=100mm]{standalone} \begin{document} \begin{...
2
votes
1answer
38 views

Cover in latex problem to setting a vertical rule

I am using the example posted by overleaf to create my cover. When I add more items I have the following problems: (1) two pages instead of one cover page and (2) the vertical rule is misaligned. \...
3
votes
1answer
28 views

Lines (rules) and \multicolumn in tabular content built with token lists

Building on the MWE in my first ever question here (Extra space in cells when using token lists to build tabular content), I would like to add multicolumn content and \toprule (\midrule, \bottomrule, ...
1
vote
2answers
32 views

Best alternative to toprule outside table environment

Here is a repro for my problem: \documentclass[10pt]{article} \usepackage[ a4paper, top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm ]{geometry} \usepackage{booktabs} \begin{...
0
votes
1answer
26 views

Drawing horizontal line through center of page

Is it possible to draw a horizontal line through the center of the page (such as with \hrule) regardless of the content of a page.
2
votes
1answer
79 views

Is this way of adding a horizontal line after the frame title stupid?

I use the default beamer theme, where the \defbeamertemplate*{frametitle} has: \strut\insertframetitle\strut\par% so I ignore the \par using \ignorepar command in the following code: \documentclass{...
3
votes
2answers
68 views

custom \midrule length

I just want a simple \midrule that doesn't span the entire page or cell. For instance, with \rule, you can specify dimensions like: \rule[0.2cm]{100pt}{0.5pt} That's as close as I can get it, but ...
0
votes
2answers
23 views

How to get horizontal rules around title and left-aligned author details?

I want to format the title and author section of my report like the authors have done in the image below. I have tried putting two horizontal rules above and below the title, but, if I do this, the ...
2
votes
1answer
99 views

Place, date, signature in one line

I want to put the place on the left side, the date on the center and the signature on the right side. And above them, a line should come. I am trying this on Sharelatex. I couldn't control the ...
1
vote
1answer
41 views

How do I adjust vertical spacing above \rule line to match that below the line?

I want to know how to adjust vertical spacing above \rule line to match that below the line. I have attempted to solve this problem using the solutions presented for similar questions hrulefill ...
1
vote
1answer
36 views

How to set a line between begin and end?

\documentclass{article} \usepackage[utf8]{inputenc} \usepackage{latexsym} \usepackage[linesnumbered,ruled,vlined]{algorithm2e} \SetCommentSty{mycommfont} \usepackage[linkbordercolor={0 0 1}]{...
4
votes
1answer
67 views

Change the color of the header line

The answer to the question fancyhdr - Change horizontal line color on top of footer is not completely satisfactory, because it changes the position of the header line, for example with this example. \...
3
votes
1answer
196 views

Drawing close together horizontal lines in Latex

How can I draw lines like in the picture in Latex? I tried using two consecutive \rule but they are not as close together as I would like them to be. This is how I tried: \noindent\rule{15cm}{0.7pt} \...
5
votes
2answers
163 views

hrule into tikz circle node

I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try: \documentclass{standalone} \...
0
votes
0answers
24 views

How to change the color of the header and footer horizontal lines? [duplicate]

I want to change the color of the lines (i think they are called "rules" in latex) after the heading and before the footer in every page of my report. I used these commands to add them but i couldn't ...
0
votes
1answer
32 views

Modify Floatfoot of Floatrow Package and move Rule

From the floatrow package, I am using the floatfoot command to reference sources and similar content. This MWE produces an output that is quite acceptable: \documentclass{article} \usepackage{...
2
votes
1answer
102 views

How to increase width of \titlerule in \titleformat?

I want to change the width of the \titlerule under every section, the following is my code, I am using \titling and \titlesec packages in order to achieve that. The documentation said I can do {\...
3
votes
1answer
44 views

Horizontal Rules Before and After Multicols

I am trying to make a document that partially mimics the output of macOS's Calendar.app "List" print format, which looks like this: The part I am interested in here is connecting the column ...
3
votes
1answer
36 views

How to add a continuous line at the end of every caption?

I am new to lyx. I would like to know what should i write in the LaTeX preamble of the document to add a continuous line at the end of each caption and another line to separate the foot from the text (...
1
vote
1answer
41 views

Vertical lines connecting in latex tables - agujournal2018 cls

I am using the agujournal2018 cls files (available here). To make it easier while I am drafting, I want lines in tables. How can I make the vertical lines and horizontal lines connect in tables? I ...
3
votes
1answer
27 views

How to automatically leave lines for translation

I would like to enter a paragraph within a command and, each time it would go onto a new line, leave space and horizontal lines for translation. I can't for the life of me figure out how to do this ...
6
votes
2answers
236 views

Unwanted line break after beginning of solution environment in exam class

Question update: Ulrich's answer (and its iterations) largely achieves the desired behavior: An answer environment (ans is the answer environment in the new MWE provided below) where the end is ...
0
votes
1answer
80 views

Make a ribbon box with text in it

I'm pretty novice in LaTeX and use overleaf to write. Is there any way that I could do this kind of box with a arbitrary text in it that is not linked to any title or chapter - just a black box with ...
2
votes
1answer
27 views

TOC: Avoid rule to be showed in TOC

How can I avoid showing the rule in the TOC: \documentclass{article} \usepackage{fancyhdr,graphicx,blindtext} \usepackage{geometry} \usepackage{showframe,fontawesome} \usepackage{titlesec} \geometry{...
2
votes
3answers
53 views

How to draw rule from left text edge to right paper edge without overfull?

I'm currently using the following instruction to draw a horizontal rule from the left edge of the text body to the right edge of the paper: \rule{\paperwidth}{2pt} This works, but it results in an ...
1
vote
1answer
67 views

Multiple lines of text with \rule?

I'm editing a tex file which generates a calendar. It works great, and I want to add text to a day on the calendar. The calendar looks like this currently: Each cell of the calendar is generated ...
0
votes
1answer
488 views

Draw Horizontal line between rows in latex table

i want to draw horizontal lines between rows in the table. I have tried like this so far, \begin{tabular}{|c|c|} \hline attribute& Art. 16.1.b\&c Aggregated generation per type\\ ...
2
votes
2answers
178 views

insert text in rule

I have difficulty writing a compact command that allows me to insert a text between two lines. I read some links such as this and this, but each one treats the left and right line separately \...
1
vote
1answer
76 views

glossary in long-booktabs style has no bottomrule in minipage

I want to put a longbooktabs glossary in a minipage environment, but when I do that it curiously loses the bottomrule. Is there anything I can do about that? As Nicola Talbot commented it suffices to ...
1
vote
0answers
65 views

Mimicking Latex Style

I recently stumbled across the mathematics textbook Numerical Analysis 9th edition by Burden and Faires and I thoroughly enjoyed the style of it. I was able to find a link too here: https://fac.ksu....
2
votes
1answer
49 views

Incomplete side rule in beamer

This only happens with warsaw theme: \documentclass{beamer} \usetheme{warsaw} \author{diabonas} \title{Frame border} \setbeamertemplate{background canvas}{% {\color{black}\rule{3pt}{\paperheight}\...
2
votes
2answers
122 views

ConTeXt: Place rules above and below floating figure

I'm experimenting to place a rule above and below a floating figure to achieve the following design. But to no avail. I've tried to place a \blackrule before and after the \placefigure. But that's ...
-2
votes
1answer
203 views

Bottom and and top rule when box break using tcolorbox package

Here I want box breaking with continued text and top and bottom rule when its breaking to next pages. Could you please help in this case. Here I attached the required output image. \documentclass{...
1
vote
2answers
108 views

hrulefill vertical spacing

I want to reduce the vertical spacing that comes before and after \hrulefill. I have already tried different options with \hrule, which works fine except for the fact that the line doesn't end where ...
1
vote
2answers
90 views

indenting or centering \hrule

I am trying to print two horizontal lines to look like a divider in an older book. Using \hrule with slightly different widths and lengths makes the lines look hand laid. But trying to use \moveleft ...
1
vote
1answer
43 views

Span vertical line through page with minipage

I have this code: \documentclass[11pt, showframe]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[margin=2.5cm]{geometry} \usepackage{setspace} \usepackage{tabularx} \...
1
vote
1answer
64 views

Put horizontal lines above and below tabbing and prohibit page breaks between the lines and the tabbing contents

I wish to put a horizontal line above tabbing and another one below it in such a way that there are no page breaks between the tabbing contents and the two lines. Here is what I tried so far: \...
1
vote
1answer
42 views

Tabularx: Reason why customized \hrule exceeds \textwidth?

Any ideas on why my self configured \hrule exceeds the specified \textwidth of my page layout? Minimum Working Example (MWE): \documentclass{article} \usepackage{xcolor,colortbl} \usepackage{...
0
votes
1answer
187 views

Align a \hrule with the right side of the page

\documentclass[12pt,a4paper]{report} \usepackage{titletoc} \begin{document} \hrule width 2cm height 3.5pt\relax \end{document} Given a test document such as the above, how does one align the \...
1
vote
2answers
78 views

How to center a line under a figure

I want to put a line to distinguish the graphics from the text in my document. I found a way to add the line but I want it to be at the same length as the caption and not \linewidth. Although, when I ...
4
votes
1answer
126 views

Adding toprule and bottomrule to the glossary

I figured out how to add the toprule to this glossary, but I failed to do the same for the bottomrule. So, for this MWE, I have two questions: How can I add a bottomrule at the end of the glossary? ...
4
votes
2answers
546 views

Vertical lines in table

I have the next code, but I want that the vertical line be complete (it's cut off near to horizontal line): \begin{table} [H] \footnotesize \sisetup{output-decimal-marker = {,}} \centering \caption{...
0
votes
1answer
51 views

How can I remove the gap that's appearing between a graphic and a rule?

I am trying to put together a title page with a graphic taking up the upper portion, and a block of colour immediately below it. The code in question currently looks as follows: \newgeometry{margin=...
0
votes
1answer
87 views

\hrule length inconsistent

I'm using the tufte-book document class. When I use \hrule, sometimes it extends the text width (which I want), and other times it extends the full page width, apparently randomly. How can I get it ...
1
vote
1answer
91 views

Insert small line above an item in a list without adding extra space (Continued)

This is a follow up to Insert small line above an item in a list without adding extra space. I would like to control the length of the horizontal line to be the same widths as the widest \item in the ...
0
votes
1answer
35 views

Align left margin note with displaystyle math

For one of the packages I'm making, I want to denote part problems in the left margin. I don't want to use e.g. \reversemarginpar since this is up to the user to define. Exercises are always going to ...
0
votes
1answer
72 views

left rule affected if change courier font to other font

My code are follows: \documentclass{book} \usepackage{fontspec} \defaultfontfeatures{Ligatures=TeX} \usepackage{unicode-math}% \setmonofont[Path = ./Fonts/ , UprightFont= Iosevka ,]{Iosevka} \...
3
votes
1answer
152 views

Redefine \equation for grid typesetting

Please look at the following MWE: \documentclass[17pt, twocolumn, landscape]{extbook}% \baselineskip=22pt \newdimen\mathheight \newdimen\mathdepth % Redefine \equation for grid typesetting \...
3
votes
1answer
88 views

Ugly overlines on arXiv (and elsewhere)

I have observed that various horizontal and vertical lines look ugly on arXiv (and elsewhere). This includes \overline, \hrule, fraction line, end-of-proof square, lines drawn by xy-pic but not those ...