Re: Embedded files in documents

2010-09-23 Thread Erich Hoover
On Wed, Sep 22, 2010 at 11:30 AM, Richard Heck wrote: > On 09/22/2010 12:56 PM, Erich Hoover wrote: > >> I've been starting to get a few of the people I work with to convert to >> LyX and I've been noticing that when sending documents between authors it >> would be convenient to not always be ZIP

Re: Embedded files in documents

2010-09-22 Thread Abdelrazak Younes
On 09/22/2010 07:30 PM, Richard Heck wrote: For now, you might want to look at the lyxpak.py script, written by Enrico Forestieri, which is a lower-tech approach to the same problem. The script lives at development/tools/lyxpak.py in the source and can be downloaded from: http://www.lyx.or

Re: Embedded files in documents

2010-09-22 Thread Richard Heck
On 09/22/2010 12:56 PM, Erich Hoover wrote: I've been starting to get a few of the people I work with to convert to LyX and I've been noticing that when sending documents between authors it would be convenient to not always be ZIPping up all the dependencies. Is there any chance that patches t

Embedded files in documents

2010-09-22 Thread Erich Hoover
I've been starting to get a few of the people I work with to convert to LyX and I've been noticing that when sending documents between authors it would be convenient to not always be ZIPping up all the dependencies. Is there any chance that patches to allow embedding files in LyX documents would g

Re: Embedded Files

2008-03-28 Thread Jean-Marc Lasgouttes
"Bo Peng" <[EMAIL PROTECTED]> writes: > When I re-think this problem, the current approach should work just > fine. It is true that these files might be anywhere, but EmbeddedFile > will *not* embed them if it can not find it. As long as the latex > output is corrected written through the use of a

Re: Embedded Files

2008-03-28 Thread Bo Peng
> I do not think that even a InsetGraphics object has to be a valid > file. If I have Logo_INRIA.pdf in my TeX path at work, I want to be > able to use it. Currently, LyX does not find graphics through > kpsewhich, but there has been a request for that (and I think we > should do it). Therefor

Re: Embedded Files

2008-03-28 Thread Jean-Marc Lasgouttes
"Bo Peng" <[EMAIL PROTECTED]> writes: >> I'm skeptical that this will solve the problems. The issue doesn't >> really have anything to do with relative versus absolute paths. If I >> choose "biblio" as my BibTeX file, that is NOT a pathname. > > I see your point now. Unlike InsetInclude and Ins

Re: Embedded Files

2008-03-27 Thread rgheck
Bo Peng wrote: I think the approach in my patch can be made to work. I can embed the file just fine, and it gets extracted just fine. But I have seen some issues with latex output. Sometimes it works, sometimes it doesn't. But I'm thinking this can be made to work. At the very least, we can g

Re: Embedded Files

