• Color with simple picture environments

    From Jeff Barnett@jbb@notatt.com to comp.text.tex on Fri Oct 10 10:53:57 2025
    From Newsgroup: comp.text.tex

    I apologize if I'm posing my question in the wrong forum.

    My problem is I want to draw a LAN diagram that distinguish components
    and cables that are 2.5Gb/s-capable from those of slower speed. A simple
    way to do so would be to use two colors, one associated with high speed
    and the other with lower speeds. I only want to color box frames and
    lines. I've consulted "The LaTeX Companion", "A Guide to LaTeX 2e", and
    "The LaTeX Graphics Companion" all of which I have at home. Even the
    Graphics Companion virtually restricts itself to coloring text. All
    contain brief erudite discussions of color models that are of zero help.

    I have been using TeXworks with MikTeX on a Windows 11 PRO machine. Can
    anyone point me to a SIMPLE approach to accomplish what I want to do in
    LaTeX. I would consider my typesetting literacy nil if I was reduced to
    doing this task using LibreOffice, a nightmare inspired my M$ kludge.
    --
    Jeff Barnett

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Richard Heathfield@rjh@cpax.org.uk to comp.text.tex on Fri Oct 10 20:35:16 2025
    From Newsgroup: comp.text.tex

    On 10/10/2025 17:53, Jeff Barnett wrote:
    I apologize if I'm posing my question in the wrong forum.

    I apologise if I'm blaspheming by suggesting a workaround while
    you're waiting for an answer from the TeX wise men.

    My problem is I want to draw a LAN diagram that distinguish
    components and cables that are 2.5Gb/s-capable from those of
    slower speed. A simple way to do so would be to use two colors,
    one associated with high speed and the other with lower speeds. I
    only want to color box frames and lines. I've consulted "The
    LaTeX Companion", "A Guide to LaTeX 2e", and "The LaTeX Graphics
    Companion" all of which I have at home. Even the Graphics
    Companion virtually restricts itself to coloring text. All
    contain brief erudite discussions of color models that are of
    zero help.

    I have been using TeXworks with MikTeX on a Windows 11 PRO
    machine. Can anyone point me to a SIMPLE approach to accomplish
    what I want to do in LaTeX. I would consider my typesetting
    literacy nil if I was reduced to doing this task using
    LibreOffice, a nightmare inspired my M$ kludge.


    Colours are easy in dot.
    PNGs are easy for dot to produce.
    PNGs are easy to incorporate into a LaTeX document.

    If you could express your diagram as a dot graph, you have a
    bandage solution until the experts chip in.
    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julian Bradfield@jcb@inf.ed.ac.uk to comp.text.tex on Fri Oct 10 19:44:50 2025
    From Newsgroup: comp.text.tex

    On 2025-10-10, Jeff Barnett <jbb@notatt.com> wrote:
    My problem is I want to draw a LAN diagram that distinguish components
    and cables that are 2.5Gb/s-capable from those of slower speed. A simple
    way to do so would be to use two colors, one associated with high speed
    and the other with lower speeds. I only want to color box frames and
    lines. I've consulted "The LaTeX Companion", "A Guide to LaTeX 2e", and
    "The LaTeX Graphics Companion" all of which I have at home. Even the Graphics Companion virtually restricts itself to coloring text. All

    Really? The xcolor package makes using colours easier. Then the \color
    command changes the colour of all type, text and lines.

    Can you give a minimal example of what you want to do, and why \color
    doesn't do it?
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jeff Barnett@jbb@notatt.com to comp.text.tex on Fri Oct 10 14:34:37 2025
    From Newsgroup: comp.text.tex

    On 10/10/2025 1:44 PM, Julian Bradfield wrote:
    On 2025-10-10, Jeff Barnett <jbb@notatt.com> wrote:
    My problem is I want to draw a LAN diagram that distinguish components
    and cables that are 2.5Gb/s-capable from those of slower speed. A simple
    way to do so would be to use two colors, one associated with high speed
    and the other with lower speeds. I only want to color box frames and
    lines. I've consulted "The LaTeX Companion", "A Guide to LaTeX 2e", and
    "The LaTeX Graphics Companion" all of which I have at home. Even the
    Graphics Companion virtually restricts itself to coloring text. All

    Really? The xcolor package makes using colours easier. Then the \color command changes the colour of all type, text and lines.

    Can you give a minimal example of what you want to do, and why \color
    doesn't do it?

    \put(...){\framebox(...){...}} how do I color the outline of the box
    generated here?

    \put(...){\line(...)(..)} how do I color this line?

    etc.

    I'll look at xcolor - I just printed its doc file. Thanks
    --
    Jeff Barnett

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julian Bradfield@jcb@inf.ed.ac.uk to comp.text.tex on Sat Oct 11 19:02:47 2025
    From Newsgroup: comp.text.tex

    On 2025-10-10, Jeff Barnett <jbb@notatt.com> wrote:
    \put(...){\framebox(...){...}} how do I color the outline of the box generated here?

    \put(...){\line(...)(..)} how do I color this line?

    A minimum example is a complete file that compiles. I don't know what environment you're using.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jeff Barnett@jbb@notatt.com to comp.text.tex on Sat Oct 11 13:47:10 2025
    From Newsgroup: comp.text.tex

    On 10/11/2025 1:02 PM, Julian Bradfield wrote:
    On 2025-10-10, Jeff Barnett <jbb@notatt.com> wrote:
    \put(...){\framebox(...){...}} how do I color the outline of the box
    generated here?

    \put(...){\line(...)(..)} how do I color this line?

    A minimum example is a complete file that compiles. I don't know what environment you're using.

    As I said earlier I am looking for a SIMPLE way to do what I want in
    LaTeX. I also briefly described wanting to two-color box frames and
    lines (components and cables in my LAN) to distinguish things 2.5Gb/s
    capable from those that were not. Those fragments above were meant to suggestion normal LaTeX drawing primitives for simple box and line diagrams.

    I found some help yesterday in "A Guide to LaTeX 2e". In the three
    references I mentioned consulting in my original message, I had looked
    for "color" in the indices. I looked for "picture" this time.

    Thank you for staying involved. At this point I have a simple but kludge approach using tools mentioned previously.
    --
    Jeff Barnett

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julian Bradfield@jcb@inf.ed.ac.uk to comp.text.tex on Sat Oct 11 20:18:17 2025
    From Newsgroup: comp.text.tex

    On 2025-10-11, Jeff Barnett <jbb@notatt.com> wrote:
    As I said earlier I am looking for a SIMPLE way to do what I want in
    LaTeX. I also briefly described wanting to two-color box frames and
    lines (components and cables in my LAN) to distinguish things 2.5Gb/s capable from those that were not. Those fragments above were meant to suggestion normal LaTeX drawing primitives for simple box and line diagrams.

    So provide a minimal *working* example of a file that demonstrates
    what you want to do and why the obvious thing (putting \color in the appropriate places) doesn't work.

    The fragments you provide are not complete LaTeX, and therefore
    somebody trying to help you has to fill in the blanks with something
    that works. If you want other people to spend time helping you, make
    it as easy as possible for them to understand.

    For example,

    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}

    is the obvious thing to do what you say you want, but presumably you want something other than what it does, since you're not happy with that.

    See

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jeff Barnett@jbb@notatt.com to comp.text.tex on Sat Oct 11 22:15:52 2025
    From Newsgroup: comp.text.tex

    On 10/11/2025 2:18 PM, Julian Bradfield wrote:
    On 2025-10-11, Jeff Barnett <jbb@notatt.com> wrote:
    As I said earlier I am looking for a SIMPLE way to do what I want in
    LaTeX. I also briefly described wanting to two-color box frames and
    lines (components and cables in my LAN) to distinguish things 2.5Gb/s
    capable from those that were not. Those fragments above were meant to
    suggestion normal LaTeX drawing primitives for simple box and line diagrams.

    So provide a minimal *working* example of a file that demonstrates
    what you want to do and why the obvious thing (putting \color in the appropriate places) doesn't work.

    The fragments you provide are not complete LaTeX, and therefore
    somebody trying to help you has to fill in the blanks with something
    that works. If you want other people to spend time helping you, make
    it as easy as possible for them to understand.

    For example,

    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}

    is the obvious thing to do what you say you want, but presumably you want something other than what it does, since you're not happy with that.
    If I had an example I probably wouldn't of written. I was hoping that
    someone knowledgeable in these things would direct me either to a set of
    well thought out examples or, better yet, a package that brought
    together a bunch of orthogonal considerations. I do not have examples
    other than utter kludges that beg for someone with the appropriate
    background to bundle the primitives in an intelligent an clever way.
    Given he responses here, I guess that either it has happened yet or it
    has been a well kept secret.
    --
    Jeff Barnett

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julian Bradfield@jcb@inf.ed.ac.uk to comp.text.tex on Sun Oct 12 12:17:43 2025
    From Newsgroup: comp.text.tex

    On 2025-10-12, Jeff Barnett <jbb@notatt.com> wrote:
    On 10/11/2025 2:18 PM, Julian Bradfield wrote:

    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}


    If I had an example I probably wouldn't of written. I was hoping that

    But you must have an example of what you want to produce, on paper or
    in your head.

    If the above is not a solution, what do you want?

    Are you actually asking a completely separate question, not about
    color at all? I.e. how to draw LAN diagrams easily and neatly?

    The general answer to how to draw things these days is TikZ.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jeff Barnett@jbb@notatt.com to comp.text.tex on Sun Oct 12 10:46:40 2025
    From Newsgroup: comp.text.tex

    On 10/12/2025 6:17 AM, Julian Bradfield wrote:
    On 2025-10-12, Jeff Barnett <jbb@notatt.com> wrote:
    On 10/11/2025 2:18 PM, Julian Bradfield wrote:

    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}


    If I had an example I probably wouldn't of written. I was hoping that

    But you must have an example of what you want to produce, on paper or
    in your head.

    If the above is not a solution, what do you want?

    Are you actually asking a completely separate question, not about
    color at all? I.e. how to draw LAN diagrams easily and neatly?

    The general answer to how to draw things these days is TikZ.
    Look at the subject on every message in this thread.

    Look at the example above (supplied by you?). In specifying a fame box,
    there are three colors to consider: frame, interior background,
    contents. Is there a picture environment that has a sensible/simple way
    to specify the various combinations?

    It was my assumption that ANYONE with the background and interest in responding to my original message would know exactly and precisely what
    sort of truly trivial (graphics-wise) two color diagram I wanted to
    draw. It seems that I was wrong.
    --
    Jeff Barnett

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julian Bradfield@jcb@inf.ed.ac.uk to comp.text.tex on Sun Oct 12 20:24:49 2025
    From Newsgroup: comp.text.tex

    On 2025-10-12, Jeff Barnett <jbb@notatt.com> wrote:
    On 10/12/2025 6:17 AM, Julian Bradfield wrote:
    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}

    Look at the example above (supplied by you?). In specifying a fame box, there are three colors to consider: frame, interior background,
    contents. Is there a picture environment that has a sensible/simple way
    to specify the various combinations?

    OK, so we have progress. You do not find it sensible or simple to
    specify the colours you want directly. You want something else, but
    you have not explained what.


    It was my assumption that ANYONE with the background and interest in responding to my original message would know exactly and precisely what
    sort of truly trivial (graphics-wise) two color diagram I wanted to
    draw. It seems that I was wrong.

    You are not asking about how to draw a trivial diagram, which you were
    clear about. You are asking how to draw a trivial diagram in a
    particular style that you find sensible/simple. You have not
    explained, at all, what aspects of programming style you like.

    So again: what would be an example of a syntax you *would* find
    sensible/simple within the constraints of a bare picture environment?



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Holger Schieferdecker@spamless@gmx.de to comp.text.tex on Tue Oct 14 12:03:15 2025
    From Newsgroup: comp.text.tex

    Am 12.10.2025 um 06:15 schrieb Jeff Barnett:
    On 10/11/2025 2:18 PM, Julian Bradfield wrote:
    On 2025-10-11, Jeff Barnett <jbb@notatt.com> wrote:
    As I said earlier I am looking for a SIMPLE way to do what I want in
    LaTeX. I also briefly described wanting to two-color box frames and
    lines (components and cables in my LAN) to distinguish things 2.5Gb/s
    capable from those that were not. Those fragments above were meant to
    suggestion normal LaTeX drawing primitives for simple box and line
    diagrams.

    So provide a minimal *working* example of a file that demonstrates
    what you want to do and why the obvious thing (putting \color in the
    appropriate places) doesn't work.

    The fragments you provide are not complete LaTeX, and therefore
    somebody trying to help you has to fill in the blanks with something
    that works. If you want other people to spend time helping you, make
    it as easy as possible for them to understand.

    For example,

    {\color{red}\framebox(2cm,2cm){\color{black}text}}

    {\color{blue} \line....}

    is the obvious thing to do what you say you want, but presumably you want
    something other than what it does, since you're not happy with that.
    If I had an example I probably wouldn't of written. I was hoping that someone knowledgeable in these things would direct me either to a set of well thought out examples or, better yet, a package that brought
    together a bunch of orthogonal considerations. I do not have examples
    other than utter kludges that beg for someone with the appropriate background to bundle the primitives in an intelligent an clever way.
    Given he responses here, I guess that either it has happened yet or it
    has been a well kept secret.

    In case you never heard of the term "minimal working example":
    This means a document that shows what you have done so far. Anything not necessary has to be omitted. Only the necessary packages are loaded. It
    must be compilable.

    More information:

    https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that

    https://tug.ctan.org/info/dickimaw/dickimaw-minexample.pdf

    In your case I assume that you have tried to work with the picture environment. So a minimal example could be the following.

    %%%%%%%%%%%%%
    \documentclass{article}

    \begin{document}
    \setlength{\unitlength}{10mm}
    \begin{picture}(10, 5)
    \put(0, 0){ \line(1, 1){1} }
    \end{picture}
    \end{document}
    %%%%%%%%%%%%%

    Julian already showed you how to draw colored lines and boxes there. A
    working example including the solution would be like this. It also shows
    how to limit the scope of color settings.

    %%%%%%%%%%%%%
    \documentclass{article}
    \usepackage{xcolor}

    \begin{document}
    \setlength{\unitlength}{10mm}
    \begin{picture}(10, 5)
    \put(0, 0){ \line(1, 1){1} }
    \color{blue}
    \put(1, 0){ \line(1, 1){1} }
    \put(2, 0){ \line(1, 1){1} }
    \color{black}
    \put(3, 0){ \line(1, 1){1} }
    {\color{yellow}\put(4, 0){ \line(1, 1){1} }}
    \put(5, 0){ \line(1, 1){1} }
    \end{picture}
    \end{document}
    %%%%%%%%%%%%%

    In case you insist on not providing minimal working examples the number
    of people trying to help could be limited (or maybe zero).

    In general I would use TikZ for drawings like this. But if you never
    worked with it (as I assume) you will have to learn a lot. Or you could
    use a vector graphics program like Inkscape, draw your picture, export
    as PDF, and embed the PDF in LaTeX.

    Holger
    --- Synchronet 3.21a-Linux NewsLink 1.2