Le 19/10/2018 à 21:28, LS a écrit :
I am attempting to use one source for both an html and PDF version of my
document. The challenge I am having is with downloads. They are only
available in the html version, but I'd like to have this also available in
the PDF. I've explored using the attachfile package in latex along with
:raw: calls in my document.

Does anyone else have this same need or done it in a different fashion?

Hi,

I used attachfile in a pure LaTeX project, problem is that attachment
icons will not show in all PDF viewers. For example on my Mac OS,
Preview.app and Skim.app both fail to show the attachment icons or
provide any way to user to reach the attachement. It is as if the
attachment is not there. My system is a bit old, perhaps current Preview
handles attachments.

Surprisingly, the Firefox pdf viewer does have an attachment panel and
they appear there when one scrolls through the document.

It works fine with Adobe Reader, the paperclip icon is displayed, and
additionally attachments are available via the corresponding panel.

Using attachfile is simple. Basically \attachfile{filename.extension}
when needed, possibly following some

\attachsetup{icon=Paperclip, mimetype=suitable mime type,
     author={me}}

All my attachments were with application/x-tex mime type, so I only
had to use once \attachsetup in the LaTeX preamble.

To make your files available you may either use latex_additional_files
to make sure they are copied over by Sphinx to latex builddir,
and will be found there by attachfile, or possibly better
leave them in source repertory and use \attachfile with some relative
path (with latex builddir being reference dir). (untested)

(Using raw directive as you said.) It should work.

Jean-François






--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to