Announcement

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

  • Getting bold and italics simultaneously via {bf: and {it:

    Colleagues,

    I was wondering whether is possible to get bold and italicised font in the graph tile. Presently, I'm using code:
    Code:
    title("{it:{bf:Outside} this and that }"
    which produces:
    Outside this and that
    whereas my ambition is to get
    Outside this and that.
    Kind regards,
    Konrad
    Version: Stata/IC 13.1

  • #2
    As your experiment shows, italic and bold can't be combined using SMCL.

    Comment


    • #3
      It's a shame, I was hoping that maybe there is a way to do this. Presumably, I could attempt to change the font face to a font type that looks like italic and bold.
      Kind regards,
      Konrad
      Version: Stata/IC 13.1

      Comment


      • #4
        With black font on white screen (i.e. the standard since Stata release 11 and in the viewer) you can trick SMCL and use {hi:} (or {opt } instead of {bf:}.

        Save the following as foo.sthlp where Stata can find it

        Code:
        {smcl}
        {sf:bar}
        {bf:{it:bar}}
        {it:{bf:bar}}
        {it:{hi:bar}}
        {it:{opt bar}}
        and type h foo

        Best
        Daniel

        Comment


        • #5
          Daniel,

          Thanks very much for this. It works like a charm:
          Click image for larger version

Name:	Untitled.png
Views:	1
Size:	862 Bytes
ID:	257840
          Out of curiosity, could you explain how this works?
          Kind regards,
          Konrad
          Version: Stata/IC 13.1

          Comment


          • #6
            Sorry, I have no further insights into SMCL, I just wrote and read lots of help files. It is mostly try and error, really.

            Some parts of SMCL remain a mystery to me. For example, I cannot find a documentation of the order of evaluation. Writing

            Code:
            {it:{help foo}}
            will display foo as a link to the help file called foo.sthlp while

            Code:
            {help {it:foo}}
            displays (in blue) foo}. There are lots of other examples I cannot explain, but playing around a bit, I usually get close to what I want.

            Best
            Daniel

            Comment


            • #7
              Daniel: Good tricks.

              Comment


              • #8
                My guess is that {sf}, {bf}, and {it} are mutually exclusive and that the SMCL parser just moves left to right without trying to evaluate nesting. Accordingly, when it sees something like {bf:{it:bar}} the {it} overrides the {bf}. For whatever reason, {hi} and {opt} are not considered mutually exclusive with {it} and are thus additive.

                Regarding Daniel's example using {help}, perhaps the SMCL help may clarify:

                Pretend that {xyz} is a SMCL directive, although it is not. {xyz} might have any of
                the following syntaxes:

                Syntax 1: {xyz}
                Syntax 2: {xyz:text}
                Syntax 3: {xyz args}
                Syntax 4: {xyz args:text}

                Syntax 1 means "do whatever it is that {xyz} does". Syntax 2 means "do whatever it is
                that {xyz} does, do it on the text text, and then stop doing it". Syntax 3 means "do
                whatever it is that {xyz} does, as modified by args". Finally, syntax 4 means "do
                whatever it is that {xyz} does, as modified by args, do it on the text text, and then
                stop doing it".

                Not every SMCL directive has all four syntaxes, and which syntaxes are allowed is made
                clear in the descriptions below.

                In syntaxes 3 [sic--should be 2] and 4, text may contain other SMCL directives. However, be aware of one
                important limitation: not only must the braces match, but they must match on the same
                physical (input) line.
                Note that {help {it:foo}} violates the last rule, in that {help} is a syntax 3 directive and as such args cannot contain a SMCL directive. On the other hand, {it} is a syntax 2 directive and {it:{help foo}} is perfectly legal as per the last rule.

                Comment


                • #9
                  Colleagues,
                  I want the variables in my table to be the name of their label, in italics. How can I modify the command:
                  esttab est1 using H.rtf, replace indicate(`r(indicate_fe)') star(* 0.1 ** 0.05 *** 0.01) b(%6.3f) t(2) ar2(3) nocons nogap title(Table) label

                  Comment

                  Working...
                  X