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.

Trying to do some basic algebra here, have input 12 expressions. I would like to label the output so that I can connect the outputs to the context of the inputs, within the output line.

Having no luck finding anything related to this via web search, or searchboxes within Mathematica's documentation.

Generally when I do find something that appears relevant by such searches and try it, the error messages generated do not convey anything I can extract any sense from.


Incorporating Nasser's comment:

additional info from user5997 via email to help others:

Long list of expressions in one input cell. Evaluate notebook. Want to quickly find output for nth input of m total lines. Currently settling for adding semicolon at end of all other input lines. Would really like to preface output with string representing input expression, line by line, so sort of interleaving output line with corresponding input code. Not sure if this makes it any clearer. I do appreciate the help

share|improve this question

closed as not a real question by Jens, Rojo, m_goldberg, Yves Klett, Oleksandr R. Feb 22 '13 at 13:11

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
How about an example code of what you're trying to achieve? –  RunnyKine Feb 22 '13 at 2:55
2  
I couldn't understand what you are trying to do –  Rojo Feb 22 '13 at 3:08
    
@Rojo He already told you: "Trying to do some basic algebra" –  belisarius Feb 22 '13 at 3:28
    
(1) x1=5 (2) x2=x1^2-3 (3) x3=x1-x2^4 –  rexacoatl Feb 22 '13 at 3:54
1  
...I don't understand why you don't put the expressions into multiple input cells? –  Rahul Narain Feb 22 '13 at 7:40
show 2 more comments

1 Answer

Each of the methods I described here are adaptable, as the question that answers is a more specific version of this one. Illustrating the first:

$Pre = Function[expr, Print["Input: ", HoldForm@expr]; expr, HoldAll];

Now evaluating these lines in a single cell:

2 + 2
a^2 + 15*4^2
Sin[2 Pi]
Log10[100/10]

Mathematica graphics

share|improve this answer
    
Thank you, that does allow me to keep track of which result I need to grab for a specific purpose. –  rexacoatl Feb 22 '13 at 16:48
    
Thank you, Mr. Wizard. That does work for easily finding the result I need for a particular purpose. My apologies to all who found my description vague &c. –  rexacoatl Feb 22 '13 at 16:51
    
@user5997 I'm glad it helps. Please consider updating your question to be more clear and specific. Also, you may be interested in this. –  Mr.Wizard Feb 22 '13 at 23:29
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.