Link Specific Text from One Document to Another?

I’ve improved the method a bit…

I redesigned it using a character attributes style. So that handles removing the location tags from compile if desired. It also takes care of the comments/footnotes issue in the simplest way, as well as operating outside of the inline annotations, allowing the location tags to be treated 100% apart from any other built in switches. Thus allowing to compile with inline annotations, comments, footnotes, while removing the tags that might serve no purpose in a compiled document. (Although in some situations they may. So it’s up to the user to decide whether to include them or not, leaving everything else untouched.)
Finally, using a character attributes style allows for all of this to happen without any RegEx involved. Which I believe is a big improvement.

I’ve included a project at the bottom of this post.
It contains 200 preadjusted tags that can be used to precisely jump from one location to another, anywhere should that be within a project.
image

Here is how to “install” those tags.
(Backup your project first.)

Once you have that project downloaded and unzipped, import the styles from it.
It has only one style,
image
so that is not gonna mess the styles list of your current project by bloating it.

Import styles

image


Once this is done, open that project side by side with your current one.
Drag the “Location TAGS” file from its binder to your project’s.
(I personally would place that file at the top of the binder. Above the Manuscript/Draft folder and the front matter. - By all means, don’t put it in one of those two folders…)

Once the file is in your binder, add it to project bookmarks.

That list of pre-styled tags is now accessible from within any document.


To use it:

Whenever you want to insert a tag that can be used to jump to a specific spot within another file, snatch one from that “Location TAGS” document.
It is easily accessible in the project bookmarks if you followed my instructions.
Triple click it, then cut it. (You want to cut it. Ctrl-X (not Ctrl-C). To make sure you’ll never use it again after this. → Picture that “Location TAGS” document as a sheet of single use stickers. You peel the sticker and then stick it where you want it.)
You can also drag and drop the tag from the bookmarks panel to where you want it in the main editor, then hit Ctrl-X while the focus is still on the bookmarks panel’s bottom section. As long as you don’t leave the tag in the list, for you to later mistakenly use it again for a different “link”.

Cut → Paste

image

That would be the “link to”.

Go to where you want that link to take you, and paste it again. Add a “D” (or whatever) to it, as in “Destination”.
image


And now, when you want to go from a tag to another, double click the tag from within the editor and copy it to the clipboard. (The brackets prevent the double-click selection to go beyond the tag itself.)
Using Edit / Find / Find by formatting :

This will cycle you through all of the instances of that one tag :
image

This will take you straight to the destination tag (the one you’ve added “D” to) :
image


To have all of those tags removed at compile, add the style to your compile format and check “Delete text of this style”.
image

That’s it.
Here is the project for you to download :
LocationTags-bak-2023-02-10T15-15.zip (16.7 KB)


P.S. I have stopped using the TimeStamp thing since it seems that Mac users can’t customize it, and also, in my case (Windows user), doing things like I just depicted takes the step of assigning the style to the tag out of the equation, as I preformatted them.
I will have that “Location TAGS” character attributes style and the tags document + project bookmark as part of my new project template, giving me a fresh batch of tags with each new project, everything ready to be used with no further steps.


You can search for the tag in any of the other search fields as well.
image

image


Setting up one of these emulated links can be done backwards. Destination first. It doesn’t matter.
See my previous post for the full picture.


I am proposing this uniquely as an alternative to bookmarks for when you want to point within a paragraph, or for when splitting the document in smaller bits is for some reason inconvenient.


I’ve included 200 preadjusted tags. It should be more than enough. If you need more, compile a bunch of [≡<$n>≡], paste them back (starting at 201) in the Location TAGS document, and apply the “000 Location TAGS” style to them.

5 Likes