41

I use Mma mainly to solve relatively small problems.

I want to start using it also to prepare my presentations and documents, but I am having troubles to learn how to do it from the embedded help, and I guess some good resources may be available elsewhere.

Do you know any useful pointers (books, papers, videos ...)?

Do you have a "bag of tricks" to post here?

Edit

This question received two answers so far (@mzabsky's and Mr.Wizard's) and although both are useful, perhaps my concerns are much more basic. So I am posting an example of the kind of things I am unable to do (or understand how to discern how others did them).

I took the following example from The Mathematica Journal (the notebook at the left on the following image - click on the image to see full size):

Enter image description here

So, some issues, just to get the idea of my troubles:

1) I copied the text to my .nb on the right, formatted it with the same style (text), but the appearance is different, so I guess the style definition is different. How can I copy the style definitions from one .nb to the other?

2) The table below the text block doesn't have an attached style. How was it formatted? Where is the background color defined?

I would like pointers to read (or videos to look, or whatever) about these issues. I don't want you to write down here a book on Mathematica formatting!

Summary of the links posted in answers

Dr. belisarius
  • 60,527
  • 15
  • 115
  • 190
  • Here's a couple of links from library.wolfram: [Tips for Mathematica Slide Show Presenters](http://library.wolfram.com/infocenter/TechNotes/5299/), [How to - Automatic Slide Show](http://library.wolfram.com/infocenter/MathSource/6282/), [Create a Lecture Notebook](http://reference.wolfram.com/mathematica/howto/CreateALectureNotebook.html) – Simon Feb 21 '11 at 05:58

4 Answers4

21

I use Mathematica to take lecture notes in real time without any major issues (while the proud TeX guys struggle hard to keep up :) ). I have also used it for most math-related homework/assignments I wrote during past two and half years on university.

Before you start, you may want to look at some of these video tutorials.

Also, a few recommendations from me:

  • Keyboard shortcuts are the key to type fast. Ctrl+9 for inline math cell, Ctrl+6 for superscript, etc.
  • Learn symbol identifiers for the "esc - symbol - esc" notation. "sum" for Sum, "es" for empty set...you can find list of these in the Mathematica documentation. I have encountered only very few symbols I wanted to type that don't have the esc notation name (for example, leftwards double arrow or double right tee).
  • Type all math-related stuff into inline math cells. The math cell will do some of the math related formatting for you - put spaces where they belong, render all variables and symbols in italics, etc.
  • Use the preformatted templates found in "New"->"Styled Notebook".
  • Do not use ENTER for breaklines, individual paragraph should go into separate text cells (Ctrl+Shift+D) so Mathematica can break the content into individual pages/slides correctly.
  • In-built Mathematica PDF export sucks big-time; I use CutePDF printer for this.

Also, save often and back up often (Dropbox/Syncplicity are the ideal solution), one misplaced keyboard shortcut can turn hundred hours of work worth document into a goulash (trust me, been there) :)

Example of lecture notes I took in real-time during lecture (it is in Czech, but that doesn't matter much).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Matěj Zábský
  • 16,909
  • 15
  • 69
  • 114
  • @Simon I think he easily beats my Champollion-class hand written notes :D – Dr. belisarius Feb 20 '11 at 22:49
  • Impressive note taking! I don't think I could all this in real time. But then again, couldn't you just photograph the powerpoint or white board? Gives you time to think about the presentation instead of just typing it. – Sjoerd C. de Vries Mar 28 '11 at 12:12
  • 1
    I knew a student at a class I took once who would also type directly into Mathematica during lectures using his labtop. He was very good with keyboard shortcuts and such, and he would keep up with easily. The rest of us were old fashioned students using pen and paper. I never understood how he can do it. I find it hard to use a laptop even when I have to type slowly since the keyboard is so small. – Nasser Jun 08 '11 at 03:06
  • Do you know if there is a way to refer to NumberedEquations? I like how I can have a cell with the style NumberedEquation but I was wondering if there's some sort of label to append to the equation so that in case we move the order of the equation then we don't have to go through the text changing all the references to the equation. The more I learn about Mathematica the more I'm planning on using it to replace latex but I still want to have a quick access to latex for the times when I collaborate with others using Latex. – jmlopez Jul 29 '11 at 05:57
  • @jmlopez: Go to the menu item "Insert" > "[Automatic Numbering](http://reference.wolfram.com/mathematica/tutorial/AutomaticNumbering.html)". This can be used for all sorts of numbering, from equations, sections and chapter/titles. You can refer to the current value of a counter or to a cell with a particular cell tag - which you can [add/remove](http://reference.wolfram.com/mathematica/ref/menuitem/AddRemoveCellTags.html) using the context (right-click) menu. – Simon Aug 05 '11 at 13:35
  • @Simon, I sort of figure that out after asking the question. This is a really nice feature I like. Have you taken a look at my most recent [question](http://stackoverflow.com/questions/6870435/numbered-equations-formulas)? I now understand how to make good looking documents in Mathematica but I would like to be able to export it to LaTeX. There has to be way, I recently found a [question](http://www.mathkb.com/Uwe/Forum.aspx/mathematica/7678/LaTeX-and-the-ConversionRules-option) that talks about this but I've had no luck making MMA preserve the cross references in LaTeX. – jmlopez Aug 05 '11 at 14:48
  • @jmlopez: I had a play with your question, but could not get cross referencing correct because the "ConversionRules" option doesn't seem to pick up cell options - thus no cell tags. I probably should have posted a comment, but I forgot... In the post you link to, they say that Publicon uses button boxes to handle cross references - probably to get around the above limitation. So there might not be an easy way of getting Mma to to export TeX crossrefs correctly. – Simon Aug 05 '11 at 23:36
  • Could you show us your source code?(.nb), I want to know how to make this good-looking and easily-made notes. – ZK Zhao May 09 '14 at 10:20
  • @cqcn1991 I never wrote the code by hand. I used one the templates supplied with Mathematica (I don't have Mathematica installed right now, so I can't tell you how exactly which) and then I IIRC used the "split cell" tool to clone the included headings and sections (yes, it is quite some time since I last used the program :) ). The file is here: http://www.mediafire.com/view/4oh15c7ubbawiji/LA_II_-_poznamky.nb – Matěj Zábský May 10 '14 at 11:16
8

I agree with all that mzabsky said in his answer. Here's a few of extra things:

I find it useful to make statements using a Text or DisplayFormula cell then manually group a Mathematica check/proof to the statement which is then collapsed and can be displayed when you want.

The Writing Assistant Palette has quite a few useful constructions in it that you can learn from.

Finally, I found it really useful to make my own style sheet for a couple reasons: 1) the built-in ones are a bit ugly; 2) it really helps you to understand how the notebooks work.

