Announcement

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

  • Including bold font in custom Stata scheme

    Hi,

    I am building my own custom Stata scheme based on s2color. I would like to define the title of the graph to appear in bold font, but cannot see anywhere to specify this.

    Many thanks for any help,
    Christian

  • #2
    Christian Henn you might want to look at the help documentation from the brewscheme package. I'm not sure there is a direct way to accomplish what you want, but if there is you would be able to find it as one of the options you can set with the brewtheme command.

    Comment


    • #3
      Hello Christian,

      Welcome to the Stata Forum.

      I wonder whether you have tried to insert the word "bf" before the phrase you wish to be presented in bold font.

      For example:

      Code:
      graph twoway (scatter var1 var2) , title({bf: This title shall be presented in bold})
      Hopefully that helps.
      Best regards,

      Marcos

      Comment


      • #4
        Marcos Almeida that will work interactively in commands, but I don't believe there is an option to insert this in a scheme file.

        Comment


        • #5
          wbuchanan : you are right. We may get it interactively, but not under a scheme file. Still, since you think there may not be a direct way to perfom this, even under user-written programs, an alternative could be just using both "scheme" and "bf" options.

          Sort of:

          Code:
          .sysuse auto
          .graph twoway (scatter price mpg) , scheme(sj) title({bf: This title shall be presented in bold})
          Last edited by Marcos Almeida; 12 Feb 2017, 12:28.
          Best regards,

          Marcos

          Comment


          • #6
            Marcos Almeida I agree completely. While I wouldn't be as likely to use bold type face in a graph personally, I can see your suggestion being the best possible compromise.

            Comment


            • #7
              You can't do anything with characters in a graph scheme. Lots of people want to choose the font themselves, but not many people write schemes, so you don't want a scheme overriding your font selection.

              The way to do stuff with fonts is via graph set. Note that font ≠ typeface. Say you want Arial bold, then you can just do:
              Code:
              graph set [exporttype] fontface "Arial Bold"
              For pdf graphs, it's a bit different (who knows why):
              Code:
              translator set Graph2pdf fontface "Arial Bold"
              (though I haven't checked that the bold part works for pdf).

              Comment


              • #8
                Indeed, Tim, that is a very interesting solution, for - graph set - can provide bold fonts as well.

                But I gather it would provide bold fonts for all characters in the graph, not only for the title, as demanded in #1.

                In #5, I just tried to preserve the desired scheme along with providing a bold font only for the title.
                Best regards,

                Marcos

                Comment


                • #9
                  Ah yes, thanks Marcos Almeida – I mis-read and thought Christian had asked for bold for the whole graph. That did seem strange! Apologies.
                  Tim

                  Comment


                  • #10
                    Originally posted by Tim Morris View Post
                    You can't do anything with characters in a graph scheme. Lots of people want to choose the font themselves, but not many people write schemes, so you don't want a scheme overriding your font selection.

                    The way to do stuff with fonts is via graph set. Note that font ≠ typeface. Say you want Arial bold, then you can just do:
                    Code:
                    graph set [exporttype] fontface "Arial Bold"
                    For pdf graphs, it's a bit different (who knows why):
                    Code:
                    translator set Graph2pdf fontface "Arial Bold"
                    (though I haven't checked that the bold part works for pdf).
                    This is very helpful. Thanks.

                    Comment

                    Working...
                    X