Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add way to reference images (with captions) #904

Closed
akerbos opened this issue Jul 11, 2013 · 9 comments
Closed

Add way to reference images (with captions) #904

akerbos opened this issue Jul 11, 2013 · 9 comments

Comments

@akerbos
Copy link
Contributor

akerbos commented Jul 11, 2013

We can specify images such that they get a a caption which translates to a figure environment in the LaTeX target (which is in particular used for PDF export in gitit).

However, floating graphics are all but useless if you can not link/refer to it. Therefore, I suggest a syntax to enable (labelling and) referencing images (with captions).

@jgm
Copy link
Owner

jgm commented Jul 13, 2013

Dup of #813?

@akerbos akerbos closed this as completed Jul 13, 2013
@CFCF
Copy link

CFCF commented Nov 15, 2013

There is a difference between referencing figures (e.g. for print media) and making internal links to figures(e.g. for HTML, on-screen reading).

This is a solution for referencing figures in academic writing in .docx works with numbered example lists:

Here is the captioned figure:

![Figure (@primitive_hut): The primitive hut](Illustrations\primitive_hut.png)

Here is a reference to the figure:

As can be seen in Figure (@primitive_hut), huts may be primitive.

And at the end of the document there is an index of figures:

# Index of Figures

(@primitive_hut) *Primitive hut* from the frontispiece of Marc-Antoine Laugier’s 1755 second edition of *Esssay on Architecture*, illustration by Charles-Dominique-Joseph-Eisen.

The index of figures is nice to have, yet actually it is an excuse to define the items of the numbered list - this can only be done at the start of a new line...

@jhchung
Copy link

jhchung commented Nov 22, 2013

@CFCF The workaround you show works pretty well. Do you know of a way to restart the numbering? For example, having an index of figures and a separate index of tables?

@akerbos
Copy link
Contributor Author

akerbos commented Nov 23, 2013

You can probably hack something like this together for LaTeX (and thus, PDF) -- or any target, for that matter -- as well but that's not really the point of pandoc, isn't it?

@grissiom
Copy link

I have a hack version for latex:

As \ref{fg:sys} **some figure** shows.

![some figure \label{fg:sys}](sth.pdf)

But this only get the figure number and hyper link done. No caption reference though...

BTW, is there any way to reference the caption of a figure in latex?

@timtylin
Copy link
Contributor

Would that be necessary? I'm having a hard time imagining a scenario where you can't just write "as explained in the caption of Figure 1".

@akerbos
Copy link
Contributor Author

akerbos commented Dec 22, 2013

@evitaerc Write an article/thesis with lots of figures and then rearrange them. You don't want to go through the whole text and change labels. It's a) useless busy work and b) prone to errors.

@certainlyakey
Copy link
Contributor

CFCF's hack is working perfectly, except you have to include the example list itself, which in case of figures in an academic paper is not needed. But omit the example list and the hack will not work. Also the parentheses are not obligatory everywhere except the example list. So we're able to write

Recently the monster has been photographed – see fig. @monster.

and then

Fig. @monster. The monster from the Earth's Core

but always with

(@monster1) blahblah anyphrase

at the end of the document.

This is not very handy, but still.

@p3palazzo
Copy link

p3palazzo commented Feb 20, 2017

@CFCF's hack is incompatible with pandoc-citeproc, which overrides every instance of @reference even when it is not inside brackets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants