# colored lines

• March 23rd 2010, 07:21 AM
Joolz
colored lines
Hi there,

I'm writing a report in/with Latex and I need to draw some colored lines like:

---------------xxxxxxxxxxxx

xxxxxxxxxxxxxxx------------

where ------ is a red line and xxxxx blue

And it would be perfect if it can be thick lines also...

Does anyone have an idea how to create this in/with latex. Is there some kind of package that I would need?

I really appreciate all kinds of help!

Regards
A.
• March 23rd 2010, 07:29 AM
Soroban
Hello, Joolz!

Something like this?

{\color{red} -------} {\color{blue} =======}

${\color{red} -------} {\color{blue}=======}$

• March 24th 2010, 02:33 AM
flyingsquirrel
Hello,
Quote:

Originally Posted by Joolz
Does anyone have an idea how to create this in/with latex.

I'd do it this way :
Code:

\documentclass{article} \usepackage{color} \usepackage{lipsum} \newenvironment{bluered}{     {\noindent\color{red}\rule{.6\textwidth}{1pt}}{\color{blue}\rule{.4\textwidth}{1pt}}     }{     {\noindent\color{blue}\rule{.4\textwidth}{1pt}}{\color{red}\rule{.6\textwidth}{1pt}} } \begin{document} \begin{bluered} \lipsum[1] \end{bluered} \end{document}
Is that what you want ?

Edit : 800 \o/
• March 24th 2010, 04:02 AM
Joolz
Thnx
Hi there,

Thank you both for your help! :-)

Flyingsquirrel, you are my hero today! :D
• March 25th 2010, 06:08 AM
Joolz
hi hero! :)

You helped me with creating colored lines and now
I have a question for you...

I would like the colored lines to be shorter... like 4 cm or so...
So I've tried to change the 0.6\textwidth and 0.4\testwidth in say 1cm and 3cm but then the two lines apear next to each other... I used \\ and \newline but that doesn't seem to work...

How can I get the lines you gave me... shorter and centered???

I hope you can help me!
In the mean time I'm gonna try some more myself...

thx!

Kind regards,
Joolz
• March 25th 2010, 06:47 AM
flyingsquirrel
Quote:

Originally Posted by Joolz
hi hero! :)

Hello :D
Quote:

Originally Posted by Joolz
I would like the colored lines to be shorter... like 4 cm or so...
So I've tried to change the 0.6\textwidth and 0.4\testwidth in say 1cm and 3cm but then the two lines apear next to each other... I used \\ and \newline but that doesn't seem to work...

How can I get the lines you gave me... shorter and centered???

I got rid of the "bluered" environment since apparently you don't need it. Using \\ so that the lines do not appear one next to the other works for me. To get the line centered simply use the... "center" environment ! :D
Code:

\documentclass{article} \usepackage{color} \begin{document} \begin{center}     {\noindent\color{red}\rule{1cm}{1pt}}{\color{blue}\rule{3cm}{1pt}}\\     % increases/decreases the vertical space between the two lines     % \vspace{-3mm}     {\noindent\color{blue}\rule{3cm}{1pt}}{\color{red}\rule{1cm}{1pt}} \end{center} \end{document}
• March 25th 2010, 07:56 AM
Joolz
Whieeeeeehaaaa

Thank you thank you thank you.... AGAIN!!

:D