Text FormattingVertical line around text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Vertical line around text

Post by yiorgosb »

I've created an "example" environment for my examples.
I need to enclose the text inside the example with a vertical line.
Obviously the \vline command won't work.
What's the optimal way to achieve this?

I want to avoid using minipage or multicol since I use the wrapfig inside the example environment and as you most probably know these packages are incompatible to each other.
Last edited by yiorgosb on Thu Mar 03, 2011 1:13 am, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Vertical line around text

Post by localghost »

How can a (single) vertical line enclose something? Please give at least a visual help of what you are after or submit a minimal example with what you have done so far. Both would be best.


Thorsten
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Vertical line around text

Post by yiorgosb »

You are right. The term enclose is not appropriate.
I mean a result like the one produced by the following code

Code: Select all

\begin{tabular}{|c}
Lorem Ipsum is simply dummy text \\
Lorem Ipsum has been the industry's  \\
when an unknown printer specimen book. \\
\end{tabular} 
which is just for demonstration of what I want to do.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Vertical line around text

Post by localghost »

The framed package is probably what you are looking for.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{framed}
\usepackage{blindtext}

\begin{document}
  \blindtext
  \begin{leftbar}
    \blindtext
  \end{leftbar}
  \blindtext
\end{document}
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Vertical line around text

Post by yiorgosb »

Thank you it's working.
For anyone who may see this topic, to change the color of the sidebar
you may refer here
Post Reply