How to Specify PDF Attachments?
Joel Kulesza
jkulesza at gmail.com
Wed Feb 26 14:45:20 UTC 2020
On Wed, Feb 26, 2020 at 6:33 AM Pavel Sanda <sanda at lyx.org> wrote:
> On Wed, Feb 26, 2020 at 06:15:20AM -0700, Joel Kulesza wrote:
> > > I think the most obvious candidate is external material machinery.
> >
> > This means that I???ll have to specify the file name twice, right? It
> is often the case that I want/need to list the file but also want to
> include it for the readers convenience. The frustration of files being
> renamed and having to keep them updated in multiple places is why I???m
> becoming tired of ERT. This, and having multiple items for each file (a
> program listing and the ERT).
>
> Well, if the external template can spit out whatever tex code, right? So
> it could print the command for material embedding, but it could also print
> out some variable/label which contains the name of the file (like
> emebdding_no_01=file.mp3). You would need to define two strings -
> emebdding_no_01 && file.mp3, but from then you could change filename string
> at one place as much as you want while keeping the label name constant and
> using it within the document (through e.g. insetinfo or ERT).
>
Sorry if I'm being dense, but what do you mean by "external template"? An
example application:
I am writing a report with LyX and want to show a Python source-code file
(myfile.py) in it with the listings package via a Program Listing. I also
want to attach the file electronically to the PDF so a user can directly
retrieve and open it. The Python file is unrelated to LyX/TeX and should
not have code to point back to itself, echo its path, etc. However,
through the course of working I may rename the file (mynewfile.py); and I'd
like to update this name once within the LyX document and have both the
Program Listing and attachment now point to the right file.
For the two-string approach you suggest, how would I interact with that and
also point it to something else like a program listing, which interprets
string but does not accept ERT?
Thank you,
Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200226/04830bd2/attachment-0001.html>
More information about the lyx-devel
mailing list