public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Converting to latex with a figure in a table
@ 2021-05-20  2:22 jiewuza
  2021-05-21  2:35 ` jiewuza
  0 siblings, 1 reply; 5+ messages in thread
From: jiewuza @ 2021-05-20  2:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I got 2 problems.
1. If the figure is converted as 
```
\includegraphics{img/logo.png}
```
in a table cell, the image is two big to fill in the cell in the resulting pdf. It seems the image is not constained by the width of the table cell.

2. Now if I want to add caption for the figure and manually modify it as
```
\begin{figure}
\centering
\includegraphics{img/logo.png}
\caption{blah blah}
\end{figure}
```

It results in error during pdf generation.

According to https://tex.stackexchange.com/questions/383254/placing-figures-inside-table-with-captions-for-each

I wonder if it is possible for a lua filter to use subfigure when a figure is found in a table.
-- 


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

* Re:Converting to latex with a figure in a table
  2021-05-20  2:22 Converting to latex with a figure in a table jiewuza
@ 2021-05-21  2:35 ` jiewuza
  2021-05-21 17:07   ` John MacFarlane
  0 siblings, 1 reply; 5+ messages in thread
From: jiewuza @ 2021-05-21  2:35 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I found that the first problem is caused by
```
\begin{longtable}[]{@{}


  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}


  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}


  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}@{}}

```
the width setting in the resulting longtable.

But I have no idea when pandoc will generate such settings for a table, since in most cases I saw
```
\begin{longtable}[]{@{}ll@{}}
```



-- 


jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> 写入消息新闻:
> I got 2 problems.
> 1. If the figure is converted as 
> ```
> \includegraphics{img/logo.png}
> ```

----Android NewsGroup Reader----
http://www.piaohong.tk/newsgroup

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/s8769u%24k1f%241%40ciao.gmane.io.

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

* Re:Converting to latex with a figure in a table
  2021-05-21  2:35 ` jiewuza
@ 2021-05-21 17:07   ` John MacFarlane
  2021-05-24  1:42     ` jiewuza
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2021-05-21 17:07 UTC (permalink / raw)
  To: jiewuza, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


When you have a "simple" table with inline cell contents,
no widths are needed, but if you have a table with contents
that span multiple lines, then we need to explicitly
specify widths for the columns.  If you don't do this
yourself (see the manual), then pandoc will divide equally.


jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> writes:

> I found that the first problem is caused by
> ```
> \begin{longtable}[]{@{}
>
>
>   >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}
>
>
>   >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}
>
>
>   >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.33}}@{}}
>
> ```
> the width setting in the resulting longtable.
>
> But I have no idea when pandoc will generate such settings for a table, since in most cases I saw
> ```
> \begin{longtable}[]{@{}ll@{}}
> ```
>
>
>
> -- 
>
>
> jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> 写入消息新闻:
>> I got 2 problems.
>> 1. If the figure is converted as 
>> ```
>> \includegraphics{img/logo.png}
>> ```
>
> ----Android NewsGroup Reader----
> http://www.piaohong.tk/newsgroup
>
> -- 
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/s8769u%24k1f%241%40ciao.gmane.io.

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2k0nsdnhc.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re:Converting to latex with a figure in a table
  2021-05-21 17:07   ` John MacFarlane
@ 2021-05-24  1:42     ` jiewuza
  2021-05-24 18:33       ` John MacFarlane
  0 siblings, 1 reply; 5+ messages in thread
From: jiewuza @ 2021-05-24  1:42 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Thank you John for your explanation.

The design is reasonable. 
If I have col width setting in a HTML table, and convert it to latex, the setting is discarded currently. And it would be great if the width setting is accessible in a lua filter.


-- 


John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> 写入消息新闻:
> 
> When you have a "simple" table with inline cell contents,
> no widths are needed, but if you have a table with contents

----Android NewsGroup Reader----
http://www.piaohong.tk/newsgroup

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/s8f0ar%24169q%241%40ciao.gmane.io.

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

* Re:Converting to latex with a figure in a table
  2021-05-24  1:42     ` jiewuza
@ 2021-05-24 18:33       ` John MacFarlane
  0 siblings, 0 replies; 5+ messages in thread
From: John MacFarlane @ 2021-05-24 18:33 UTC (permalink / raw)
  To: jiewuza, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> writes:

> Thank you John for your explanation.
>
> The design is reasonable. 
> If I have col width setting in a HTML table, and convert it to latex, the setting is discarded currently. And it would be great if the width setting is accessible in a lua filter.

IT shouldn't be discarded. Maybe we need to look at a specific
example that shows this.


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

end of thread, other threads:[~2021-05-24 18:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  2:22 Converting to latex with a figure in a table jiewuza
2021-05-21  2:35 ` jiewuza
2021-05-21 17:07   ` John MacFarlane
2021-05-24  1:42     ` jiewuza
2021-05-24 18:33       ` 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).