Text FormattingCSS border-right equivalent

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

CSS border-right equivalent

Post by Toshiro »

Hello!

I would like to annotate text in the following manner:
annotated.png
annotated.png (5.08 KiB) Viewed 2646 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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

CSS border-right equivalent

Post by Stefan Kottwitz »

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:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
  \matrix (m) [matrix of nodes]{
    A & B & C & D & E\\};
  \draw (m-1-1.north west) -- (m-1-1.north east) -- (m-1-1.south east)
    -- (m-1-2.south west) -- (m-1-2.south east) -- (m-1-2.north east)
    -- (m-1-5.north east);
\end{tikzpicture}
\end{document}
path.png
path.png (1.75 KiB) Viewed 2645 times
Stefan
LaTeX.org admin
Post Reply