Results 1 to 7 of 7

Math Help - colored lines

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    14

    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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,909
    Thanks
    773
    Hello, Joolz!


    Something like this?


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


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

    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Hello,
    Quote Originally Posted by Joolz View Post
    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/
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Oct 2009
    Posts
    14

    Thnx

    Hi there,

    Thank you both for your help! :-)

    Flyingsquirrel, you are my hero today!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Oct 2009
    Posts
    14
    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
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Quote Originally Posted by Joolz View Post
    hi hero!
    Hello
    Quote Originally Posted by Joolz View Post
    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}
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Oct 2009
    Posts
    14
    Whieeeeeehaaaa


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


    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: March 10th 2012, 05:48 PM
  2. Replies: 1
    Last Post: April 18th 2010, 12:52 AM
  3. Replies: 2
    Last Post: January 25th 2009, 09:41 PM
  4. [SOLVED] Colored Stones
    Posted in the Math Topics Forum
    Replies: 4
    Last Post: April 21st 2005, 06:25 AM

Search Tags


/mathhelpforum @mathhelpforum