On 6/24/2010 1:27 AM, Jacob Heimark wrote:
I am a newb to LyX and LaTeX. I apologize if this is (a) not the right forum/locale to ask my question in and (b) the answer to this question is somewhere on the website and I am just too stupid to find it (I spent several hours searching - at least I can't find an answer to my question). I am trying to get LyX to hyperlink to a local pdf such that a clickable "name" field in the pdf created by lyx opens a desired pdf (located in the same folder as the LyX document and the pdf). I want to use local references because I am using dropbox with a colleague, I use a mac, he uses Windows.
In LyX, click Insert > Hyperlink, put the link text in the Name field, the name of the PDF file (including extension, but excluding path) in the Target field, and click the File radio button. You're going to have to give LyX the benefit of the doubt on this: if you preview your file with one of the View > PDF (...) options, the link will be there but won't work when you click on it. If you _export_ your file to PDF, however, the link will work (provided that the target file is in the same directory as the exported document). The reason it doesn't work in preview mode is that LyX generates the preview document in a temporary directory, not in the document's home directory, and it does not copy the target file to the temp directory, nor does it adjust the path automatically (which I would characterize as a minor bug).
If I am not being clear about what I am trying to do, I will try to explain again: I am working on a joint research paper, we are trying to write it in LaTeX, we would like the final PDF produced by LyX to link to PDFs in the same folder as the LyX document so that we can quickly jump to references. Essentially, I am writing him notes and saying: see here, and want him to be able to jump there.
This will work, but keep in mind that the default behavior is for the link to _replace_ the current document with the target document (at least in Acrobat Reader). So the reader loses his/her place in the current document. If you want the link to open the target in a new reader window without closing the current document, go to Document > Settings > PDF Properties, enable "Use hyperref support", and add pdfnewwindow=true to the Additional options field.
If the hyperlink would also work in LyX and/or anyone could give me advice on how to jump to a specific section in a pdf or how best to annotate said pdf this would all be REALLY helpful.
Insert > Hyperlink causes your document to load the LaTeX hyperref package, which automatically creates bookmarks to major structural components of your PDF file (sections, subsections etc.), provided that they are numbered. If you look in the environment list, you'll see "starred" versions of several environments (e.g., Section and Section*). The starred versions are not numbered, and as a consequence hyperref will not create bookmarks for them. When the resulting PDF file is opened in Acrobat Reader (and I'm pretty sure other readers behave similarly), there will be a sidebar containing links to the unstarred components. You can control whether the sidebar is open or closed at the time the document is opened with one of hyperref's many options. If you want to generate a PDF that does not contain any external links (i.e., you're not going to do Insert > Hyperlink anywhere in it) but you do want the internal document links, just go to Document > Settings > PDF Properties and check "Use hyperref support". Note that you can also customize hyperref options there. See the manual that comes with hyperref for full details -- it should be located in the .../doc/latex/hyperref folder under your LaTeX distribution's installation directory. (All this presumes that you have the hyperref package installed, of course.)
Thank you so much for understanding, sorry to be such a newbie if my questions seem stupid.
We're all newbies until we're not. /Paul