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.

Now when I merge two cells with right-click "Merge Cells", they merge with the results included, while I only want the commands merged. Can I make it a one-click button?

Now I have to delete the results first then merge.

share|improve this question
    
Go to Cell->Delete All Output, then merge. –  bill s Oct 25 '13 at 0:21
    
Where do you want the output to go? –  Mike Honeychurch Oct 25 '13 at 0:21
    
I want to merge the commands and don' t care about the output. –  xgdgsc Oct 25 '13 at 0:31
    
@xgdgsc "I don't care" is not precise statement. Unless you really meant this, that the output can disappear or not or change the background to Red... Is it so? –  Kuba Oct 25 '13 at 6:02

1 Answer 1

up vote 1 down vote accepted

First select just the input cells. command-click will do this on OS X, but I don't know what the Windows equivalent is. Your selection should look like this

before.png

Then, with the mouse cursor on one of the blue highlighted cell brackets, right click and select Merge Cells. This produces

after.png

share|improve this answer
    
It is valid. for windows and linux with Ctrl+click. However, I' m usually too lazy to select the small command cell, I usually just select the sequential outer cells with a mouse slide . What I really want is selecting the outer cells and merge without output. Thanks, though. –  xgdgsc Oct 25 '13 at 0:45
1  
@xgdgsc. I can't imagine that what you ask for in your comment is possible. What you describes selects both the input and output cells. How do expect Mathematica to know you don't really mean that? Do you expect it to read your mind? –  m_goldberg Oct 25 '13 at 0:50
    
@xgdgsc Probably what you want is possible to achieve by creating your own Palette with button which will select inside of the current selection only Cells with the Input style and then evaluate FrontEndExecute[FrontEndToken["CellMerge"]]. It is probably even possible to assign a keyboard shortcuts to this by modifying the KeyEventTranslations.tr file. –  Alexey Popkov Oct 25 '13 at 11:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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