#11311: engine="pdflatex" in view is ignored
-----------------------------------+----------------------------------------
Reporter: saliola | Owner: jason, was
Type: defect | Status: needs_info
Priority: major | Milestone: sage-4.7.1
Component: graphics | Keywords: latex, pdflatex, days30
Work_issues: | Upstream: N/A
Reviewer: Karl-Dieter Crisman | Author: Franco Saliola
Merged: | Dependencies:
-----------------------------------+----------------------------------------
Comment(by jhpalmieri):
With the current patch, we have a little code duplication, so we could
make the following change:
{{{
#!diff
diff --git a/sage/misc/latex.py b/sage/misc/latex.py
--- a/sage/misc/latex.py
+++ b/sage/misc/latex.py
@@ -1851,6 +1851,10 @@ def view(objects, title='SAGE', debug=Fa
else:
latex_options = {}
s = _latex_file_(objects, title=title, sep=sep, tiny=tiny,
debug=debug, **latex_options)
+ if engine is None:
+ engine = _Latex_prefs._option["engine"]
+ if pdflatex or (viewer == "pdf" and engine == "latex"):
+ engine = "pdflatex"
# notebook
if EMBEDDED_MODE and viewer is None:
jsMath_okay = True
@@ -1862,10 +1866,6 @@ def view(objects, title='SAGE', debug=Fa
if jsMath_okay:
print JSMath().eval(objects, mode=mode) # put comma at end
of line?
else:
- if engine is None:
- engine = _Latex_prefs._option["engine"]
- if pdflatex or (viewer == "pdf" and engine == "latex"):
- engine = "pdflatex"
base_dir = os.path.abspath("")
png_file = graphics_filename(ext='png')
png_link = "cell://" + png_file
@@ -1874,10 +1874,6 @@ def view(objects, title='SAGE', debug=Fa
print '<html><img src="%s"></html>'%png_link # put comma at
end of line?
return
# command line or notebook with viewer
- if engine is None:
- engine = _Latex_prefs._option["engine"]
- if pdflatex or (viewer == "pdf" and engine == "latex"):
- engine = "pdflatex"
tmp = tmp_dir('sage_viewer')
tex_file = os.path.join(tmp, "sage.tex")
open(tex_file,'w').write(s)
}}}
Otherwise, I think it looks good.
As far as opening in a pdf viewer rather than in a TeX program, hasn't
that been the behavior for a while? (Sage basically opens up the file,
blah.pdf or blah.dvi, using some sensible default depending on the OS --
see the file misc/viewer.py. On OS X, for example, this just calls "open
blah.pdf" or "open blah.dvi", depending on which file is produced.)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11311#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.