Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to represent expressions mostly in unevaluated form, but being able to evaluate it's subparts.

For example, how to evaluate only arguments, but leave topmost expression unevaluated?

For example, so that

1 + Cos[0]

give

1 + 1

UPDATE

I want Mathematica to act something like follows.

If I write

<something> 1 + Cos[0]

it should respond with

<something> 1 + Cos[0]

i.e. having expression as is, unevaluated

Then if I enter something

<something> 1 + Evaluate[Cos[0]]

it should respond with

<something> 1 + 1

I.e. I want to CONTROL evaluation, not allowing Mathematica to evaluate what it wants. Only what I want.

Imagine gradual scholar math text where expression is converted gradually portion by portion and presented at intermediate stages.

Since I don't know how it can be implemented, I am not describing this with much detail. It can be some combination of holding heads or some global modes turnable on and off.

The goal is not to loose my work done while entering long expressions, which Mathematica tends to throw out by evaluating.

The solution should not be complex like in referred answer, it should be some simple built-in feature.

share|improve this question

marked as duplicate by Jens, chris, Oleksandr R., m_goldberg, Sjoerd C. de Vries Jun 16 '13 at 22:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
$\sin\,0\neq 1$. –  J. M. Jun 16 '13 at 16:48
1  
@Jens What is being requested is not quite the same, I think. But the question is ill-formed. The general answer seems to be to use something like Trott-Strzebonski technique: 1,2,3. –  Leonid Shifrin Jun 16 '13 at 18:21
    
@LeonidShifrin Maybe - I don't know what it means to "give" 1 + 1. What is the context? Surely, one can't expect that this is supposed to happen globally to all expressions entered by the user? –  Jens Jun 16 '13 at 19:02
    
@Jens I don't know either. This is why I said that I think the question is ill-formed. –  Leonid Shifrin Jun 16 '13 at 19:15
    
Check Leonid's advice. For example, Hold[expr]/.c_Cos:>Block[{},c/;True] –  Rojo Jun 16 '13 at 20:58

Browse other questions tagged or ask your own question.