Programmatic links

I’m currently creating a PDF and EPUB from a single source. I would like to include several links to Wikipedia in my EPUB, but not in my PDF. Is it possible to do this?

I have explored text replacement at compile time to replace manually inserted tags with http:// references, but that creates a string literal, not a clickable hypertext reference.

I suppose I could compile to MMD and then from MMD to EPUB, but that work flow feels laborious compared to compiling directly to EPUB.

Thanks for any advice,

In compile in third panel under cogwheel icon is option to remove all hyperlinks, so add to one then remove for the second output in that section.

Yes, you can do conditional text in Scrivener. Here’s a write-up, with a demonstration project.

Styles are what you’re looking for though. Putting a link inside of one that gets deleted when you compile to one format but not another is trivial.

1 Like

Thanks, but i think that would remove internal links, also.

That is for the compiled project, if you want to include internal links in compiled pdf then yes.