Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Tip - Special characters in labels, titles of graphs &c


From   "Newson, Roger B" <[email protected]>
To   <[email protected]>
Subject   st: RE: Tip - Special characters in labels, titles of graphs &c
Date   Tue, 12 Dec 2006 12:16:31 -0000

A good reference for this is Cox (2004), who wrote a Stata Tip on the
subject, which is collected with 32 others in Cox and Newton (2006).
Essentially, you use macros, together with the Stata char() command,
which inputs a number and outputs the corresponding ASCII character. For
instance, if we want to produce a mu in a variable label that might
appear in a plot title, we might type

local mu=char(181)
label variable conc "Concentration (`mu'moles/l)"
scatter conc time

These characters can be exported to text editors or even Microsoft Word.
However, superscripts and subscripts, as you say, are still a problem,
especially if you are producing graphs and/or exporting text to
Microsoft Word. (Life is a bit easier if you are exporting TeX tables,
eg using the SSC package -listtex-.)

I hope this helps.

Best wishes

Roger


References

Cox NJ. 2004. Stata tip 6: Inserting awkward characters into the plot.
The Stata Journal 4(1): 95-96.

Cox NJ, Newton HJ (eds.) 2006. Thirty-three Stata tips. College Station,
TX: Stata Press.


Roger Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected] 
www.imperial.ac.uk/nhli/r.newson/

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Paul Seed
Sent: 12 December 2006 11:35
To: [email protected]
Subject: st: Tip - Special characters in labels, titles of graphs &c

It has been a bugbear of mine for some time that it seems
impossible to get special characters where I want them within Stata.
In particular the "mu" in "micromol/L", and the "superscript 2" in
"BMI (kg/m2)".  I can remember some discussion previously on Statalist,
but no solution that I could track down.  Maybe I've missed something

One approach, that I have just discovered, is to use
the Symbol command from the Insert menu within Word.
Then choose font arial and subset "basic Greek" to find "mu"; copy and
paste
it into your Stata command as desired.
"superscript 2" is given similarly in the subset Latin-1.
As these symbols are likely to cause problems on some e-mail servers, I
have not inserted them here.















*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index