Mercurial > octave
comparison scripts/plot/util/print.m @ 28337:8d2f9cfc16bc
Use relative filename in .tex file when printing using -dXXXlatex devices (bug #58374).
* gl2ps-print.cc (gl2ps_renderer::draw): Strip path and pass basename of file
to gl2ps for inclusion in the latex directive \\includegraphics.
* print.m (latex_standalone): Remove code that was correcting absolute
filenames since they no longer occur.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 20 May 2020 13:17:00 -0700 |
parents | c3dd445fcc2f |
children | a57e52e4523a |
comparison
equal
deleted
inserted
replaced
28336:391a9d85e59d | 28337:8d2f9cfc16bc |
---|---|
1004 latexfile = [opts.name ".tex"]; | 1004 latexfile = [opts.name ".tex"]; |
1005 | 1005 |
1006 switch (opts.devopt) | 1006 switch (opts.devopt) |
1007 case {"pdflatexstandalone"} | 1007 case {"pdflatexstandalone"} |
1008 packages = "\\usepackage{graphicx,color}"; | 1008 packages = "\\usepackage{graphicx,color}"; |
1009 graphicsfile = [opts.name "-inc.pdf"]; | |
1010 case {"pslatexstandalone"} | 1009 case {"pslatexstandalone"} |
1011 packages = "\\usepackage{epsfig,color}"; | 1010 packages = "\\usepackage{epsfig,color}"; |
1012 graphicsfile = [opts.name "-inc.ps"]; | |
1013 otherwise | 1011 otherwise |
1014 packages = "\\usepackage{epsfig,color}"; | 1012 packages = "\\usepackage{epsfig,color}"; |
1015 graphicsfile = [opts.name "-inc.eps"]; | |
1016 endswitch | 1013 endswitch |
1017 | 1014 |
1018 packages = {packages "\\usepackage[utf8]{inputenc}"}; | 1015 packages = {packages "\\usepackage[utf8]{inputenc}"}; |
1019 | 1016 |
1020 papersize = sprintf ("\\usepackage[papersize={%.2fbp,%.2fbp},text={%.2fbp,%.2fbp}]{geometry}", | 1017 papersize = sprintf ("\\usepackage[papersize={%.2fbp,%.2fbp},text={%.2fbp,%.2fbp}]{geometry}", |
1033 status = fclose (fid); | 1030 status = fclose (fid); |
1034 if (status != 0) | 1031 if (status != 0) |
1035 error ("Octave:print:errorclosingfile", | 1032 error ("Octave:print:errorclosingfile", |
1036 "print: error closing file '%s'", latexfile); | 1033 "print: error closing file '%s'", latexfile); |
1037 endif | 1034 endif |
1038 ## FIXME: should this be fixed in GL2PS? | |
1039 latex = strrep (latex, "\\includegraphics{}", | |
1040 sprintf ("\\includegraphics{%s}", graphicsfile)); | |
1041 | 1035 |
1042 fid = fopen (latexfile, "w"); | 1036 fid = fopen (latexfile, "w"); |
1043 if (fid >= 0) | 1037 if (fid >= 0) |
1044 fprintf (fid, "%s\n", prepend{:}); | 1038 fprintf (fid, "%s\n", prepend{:}); |
1045 fprintf (fid, "%s", latex); | 1039 fprintf (fid, "%s", latex); |