From: Thomas Lord <lord-A+ZCe59fpk2Wd6l5hS35sQ@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: internal link page numbers?
Date: Fri, 09 Jun 2017 16:14:52 -0700 [thread overview]
Message-ID: <a2cffc92057a6d133075b499b1228378@basiscraft.com> (raw)
In-Reply-To: <20170608093907.GD23518-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
Thank you. To get printed page numbers on references
I adopted this workaround:
In a custom LaTeX template I defined a macro PG,
after package hyperref is loaded:
\usepackage{hyperref}
\newcommand{\PG}[1]{\mbox{(p. \pageref{#1})}}
Thus I can write a link this way:
[copyright and licensing terms \PG{copyright}](#copyright)
which is not ideal but will do.
On the other issue, you suggest writing:
[Appendix: The GNU General Public License 3.0]
That's the opposite of what I am wishing for. Supposing
a section header like this:
Appendix: Copyright and Licensing Information {#copyright .unnumbered}
=============================================
I wish I could write a link like this:
[](#copyright)
And have the text "Appendix: Copyright ... Information" supplied
automagically.
That way, if I alter the section header, all such links
to the section stay in sync.
-t
On 2017-06-08 02:39, John MacFarlane wrote:
> +++ Thomas Lord [Jun 06 17 17:18 ]:
>> Help?
>>
>> I am writing markdown source in order to produce HTML output and PDF
>> (via LaTeX) output.
>> I have two questions about internal links:
>> 1. My internal links are being rendered, in PDF, as hyperlinks that
>> are
>> useful when viewing the PDF on a screen. How can I have such links
>> be
>> rendered in a way that includes a page number, suitable for printed
>> forms of the PDF? (Of course, I hope the on-line PDF still has a
>> clickable hyperlink.)
>
> You can use raw LaTeX \label{..}, \pageref{..} for this.
> But there's no way to do it in native pandoc; pandoc doesn't
> have a concept of pages, since only page-layout software can
> know what page it's on.
>
>> 2. Is there a way to write a link to an internal section, such that
>> the
>> link text is automatically taken from the section name? For
>> example,
>> if I have a section:
>> Appendix: The GNU General Public License 3.0 {#gnu-license}
>> ============================================
>> then is there a way to write a link mentioning just "#gnu-license",
>> and
>> having the title of the appendix filled in automatically?
>
> You can just write
>
> [Appendix: The GNU General Public License 3.0]
>
> and you'll get an automatic link with the title.
next prev parent reply other threads:[~2017-06-09 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 0:18 Thomas Lord
[not found] ` <9c1fc336-b56d-433d-a007-1a094326afce-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-06-08 9:39 ` John MacFarlane
[not found] ` <20170608093907.GD23518-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2017-06-09 23:14 ` Thomas Lord [this message]
[not found] ` <a2cffc92057a6d133075b499b1228378-A+ZCe59fpk2Wd6l5hS35sQ@public.gmane.org>
2017-06-11 8:29 ` John MacFarlane
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=a2cffc92057a6d133075b499b1228378@basiscraft.com \
--to=lord-a+zce59fpk2wd6l5hs35sq@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/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).