# Insert a PDF paragraph (from LaTeX) in a cell

I need to insert a PDF paragraph (from LaTeX) in a cell. I realized that the option "Insert file" does not work with PDF text.

Because I need resize the paragraph without quality loss, PNG image is not an option. So, my strategy is: Convert PDF to SVG with pdf2svg (Ubuntu's program)

pdf2svg pba.pdf  SALIDA%d.svg all


and text is converted to outlines, and after I save it in PDF format. The result is good and I can edit and make some adjusts with Drawing Tools.

But it no seems very efficent procedure. Is there another way to do it?

• You could post that update as a self-answer (if you like). Jan 3, 2018 at 19:30

Mathematica always outlines text when Importing PDF as Graphics. There's no way around that. Update: There is the "TextOutlines" option, as Alexey notes in a comment below.

Some PDF files are not imported correctly by Mathematica. There can be multiple reasons for this. We would have to see your PDF file to see why it doesn't import correctly.

If the reason is indeed fonts, you can outline fonts using Ghostscript 9.15 or later. Example command line:

gs -o out.pdf -dNoOutputFonts -sDEVICE=pdfwrite in.pdf

• Thanks, I've tried your command line code and it works, I used the new PDF and I've been able to import the pdf without problems. To my purposes, the outlines text it's oK. I have also tried matex, and it is excellent for my purposes. Sincerely, thanks a lot Nov 3, 2016 at 1:47
• "Mathematica always outlines text when Importing PDF as Graphics." - this isn't correct: try Import[fileName, "PDF", "TextOutlines" -> False]. For importing ASCII text it usually works nicely. Apr 30, 2017 at 12:44
• Ok, I already did Jan 3, 2018 at 19:49

I use the tcolorbox package to work with paragraphs, examples, definitions, theorems, etc. Example:

<< MaTeX
SetOptions[MaTeX,
"Preamble" -> {"\\usepackage[most,listings]{tcolorbox}",
"\\tcbset{colframe=white}"}];
MaTeX["\\mbox{\\begin{tcolorbox}[colback=white]
Esta es una prueba con el paquete {\\tt tcolorbox }\\\\

$f(x)=\\left\\{\\begin{array}{rcl} x^2 &si& x>0\\\\ \\\\ \\sin x &si& x<0 \\end{array}\\right.$\\end{tcolorbox}}", Magnification -> 1.5]
`