To see examples of the stylesheet I made (which I don't claim to be perfect - I didn't bother making it work in all screen environments) look at some of the files in ftp://ftp.physics.uwa.edu.au/pub/MATH2200/2010/. I use a similar stylesheet in all of my notes - I have many research projects primarily contained in Mma notebooks, eg http://arxiv.org/abs/1102.3043.

Like Mr Wizard, I also recommend David Park's notes as a starting point. Also, you should study stylesheets that you like by going to the Format menu and clicking "Edit Stylesheet". Don't forget to follow the links through the cascade of stylesheets (version 6 onwards).

To answer the questions in your edit: Once you are viewing a notebook's stylesheet, you can save it, edit it, and use it in your own documents. Stylesheets in $UserBaseDirectory/SystemFiles/FrontEnd/StyleSheets are automatically available in the menu. You can then use that stylesheet in any notebook by simply selecting it from the menu.

The formating in the screenshot that you posted is all contained in the stylesheet. This includes the grey background in the table.

Addendum:

When distributing notebooks to others, if the stylesheet is external from the notebook, then other people will not see it as you do. To include the stylesheet into the current notebook, you need code like

ss = StyleDefinitions /. Options[EvaluationNotebook[]]
fn = ToFileName[{$UserBaseDirectory, "SystemFiles", "FrontEnd",  "StyleSheets"}, ss]

If[FileExistsQ[fn],
     style=Get[fn];SetOptions[EvaluationNotebook[],StyleDefinitions->style];,
     Print["Can not find file"]]

(Assuming the file is in stored in the conventional place)

Here's an EmbedStylesheet.m that is an improved version of the above.

Simon
  • 14,631
  • 4
  • 41
  • 101
  • Thanks a lot. I guess there is enough info and examples to get me started. Let's see if I can abandon my ugly powerpoint habit! – Dr. belisarius Feb 21 '11 at 02:38
  • @belisarius - note, that I'm not necessarily recommending using Mma for presentations. It depends on the presentation. For some, [beamer](http://en.wikipedia.org/wiki/Beamer_(LaTeX)) or [S5+instiki](http://golem.ph.utexas.edu/wiki/instiki/show/S5) might be better. – Simon Feb 21 '11 at 05:10
  • Note taken. I usually present a mixed math & business mess that is not easily digested by powerpoint, so I am starting to explore alternatives. LaTex based sort of things are almost discarded because my business oriented colleagues will be lost there. So I thought setting up a reasonable presentation development environment with Mma. It'll be a long way till I can manage my team there, but I've to start some day. Thanks for the note, indeed. – Dr. belisarius Feb 21 '11 at 05:44
4

A Mathgroup thread on embedded stylesheets, particularly here (John Browne) and here (David Park and Selwyn Hollis) might be of interest.

I find stylesheets problematical. In particular I don't like having to remember to embed a stylesheet before I give the notebook to someone else, or before I try to print from an unfamiliar computer. However, along with David Park's tutorial (referenced above by Mr Wizard), I find this advice from Bob Ueland very useful.

681234
  • 4,214
  • 2
  • 35
  • 42
  • 1
    Thanks! Also look at @Simon's code here http://stackoverflow.com/questions/5058854/using-mathematica-to-build-presentations-and-documents/5061599#5061599 to embed the stylesheet. – Dr. belisarius Feb 21 '11 at 13:14
3

If you browse the back-issues of The Mathematica Journal you will see that articles are available in Notebook format. These may be a useful reference.

Edit

I cannot recall a good formatting tutorial at the moment. You can use Show Expression (Win: Shift+Ctrl+E) to view the code expression for a block, such as the table in your example. While one may not enter code by hand in the same form, it can give indications of the options or methods that are used. Code can also be procedurally produced as needed.

I will add links as I find or recall them.

David Park's StyleSheet creation notes

Tips for Mathematica SlideShow presenters

These are brief, but may still be useful:

Notebook formatting

Presentations with Mathematica

Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
  • @Mr. Thanks for the pointers. I already knew the Journal, and also explored some docs by others, but my problem is that I am not able to realize how the formatting is done. – Dr. belisarius Feb 20 '11 at 23:30
  • @mzabsky yes, but that is only one style of document. It may also not be trivial to find the .nb file for the help topic you are viewing, to view or edit (though I am sure it is for belisarius). – Mr.Wizard Feb 20 '11 at 23:36
  • @belisarius, since one can view the .nb file code, do you mean the keyboard shortcuts, input aliases, etc.? – Mr.Wizard Feb 20 '11 at 23:39
  • The second link on your edit contains the kind of information I am looking for. Nice find! – Dr. belisarius Feb 21 '11 at 02:57