Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to create links or bookmarks to jump to sections inside a

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127910] Re: How to create links or bookmarks to jump to sections inside a
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Fri, 31 Aug 2012 04:00:06 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

>I'm trying to make an interactive e-book in mathematica.

>I know how to hyperlink to jump from one notebook to another, or to a helpfile in mathematica using 'hyperlink' symbol http://reference.wolfram.com/mathematica/ref/Hyperlink.html

>but how do I make text click-able which will make it jump to a certain picture inside the nb.

>So for example if I have a cell of text that has the text "Figure 1.1" somewhere in there, I need to be able to click the "Figure 1.1" text like a hyperlink to jump to the figure which is in the same lengthy notebook but in a different section. Is it possible?

>If it is possible, how would I make a stylesheet that would automatically interlink textual "Figure X.X" with the actual picture (by tagging the picture), and then clicking the picture would jump back to the text?



I am aware of three ways to do it.

1.  You can simply create tags to all cells containing your images. You mark the parentheses at the right edge of those cell with your figures that you will want to redirect the reader to,  and go to Menu/Cell/Cell Tags/Add Remove Cell tags which will help you to create the tags. As a second step you make a hyperlink in the text, from where you want to redirect the reader to the figure using  Menu/Insert/Hyperlink. In the dialog you check ?Current notebook? and ?Cells with tags?. In the field to the right you will see all tags of your notebook and will choose the necessary one. Done.

2.  The second way is to use Automatic Numbering mechanism, existing in Mathematica. It is a bit more complex, but it has its advantages beyond only redirecting to figures. For this purpose you also mark each cell containing the picture (in this case, without any exception). When after tagging you start writing the captions for this illustration, you type Fig. and then go to Menu/Insert/Automatic Numbering and use the dialog to choose the tag of your figure. Note that in this case you need to check it both in the Counter at the top, and in the window in the bottom of the dialog.  Have a look at tutorial?AutomaticNumbering and ref/menuitem/AutomaticNumbering and to a recent discussion at the MathGroup.

When you then write your text and give the reference to your figure, you also use the automatic numbering, choosing the tag from the list of the AutomaticNumbering dialog, or simply copy-pasting the number from the caption for the corresponding illustration (where you have already once used this dialog). One side effect of such numbering is that the click on the number of the figure brings you to the cell with this figure. The disadvantage is that the reader may not know this. If you choose this way, a good idea would be to check Menu/Cell/Cell Tags/Show Cell Tags, while you are writing your text. Then all the tags will become visible.

3. The both these approaches have a defect that the reader is taken away from the place, where he reads the text. It may be several (or even several hundreds) pages away, and returning to the text each time may be boring. The possibility to avoid this has been proposed by David Park in his package "Presentations". David has a routine to create a button inserted into an Inline cell in your text body, which will open a separate notebook with the figure in question. This, of course, may be done also without this package, though the use of the package goes far beyond this particular question. For example, you may write something like this:


Button["Show Fig.1", CreateDocument[Column[{

    Row[{
      ExpressionCell[Plot[Sin[x], {x, 0, \[Pi]}], "Output"],

      }],
    TextCell[Style["Fig. 1. This is some explanation ", 12], "Output"],

    Button[Style["Close the window", 16, Blue], NotebookClose[]]

    }], WindowTitle -> "Fig. 1, Short title",
  WindowSize -> {500, 320}]]

Then copy the button that will appear as the result of the execution and paste it into the Inline Cell (Ctrl+9) of your text. You will get a button inserted into your text that opens a notebook with the figure.

Now place the codes for all such buttons that you use into one cell that should be marked as the Initialization cell (Menu/Cell/Cell Properties/Initialization Cell). You may also uncheck the attribute "Open"  in Menu/Cell/Cell Properties/Open, hiding it.  It should be noted that this is additional to the image itself, that is placed on its proper place in the text.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu



  • Prev by Date: Re: Problems obtaining a free c compiler...
  • Next by Date: Re: Landau letter, Re: Mathematica as a New Approach...
  • Previous by thread: split the sublists into parts according to some rules
  • Next by thread: Re: Creating animated 3d graphic in Mathematica for export