H II regions are ionized clouds of gas associated with zones of recent star formation. They are powered by one, a few, or a cluster of massive stars (depending on the resolution at which one is working). The effective temperatures T of the ionizing stars lie in the range 35000 - 50000 K. The nebular geometries result from the structure of the parent molecular cloud. Stellar winds, at evolved stages, may produce ring-like structures, but the morphology of H II regions is generally rather complex on all scales. Typical hydrogen densities n are 103 - 104 cm-3 for compact H II regions. The average densities in giant extragalactic H II regions are lower, typically 102 cm-3 since giant H II regions encompass also zones of diffuse material. The total supply of nebular gas is generally large, so that all (or at least a significant fraction) of the ionizing photons are absorbed.
Planetary nebulae (PNe) are evolutionary products of so-called intermediate mass stars (initial masses of 1 - 8 M) as they progress from the asymptotic giant branch (AGB) to the white dwarf stage. It is the interaction of the slow AGB wind with the fast post-AGB wind which produces the nebula. Because the ionizing star is also the remnant of the PN progenitor, the morphology is much simpler that in the case of H II regions, although not all PNe are round! The temperature of the central star - or nucleus - can be much higher than that of main sequence massive stars, reaching values of the order 200000 K for a remnant of about 0.6 M. The densities of the brightest (and therefore best studied) PNe are around 103 - 105 cm-3. PNe of lower densities, corresponding to more evolved stages, are fainter and therefore less observed. The amount of nebular gas is not always sufficient to trap all the stellar ionizing photons, and a significant part of these may leak out from the nebula.
This brief introduction points at two things. One is that the ionized plasmas in H II regions and PNe are similar from the physical point of view, and therefore can be analyzed with similar techniques (although the range of physical conditions is somewhat different). The other is that the astrophysical significance of the chemical composition in these two classes of objects is not the same. H II regions probe the state of the gas at the birth of massive stars (i.e. a few Myr ago). The status of the chemical composition of PN envelopes is more complex. Some constituents have not been changed and reflect the state of the gas out of which the progenitor of the PN was formed, 108 yr ago or more. Other elements, such as carbon and nitrogen, have had their abundances strongly affected by nucleosynthesis and mixing processes in the progenitor, and therefore probe the evolution of intermediate mass stars.
The text presented below is based on lectures given at the XIII Canary Islands Winterschool on Cosmochemistry, where I have been asked to review the status of abundances in planetary nebulae (both Galactic and extragalactic) and in Galactic H II regions. Abundances in extragalactic H II regions were treated by Don Garnett, and the determination of the primordial helium abundance using low metallicity H II galaxies was discussed by Gary Steigman. In my lectures, I have emphasized the methods for abundance determinations in ionized nebulae. In this respect, giant extragalactic H II regions provide interesting complementary information and methods used for giant H II regions were included for completeness.
The scope of this article is as follows. Section 1 summarizes the basic physics of photoionized nebulae, Section 2 presents the different families of methods for abundance determinations. Section 3 discusses the various sources of uncertainties. Section 4 outines some important recent results on abundances in the Milky Way H II regions, including ring nebulae. Section 5 presents a selection of recent results on abundances in planetary nebulae, that are relevant to our understanding of the chemical history of galaxies or of the nucleosynthesis in intermediate mass stars. Due to limited space (and limited knowledge!), Sections 4 and 5 are not to be taken for extensive reviews. A large amount of interesting work could not be mentioned here. This text is rather to be understood as a guide line for the astronomer interested in nebular abundances, either to embark on his own abundance determinations or to be able to better understand the literature on this topic. The papers quoted below were preferably chosen among recent studies published in refereed journals. A few pioneering, older studies are occasionally mentioned.