ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Link from a PDF to a reference of an embedded PDF
Date: Sat, 22 Jul 2023 10:29:13 +0200	[thread overview]
Message-ID: <9f083f31-39e4-31ff-8d62-487d50b54b34@gmx.es> (raw)
In-Reply-To: <2292700.ElGaqSPkdT@falbala>

On 7/20/23 16:25, Gerion Entrup wrote:
> [...]
> Can I somehow access the references of inner.tex from outer.tex?
> For me, it is not that relevant, that the correct number is set, but the
> interaction within the outer PDF should work, so clicking on the
> reference should scroll to the correct content.

Hi Gerion,

not sure I’m getting your point right.

As such, one of the features of PDF are named destinations, such as in:

  https://www.pragma-ade.com/general/manuals/luametatex.pdf#%2381

I consider them as identifiers:

  https://wiki.contextgarden.net/Installation#Unix

If that could be what you might need, here is a sample.

First you have the destination file:

  \setupinteraction[state=start,
    focus=standard,
    prefix=n_,]
  \starttext
  \dorecurse{50}
    {a\footnote{b} }
  \startluacode
  luatex.wrapup(
    function()
      os.rename(tex.jobname .. ".pdf", "ba.pdf")
    end
  )
  \stopluacode
  \stoptext

Then you have calling file (with file:///):

  \setupinteraction[state=start,
    focus=standard]
  \def\MyURL#1{\goto{\tt#1}[url(#1)]}
  \starttext
  Link to other document: \MyURL{file:///path/ba.pdf\letterhash n_73}

  Link to the web:
 \MyURL{https://www.pragma-ade.com/general/manuals/luametatex.pdf#%2381}
  \stoptext

file:/// requires an absolute path. It might be handled right or not,
depending on your PDF viewer.

On Linux, Evince cannot open a file with named destination specified as
doc.pdf#destination (or doc.pdf#nameddest=destination). But it
understands file:///.

MuPDF-GL seems also not to handle named destinations, but it understands
file:/// too.

PDF.js (the default PDF viewer that comes with Firefox) handles named
destinations, but doesn‘t seem to understand file:/// as a link.

> Background of my question: I normally do graphics in a separate PDFs.
> Some graphics consists of source code together with a graphical
> representation and I want to be able to link to single source code lines.

I think it may be possible, but I don’t know how to generate named
destinations for source code lines.

Just in case it may help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-07-22  8:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 14:25 [NTG-context] " Gerion Entrup
2023-07-22  8:29 ` Pablo Rodriguez [this message]
2023-07-24 16:04   ` [NTG-context] " Gerion Entrup
2023-07-24 17:13     ` Aditya Mahajan
2023-07-25 15:38     ` Pablo Rodriguez
2023-07-26 17:47       ` Pablo Rodriguez
2023-07-27 15:20         ` Pablo Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f083f31-39e4-31ff-8d62-487d50b54b34@gmx.es \
    --to=oinos@gmx.es \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).