2008-03-27 Thread rgheck
buffer); Index: src/EmbeddedFiles.cpp === --- src/EmbeddedFiles.cpp (revision 24005) +++ src/EmbeddedFiles.cpp (working copy) @@ -54,6 +54,16 @@ } +EmbeddedFile::EmbeddedFile(std::string const & file, + std::string const & inz

Re: Embedded Files

2008-03-27 Thread Bo Peng
> I think the approach in my patch can be made to work. I can embed the > file just fine, and it gets extracted just fine. But I have seen some > issues with latex output. Sometimes it works, sometimes it doesn't. But > I'm thinking this can be made to work. At the very least, we can give a >

Re: Embedded Files

2008-03-27 Thread rgheck
rc/EmbeddedFiles.cpp === --- src/EmbeddedFiles.cpp (revision 24005) +++ src/EmbeddedFiles.cpp (working copy) @@ -54,6 +54,16 @@ } +EmbeddedFile::EmbeddedFile(std::string const & file, + std::string const & inzipName, bool

Re: Embedded Files

2008-03-27 Thread Bo Peng
> I'm skeptical that this will solve the problems. The issue doesn't > really have anything to do with relative versus absolute paths. If I > choose "biblio" as my BibTeX file, that is NOT a pathname. I see your point now. Unlike InsetInclude and InsetGraphics where a file must be a file, this

Re: Embedded Files

2008-03-27 Thread rgheck
src/EmbeddedFiles.cpp (working copy) @@ -54,6 +54,16 @@ } +EmbeddedFile::EmbeddedFile(std::string const & file, + std::string const & inzipName, bool embed, Buffer const & buf) + : DocFileName("", false), inzip_name_(inzipName), inset_list_() +{ + DocFileName::set(file, buf.

Re: Embedded Files

2008-03-27 Thread rgheck
Andre Poenitz wrote: On Thu, Mar 27, 2008 at 09:33:20AM -0500, Bo Peng wrote: In the case of InsetBibtex, I think maybe an approach more like the one in InsetInclude might work, where there aren't any "local" EmbeddedFile objects but only the ones in the Buffer-level EmbeddedFileList. Ins

Re: Embedded Files and InsetBibtex

2008-03-27 Thread rgheck
> I'm fairly convinced that we should not be using the > EmbeddedFiles stuff to represent the parameters here. That just seems > like mixing up the wrong things. Why not? We need to store filenames (I know I need to keep the original filenames), and the embedding status. Using a EmbeddedFiles

Re: Embedded Files and InsetBibtex

2008-03-27 Thread Bo Peng
> I'm fairly convinced that we should not be using the > EmbeddedFiles stuff to represent the parameters here. That just seems > like mixing up the wrong things. Why not? We need to store filenames (I know I need to keep the original filenames), and the embedding status. Using a EmbeddedFiles ob

Re: Embedded Files and InsetBibtex

2008-03-27 Thread rgheck
Andre Poenitz wrote: On Thu, Mar 27, 2008 at 04:30:08AM -0400, rgheck wrote: Attached is a more radical sort of patch, one that disentangles InsetBibtex from the EmbeddedFiles stuff a bit, while making the logic a lot simpler, I think. It's at least proof of concept that this kind if disenta

Re: Embedded Files and InsetBibtex

2008-03-27 Thread Bo Peng
ssue with > InsetInclude::setParams(): Presumably the Buffer needs to know about it > if the embedding status has changed. EmbeddedFiles was the center of the embedding feature, but not now. Every inset takes care of its own embedded files, and conflict etc are only handled when necessary. Th

Re: Embedded Files

2008-03-27 Thread Andre Poenitz
On Thu, Mar 27, 2008 at 09:33:20AM -0500, Bo Peng wrote: > > In the case of InsetBibtex, I think maybe an approach more like the one > > in InsetInclude might work, where there aren't any "local" EmbeddedFile > > objects but only the ones in the Buffer-level EmbeddedFileList. > > InsetBibtex co

Re: Embedded Files

2008-03-27 Thread rgheck
Bo Peng wrote: > At least my most recent bit encapsulates that. I have not looked at the svn, have your committed your patch? Will you be able to wait for me to make EmbeddedFile relative-path friendly? No, I haven't committed it yet. And see the other note on this. rh

Re: Embedded Files and InsetBibtex

2008-03-27 Thread rgheck
Bo Peng wrote: Comments welcome. This is pretty radical. You basically have a relative-path version of EmbeddedFile in InsetBibtex and convert to EmbeddedFile if needed. In a way, but there's no EmbeddedFile object stored there at all. Just the old parameter info. We build EmbeddedFi

Re: Embedded Files and InsetBibtex

2008-03-27 Thread Andre Poenitz
On Thu, Mar 27, 2008 at 04:30:08AM -0400, rgheck wrote: > > Attached is a more radical sort of patch, one that disentangles InsetBibtex > from the EmbeddedFiles stuff a bit, while making the logic a lot simpler, I > think. It's at least proof of concept that this kind if disentanglement can > be

Re: Embedded Files

2008-03-27 Thread Bo Peng
> > > At least my most recent bit encapsulates that. I have not looked at the svn, have your committed your patch? Will you be able to wait for me to make EmbeddedFile relative-path friendly? Cheers, Bo

Re: Embedded Files

2008-03-27 Thread rgheck
Bo Peng wrote: In the case of InsetBibtex, I think maybe an approach more like the one in InsetInclude might work, where there aren't any "local" EmbeddedFile objects but only the ones in the Buffer-level EmbeddedFileList. InsetBibtex could have a vector of EmbeddedFile* instead, where these

Re: Embedded Files

2008-03-27 Thread Bo Peng
> Well, we need some general solution, because there are similar problems > elsewhere. If you have a file that contains a path to an included file, > for example, it can be changed simply by opening and saving the file. In > particular, it will always be converted from an absolute to a relative

Re: Embedded Files and InsetBibtex

2008-03-27 Thread Bo Peng
> Comments welcome. This is pretty radical. You basically have a relative-path version of EmbeddedFile in InsetBibtex and convert to EmbeddedFile if needed. How about making EmbeddedFile a standard-alone class that does not derive from DocFileName? We simply save whatever path, relative or absol

Embedded Files and InsetBibtex

2008-03-27 Thread rgheck
Attached is a more radical sort of patch, one that disentangles InsetBibtex from the EmbeddedFiles stuff a bit, while making the logic a lot simpler, I think. It's at least proof of concept that this kind if disentanglement can be done. Note that it also disentangles EmbeddedFile from the bib

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Andre Poenitz
On Wed, Mar 26, 2008 at 07:54:03PM -0400, rgheck wrote: >> Andre sayeth: >> >> On Wed, Mar 26, 2008 at 05:29:22PM -0400, rgheck wrote: >> > [...] >> > Comments welcome. And see the long FIXME about remaining issues. >> >> > + >> > + docstring embed(getParam("embed")); >> >> We use >> >>

Embedded Files

2008-03-26 Thread rgheck
Bo Peng wrote: I tried using updateParam() after introducing getTeXFile, but that didn't work. The problem is that there's no way to tell when you get back from EmbeddedFiles what the ORIGINAL path was. Things like: biblio, ../biblio, /home/me/biblio, etc, all look the same to EmbeddedFiles a

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Bo Peng
> I tried using updateParam() after introducing getTeXFile, but that > didn't work. The problem is that there's no way to tell when you get > back from EmbeddedFiles what the ORIGINAL path was. Things like: biblio, > ../biblio, /home/me/biblio, etc, all look the same to EmbeddedFiles at > that

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Andre sayeth: On Wed, Mar 26, 2008 at 05:29:22PM -0400, rgheck wrote: > [...] > Comments welcome. And see the long FIXME about remaining issues. > + > + docstring embed(getParam("embed")); We use docstring embed = getParam("embed"); [Several occurences] If you say so, OK. But the

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Bo Peng wrote: Comments welcome. And see the long FIXME about remaining issues. Why do you remove updateParam and manipulate (in add/remove database etc) these parameter strings again and again? The original idea was to change EmbeddedFiles, and write these strings from the file list each

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Bo Peng
> Comments welcome. And see the long FIXME about remaining issues. Why do you remove updateParam and manipulate (in add/remove database etc) these parameter strings again and again? The original idea was to change EmbeddedFiles, and write these strings from the file list each time. Bo

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Andre Poenitz
On Wed, Mar 26, 2008 at 05:29:22PM -0400, rgheck wrote: > [...] > Comments welcome. And see the long FIXME about remaining issues. > + > + docstring embed(getParam("embed")); We use docstring embed = getParam("embed"); [Several occurences] Andre'

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
The attached patch solves the problem about relative pathnames and BibTeX files...at least, it solves most of the problem. You can at least use relative pathnames now, though they won't always work correctly with the embedding feature (though no worse than before). I've also fixed up some of

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Bo Peng wrote: Can you explain to me what the embed parameter here is supposed to mean? I have e.g. \begin_inset CommandInset bibtex LatexCommand bibtex bibfiles "/home/rgheck/files/bibtex/biblio" embed "./LyX.Embed.Dir.Abs//home/rgheck/files/bibtex/biblio.bib" options "plain" The b

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Bo Peng
> Can you explain to me what the embed parameter here is supposed to mean? > I have e.g. > \begin_inset CommandInset bibtex > LatexCommand bibtex > bibfiles "/home/rgheck/files/bibtex/biblio" > embed "./LyX.Embed.Dir.Abs//home/rgheck/files/bibtex/biblio.bib" > options "plain" The bib file i

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Bo Peng wrote: I have to say that it seems messy to me that we're effectively storing two sets of things that have the same significance: params["bibfiles"], on the one hand, and the embedded file list, on the other. This makes the logic in InsetBibtex, on which I worked a fair bit and would

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Bo Peng
> I have to say that it seems messy to me that we're effectively storing > two sets of things that have the same significance: params["bibfiles"], > on the one hand, and the embedded file list, on the other. This makes > the logic in InsetBibtex, on which I worked a fair bit and would have > t

Re: Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Stefan Schimanski wrote: I've traced the problem with citations for a while, and I'm still kind of puzzled. This has something to do with the fact that EmbeddedFile objects, since they inherit from FileName, always store absolute pathnames. But in many of these cases, it seems that the Embedde

Re: Embedded Files and InsetBibtex

2008-03-26 Thread Stefan Schimanski
I've traced the problem with citations for a while, and I'm still kind of puzzled. This has something to do with the fact that EmbeddedFile objects, since they inherit from FileName, always store absolute pathnames. But in many of these cases, it seems that the EmbeddedFile objects actually

Embedded Files and InsetBibtex

2008-03-26 Thread rgheck
Bo Peng wrote: Is there any progress on this? Is it a problem by design of the new file handling? Or just a bug? What does "There are a lot of work in this area." mean? Is anybody actively working on this? These files are now EmbeddedFiles and their latex output names are currently wron

Re: [Embedding discussion 2] Data structure of embedded files.

2007-09-10 Thread Bo Peng
> Using a map for this purpose would fit exactly. If you > need also the reverse translation then it might not be the best fit > anymore There are reverse translations. The problem is that *both* names have to be checked because EmbeddedFiles does not know in advance which name will be checked. >

Re: [Embedding discussion 2] Data structure of embedded files.

2007-09-10 Thread Georg Baum
Bo Peng wrote: > Now, JMarc mentioned that he would like to use a map for embedded > files. That seems natural to me: At some place you have to translate from external to embedded names. Using a map for this purpose would fit exactly. If you need also the reverse translation then it might

Re: [Embedding discussion 2] Data structure of embedded files.

2007-09-07 Thread Bo Peng
> I am solving this problem by A patch has already been submitted. Please test it using lyx' User's guide. Bo

Re: [Embedding discussion 2] Data structure of embedded files.

2007-09-07 Thread Bo Peng
> This is actually also related to the original problem with [Embedding > discussion 1], do we want multiple entries for multiple insets > referring to the same file? I am solving this problem by 1, store a list of ParConstIterator for multiple insets in a EmbeddedFile item. 2. display the file i

[Embedding discussion 2] Data structure of embedded files.

2007-09-07 Thread Bo Peng
Dear all, Thanks to Edwin, the embedding dialog is working again. It now has a list of embedded files, with embedding status (true/false) indicated by checkboxes. There are five buttons: select (embed selected files), unselect (dis-embed selected files), add (add a file), extract (extract

Re: [PATCH] Embedding feature patch 2: Collect embedded files and read/write zipped .lyx file with a manifest.

2007-08-22 Thread Andre Poenitz
enabled (disabled by default), .lyx file can embed > graphics, > +listings, bib file etc. > + > +2. Embedding of certain files are automatic (graphics, bib etc), and > +other files can be embedded manually. > + > +3. Embedded file.lyx file is a zip file, with file.ly

Re: [PATCH] Embedding feature patch 2: Collect embedded files and read/write zipped .lyx file with a manifest.

2007-08-22 Thread Bo Peng
+ + +void EmbeddedFiles::update() +{ + // invalidate all files, obsolete files will then not be validated by the + // following document scan. These files will still be kept though, because + // they may be added later and their embedding status will be meaningful + // again (thinking of cut/paste

[PATCH] Embedding feature patch 2: Collect embedded files and read/write zipped .lyx file with a manifest.

2007-08-22 Thread Bo Peng
Dear all, Attached please find the second patch for the embedding feature. The key points are: 1. void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &, ParConstIterator const &) const; An inset registers embedded files with an EmbeddedFiles class. 2. void EmbeddedFiles::up