Tag Info

Hot answers tagged

10

The "OperatorSubstitution" option does prevent the use of Mathematica fonts, but only for those cases where there were ASCII equivalents. So if your graphic contains expressions which use, for example, parentheses, brackets, braces, or various ASCII operators (plus, minus, asterisk, etc.), then the "OperatorSubstitution" is exactly what you want and you are ...


8

To make nicer PDFs, you could adapt the answer here as follows. Before making any plots, execute the command Map[SetOptions[#, Prolog -> {{EdgeForm[], Texture[{{{0, 0, 0, 0}}}], Polygon[#, VertexTextureCoordinates -> #] &[{{0, 0}, {1, 0}, {1, 1}}]}}] &, {Graphics3D, ContourPlot3D, ListContourPlot3D, ListPlot3D, ...


7

Please try adding some space around the plot: Plot[2 Sin[x] + x, {x, 0, 15}, Filling -> Bottom, ImageMargins -> 10] ImageMargins gives a margin around the existing plot that can be seen by selecting the graphic (the outer orange frame): By comparison ImagePadding is used by Plot itself to make room for the axes labels (the inner orange frame).


7

One possible solution is to do as I suggested in this MathGroup post (see also the follow-ups). I think one can simplify it by doing the following: g = Graphics[{Inset[ Plot[10^5 x^2, {x, -2, 2}, Frame -> True, Axes -> None], ImageScaled[{0, 0}], ImageScaled[{0, 0}], ImageScaled[1]]}, ImageSize -> {400, 400}, PlotRange -> {{0, 1}, {0, ...


7

This issue seems to affect all PDFKit based viewers on OS X, but it doesn't appear to point to anything intrinsically wrong with Mathematica's PDF export. A work-around that allows you to view the exported PDF without color bands in PDFKit viewers such as Preview would be to use the following command when creating the PDF in Mathematica: Export["py.pdf", ...


6

Mathematica uses two differen sets of styles for displaying graphics on screen and for exporting: ScreenStyleEnvironment for displaying and exporting in raster formats and PrintingStyleEnvironment for printing and exporting to EPS and PDF formats (see here for more details). One way to achieve consistent export to PostScript is to set ...


6

Not knowing in what other external application you plan to process the exported PDF, I'm focusing mainly on the last paragraph of the question which asks for a way to outline fonts. To do this, you can simply define the function outlinedExport[name_, gr_, opts : OptionsPattern[]] := Export[name, First@ImportString[ExportString[gr, "PDF"], "PDF", ...


6

You can adjust page size, page number style, headers, footers, etc from items under File -> Printing Settings menu. Or you can programmatically modify them by manipulating Notebook's options: PrintingCopies, PrintingStartingPageNumber, PrintingPageRange, PageHeaderLines, PageFooterLines, PrintingOptions. Note: It seems "PaperSize" and "PrintingMargins" ...


6

Update As @VCL pointed out in his comment, just exporting a list of graphics does not work since the braces and commas of the list a exported as well. Additionally, the pdf is one single page. Here is an updated approach, which takes all imported pdf-pages and inserts them into a new notebook where every page is separated by a pagebreak. The resulting pdf ...


6

You can export animations to SWF: movie = Animate[Plot[Sin[x + a], {x, 0, 10}], {a, 0, 5}]; Export["movie.swf", movie] You can import them in LaTeX (see TeX SE): \documentclass{article} \usepackage{media9} \begin{document} \includemedia[ activate=pageopen, width=405pt,height=292pt, ]{}{movie.swf} \end{document} (I had to insert ...


5

To get nice looking PDF export in this case is not easy. Export is really doing something wrong here. The best option I think would be to do the following: regionplot = RegionPlot[x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1}, PlotStyle -> Opacity[0.5, Black]]; Export["region.pdf", Show[regionplot, Prolog -> {Opacity[0], Texture[{{{0, 0, 0, ...


5

Please let me compile answers from the comments so that this topic can be marked as answered. Yes, this is a bug. A better solution than having rectangles of slightly different sizes and slightly larger than desired is to export the figure as EPS first and then convert it to PDF later. The cut corners are still there though.


5

Solution The problem seems to be that the polygonal regions in the exported PDF file do not have edge strokes. It can be partially solved by reimporting the figure and correct this. (* FILENAME.pdf contains an exported BarChart3D figure *) (* 't' gives the desired edge thickness *) chart = Import["FILENAME.pdf"]; chart = chart /. {FaceForm[n__] :> ...


5

In my opinion you don't have many options here and honestly, I would not try to achieve this with Mathematica and Linux because the font-rendering was, is and will at least for some time be crappy. In the examples, I use the "Liberation Serif" which is the default serif font on my system. Let me give some ideas: The easiest thing I know is to use ...


4

Here is my original suggestion using ImagePadding: p = Plot[Cos[x], {x, 0, 2}, AxesStyle -> Arrowheads[.1], PlotRange -> {0, 1}, TicksStyle -> Large, RotateLabel -> False, ImagePadding -> 70] And here is an example of how to use ImageMargins in the plot command: p = Plot[Cos[x], {x, 0, 2}, AxesStyle -> Arrowheads[.1], ...


3

I've encountered this problem, coming from a slightly different direction. I think the compound paths contain an extra pair of coordinates that you're noticing when you split up the results of a FilledCurve. Here's how I first came across this: glyph[code_, font_, size_] := First[First[ ImportString[ ExportString[ ...


3

You should probably be able to get it working with this addition to your stylesheet:- Cell[StyleData[All, "Printout"], ShowAutoStyles->True, ShowSyntaxStyles->True] Ref: http://forums.wolfram.com/mathgroup/archive/2011/May/msg00323.html (Stylesheet for coloured syntax code printing.)


3

So PDF Import accepts a CharacterEncoding option, but it seems to ignore it. Exporting in UTF-8 or in ASCII gives the best results, with the former supporting the Euro symbol € and the latter supporting the ² and ³ symbols. Life is all about choice I guess. The String itself has to be encoded using Style, and the FontFamily matters, too: ImportString[ ...


3

The main point is, that you can change two things, the resolution of the image (which is for example the option ImageResolution in dpi but only for PNG and not for EPS) and the actual size of the image using ImageSize. That one is a little tricky, because it is given in dpi with respect to 72 dpi. The following changes your image A = Plot[{Sin[x], Cos[5 ...


3

It's true that there is a problem in Mathematica version 7. I just remembered that I noted this here: outlining of glyphs on import as PDF is buggy in version 7. The confusing thing is that Import sets the option "TextOutlines" -> True so that outlines are indeed produced unless I specify "TextOutlines" -> False in the Import command. For example, ...


2

If you are willing to export to eps first and then convert to pdf, try if this works for you. I think it does for me. It is a pretty dirty hack though, so there might be side effects I haven't noticed. p=Plot[Sin[x], {x, -Pi, Pi}]; Export["plot.eps",StringReplace[ExportString[p,"EPS"],"clip np"->""],"Text"] Also, it might not work for all plots. Edit ...


2

If I understood your question correctly, you may want something like this: grid1 = Grid[{{Style["Life Alerts", Bold, 20], SpanFromLeft, SpanFromLeft}, {Style["Alert", Bold, 15], Style["<>", Bold, 15], Style["%Life", Bold, 15], Style["OnDay", Bold, 15]}, {Style["L1", Bold, 15], Style["<", Bold, 15], Style["90", Bold, 15], ...


2

Only expected to work for Mac OS X and linux (Windows has ghostscript, but calls have different syntax): The reason why the errors happen in the first place is that pdflatex generates one of the more recent versions of the PDF specification (1.5), whereas Mathematica expects an older version upon import (probably 1.3). Specifying the lower version by adding ...


2

Having Mathematica Enterprise Edition you can do it - export, import - in a manual or automated way. Take a look at the following blog: Using Mathematica Enterprise Edition to Create Professional Apps, Tools, and Reports For example quoting from the blog: We needed a way for Mathematica users to create CDFs that could link and interact with proprietary ...


2

I think the problem is that the exported PDF file doesn't contain the correct bounding box information appropriate for the image size that you specified. Maybe an acceptable work-around is to specify this information by hand as follows: fixSize[plt_, width_, height_] := Graphics[ { Inset[plt] }, ImageSize -> {width, height}, AspectRatio -> ...


2

Notebooks saved to PDF are rendered with the Printing Environment that is selected. The Code style does not have a gray background in the "Printout" environment. You can change the Printing Environment to "Working" in the menu: File > Print Settings > Printing Environment Combining this method with Chris Degnen's you can further customize the output ...


1

Actually, *.avi or *. SWF can be read by Adobe Acrobat Pro. You can try as Michael E2 did: movie = Animate[Plot[Sin[x + a], {x, 0, 10}], {a, 0, 5}]; Export["C:\\movie.avi", movie] Use Adobe Acrobat Pro to open the file exported, i.e., C:\movie.avi. Double click on the figure will animate it.


1

The Adobe PDF generators that are built into various products appear to often be inferior to the results obtained "Printing" with Adobe Acrobat Professional. Using that method, instead of Export, I obtain:


1

It is sufficient if you just do ssh - I was able to use the following commands without X11 forwarding. After you ssh to the machine with Mathematica and invoke MathKernel you can do in the interactive session: UFE = UsingFrontEnd (* Out[4]= UsingFrontEnd *) plot = UFE @ Plot[x^2,{x,-2,2}] (* Out[5]= -Graphics- *) UFE @ ...


1

Force use of system fonts by the following: SetOptions[EvaluationNotebook[], PrivateFontOptions -> {"OperatorSubstitution" -> False}] or SetOptions[$FrontEnd, PrivateFontOptions -> {"OperatorSubstitution" -> False}] Note: Options set for $FrontEnd are by default stored in the front end init.m file, and are persistent between front end ...



Only top voted, non community-wiki answers of a minimum length are eligible