Clickable Link to Specific *location* of document? (eg. TOC

Hi guys,

I’ve been trying to figure out how to do this in DTPro Office for a while and also have been searching on google and here because I was sure I would find the solution but… no luck!

I think what I’m trying to do is very basic. I’d like to create a clickable link in a document that links to a specific section/location of a file (same document or different).

For instance let’s say you have a long document you’re working on that has 7 different parts. For quick access to each of those 7 parts you’d create a table of contents type section at the top of the document that would link to the different parts of the document. Or a little link after a citation that would lead to a footnote.

Yes like we see all the time on the web. e.g. Wikipedia.
It’s easy to create a link to another document, but to a specific section of a document? Don’t tell me that’s not possible!? :open_mouth:

Thanks!
Gabriel

What kind of documents do you use? E.g. it’s possible to link to certain pages of PDF documents.

The HTML code of Web pages makes it possible to define anchor points within the page that can be linked to; that’s the basis of the TOC links on many Web pages.

But that’s not possible in most document filetypes. Some, such as Word and Pages, enable features such as links to endnotes, but that can only be done within the parent application, not by DEVONthink (which doesn’t modify the filetypes of documents).

As Christian noted, in the case of PDFs the filetype provides links to individual pages of a document, and such Page Links can be copied within DEVONthink and pasted into, e.g., a rich text Annotation document. If you’ve copied an excerpt from a PDF into a rich text note, its Page Link can be used to accompany that excerpt as source information.

Another approach that I use to refer to the location of references within a document (of any filetype containing text) is to pick a “cue string” of text that’s likely to be pretty unique when searched for in my databases. It’s easy to pick a string of 5, 6 or 7 words within or near the location of the excerpted material and copy/paste them into my notes as a searchable “location finder” for an excerpt I’ve copied from a document into a note. I can then copy/paste that text string into a DEVONthink search query, enclosing the string by quotation marks to specify that the search is for an exact string (phrase).

This “cue string” phrase search almost always results in a very small list of search results, within which it’s easy to pick the document I’m looking for. In a number of document filetypes, selecting the desired document will result in scrolling to the first occurrence of the cue string, which in many cases including text, HTML, WebArchive and PDF documents will be highlighted. So it’s quite practical as an approach to defining locations in such documents.

Thanks guys for your input.

Right now I use simple RTF files but I’d be open to use something else.
It needs to be editable though so I can’t really consider using PDF.

Bill if I understand what you’re saying correctly, you’re talking about using the search dialog (quick or query) with a specific combination of words that would find the document and location of that “cue string” as you call it.

Even if it would find the exact spot in the exact document I want to go to every time, it’s still a cumbersome way to do it right? (click search dialog or launch search query, paste or type words, hit return, click on item, etc. instead of going to the TOC and clicking on the section you want to go to)

Unless there would be a way to Create a Link within a document that would trigger a search within that document?
i.e. “Make link” of sentence or word, then that link triggers a cmd-f of “7.2 The Theory of xxxxxx xxxxx” which would then jump to that first occurrence of that search.

Possible?

Not possible. Such a feature doesn’t exist in the plain and rich text code that’s part of OS X and is used by DEVONthink. There are, of course, text editors that can add features to text documents, but those added features would usually require opening the document under that parent application.

The focus of DEVONtechnologies is not on creating new proprietary applications, but on database technology, the environment in which one works with collections of documents.

Yes, the approach of using searchable “cue strings” takes a few seconds, but gets the job done. As kludges go, it’s a pretty simple one. :slight_smile:

For an HTML document in your database, you could open the document in an HTML editor and create your TOC or other links to anchor points within the document. Unless you then use the anchor link(s) frequently, you would have spent more time than by using the cue string approach. And that specific editing approach would be limited to HTML or WebArchive documents.

It is straightforward to create a clickable link to a specific section or location in the same document by using MultiMarkdown, which is supported by DEVONthink. Just write the document in MultiMarkdown using the syntax for Cross Reference, and then render it in DTPO using View/Best Alternative to display the clickable links. The syntax guide for MultiMarkdown is here: rawgithub.com/fletcher/human-ma … index.html

As I had noted, there are text editors that can do linking to locations inside s document, snd the reference noted by khw can be useful.

The kludge I suggested, using “cue strings” and Search, remains a useful option to return to a location in a number of document filetypes that don’t provide such a feature. It’s available in any text editor or word processor, whose documents are stored in a DEVONthink database and contain summaries, excerpts or notes about another document. I find this helpful when I’m making notes, as I may need to return to the location in the document to verify a summary I’ve made.

Thanks everyone for your input !
I’ll explore different techniques including the MultiMarkdown one. Thanks khw for that!

One can get close to a specific location using an alternate form of a standard DEVONthink item link. (Edit > Copy Item Link)

Modify the item link as follows:


x-devonthink-item://00F8CB9F-171F-4FD0-965C-2AFA4C770B49?search=terminology

the search string should be URL-encoded, so this is a longer version of the string


x-devonthink-item://00F8CB9F-171F-4FD0-965C-2AFA4C770B49?search=terminology%20location%20target

The target document (the destination at the other end of the x-devonthink-item:// link) can be PDF, RTF, Markdown, Text, etc.

I’ve published over the years several scripts in the forum that automate the capture of such links. (Search and you’ll find them.) Such a script can be installed in the toolbar, for example, and operate to capture a ?search link from selected text in a document, for pasting elsewhere. This is not a real location-specific link, but can be finer-tuned than page links.