Schmitt gate is formed by R1, R2, R3, R4, Q1 and Q2. 
Before we start writing equation, we need to qualitatively understand how this circuit works. One of the ways to understand it is start with the input at 0.0 V.  then gradually increase the input voltage. Then on second half, we need to start with the input at Vcc and decrease the input voltage to 0.0V.
When the input is 0.0V, we see that Q1 is off because there is not enough Vbe to turn Q1 on. So we look at R2, R3, R4 and Q2. Q1 is off and R1 is not conducting current thus we can ignore both Q1 and R1 initially.  And we can calculate the operating point of Q2's base voltage, emitter voltage and Vhys voltage. See  figure 1. 
When we begin to increase Vin, we see that Q1's Vbe will be increasing but no current will be flowing through Q1 until Vin is sufficiently high and Q1 barely turns on. When this happens current starts to flow through Q1 and pulls the voltage down on the collector of Q1 and the base of Q2. Since Q2's base voltage just dropped by a small amount, the current flowing out of Q2's emitter  and through R4 drops by a small amount. But this causes a drop in the voltage across R3 because current for R3 was supplied by R4 and it decreased. You might ask but Q1 is  now supplying the current through R1 and wouldn't that cancel out the loss of current from Q2? To some extent this is true but Q1 is acting as an amplifier and the voltage swing on Q1's collector (Q2's base) is going to be bigger than input voltage rise on Q1. So the current flowing through Q2 decreases much more rapidly than the increase in the current flowing through Q1. Net effect is that less current is flowing through R3.
Less current through R3 causes a drop in the voltage on Vhyst and causes a drop in the emitter voltage of  Q1. The end result is that even though the input voltage increased to when Q1 begins to conduct, it caused a reaction whereby the emitter voltage of Q1 dropped. So Q1 turns on harder and the whole process repeats itself until Q2 turns off and Q1 goes into saturation. A positive feedback. 
------
Lets look at the input at Vcc then works its way down from Vcc. 
Q1 is saturated. We will prove this when we analyze the circuit. Until Q1 comes out of saturation, Q1's collector voltage will follow Vin and Q1's collector, Vout, will track Vin. Q2 will be conducting current. Vhys will be dropping because Q1's base voltage is dropping and Q2's base voltage is dropping. This will continue until Q1 comes out of saturation. When Q1 comes out of saturation, Vout, instead of dropping with decreasing Vin, will now begin to increase. Increase in Vout, increase in the base voltage of Q2 will cause the emitter of Q2 to increase and more current will flow into R4 and the increased current will then flow into R3 thereby increasing  Vhys. Voltage across R1 drops because input voltage was dropping while Vhys was increasing. Less voltage drop across R1 and we have less current through R1. Less current in R1 causes less current to flow in R2 thereby increasing Vout. And the cycle repeats until Q1 is turned off with no current flowing and Vout rises to near Vcc.  Again a positive feedback but this time with Q1 turned off and Vout voltage nears Vcc. 
-------
So now we look at how to solve this problem. It's a two part problem when the input goes from ground toward Vcc and the second half is when the input goes from Vcc toward ground.
We look at input going from ground to Vcc  See Figure 1:
In this state Q1 is off initially and no current is flowing through R1. We solve for the operating point of the circuit. See figure 1.
R2 is providing a base current to Q2 and the emitter current is providing the current to R4 and R3. R4 and R3 forms a voltage divider. We also know that emitter current is beta times the base current.  Follow the current path and add the voltages to ground and this should equal Vcc voltage.
 Vcc = R2* Ib  + Vbe(Q2) + R4 *  Ie + R3 * Ie 
Ib is the base current of Q2; Ie is the emitter current of Q2; Vbe(Q2) is the voltage across Q2's emitter and the base (positive if base voltage is higher than the emitter voltage). Ie is equal to Ib * beta and substitute for Ie. 
Vcc = R2 * Ib +Vbe(Q2) + (R4 + R3) * Ib * beta
For simplicity we will assume a beta to be 100  and Vbe(Q2) to be 0.7V since its conducting fair amount of current. And we have Vcc equal to 3.3 V
3.3 = 47K * Ib + 0.7 + (1.5K + 4.7K) * Ib * 100
solve for Ib
Ib = (3.3 - 0.7) / (47K + (1.5K + 4.7K) * 100) = 3.89uA
and Ie = Ib * 100 = 3.89uA * 100 = 0.389mA
Vhys is the voltage across R3 from the current flowing through it. Since Q1 isn't flowing any current, only current is that of Ie from Q2.
Vhys = Ie * R3 =0.389mA * 4.7K = 1.83V.
so the emitter voltage of Q1 is sitting at 1.83V
-----------------
The point when Q1 begins to conduct current is when Q1's Vbe reaches 0.7V. Since no current is flowing through R1.  Emitter of Q1 is at 1.83V.  Thus, input voltage required to cause the circuit to change is 1.83V plus 0.7V or 2.53V. (typically bipolar transistor begins to conduct current when Vbe is around 0.65V so with 0.65V the input voltage required is 1.83V + 0.65V or 2.48V. Much closer to the simulator result).
My simulator said its around 2.484V. So its pretty close. 

