25

Quoting the pdfpages manual (page 2): [...] all kinds of links1 will get lost during inclusion. (Using \includepdf, \includegraphics, or other low-level commands.) However, there's a gleam of hope. Some links may be extracted and later reinserted by a package called pax which can be downloaded from CTAN [3]. Have a look at it! The pax package ...


24

Hartmut Henkel states these conditions in a mail on the context mailing list: non-interlaced no palette no transparency no gamma coming with it no gamma modification requested no white adjustment in the PNG and a few more rare others. He also states: These are about the factors affecting the PNG to PDF size. For your big PNG graphic you may find a ...


23

Disclaimer: I'll try to write a technical explanation of what I found, but I'm not versed in those image witchcrafts. Please bear with me. :) This is just a partial answer. I have no idea of the impact of such formats when processed by pdfTeX. EDIT: See Patrick's answer. Just to make our lives easier, I'll name the images: The "normal" one: subject1.png ...


23

Notice of obsolescence: YouTube have dropped its Flash-based video player in Sept 2017. For the lack of HTML5 support in the PDF specification (and thus by PDF viewers), YT playback is not possible anymore in an embedded fashion. \documentclass{article} \usepackage{media9} %pdflatex, latex+dvips+ps2pdf, xelatex %\usepackage[dvipdfmx]{...


19

I know this is an old topic, but I stumbled across it while searching for a solution. I found one, so I share it with you. I usually embed pdfs generated by R. Unfortunately R also doesn't embed the fonts. Processing the output of LaTeX with ghostscript will preserve all the links in the document: gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dEmbedAllFonts=true -...


16

Unfortunately Tobias' approach didn't work for me when trying to embed fonts in my images for use with pdfTeX. The following command line, based on an answer from StackOverflow did work for me: gs -dCompatibilityLevel=1.4 \ -dPDFSETTINGS=/screen \ -dCompressFonts=true \ -dSubsetFonts=true \ -dNOPAUSE \ -dBATCH \ -sDEVICE=pdfwrite \ ...


15

It seems that there is not such thing as native encryption (binary or text) of files from TeX. An option would be to issue a command before compilation or a shell command in order to encrypt the file before it is embedded. Doing a little further research I found that there are indeed ways to specify the password non interactively \documentclass[]{article} ...


15

I feel your pain I was in the same situation a minute ago for an IEEE conference. There doesn't seem to be a clear or easy answer anywhere on this. I wonder why they don't make this easier to do. This worked for me and I hope it works for you: open your pdf file, select file -> print set your printer to be Adobe printer (assuming you already installed ...


13

You can do this in ConTeXt as well. Example: \setupinteraction [state=start] \starttext Foo \attachment[file=attachfile.tex, title=Some file, author=Me] \stoptext The file key contains the file name, the title key is used (probably depending on the reader) e.g. for a tool tip (see screenshot). Interaction needs to be activated, otherwise the attachment ...


12

I've played around a little with the sagetex package (designing tests which can be randomized) and I think you should look into its documentation. sagetex allows you incorporate Sage into your LaTeX code. Since Sage is based Python, you can run Python using sagetex. There is a \sage command that lets you jump back in to work with variables you've defined ...


12

You can use the getmap package. It offers an interface to Google Maps' Static Image API! \documentclass[margin=10pt]{standalone} \usepackage{graphicx} \usepackage[overwrite=true,mode=gm]{getmap} \begin{document} \getmap[file=pittsburgh, color=blue, number=A, xsize=600, ysize=450, zoom=16, scale=2] {...


12

Vertical scrolling based on the animate package; definition of command \smoothScroll taken from an earlier post with slight modifications. As an example document, we take lppl.pdf from TEXMF/doc/latex/base/lppl.pdf, the pages somewhat trimmed. Update with suggestions incorporated: Start auto-scroll by clicking on the "widget", pause auto-scroll on mouse-...


11

No, it's not possible to do this. Section 12 of the dvipdfmx documentation deals explicitly with font embedding. From page 21 of the documentation (the very last sentence of the docs, in fact): dvipdfmx does not support full embedding. Only subset embedding is supported.


10

I wouldn't go with PNG for vector graphics. I had a few Visio-Diagrams as well in my LaTeX documents and then used the following way: Install a PDF printer which allows you to create PDF using the print function of any software. For Windows I can recommend the free pdfcreator which is based on Ghostscript. Then print the Diagram to a single PDF page. ...


10

The following example defines \embedvideo. It uses the same media embedding method as the media9 LaTeX package. Video files in the MP4/H264 and FLV formats are played back within the video player component VPlayer.swf shipping with media9. See the media9 manual on how to configure VPlayer via FlashVars, which are passed as the 3rd argument of \embedvideo. ...


10

You ask in comments if a separate file can be avoided, but it is much more accurate to just typeset the document to a separate file and include the resulting page with \includegraphics from graphicx package. Obviously for small sections such as a single \textbf{hello} or even an enumerate environment it is possible just to put the code being demonstrated in ...


9

There is also SympyTeX, a package that allows you to use the complete functionality of python and sympy within your LaTeX document. Here is an example: Using sympy within your LaTeX document is as easy as $2+2=\sympy{2+2}$. You can write a block, and then use the variables defined later in your code! \begin{sympyblock} x = sympy.Symbol('x') h ...


9

I'm worried this is not going to be possible. It reminds me of a remark from the PGF manual regarding the pgfpages package. A word of warning: using pgfpages will destroy hyperlinks. Actually, the hyperlinks are not destroyed, only they will appear at totally wrong positions on the final output. This is due to a fundamental flaw in the pdf specification: ...


9

As embedfile can only embed external files, you have to write the content of the environment to a file first. To do this, the capabilities of the listings package, namely the \lst@BeginAlsoWriteFile macro, can be used: \usepackage{listings} \usepackage{embedfile} \makeatletter \lst@RequireAspects{writefile} \lstnewenvironment{lstembedlisting}[2][]{% \...


9

A possible solution using titlesec and tcolorbox (make the adjustments that best suit your needs): \documentclass{article} \usepackage[most]{tcolorbox} \usepackage[explicit]{titlesec} \usepackage{lipsum} \tcbset{ bgtable/.style={ freelance, frame code={} center title, left=0pt, right=0pt, top=0pt, bottom=0pt, watermark graphics=bricks.jpeg, watermark ...


8

This is too long to be a comment, since the OP's intent is not 100% clear. There is usually very little in terms of interaction between environments used and whatever is contained within them that can be used outside of that environment. Typically, environments are used to format its contents in a general way, performing certain operations at the start of ...


8

Easy way to achieve this, is to intentionally put some carefully placed typos (or punctuation, any sort of slight modification), of no real consequence to the document, prior to issuing it to the respective party, ensuring that you keep a ledger of what changes were made. When the leaked document is identified, cross-reference it with your ledger, then (...


8

I found no LaTeX-internal way to optimize that.You can use pdfsizeopt as an external tool to optimize the embedded fonts. It works great as long as the font names of the instances of the font are the same. It also uses subsetting, so that only the glyphs that you use are embedded and it converts fonts to a smaller format. I suggest to disable the conversion ...


8

I've used XeLaTeX for a document which when I open it in Adobe Reader shows that a subset of the font is already embedded. So I think it should be already happening for your document. Just check it in the File->Properties->Fonts settings.


8

Simulating the more general case (just for fun). You can adapt it to suit your need. \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{layout.tex} \documentclass[preview,border=12pt,12pt]{standalone} \usepackage[a6paper,margin=1cm,showframe]{geometry} \usepackage{lipsum} \begin{document} \section*{Minipage} \noindent \fbox{% \begin{...


8

If you have a command line base64 decoder (base64 -d here) and allow pdflatex --shell-escape to run external commands then you do not need anything other than the standard graphics package. Here I include a base64 encoded pdf image. \documentclass{article} \begin{filecontents*}{\jobname.64} ...


7

I routinely attach source (and other related documents) to a compiled PDF using embedfile, so I can definitely relate to having that 'luxury'. Protecting individual attachments within a PDF is not possible, AFAIK. Not even Adobe Acrobat allows this security of it's attachments. Although this may be old news, you can protect the entire PDF using Acrobat's ...


7

Though I was not able to embed fonts while compiling, I found this solution. Generate your pdf, turn it into a postscript file with pdf2ps, and then turn it back into a pdf while embedding the fonts. commands in linux: pdf2ps doc.pdf ps2pdf14 -dPDFSETTINGS=/prepress doc.ps doc2.pdf


7

You can create a link to an embedded file using the JavaScript function exportDataObject. The following code creates a new command \embeddedfilelink{<file>}{<text>} that creates a link to an embedded file specified by its file name with the given link text. The code is taken from hypgotoe and modified to create a JavaScript action instead of a ...


7

The "hidden" embedded file in the blog post is not an embedded file in the sense of the PDF standard, so the question is what you really want: If you only want to include the content from the file in the generated PDF, you can add a PDF stream: If you write \immediate\pdfobj file{some-filename.tex}, the file some-filename.tex is copied into the PDF as a ...


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