public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* The difference between image caption and title
@ 2021-05-20  1:39 jiewuza
  0 siblings, 0 replies; only message in thread
From: jiewuza @ 2021-05-20  1:39 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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


-- 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-20  1:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  1:39 The difference between image caption and title jiewuza

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