Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6927837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:25+00:00 2026-05-27T11:06:25+00:00

I am experimenting with logo designs in Mathematica (8 or above) using the notebook

  • 0

I am experimenting with logo designs in Mathematica (8 or above) using the notebook interface and I want to change the generating formula A LOT. The problem is I only know SHIFT + ENTER which makes me jump outside my current cell and lose my position.

Is there a way to evaluate the current cell without leaving it and losing your position within it? So: Evaluate a cell and land back inside the same cell at the exact position I pressed SHIFT + ENTER at.

What I once came to use was along the lines:

a = Exp[1.994 \[Pi]/(3 I)];

b = Nest[{#, a #, a\[Conjugate] #, #} &, 1, 5];

{Re[#], Im[#]} & /@ 
   Accumulate[
    Flatten[{0, a b, a\[Conjugate] b, -b}]] // {\[Rho]\[Chi], # // 
     Line} & // Graphics

NotebookFind[EvaluationNotebook[], "E" <> "xp", Previous];

but I hope there is just another key combination or sth. that I am not aware of.

Edit:

a = Exp[(*1*)1.994 \[Pi]/(3 I)];

b = Nest[{#, a #, a\[Conjugate] #, #} &, (*2*)1, (*3*)5];

{Re[#], Im[#]} & /@ 
   Accumulate[
    Flatten[{0, a b, a\[Conjugate] b, -b}]] // {\[Rho]\[Chi], # // 
     Line} & // Graphics

Do[NotebookFind[EvaluationNotebook[], "(*1*)", Previous], {2}];

is a nice little improvement to my solution as partly suggested by Chris Dengen.

Edit 2:

NotebookFind[EvaluationNotebook[], "(*1*)", EvaluationCell]

This solves:

  • these only work with cells that produce one or a known number of output cells

EvaluationCell is sparsely documented so hard to find in fact I just stumbled upon it. Using the EvaluationCell the search starts from above (eliminating the Do twice construct) as we do not come from an output cell further down the screen.

What remains to be solved:

  • one needs to do manual cell-keeping (bookkeeping at cell level) to land at places of interest
  • using comment-based landing markers clutters the input cells

Note
This question is about not losing current position when one presses SHIFT + ENTER inside a Mathematica notebook cell. It is not about content or Manipulate. Sorry for not making that clear at the beginning.

Temporary Note

Now trying the following:

  1. use event handlers to define an alternative evaluation key combination
  2. when triggered, find a way to store the exact keyboard position in the current input cell
  3. evaluate the current input cell
  4. restore the position in the current input cell

I internally hope some function might just take care of the store/restore by chance being optimistic. Being realistic though, I first hope I can even find a way to get at the current keyboard position. Will follow up here if anything materializes out of my attempt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:06:25+00:00Added an answer on May 27, 2026 at 11:06 am

    You can run this cell over and over:

    If[NumberQ[x], x++, x = 1];
    Print[x]
    Do[SelectionMove[EvaluationNotebook[], Previous, Cell], {2}]
    

    This version places the cursor after the Exp in line 1:

    a = Exp[1.994 \[Pi]/(3 I)];
    b = Nest[{#, a #, a\[Conjugate] #, #} &, 1, 5];
    {Re[#], Im[#]} & /@ 
       Accumulate[
        Flatten[{0, a b, a\[Conjugate] b, -b}]] // {# // 
         Line} & // Graphics
    Do[NotebookFind[EvaluationNotebook[], "Exp", Previous], {3}];
    SelectionMove[EvaluationNotebook[], "Exp", After];
    

    You could also put Evaluate & move on a key combination, e.g. ctrl+r in the example below. This assignment only lasts for the current session but it can be loaded with pre-initialisation so that it is always present. (The key combo item is added to the Insert menu.)

    FrontEndExecute[
     FrontEnd`AddMenuCommands[
      "DuplicatePreviousOutput", {Delimiter, 
       MenuItem["Evaluate and return", 
        FrontEnd`KernelExecute[Module[{nb}, nb = SelectedNotebook[];
          SelectionMove[nb, Previous, Cell];
          SelectionMove[nb, Next, Cell];
          SelectionEvaluate[nb];
          Do[SelectionMove[EvaluationNotebook[], Previous, Cell], {2}]]], 
        MenuKey["r", Modifiers -> {"Control"}], 
        System`MenuEvaluator -> Automatic]}]]
    

    To set pre-initialisation save the above code to a package .m file as EvaluteReturn.m in your Documents directory and evaluate the following.

    InitializationValue[$PreInitialization] = Hold[Get[
       FileNameJoin[{$HomeDirectory, "Documents", "EvaluateReturn.m"}]]]
    

    To inspect the value

    InitializationValue[$PreInitialization]
    

    To clear the value

    obj = InitializationObjects[$PreInitialization, {"Local"}]
    
    DeleteObject[obj]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experimenting with OpenSSL on my network application and I want to test if
I am experimenting with Ruby and Rails on OS X, using the XCode text
been experimenting with unordered list UL and i have seem varios examples of using
Experimenting with a battery monitor icon at the moment in Python using pygtk and
Experimenting using different approaches and reducing code maintenance I have ended up using reflection
Experimenting with Asynchronous Mail 0.2.1 using Oracle as backing database. Running small test app
I'm currently experimenting with generating sounds in Python, and I'm curious how I can
Was experimenting with interface inheritance and found this: interface String{} interface Object{} interface Exception{}
I experimenting with writing Vista/W7 gadgets. In my experiment I want to write the
Experimenting with Scala... I'm trying to define something analogous to the @ hack in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.