public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: The difference between image caption and title
Date: Thu, 20 May 2021 09:39:29 +0800 (GMT+08:00)	[thread overview]
Message-ID: <s84el7$sj1$1@ciao.gmane.io> (raw)

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

I have tested a lua function:

```
function handleFigure(el)
   ... --- some code to get the figure and caption object 
   if caption.content[1] then
        figure.caption = caption.content[1]
        print(TableToStr(figure))
   end
   ---figure.title = 'fig:'
   return pandoc.Para{ figure }
end
```

The printed info as below shows the caption is set correctly.
```
{['attr']={['identifier']='',['classes']={},['attributes']={}},['caption']={['content']={{['text']='xxx'},{},{['text']='yyy'}}},['src']='img/logo.png',['title']=''}
```
But the resulting latex is (What I expected is a floating figure since it has a caption)
```
\includegraphics{img/logo.png}
```

When I uncomment the line of setting figure.title, I get the expected latex result, except that the caption is still empty.
```
\begin{figure}
\centering
\includegraphics{img/logo.png}
\caption{}
\end{figure}
```

So I am confused what is the difference between caption and title, and how can I set the caption.


-- 


                 reply	other threads:[~2021-05-20  1:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='s84el7$sj1$1@ciao.gmane.io' \
    --to=jiewuza-9onoh4p/ygk@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).