LaTeX forum ⇒ Text FormattingCSS border-right equivalent

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Posts: 1
Joined: Sat May 12, 2012 4:08 pm

CSS border-right equivalent

Postby Toshiro » Sat May 12, 2012 4:26 pm


I would like to annotate text in the following manner:

annotated.png (5.08 KiB) Viewed 1006 times

I'm aware of \underline and \overline, but I need to make a border on the right side, like in the attached image, so it looks like an unbroken chain of "__|¯¯|__|¯¯|__".

Thank you.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany

Postby Stefan Kottwitz » Sat May 12, 2012 4:43 pm

Hi Toshiro,

welcome to the board!

A quick and easy way would be to define a TikZ matrix for the characters, where each character is a node which can be referred to, for drawing such a path.

For example:

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usetikzlibrary{matrix}
  4. \begin{document}
  5. \begin{tikzpicture}
  6. \matrix (m) [matrix of nodes]{
  7. A & B & C & D & E\\};
  8. \draw (m-1-1.north west) -- (m-1-1.north east) -- (m-1-1.south east)
  9. -- (m-1-2.south west) -- (m-1-2.south east) -- (m-1-2.north east)
  10. -- (m-1-5.north east);
  11. \end{tikzpicture}
  12. \end{document}

path.png (1.75 KiB) Viewed 1005 times

Site admin

Return to “Text Formatting”

Who is online

Users browsing this forum: Bing [Bot] and 5 guests