TITLE: Which comma categories are topoi?
QUESTION [17 upvotes]: It is well known that for a topos C and an object x of C, the
slice category C/x is also a topos ("topos" here as "elementary topos").
Now there is the more general concept of a comma category (F,G), with
functors F:A->C, G:B->C. I believe that there are reasonable generalisations
of the above fact, but I can't find anything in the literature.
So my question: Which criterions are known for functors F, G, so that
the comma category (F,G) is a topos?

REPLY [15 votes]: The Artin gluing of a functor $G\colon B \to C$ is the comma category $(1_C \Downarrow G)$ (or in the notation of the question, $(1_C, G)$).  If $B$ and $C$ are toposes and $G$ preserves pullbacks, then its Artin gluing is also a topos.  
I learned this from:

Aurelio Carboni, Peter Johnstone, Connected limits, familial representability and Artin glueing.  Mathematical Structures in Computer Science 5 (1995), 441-459.  Corrigenda: Mathematical Structures in Computer Science 14 (2004), 185-187.

They attribute the result to:

Gavin Wraith, Artin glueing.  Journal of Pure and Applied Algebra 4 (1974), 345-348.

According to Carboni and Johnstone, Wraith proved it under the hypothesis that $G$ preserves all finite limits, but they add that it was observed very soon afterwards (by whom, they don't say) that it's enough to assume that $G$ preserves pullbacks.
(Incidentally, I don't know what that extra "e" in "glueing" is doing there.  My dictionary says that's wrong.)
The strengthened version of Wraith's result includes the famous result on slices, since if $B = 1$ then a pullback-preserving functor $B \to C$ is just an object $c$ of $C$, and its Arting gluing is then $C/c$.