Announcement

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

  • profile.do - useful startups?

    Hey Statalist.

    This might be an old topic, but searching for profile.do yields many results and none I could see answered this. What do you guys have in your profile.do? I'm always curious to learn new tricks of the trade and we might be able to learn something from one another.

    I usually only have a few things setup from profile.do. I start a log with a timestamp, I cut out the automated update checker since the university I work at decided to screw with the firewall and thereby making Stata stall at startup and I have Stata tell me a random joke from a list (just to get the day going ).


  • #2
    If I teach a class where I make extensive use of smcl presentation I will add a shortcut to where the presentations are stored. This is very situational of course.

    Code:
    noi di as txt _n"Current projects:"
    
    noi di as txt "F4" as result " WS17 log linear models"
    global F4 cd "D:\Mijn documenten\onderwijs\konstanz\ws17\loglinear\talks\";
    
    noi di as txt "F5" as result " WS17 Stata"
    global F5 cd "D:\Mijn documenten\onderwijs\konstanz\ws17\stata\talks\";
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Code:
      set scheme s1color
      is in my profile (and that of my institution's network too, because I advise on what it should be).

      I found that many students and colleagues were using Stata graphs with a blue backdrop and graphs from other software without such. I cared about the inconsistencies more than they usually did, but even so got tired of explaining to some how to remove it. So I fixed the problem at root.

      The more general point is clearly just to choose your own favourite graph scheme as your personal default.

      I also have a bundle of stuff to do with netio.

      If you hate variable name abbreviation, you'll want to disable it.

      Comment


      • #4
        I have a few settings that I don't think can be set permanently. radwin3 is the latest iteration of my slightly customized graph scheme. Among other things, it uses a white background instead of blue (like Nick's example above), small hollow circles in scatterplots, and horizontal axis labels on the vertical axis.
        Code:
        set maxvar 10000
        set seed 12345
        set scrollbufsize 2000000
        set varlabelpos 32
        set tracedepth 1
        set scheme radwin3
        graph set eps logo off
        graph set print logo off
        graph set eps fontface Arial
        graph set window fontface "Times New Roman"
        translator set smcl2txt logo off
        David Radwin
        Senior Researcher, California Competes
        californiacompetes.org
        Pronouns: He/Him

        Comment


        • #5
          I use my profile.do to set up several things consistently for all machines (Linux and Windows) I'm using, especially:
          • ADO file paths
          • disabling logos and setting default fonts for graphs
          • use F-keys for things like -set trace on- and -set trace off-
          • display a default greeting messages enabling me to manually search for updates to Stata (I don't like Stata's automatic update check procedure very much) or installed ADO files
          Regards
          Bela

          PS: Here's the code, if someone is interested
          Code:
          ** general settings **
          set more off                // no -more- pauses on execution
          set varabbrev off            // disable variable abbreviation
          set matastrict on            // Mata: require explicit declarations
          version 12.1                // minimum Stata version
          
          ** system paths **
          * if on Linux machines
          if ("`c(os)'"=="Unix") {
              sysdir set PLUS ~/.customization/stata/plus                                // set default PLUS path
              sysdir set PERSONAL ~/.customization/stata/personal                            // set default PERSONAL path
              sysdir set OLDPLACE ~/.customization/stata                                // set default OLDPLACE path
          }
          * if on Windows machines
          else {
              sysdir set PLUS `=usubinstr(`"`: environment USERPROFILE'/Stata/plus"',"\","`c(dirsep)'",.)'        // set default PLUS path
              sysdir set PERSONAL `=usubinstr(`"`: environment USERPROFILE'/Stata/personal"',"\","`c(dirsep)'",.)'    // set default PERSONAL path
              sysdir set OLDPLACE `=usubinstr(`"`: environment USERPROFILE'/Stata"',"\","`c(dirsep)'",.)'        // set default OLDPLACE path
          }
          
          ** F-keys **
          global F3 "`"            // F3: opening -local- delimiter
          global F4 "'"            // F4: closing -local- delimiter
          global F6 "set trace on;"    // F6: set trace on
          global F7 "set trace off;"    // F7: set trace off
          global F8 "set more on;"    // F8: set more on
          global F9 "set more off;"    // F9: set more off
          
          ** plot output **
          graph set print logo off                // no Stata logo in plots (print)
          graph set window fontface "Linux Biolinum O"        // set default font (window)
          graph set window fontfacesans "Linux Biolinum O"    // set default sans font (window)
          graph set window fontfaceserif "Linux Libertine O"    // set default serif font (window)
          graph set window fontfacemono "DejaVu Sans Mono"    // set default mono font (window)
          graph set ps logo off                    // no Stata logo in plots (ps)
          graph set ps fontface "Linux Biolinum O"        // set default font (ps)
          graph set ps fontfacesans "Linux Biolinum O"        // set default sans font (ps)
          graph set ps fontfaceserif "Linux Libertine O"        // set default serif font (ps)
          graph set ps fontfacemono "DejaVu Sans Mono"        // set default mono font (ps)
          if "`c(console)'"!="console" graph set eps preview on    // include preview-imanges to EPS (eps)
          graph set eps logo off                    // no Stata logo in plots (eps)
          graph set eps fontface "Linux Biolinum O"        // set default font (eps)
          graph set eps fontfacesans "Linux Biolinum O"        // set default sans font (eps)
          graph set eps fontfaceserif "Linux Libertine O"        // set default serif font (eps)
          graph set eps fontfacemono "DejaVu Sans Mono"        // set default mono font (eps)
          
          ** Linux/Unix only **
          if "`c(os)'"=="Unix" {
              ** plots **
              graph set ps fontdir ~/.fonts            // set default font directory for embedding fonts (ps)
              graph set eps fontdir ~/.fonts            // set default font directory for embedding fonts (eps)
          
              ** use gnome-terminal as -xshell-
              global S_XSHELL /usr/bin/gnome-terminal
              global S_XSHELL2 /usr/bin/gnome-terminal -e
              
              ** include -gedit- to the menu **
              if "`c(console)'"!="console" {
                  window menu append submenu "stUser" "Editors"
                  window menu append item "Editors" "gedit" "winexec /usr/bin/gedit"
                  
                  ** define -gedit- program **
                  program gedit
                      version 8
                      winexec /usr/bin/gedit `*'
                  end
              }
          }
          
          ** greetings **
          noisily:display "{hline}"
          noisily:display _newline "Read {hilite:{news:Stata-News}}?"                // read Stata news
          noisily:display _newline "Search for {hilite:{stata update query:Stata updates}}?"    // search Stata updates
          noisily:display _newline "Search for {hilite:{stata adoupdate:ado file updates}}?"    // search ado updates
          noisily:display _newline "{hline}"
          
          ** done **
          exit 0

          Comment

          Working...
          X