Dear Daniel, Le vendredi 19 janvier 2018 21:05:59 UTC+1, danielv...@yahoo.es a écrit : > > Since I was the originator of this request I would like to explain myself. >> > > I'm new to SageMath, but I have been using WxMaxima for quite a while now. >
Which is indeed a good notebook (if a bit insular, when compared to the Jupyter ecosystem). > > I would like to have some way to define Sections and Subsections in a > SageMath notebook, but the definitions should not be static, i.e. if I > define 1, 2, 3, 4 sections in my document and then I delete Section 2, I > want section 3 to be renumbered 2 and section 4 to be renumbered 3 so that > the section numbers are always consecutive. If I then add a section in the > middle between 2 and 3 I want it to be numbered 3 and section 3 to be > renumbered 4. > > The same for subsections inside a section. They should always be numbered > consecutively no matter how many times I delete or add subsections. > It turns out (see previous posts in this thread) that the feature you were searching for has been removed from modern versions of Jupyter ; users are now supposed to make-do with Markdown's headers. The Jupyter developers propose some extensions <http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/index.html> that may or may not fulfill your needs. I have no idea how easy (or hard) it would be to add (some of) them to the current Sage Jupyter notebook. > > Long term, I would like to be able to create a PDF file from this notebook > with those section and subsections as bookmarks of the file so I can access > then using the bookmark PDF panel. > [ Full disclosure : I was first exposed to emacs and LaTeX 31 years ago ; my professionnal life has made me endure various "word processors" and suchlike horrors for more than a quarter century . I can hardly claim unbiasedness... ] I am often confronted to this conudrum. I find the Sage notebook extremely handy to jot down an idea, toy and experiment with it and take quick notes, but I feel more at home with LaTeX when it comes to writing down things for good. LaTeX has been created to prepare structured documents. It supports not only hierarchical sectioning, but also cross-referencing, footnotes, tables of contents, indexing, references (most important !), und so weider ad infinitum... SageTeX <http://doc.sagemath.org/html/en/tutorial/sagetex.html> is a LaTeX package that allows to insert almost any form of Sage calls in a LaTeX document, from the simple inline insertion of a Sage expression to a full program, along with LaTeX documentation. The development of such a document is tremendously helped by the use of emacs along with sage_shell_mode <https://github.com/sagemath/sage-shell-mode>, which allows you to run Sage in an emacs frame, allowing you to check your (typeset) results and your (2D) figures ; it even has a notebook emulation <https://github.com/sagemath/sage-shell-mode#emulating-worksheets-code-blocks> feature that might help your transition. The price to pay is learning these tools, of course. Emacs' learning curve is a bit Matterhorn <https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Matterhorn_from_Domh%C3%BCtte_-_2.jpg/1200px-Matterhorn_from_Domh%C3%BCtte_-_2.jpg>-like (only a bit steeper, according to some...), Latex's vastness can be compared to the Ural <https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Ural_Mountains_Map.gif/280px-Ural_Mountains_Map.gif>, and sage is ... well... Sage (and expanding !). But these difficulties are mutually healing : emacs' infinite programmability opens the possibility of sage_shel_mode, but also of AUCTeX <https://www.gnu.org/software/auctex/> and RefTeX <https://www.gnu.org/software/auctex/reftex.html> (which make the maintainance of a complicated document a breeze, compared to what word processors offer) and allow you not to learn 90% of LaTeX (the existing macroes will do the job for you). However, almost all you need for that *can* be done in Markdowwn. It just happents that these tools exist in a zillion different (and mutually incompatible, of course) extensions, with no central federating program. Furthermore, these tools are probably better adapted to the production of "dynamic" documents such as HTML pages or e-books, whereas LaTeX is strongly paper-oriented : papers, books, slides are supposed to have a *fixed* layout. If you aim to go to the Web or e-publications (such as e-pub), you might be better off developing your document in the Notebook, exporting to pandoc or something like that, and re-exporting to HTML, e-pub or whatever (my experiences of converting a math-heavy LaTeX document to epub was not, to say the least, overwhelmingly successfull : the solution lies probably somewhere in the futire of LaTeXML <http://dlmf.nist.gov/LaTeXML/>). That way, you could ask Pandoc to number your section hierarchy and insert a table of contents. I currently see no way to cross-refer your document in the notebook (but I'm certainly not an expert in Markdown), but it might be added in this post-processing stage. So pick your poison according to your goals : if you aimt to a PDF, LaTeX is perfect, and learning to use it with the help of AUCTeX and sage_shell_mode might well worth learning emacs. If you aim to e-publication, pandoc is worth a look. HTH, Emmanuel Charpentier > > Thanks, > > Daniel > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.