Nimitta - sutta references Please provide references from the Pali suttas on nimitta.

Are they mentioned in the context of jhana?

In the article below, it is mentioned that nimitta is found in the Anapanasati Sutta, but I couldn't find it. Is it there?

In the article "Stepping Towards Enlightenment", Ajahn Brahm wrote about nimitta:


  THE NINTH STEP OF the Anapanasati Sutta describes a very important
  creature that comes to visit the still, silent mind—a nimitta. Pali
  for “sign,” a nimitta is a reflection of the mind. This step is called
  citta-patisamvedi, “experiencing the mind,” and is achieved when one
  lets go of the body, thought, and the five senses (including awareness
  of the breath) so completely that only a beautiful mental sign, a
  nimitta, remains. This pure mental object is a real object in the
  landscape of the mind, and when it appears for the first time it is
  extremely strange. For most meditators this mental joy, is perceived
  as a beautiful light. But it is not a light. The eyes are closed, and
  the sight consciousness has long been turned off. Other meditators
  choose to describe this first appearance of mind in terms of a
  physical sensation such as intense tranquility or ecstasy. It is
  perceived as a light or a feeling because this imperfect description
  is the best that perception can offer.
SN 35.120:

Sujato


  ...And how does someone guard the sense doors?
  -- When a mendicant sees a sight with the eyes, they don’t get caught up in the features and details.
  (Idhāvuso, bhikkhu cakkhunā rūpaṃ disvā na nimittaggāhī hoti nānubyañjanaggāhī.)  


Bodhi


  ...And how, friend, does one guard the doors of the sense faculties?
  -- Here, having seen a form with the eye, a bhikkhu does not grasp its signs and features.


This is not in the context of jhana. The word seems to be used synonymically with "feature" or "detail". The other word, nānubyañjana (Sanskrit anuvyañjana) means "a secondary or minor characteristic, a secondary attribute, mark or sign".



Also, MN138

Sujato:


  Take a mendicant who sees a sight with their eyes [, hears a sound etc]. Their consciousness follows after the features of that sight [sound, odor etc.] and gets tied, attached, and fettered to gratification in its features. So their consciousness is said to be scattered and diffused externally.
  (Idhāvuso, bhikkhuno cakkhunā rūpaṃ disvā rūpanimittaanusāri viññāṇaṃ hoti rūpanimittassādagadhitaṃ rūpanimittassādavinibandhaṃ rūpanimittassādasaṃyojanasaṃyuttaṃ bahiddhā viññāṇaṃ vikkhittaṃ visaṭanti vuccati.)


Here, Mahākaccāna elaborates on a phrase uttered by Buddha that "A mendicant should examine in any such a way that their consciousness is neither scattered and diffused externally nor stuck internally, and they are not anxious because of grasping." Here, the piece about nimitta is a detailed exposition of how consciousness gets "scattered and diffused externally". 

The consciousness "follows after the features" of a rupa, and gets "tied, attached, and fettered" to gratification in the rupa's features.

Here again, the meaning seems to be that nimitta is a specific attribute of a visual object, sound, odor, flavor, tactile sensation, or a mental phenomenon (dharma).



Also, in Visuddhimagga:


  All [saññā] has the characteristic of recognition [sañjānana]; its property is the making of nimitta that is a condition of recognizing again, 'this is the very same thing' [...] its manifestation is the producing of conviction by virtue of a nimitta that has been accordingly learnt - [...] its basis is whatever object that has come near - like the recognition [saññā] 'people' that arises for young animals in respect of scarecrows.


Here it becomes clear that nimitta can play role of an identifying feature that the mind learns to associate with an object, in order to recognize it again.



In SN 46.51 Buddha speaks about nimitta in context of two of the five lower fetters, sensual desire and ill-will:


  And what fuels the arising of sensual desire, or, when it has arisen, makes it increase and grow?
  There is the feature of beauty.
  (Atthi, bhikkhave, subhanimittaṃ.)
  Frequent improper attention to that fuels the arising of sensual desire, or, when it has arisen, makes it increase and grow.


In MN 5, the word is used in a similar context:


  Take the case of the person who doesn’t have a blemish [sāṅgaṇa - issue, flaw] but does not understand it. You can expect that they will focus on the feature of beauty, and because of that, lust will infect their mind.
  Tatrāvuso, yvāyaṃ puggalo anaṅgaṇova samāno ‘natthi me ajjhattaṃ aṅgaṇan’ti yathābhūtaṃ nappajānāti, tassetaṃ pāṭikaṅkhaṃ—subhanimittaṃ manasi karissati, tassa subhanimittassa manasikārā rāgo cittaṃ anuddhaṃsessati;




P.S.

As you can see, in most if not all cases, the word is used in context of phenomenology of perception and the resulting emotional response - not in context of jhanas. And yet, in Theravada tradition there is a definite case of using the word to refer to experiences arising in meditation. Why?

Here is my theory:

One of the key doctrines the Buddha established is the doctrine of this-that conditionality. In my understanding, this doctrine does not refer to mere causality, but to the mutual co-definition of the object and its counterpart. For example, when we identify an object, we implicitly identify its background. When we identify "top" we implicitly identify the middle reference point etc.

This mechanism is behind everything: The 2nd and 3rd Noble Truths define suffering as counterpart of craving. Dependent Origination relies on this-that-conditionality for explanation of how development of the mind that recognizes external forms and learns to act in pursuit of them leads to development of Self as the counterpart.

So, in context of meditation, I think the idea is for the meditator to learn to see both the sign and its counterpart at the same time. This counterpart is dubbed "reflection of the thought" or "the mirror". Once this ability is acquired and refined, the meditator can directly see his or her issues that lead to suffering, and completely overcome them.