Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • display in red undocumented?

    Dear Stata users,

    I find in some use-writted commands that using "display in red" to display output of results in red font. I change the corresponding code to "display in blue" or "display in yellow", and nothing occurs. There's no record of "display in red" in the help file of command display. I want to know more about it. Thank you very much.
    Code:
    . display in red "it puzzled me in help display"
    it puzzled me in help display

  • #2
    display in red still works and as I understand it was the previous version of display as error

    With green and yellow what is key are your preferences for window display. Such directives are ignored with e.g. the current default, but highly visible with e.g. Classic. I found out the hard way with distinct (Stata Journal) that some users were not seeing colours they expected.

    In essence I would guess that you are in a minority (who knows, perhaps 1%) of users who notice details like this and care about them. That's not a criticism as I am alongside you.

    Whatever is not covered by

    Code:
    help undocumented
    must be considered non- or not documented.

    Comment


    • #3
      I don't remember it being documented and couldn't find it documented in Stata 9, which is the earliest release I can access. But,
      Code:
      display in red
      is the (non-documented?) equivalent to
      Code:
      display as error
      When you say that "nothing occurs" when you type
      Code:
      display in yellow
      you probably just don't realize the effect. It is the equivalent to
      Code:
      display as result
      The colors represent the color scheme of earlier releases of Stata (before Stata 11). This color scheme is available in the general settings as "Classic". Try it out.

      Comment


      • #4
        Thank you Nick. I test following your advice, and under my current preference (overall color scheme is light and results color scheme is studio) the green and yellow are invisible. I'm impressed by your erudition again.

        Comment


        • #5
          As daniel klein also implies, whether any given colo[u]r is (easily) visible depends on what other colo[u]rs are being used!

          Comment


          • #6
            Code:
            * Displayed as intended colors when using "classic" color scheme
            di as white "foo"
            di as w "foo"
            di as inp "foo" // Synonym for this
            
            di as green "foo"
            di as g "foo"
            di as txt "foo" // Synonym for this
            
            di as yellow "foo"
            di as y "foo"
            di as res "foo" // Synonym for this
            
            di as red "foo"
            di as r "foo"
            di as err "foo" // Synonym for this
            
            * Formerly displayed as blue (in Stata 6?), changed to green when they decided only links should be blue
            di as blue "foo"
            di as b "foo"
            di "{help foo}" // Currently the only way to display in actual blue is with an SMCL link
            
            * Not really a color/style, but allowed with "as" (for backwards compatibility reasons?)
            di as smcl "foo"
            di as s "foo"

            Comment

            Working...
            X