In general, can a Lagrangian density depend on space-time explicitly? In an exercise on classical field theories, I'm trying to derive the general formula of the Energy-momentum tensor. According to the formula in the lecture notes, this tensor includes a term of minus the Lagrangian density along the diagonal. However, this term does not appear in my derivation unless I assume that the Lagrangian density does not depend explicitly on space-time. 
If I do make this assumption, the term appears as a result of partial integration of the term which is the product of the Lagrangian density and the derivative of the variation parameter with respect to a component of space-time. Doing the partial integration gives us the partial derivative of the Lagrangian density with respect to this space-time component times the variation parameter. But, since we assumed that the Lagrangian density does not depend explicitly on space-time, we might as well ignore this term, and again I do not obtain the diagonal Lagrangian density term. 
In other words, if we assume that the Lagrangian density does not depend on space-time explicitly, this term doesn't actually contribute to the conservation law, so we might as well ignore it. 
So the questions are:


*

*Can the Lagrangian density depend on space-time explicitly, and 

*Why does the Energy-momentum tensor have a diagonal Lagrangian term?
 A: Before going to field theory, it seems instructive to first ask the same questions in point mechanics:

  
*
  
*Can the Lagrangian $L(q,v,t)$ depend on time explicitly?

Yes. The Lagrangian $L(q,v,t)$ can depend explicitly on time. E.g. there could be external sources.
On the other hand, if the Lagrangian does not depend on time explicitly, then the action has a time translation symmetry, which (via Noether's theorem) leads to energy conservation. Let us from now on assume that this is the case$^1$.


  
*Why does the energy function
$$\tag{1}h~:=~p_{i}\dot{q}^{i}-L,\qquad 
p_i ~:=~\frac{\partial L}{\partial \dot{q}^i},$$
have a Lagrangian term?

Well, the energy is defined to be the Noether charge for the time translation symmetry. One would have to go through the standard Noether procedure/method to derive the standard formula (1) for the energy function. This is e.g. discussed on Wikipedia or this Phys.SE post. 
Finally, the above reasoning can be generalized from point mechanics to field theory, where time $t$ is replaced with spacetime points $x^{\mu}$, and where positions $q^i(t)$ are replaced with fields $\phi^{\alpha}(x)$.
--
$^1$ Even in situations with explicit time dependence, we will still use formula (1) as a definition of the Lagrangian energy function, although it will no longer be a constant of motion.  
