TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to write an underscore that extends along the full length of the page, to represent a break in sections?

As of now, I'm using the \blank{?cm} command explained in this answer, but with this solution I need to specify the length of the blank manually (so if I change my page size later, I'll have to go back and change all these parameters)...

share|improve this question
Are you planning to use this rule for every \section of your document? – Gonzalo Medina Dec 16 '11 at 17:55
No, just to use once in a while to indicate separation between a special section. – jamaicanworm Dec 16 '11 at 19:16
up vote 7 down vote accepted

Here is an alternative macro definition that does not take an argument:



Cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam. 

The \hrule inserts a horizontal rule that takes up all the available space. A \medskip before and after makes sure there is a little space above and below the rule. You could also use \smallskip or \bigskip for a smaller or bigger space.


Addendum: I like Peter Grill's addition of some ornament in his solution. Here is a \blankwith macro that takes an ornament like in \blankwith{$\clubsuit$}. This macro again relies more on TeX than LaTeX. It puts the ornament slightly lowered in the middle of the line with some space left and right. The line is drawn using \hrulefill.

    \hbox to \hsize{\hrulefill\kern.5em\lower.5ex\hbox{#1}\kern.5em\hrulefill}
share|improve this answer
Is there any reason this answer is so much simpler than @Werner's? I tried this one and it works, but might there by any complicated drawbacks? – jamaicanworm Dec 16 '11 at 19:37
@jamaicanworm: one possible issue is that you will have to manually remove the rule if a page break occurs just before it. – Gonzalo Medina Dec 16 '11 at 19:43
I was a little surprised that \noindent wasn't needed. Otherwise the solution is simple because it relies on the stretchability built into \hrule, a TeX primitive. – Christian Lindig Dec 16 '11 at 19:49
@jamaicanworm: Your original usage is still supported in my \blank{<len>} definition (now having the <len> optional). If this original definition was not required, then @ ChristianLindig's solution is the easiest. However, you didn't request an alternative to \blank, so I incorporated the original with the new. – Werner Dec 16 '11 at 20:08
Do you agree with @Gonzalo that it might help to include \leaders before \medskip\hrule\medskip? – jamaicanworm Dec 19 '11 at 16:08



instead, making the former mandatory argument optional. Now you can use


which typesets a \rule of width \textwidth. Otherwise, specify \blank[5cm]. If you're interested keeping the same format (using \blank{<len>} rather than \blank[<len>]), this is also possible by using xparse. Here is such a definition:

enter image description here

\usepackage{xparse}% http://ctan.org/pkg/xparse
Here is some text. \blank{5cm} \par
\blank \par
\blank{2cm} Here is some more text.
share|improve this answer
I would recommend to add the command \nonindent to the definition of \blank – Marco Daniel Dec 16 '11 at 17:57
@MarcoDaniel: Thanks, good suggestion. – Werner Dec 16 '11 at 19:13

I suggest using \leaders in the definition of the rule to guarantee that it won't appear if a page break occurs just before a new \section:


  \leaders\vrule width \textwidth\vskip0.4pt\smallskip}



share|improve this answer

You can use \linewidth to specify the width of the line so that if the \linewidth does change this won't need adjustment, as I have done for the first rule in the example below. This will also adapt to the column width if you use more than one column.

If you want to get fancier, there are many options as to what to use as a separator. To illustrate, I have used an ornament from this question and another from this question on how to insert a border:

enter image description here



% Ornament from http://tex.stackexchange.com/questions/11320/end-of-paragraph-with-ornament
\usepackage{pifont,fourier-orns}% These are needed only for the ornament 

\newcommand\crulefill[1][1ex]{\leavevmode\leaders\hrule depth \dimexpr-#1+0.4pt height #1\hfill\kern0pt}

\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{xparse}% http://ctan.org/pkg/xparse
\NewDocumentCommand{\myrule}{O{1pt} O{3pt} O{black}}{%
  \par\nobreak % don't break a page here
  \kern\the\prevdepth % don't take into account the depth of the preceding line
  \kern#2 % space before the rule
  {\color{#3}\hrule height #1 width\hsize} % the rule
  \kern#2 % space after the rule
  \nointerlineskip % no additional space after the rule

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in erat vitae libero dictum imperdiet volutpat nec orci.  Nam vel magna vitae risus tristique ornare. Etiam iaculis tincidunt ante, sed consectetur dui sagittis at. 
Duis porttitor lacus ut sapien varius ut dapibus odio dapibus. Pellentesque sed odio et nisl lacinia rutrum at quis diam. Mauris a nulla sed est blandit varius eget id massa. 
Vivamus libero nibh, dignissim laoreet sollicitudin nec, lobortis nec orci. Pellentesque dolor libero, pretium ut euismod nec, tempor sit amet diam. Mauris vestibulum ornare lacus, in tincidunt dolor adipiscing vel.  
Maecenas mattis sodales justo, ut fringilla leo vulputate sit amet.Vivamus in felis quis justo viverra blandit id mollis velit. Aenean mi dolor, pulvinar eu ornare et, hendrerit sed tortor. In vitae vulputate felis.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.