Ticket #66 (new enhancement)
notebook -- should be able export (=print) to latex/pdf/dvi
| Reported by: | was | Owned by: | boothby |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.10 |
| Component: | notebook | Keywords: | |
| Cc: | robert.marik, kcrisman, kini | Work issues: | |
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description (last modified by robert.marik) (diff)
As the title states - notebook should be able export (=print) to latex/pdf/dvi
Attachments
Change History
comment:2 Changed 6 years ago by was
- Milestone changed from sage-feature to sage-2.9
On 9/21/07, gani <bganapathi@earthlink.net> wrote:
> Since I really wanted a nice print out of my worksheets with Latex
> with all the fancy math intact, I decided to write a simple sed file
> which works pretty well for me. It can be modified to handle any user-
> specific html tags. The color of input/output boxes are currently blue/
> red but can be also changed, along with the width of the box
> surrounding the text (try framesep=3mm instead of 5mm for example).
> However, it does involve going through a 3-step process.
That's actually a pretty good idea for a temporary workaround. Thanks!
Could you please resend the sed file as an attachment or post it somewhere
online, since it gets mangled by email?
> 1. copy code from "edit worksheet" tab in your current worksheet into
> file, say, worksheet_code.
> 2. run "sed -f file_with_sed_cmds worksheet_code > output.tex" (see
> below for contents in file_with_sed_cmds)
> 3. Latex the resulting file output.tex. You can change the title, name
> in \title, \author command before this step.
>
> Let me know if this worked for you. Now if there is a way someone
> could include it to automate the process from within Sage, it would be
> great!
Yes, this could be easily automated (by those who know how)
from within Sage by modifying some code that's part of the
notebook server.
>
> thanks!
>
> gani --
>
> ***file_with_sed_cmds******************** (copy from below - make sure
> you start with the 1i\\\document....)
>
> *************************************************************************************************************
> 1i\\\documentclass[letterpaper]{report} \n \\usepackage[pdftex]
> {graphicx,color} \n \\usepackage[left=2cm,right=1cm,top=2cm,bottom=2cm]
> {geometry} \\usepackage{fancyvrb} \n \\begin{document} \n \\title{Your
> document title here} \n \\author {Your name here} \n \\maketitle \n
>
> $a\\\end{document} \n
>
> s?<p>?\\newline ?ig
> s?</p>??ig
> s?<ol>?\\begin{itemize}?ig
> s?</ol>?\\end{itemize}?ig
> s?<li>?\\item?ig
> s?^{{{?\\begin{Verbatim}[formatcom=\\color{blue}, frame = single,
> framesep=5mm]?ig
> s?\}}}?\\end{Verbatim}?ig
> s?<b>?\\bfseries ?ig
> s?</b>?\\normalfont?ig
> s?<i>?\\itshape ?ig
> s?</i>?\\normalfont?ig
> s?^///?\\end{Verbatim} \n \\begin{Verbatim}[formatcom = \\color{red},
> frame = single, framesep=5mm]?ig
> s?<pre>??ig
> s?</pre>??ig
> s?<img src="?\\begin{figure}[!h] \n \\begin{center} \n \
> \includegraphics[scale=0.5]{?ig
> s?<img src = "?\\begin{figure}[!h] \n \\begin{center} \n \
> \includegraphics[scale=0.5]{?ig
> s?">?\}\n \\end{center} \n \\end{figure}?ig
>
>
> --~--~---------~--~----~------------~-------~--~----~
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to sage-support-unsubscribe@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
> -~----------~----~----~----~------~----~------~--~---
>
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
comment:3 Changed 5 years ago by AlexGhitza
- Owner changed from somebody to boothby
- Component changed from basic arithmetic to notebook
comment:4 Changed 4 years ago by tjlahey
A C program to do conversion from HTML to LaTeX is available: http://www.iwriteiam.nl/html2tex.html.
It's available under the GPL. Also on that web page is a link to a Perl program that is supposed to be better. I'm not certain about the license of the Perl program.
comment:6 Changed 3 years ago by robert.marik
- Cc robert.marik added
- Description modified (diff)
- Report Upstream set to N/A
comment:7 Changed 3 years ago by robert.marik
- Description modified (diff)
See also the sws2tex converter - http://bitbucket.org/whuss/sws2tex
The demo is at http://user.mendelu.cz/marik/sage/conversion.pdf
Note: See
TracTickets for help on using
tickets.

