# Math Help - colored lines

1. ## 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.

2. Hello, Joolz!

Something like this?

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

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

3. Hello,
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/

4. ## Thnx

Hi there,

Thank you both for your help! :-)

Flyingsquirrel, you are my hero today!

5. 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

6. Originally Posted by Joolz
hi hero!
Hello
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 !
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}

7. Whieeeeeehaaaa

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