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 have a rather large notebook, which contains a lot of hyperlinks to different parts of the notebook.

Is it possible to make a back button (maybe as a docked cell button?) so that when a reader clicks a link and is moved up or down in the document, then he can click the button and then return to the location of the link?

share|improve this question
1  
This sounds possible, but you'll get faster and better responses it you "seed" the discussion with some examples you've tried. –  Jagra Aug 15 '13 at 16:15
    
The Mac version of Mathematica has a back button in the toolbar. –  Mike Honeychurch Aug 15 '13 at 22:20
    
The Help notebook toolbar also has back (and forward) buttons. You can see the code for this toolbar by executing FrontEndResource["FEExpressions", "HelpViewerToolbar"] and the ButtonFunction for the back button is FrontEndToken[FrontEnd`ButtonNotebook[], "HyperlinkGoBack"]. –  MikeLimaOscar Aug 20 '13 at 8:22
    
@Mike Why don't you post an answer? –  Mr.Wizard Feb 2 at 1:19

1 Answer 1

A simple back button can be implemented using

Button["Back", FrontEndToken[FrontEnd`ButtonNotebook[],
 "HyperlinkGoBack"], Evaluator -> None]

The Evaluator -> None option ensures that this is processed by the Front End.

I'll leave it to the OP to work out how to turn this into a docked cell (if they haven't already done so some time ago!).

For a more sophisticated button, this is a modification of the help toolbar code I mentioned in my comment to the OP:

Tooltip[DynamicModule[{$CellContext`destination$$ = 0}, 
      Dynamic[If[FEPrivate`HistoryList["Back"] === {}, 
        Button[Import[
          FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd",
             "SystemResources", "Bitmaps", "Toolbars", "DocCenter", 
            "DisabledBackIcon.png"}]], Enabled -> False, 
         Appearance -> None, FrameMargins -> 0], 
        Button[PaneSelector[{True -> 
            Import[FileNameJoin[{$InstallationDirectory, "SystemFiles", 
               "FrontEnd", "SystemResources", "Bitmaps", "Toolbars", 
               "DocCenter", "BackIconHot.png"}]], 
           False -> 
            Import[FileNameJoin[{$InstallationDirectory, "SystemFiles", 
           "FrontEnd", "SystemResources", "Bitmaps", "Toolbars", 
           "DocCenter", "BackIcon.png"}]]}, 
      Dynamic[CurrentValue["MouseOver"]]], 
     FrontEndToken[FrontEnd`ButtonNotebook[], "HyperlinkGoBack"], 
     Evaluator -> None, Appearance -> None, FrameMargins -> 0]]], 
  DynamicModuleValues :> {}], "Go back"]
share|improve this answer
    
@Mr.Wizard Was your prompt part of a general purge of unanswered questions? –  MikeLimaOscar Feb 2 at 13:27
    
It's me who is doing the slaughter. Relaxing thing when I'm bored :p –  Kuba Feb 2 at 13:33

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.