Now we will look at situation when the input voltage comes down from Vcc to ground.

What we want to find out is when does Q1 comes out of saturation. That is the voltage for the circuit to trip and Vout to rise through positivie feed back to near Vcc. See Figure 2. Calculation is slightly more involved because both Q1 and Q2 are conducting current. 

We want to calculate the input voltage when Q1 comes out of saturation. This happens when collector current of Q1 equals the emitter current of Q1. Approximate it from basic transistor current equations when operating normally. Ic=Ib x beta; and Ie = Ib + Ic so 
Ie = ib * (beta +1). For aprroximation, we let Ic equal Ie. 

Current through resistor R2 is (Vcc - (Vin – 0.7V + Vsat))/R2
Current through resistor R1 is ((Vin - 0.7V) -  Vhys)/R1

Before we go further, we should replace the Vbe on voltage of the transistor from 0.7V to a variable phi. This way, we do not lose some important facts later. 

Current through resistor R2 is (Vcc - (Vin – phi + Vsat))/R2
Current through resistor R1 is ((Vin – phi) -  Vhys)/R1

We also notice that Vin – phi is common to both equations and in later equations, we  let Vin' = Vin – phi. 

Current through R2 is  I(R2) = (Vcc - (Vin' + Vsat))/R2
Current through R1 is  I(R1) = (Vin' – Vhys)/R1

I(R2) = I(R1) is when Q1 comes out of saturation. 
(Vin' + Vsat)/R2 = (Vin' – Vhys)/R1

We need to figure out what Vhys voltage when input is at Vin voltage. We already know what the current is through R1 so we just need to solve for current through R3 then the current through R4 and the voltage Vhys.

Current through R4 is (Vout – phi – Vhys)/R4. But since we are interested right when Q1 comes out of saturation, so Vout is still equal to Vin – phi + Vsat or Vin' + Vsat 

Current through R4 is  I(R4) = (Vin' + Vsat - phi - Vhys)/R4

We know that Vhys  equals the sum of current through R1 and R4 time the value of R3.

Vhys = {I(R1) + I(R4)} * R3 = {(Vin' – Vhys)/R1 +  (Vin' + Vsat – phi - Vhys)/R4} * R2

Solve for Vhys
bit messy but it should be:
Vhys = {1/(1/R1 + 1/R3 + 1/R4)} * {Vin' * ( (R1 + R4)/(R1 * R4) + (Vsat – phi)/R4}

Again Q1 comes out of saturation, when I(R2)= I(R1)

using I(R2), I(R1) and Vhys equation we solve for Vin'

Result is a pretty big equation:
let  M = (R1 * R3)  + (R1 * R4)  + (R3 * R4)

Vin' = {Vcc / R2 + (R3 / M – 1 / R2) * Vsat – (R3 / M) * phi} * { 1/ { (1 / R1 + 1 / R2)  - (R1 + R4) * R3 / (M * R1)} }

With R1=15k; R2=47k; R3=4.7k; R4=1.5K; phi=0.7; Vsat=0.2 tripping point is calculated at 1.873V.  My simulation said 1.882V. Fairly close. Just to see what happens to the tripping point, recalculated with Vsat at 0.3 instead. The new value calculated is 2.086V. 

And if change phi to 0.65 and Vsat back to 0.2, the value would be 1.888V. So you can see just from this that small changes in Vsat, or phi can make big changes in result. This is called sensitivity. Sensitivity to the component values and parameters.

Using MCP9701, it has 0.4V at 0C output and 19.5mV/C change in output per degree C. 
Vt+ is reached when temperature is at (2.53V -0.4V)/19.5mV or 109C give or take about 6C according to the specification of MCP9701.
Vt- is reached when temperature is at (1.87V -0.4V)/19.5mV or 75C. 

This circuit will shut off the constant current source when the temperature of the TIP-120 reaches around 109C and turns it back on when TIP-120 cools to 75C.

---------------

You can see how two transistors and few resistor will allow you to design a schmitt gate. Keep in mind that there are many other way of doing this even in discrete implementation. This happens to be one of the simplist topolgy there is.
When you solved the algebraic equation, you see that the tripping point is dependent on Vcc, component values, phi and Vsat. And saw how much the voltage could shift. Thus this circuit implementation may be one of the simplist, its performance is not necessarily good enough for many application.

And yes you can use an opamp and two resistors.