Jump to content

LaTeX/Rules and Struts

From Wikibooks, open books for an open world

Www.Chikita/Isaac.com{| class="wikitable collapsible noprint" style="background-color: #efe; float: right; clear: right; border: 1px solid #8b8; padding: 0.5em; font-size: small; text-align: left; width: 20%; margin: 0.5em;" |- !

LaTeX |- | Getting Started

  1. Introduction
  2. Installation
  3. Installing Extra Packages
  4. Basics
  5. How to get help

Common Elements

  1. Document Structure
  2. Text Formatting
  3. Paragraph Formatting
  4. Colors
  5. Fonts
  6. List Structures
  7. Special Characters
  8. Internationalization
  9. Rotations
  10. Tables
  11. Title creation
  12. Page Layout
  13. Customizing Page Headers and Footers‎
  14. Importing Graphics
  15. Floats, Figures and Captions
  16. Footnotes and Margin Notes
  17. Hyperlinks
  18. Labels and Cross-referencing
  19. Initials

Mechanics

  1. Errors and Warnings
  2. Lengths
  3. Counters
  4. Boxes
  5. Rules and Struts

Technical Text

  1. Mathematics
  2. Advanced Mathematics
  3. Theorems
  4. Chemical Graphics
  5. Algorithms
  6. Source Code Listings
  7. Linguistics

Special Pages

  1. Indexing
  2. Glossary
  3. Bibliography Management
  4. More Bibliographies

Special Documents

  1. Scientific Reports (Bachelor Report, Master Thesis, Dissertation)
  2. Letters
  3. Presentations
  4. Teacher's Corner
  5. Curriculum Vitae
  6. Academic Journals (MLA, APA, etc.)

Creating Graphics

  1. Introducing Procedural Graphics
  2. MetaPost
  3. Picture
  4. PGF/TikZ
  5. PSTricks
  6. Xy-pic
  7. Creating 3D graphics

Programming

  1. Macros
  2. Plain TeX
  3. Creating Packages
  4. Creating Package Documentation
  5. Themes

Miscellaneous

  1. Modular Documents
  2. Collaborative Writing of LaTeX Documents
  3. Export To Other Formats

Help and Recommendations

  1. FAQ
  2. Tips and Tricks

Appendices

  1. Authors
  2. Links
  3. Package Reference
  4. Sample LaTeX documents
  5. Index
  6. Command Glossary

|- | edit this boxedit the TOC |}

Rules

[edit | edit source]

The \rule command in normal use produces a simple black box:

\rule[raise]{width}{thickness}


The parameter thickness determines the height, whereas width determines the width of the produced rule. With the optional parameter raise, you can optionally raise or lower the produced rule above or below the baseline.

Here is an example (the thin lines are located at the baseline):

\rule{3mm}{.1pt}%
\rule[-1mm]{5mm}{1cm}%
\rule{3mm}{.1pt}%
\rule[1mm]{1cm}{5mm}%
\rule{3mm}{.1pt}

This is useful for drawing vertical and horizontal lines.

Struts

[edit | edit source]

A special case is a rule with no width but a certain height. In professional typesetting, this is called a strut. It is used to guarantee that an element on a page has a certain minimal height. You could use it in a tabular environment or in boxes to make sure a row has a certain minimum height.

In LaTeX a strut is defined as

\rule[-.3\baselineskip]{0pt}{\baselineskip}

Stretched rules

[edit | edit source]

LaTeX provides the \hrulefill command, which work like a stretched horizontal space. See the Lengths chapter.


Previous: Boxes Index Next: Mathematics