PDF's not working in LATEX

I was not sure if I should ask this on Mathematica or LATEX or here.

I am very new to LATEX and using \includegraphics to put images into my paper. I am using plots generated in Mathematica as PDF's. After I compile the tex file and get a PDF the plots look nice but the labels for the X and Y axis are missing.

I have added \pdfoptionpdfminorversion 6 to my preamble because I was getting an error about the version of the PDF's. The error is gone but still no labels.

Any thoughts? Ben

• You may have to select a setting in Mathematica to include/embed the fonts in the exported PDF. – Werner Jan 6 '14 at 19:05
• The title is misleading. You get the PDFs but no labels, right? If that is correct, that is what you should say. – Faheem Mitha Jan 7 '14 at 14:06
• Welcome to TeX.SX! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. A suggestion: Do us a favour and change your username to something more telling than "user1234". – Martin Schröder Jan 8 '14 at 9:54
• By paper you mean publication? Independent of the solution to your actual problem, try not to use Mathematica for labeling for publication quality figures, concerning typesetting rules on italics/non-italics, usually something goes wrong. Put the labels in latex: PSTricks or PDFTricks. Like this your labels are truly identical to what you put in the text of your manuscript. It is a little bit more work but looks much better. – mikuszefski Jan 8 '14 at 16:21

I guess the PDF generated by Mathematica contains the labels correctly, but after including them in the *.tex file and compiling it, the labels are gone, right?

Does it help to put as first line of the tex-file the command \pdfinclusioncopyfonts=1?

By the way, usually PDFs are included using the package pdfpages, please read the manual. You get it after typing texdoc pdfpages on the commandline. OK, if you use texlive. With miktex I forgot.

There are some good Q / A's about this topic on Mathematica, here, here and here. Anyway, in Mathematica you have to include the "FontFamily" with "BaseStyle" and you have to do a clean export. See Example;

plotWithLegend =
ListPlot[Table[f, {f, {Sin[x], Cos[x]}}, {x, 0, 2 \[Pi], 0.1}],
Frame -> True, PlotLegends -> {"sin(x)", "cos(x)"},
FrameLabel -> "Frame label font size is about 8 pt",
ImageSize -> 200,
BaseStyle -> {FontFamily -> "Times", FontWeight -> "Bold",
FontSize -> 12}];
Export["plotWithLegend.pdf", plotWithLegend]


Runs well on OSX with latexmk

\documentclass[11pt, oneside]{article}
\usepackage{graphicx}
\title{Brief Article}
\author{The Author}

\begin{document}

\begin{figure}[htbp]
\centering
\includegraphics[width=4in]{plotWithLegend.pdf}
\caption{example caption}
\label{fig:example}
\end{figure}

\end{document}
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5151519775390625, "perplexity": 2159.668658806733}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178373241.51/warc/CC-MAIN-20210305183324-20210305213324-00434.warc.gz"}