Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5931051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:38:23+00:00 2026-05-22T14:38:23+00:00

I am using Mathematica to plot a number of figures I require and then

  • 0

I am using Mathematica to plot a number of figures I require and then using them as pdfs in Latex.

The issue is that Mathematica exports the figures using Acrobat 5.x settings compatibility and I think this results in figures that are large, not optimized and when I have a couple of them in the final pdf, sometimes it takes minutes just to print a single page of the final document.

Is there a way to change the output settings for pdfs in Mathematica?
Should I export as pdfs, convert to postscripts and then create new pdfs from the .ps with new settings?
Should I export .eps and convert to pdf?
Is there an one step way to create optimized pdfs through Mathematica?

Quick example (and a bit exaggerated so the difference is quite obvious): The pdf I export from Mathematica (Export[“C:/figure.pdf”, %]) is 1065kb in size, .pdf ->.ps ->.pdf gives a final file of 652kb and .eps->.pdf a file of 610kb.
I would not use any of these in a latex but it shows the difference in the settings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:38:24+00:00Added an answer on May 22, 2026 at 2:38 pm

    It is a myth that pdf->ps->pdf will always give you a smaller file size. For e.g., consider

    (in mathematica)

    fileName = "test.pdf";
    p = DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}];
    Export[fileName, p];
    

    (in the shell)

    pdf2ps test.pdf && ps2pdf test.ps test1.pdf
    

    test.pdf is 446kB, whereas test1.pdf is a whopping 11.5MB on my machine!

    What happens normally, is that when you export a PDF file using Mathematica, it stores the text (axes tick marks, labels, etc), fonts and images, all of which add to the bulk. If you have vector graphics with lots of tick marks/labels, these can be quite significant. Doing pdf->ps->pdf will strip the file of font data and text data, at the same time compressing the image, which is why you see a decrease in file size. Although not observable at small magnifications, you will notice the difference when you zoom in considerably. For e.g., replacing p with

    p = Plot[Sin[t], {t, 0, 2 Pi}];
    

    produces a 37kB file for test.pdf and an 8kB file for test1.pdf on my machine. The quality of the 8kb file is poorer than the original (zooming to 600%+ shows this). You can see the plain text information that mathematica stores in the PDF file by doing

    Import[fileName,"Plaintext"]
    

    However, for more complicated PDF files, converting to ps and then back to pdf is not necessarily a good option and can result in the file size blowing up.

    You can try playing with the options for PDF in Export, such as "AllowRasterization" and ImageResolution, or even rasterize the image before saving, but I guess you already knew that.

    Here’s a back-alley quick and dirty way of reducing file size from within mathematica

    Export[fileName, First@Import@Export[fileName, p]]
    

    The file size is now only 12kB! It’s only a third of the original, only slightly larger than that obtained from pdf->ps->pdf, and is of a much better quality than the 8kB one (although not exactly the same as the original. The differences can be seen at magnifications of 1200% and above).

    What happens is that upon importing and re-exporting, only the stored image is saved. The plain text part of it is thrown away, and in this small example, that happened to be significant. For the DensityPlot example, the reduction was only to 425kB (still, went down rather than blow up to 11MB).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC there are situations (such as form submission) that may require a
I want to describe an issue I have been having with Plot using With
I'm trying to plot points that I've created in a table in mathematica but
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm trying to use Mathematica's NDSolve[] to compute a geodesic along a sphere using
For better or worse, Mathematica provides a wealth of constructs that allow you to
I'm using Mathematica 7. I have an interpolated function, here's an example: pressures =
As I am trying to plot a few financial time series in Mathematica, I
I am trying to plot a few points on the following picture in Mathematica:
I'm using Mathematica 8 and I am struggling with texturing. Although texturing of polyhedral

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.