Announcement

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

  • Changing colorscheme in "translate" command

    I LOVE the "translate" command. I find fontsize(8) works best for 8.5x11 paper. I'd love to output in color. I see there isa parameter called "scheme" which is by default set to monochrome. What are the names for the color schemes? when I search all I find is the color schemes for graphs. I tried option scheme(color) to no avail.
    Owner of StataTutor.com

  • #2
    If you
    Code:
    help scheme
    You can find out a bit more about scheme files in general and will also see how to determine the schemes available on your system. You can also use brewscheme to create your own customized scheme files and get access to a few other color/visualization related tools.

    Comment


    • #3
      Thank you for your help. I looked this article up before posting. These are schemes for graphs not log files. I am looking for schemes for log files. when I use these scheme names I get an error that the scheme is invalid.
      Owner of StataTutor.com

      Comment


      • #4
        Originally posted by Mark Davis View Post
        I see there isa parameter called "scheme" which is by default set to monochrome.
        Where do you see this? The word "scheme" does not appear in help translate.

        Comment


        • #5
          @Freidrich Huebler - The manual entry [R translate] shows an example of available parameters for the smcl2ps translator: translator query smcl2ps , wherein we see scheme monochrome (as well as customizable colors).
          Stata/MP 14.1 (64-bit x86-64)
          Revision 19 May 2016
          Win 8.1

          Comment


          • #6
            Right, I have the same.
            Code:
            . translator query smcl2ps
            -------------------------------------------------------------------------
                            header | on
                        headertext | 
                              logo | on
                              user | 
                       projecttext | 
                         cmdnumber | on
            -----------------------+-------------------------------------------------
                          fontsize | 9                         lmargin | 1.00
                          pagesize | letter                    rmargin | 1.00
                         pagewidth | 8.50                      tmargin | 1.00
                        pageheight | 11.00                     bmargin | 1.00
            -----------------------+-------------------------------------------------
                            scheme | monochrome
            -----------------------+-------------------------------------------------
                cust1_result_color |   0   0   0    cust2_result_color |   0   0   0
              cust1_standard_color |   0   0   0  cust2_standard_color |   0   0   0
                 cust1_error_color |   0   0   0     cust2_error_color | 255   0   0
                 cust1_input_color |   0   0   0     cust2_input_color |   0   0   0
                  cust1_link_color |   0   0   0      cust2_link_color |   0   0 255
                cust1_hilite_color |   0   0   0    cust2_hilite_color |   0   0   0
                 cust1_result_bold | on              cust2_result_bold | on
               cust1_standard_bold | off           cust2_standard_bold | off
                  cust1_error_bold | on               cust2_error_bold | on
                  cust1_input_bold | off              cust2_input_bold | off
                   cust1_link_bold | off               cust2_link_bold | off
                 cust1_hilite_bold | on              cust2_hilite_bold | on
              cust1_link_underline | on           cust2_link_underline | on
            cust1_hilite_underline | off        cust2_hilite_underline | off
            -------------------------------------------------------------------------

            Comment


            • #7
              Yes exactly. There is even a way to pass values for scheme when you translate. I have tried "color" but it's not a valid option. can I create and save my own scheme to use later? Also I like to use font(8) so the full width of a terminal output can be displayed on 8.5 inch wide paper.
              Owner of StataTutor.com

              Comment


              • #8
                It isn't completely clear how to identify which values can be modified or not. The width may also have to do with the line size in Stata as well.

                Comment


                • #9
                  I am reasonably sure you can pass scheme() as an option because scheme(monochrome) works. What I am unsure of is that any other color schemes excist.
                  Owner of StataTutor.com

                  Comment


                  • #10
                    Ah ha! The syntax for translator set is:
                    translator set [tname setopt setval]
                    Therefore the following does change the scheme. I'll leave it to you to determine whether it actually changes the output.

                    Code:
                    translator set smcl2ps scheme color
                    translator query smcl2ps
                    
                    *Yields:
                    . translator query smcl2ps
                    -------------------------------------------------------------------------
                                    header | on
                                headertext | 
                                      logo | on
                                      user | 
                               projecttext | 
                                 cmdnumber | on
                    -----------------------+-------------------------------------------------
                                  fontsize | 9                         lmargin | 1.00
                                  pagesize | letter                    rmargin | 1.00
                                 pagewidth | 8.50                      tmargin | 1.00
                                pageheight | 11.00                     bmargin | 1.00
                    -----------------------+-------------------------------------------------
                                    scheme | color
                    -----------------------+-------------------------------------------------
                        cust1_result_color |   0   0   0    cust2_result_color |   0   0   0
                      cust1_standard_color |   0   0   0  cust2_standard_color |   0   0   0
                         cust1_error_color |   0   0   0     cust2_error_color | 255   0   0
                         cust1_input_color |   0   0   0     cust2_input_color |   0   0   0
                          cust1_link_color |   0   0   0      cust2_link_color |   0   0 255
                        cust1_hilite_color |   0   0   0    cust2_hilite_color |   0   0   0
                         cust1_result_bold | on              cust2_result_bold | on
                       cust1_standard_bold | off           cust2_standard_bold | off
                          cust1_error_bold | on               cust2_error_bold | on
                          cust1_input_bold | off              cust2_input_bold | off
                           cust1_link_bold | off               cust2_link_bold | off
                         cust1_hilite_bold | on              cust2_hilite_bold | on
                      cust1_link_underline | on           cust2_link_underline | on
                    cust1_hilite_underline | off        cust2_hilite_underline | off
                    -------------------------------------------------------------------------
                    Stata/MP 14.1 (64-bit x86-64)
                    Revision 19 May 2016
                    Win 8.1

                    Comment


                    • #11
                      I'm not sure what exactly the "color" scheme would be in this case. There are a few different color schemes that come with Stata (e.g., s2color, s2gcolor, s1color, etc...) but none that a named color. If it uses the same specifications as a normal scheme file, then brewscheme could be used to generate custom scheme files if needed/wanted, but I'm not sure how reasonable a solution it would provide for this use case.

                      Comment


                      • #12
                        The scheme here refers to the colors displayed in a file translated, for example, from a smcl file to pdf. It is not the same as graphing schemes.


                        Code:
                        translator set smcl2pdf scheme monochrome
                        log using log_mono.smcl, smcl
                        noi di as error "This text will be BLACK in the mono-pdf"
                        log close
                        translate log_mono.smcl log_mono.pdf
                        
                        translator set smcl2pdf scheme color
                        log using log_color.smcl, smcl
                        noi di as error "This text will show up as RED in the color-pdf"
                        log close
                        translate log_color.smcl log_color.pdf
                        If you compare these two pdf files, you can see the difference. **Caveat: This is on a Windows machine. There are notes about how the translator works for Mac & *nix, so YMMV.
                        Stata/MP 14.1 (64-bit x86-64)
                        Revision 19 May 2016
                        Win 8.1

                        Comment

                        Working...
                        X