public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* internal link page numbers?
@ 2017-06-07  0:18 Thomas Lord
       [not found] ` <9c1fc336-b56d-433d-a007-1a094326afce-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Lord @ 2017-06-07  0:18 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1439 bytes --]

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.)

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?

Thanks,
-t

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9c1fc336-b56d-433d-a007-1a094326afce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1978 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: internal link page numbers?
       [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>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2017-06-08  9:39 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ 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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: internal link page numbers?
       [not found]     ` <20170608093907.GD23518-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
@ 2017-06-09 23:14       ` Thomas Lord
       [not found]         ` <a2cffc92057a6d133075b499b1228378-A+ZCe59fpk2Wd6l5hS35sQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Lord @ 2017-06-09 23:14 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: internal link page numbers?
       [not found]         ` <a2cffc92057a6d133075b499b1228378-A+ZCe59fpk2Wd6l5hS35sQ@public.gmane.org>
@ 2017-06-11  8:29           ` John MacFarlane
  0 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2017-06-11  8:29 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

The shortcut you suggest isn't really in the spirit of
Markdown, which prioritizes source readability over
easy writeability.

+++ Thomas Lord [Jun 09 17 16:14 ]:

>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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-11  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07  0:18 internal link page numbers? 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
     [not found]         ` <a2cffc92057a6d133075b499b1228378-A+ZCe59fpk2Wd6l5hS35sQ@public.gmane.org>
2017-06-11  8:29           ` John MacFarlane

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).