Text FormattingHow can a get a dashed/dotted \textbar?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Maryse
Posts: 2
Joined: Fri Jul 11, 2014 1:09 pm

How can a get a dashed/dotted \textbar?

Post by Maryse »

Here is my problem: I'd like to add a dashed or dotted vertical line in my text.
I used the \textbar to add a solid line, but I also need to add dashed - or dotted, that will also do the trick! - vertical line in my text. Unfortunately, I can't find any way to do this! Do you have a solution in mind to solve this problem?
Thanks!
Maryse

Recommended reading 2024:

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

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How can a get a dashed/dotted \textbar?

Post by Johannes_B »

Is this needed in text or within a graphic or ...?
Can you prepare a minimal working example to show what you want? Maybe even a screenshot/hand-drawing?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Maryse
Posts: 2
Joined: Fri Jul 11, 2014 1:09 pm

Re: How can a get a dashed/dotted \textbar?

Post by Maryse »

I have attached the .pdf that I need so that you can have an idea.
This is needed in a table in fact. But this is not the lines/columns of the table itself that I want to be dashed. My problem is about some lines within the table.
As you'll see, I already have vertical lines - which I draw using $|$. But I need two of them to be dashed or dotted.
Maryse
Attachments
ex Latex.pdf
(43.33 KiB) Downloaded 371 times
esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

How can a get a dashed/dotted \textbar?

Post by esdd »

You can use TikZ to define your own line:

Code: Select all

\documentclass{scrartcl}
\usepackage{tikz}
\newcommand\myline[1][]{%
  \,\tikz[baseline]\draw[very thick,#1](0,-\dp\strutbox)--(0,\ht\strutbox);\,%
}
\begin{document}
Text\myline Text\myline[dashed]Text\myline[dotted]
\end{document}
myline.png
myline.png (2.62 KiB) Viewed 7825 times
Best regards
Elke
Post Reply