public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Tables and column widths
@ 2022-04-24  8:32 Lyndon Drake
       [not found] ` <fa08b2da-e039-4720-8ea1-bcf957d13acdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lyndon Drake @ 2022-04-24  8:32 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi,

Apologies for all the questions today - I'm having a day working on the 
formatting for my thesis, hence lots of little fiddly things to figure out.

If I use pipe table syntax, I can't get the column widths to adjust as 
nicely as I can if I use an external filter, and I'm not sure why. With the 
pipe table, I have done this:

|-:|:----------|----------:|:-|

which gives me the correct column alignments, but the far left and far 
right columns are wider than I would have expected. If instead I do an 
identical table with the pantable filter, and specify the widths like so:

  width:
- 0.05
- 0.45
- 0.45
- 0.05

the far left and far right columns are about what I'd expect from those 
proportions. But if possible, I'd rather avoid having to use the pantable 
filter just to nudge the column widths. Is there any way to do this in 
pandoc's Markdown table syntax?

Cheers,
Lyndon

-- 
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/fa08b2da-e039-4720-8ea1-bcf957d13acdn%40googlegroups.com.

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

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

* Re: Tables and column widths
       [not found] ` <fa08b2da-e039-4720-8ea1-bcf957d13acdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-04-24  9:17   ` Albert Krewinkel
       [not found]     ` <871qxmon09.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Krewinkel @ 2022-04-24  9:17 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Lyndon Drake <isenguard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> If I use pipe table syntax, I can't get the column widths to adjust as
> nicely as I can if I use an external filter, and I'm not sure why. With
> the pipe table, I have done this:
>
> |-:|:----------|----------:|:-|
> which gives me the correct column alignments, but the far left and far
> right columns are wider than I would have expected. If instead I do an

Columns produced from pipe tables have always the default column width.
You could use a grid table instead:

```
+--+-----------+-----------+--+
| 1| hello     | wassup?   |a |
+=:+:==========+==========:+:=+
| 2| hey       | notmuch   |b |
+--+-----------+-----------+--+
```

Wish you good luck with your thesis!

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: Tables and column widths
       [not found]     ` <871qxmon09.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-04-25  4:06       ` Lyndon Drake
  0 siblings, 0 replies; 3+ messages in thread
From: Lyndon Drake @ 2022-04-25  4:06 UTC (permalink / raw)
  To: pandoc-discuss


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

Actually I've figured out that this one was entirely my fault. The 
documentation does mention that pipe tables set column widths based on 'the 
relative cell widths determined by the number of dashes in the line 
separating the table header from the table body'.

But I wasn't counting the alignment column marker (the ':') as one of the 
dashes. Once I added sufficient extra dashes in the middle left and right 
columns to adjust the proportions, the whole table was set correctly. Which 
is great as it lets me avoid using the pantable filter (a great filter but 
as it's Python it adds quite a few seconds to my build time). That line now 
looks like this:

|-:|:-----------------|-----------------:|:-|


On Sunday, 24 April 2022 at 21:21:20 UTC+12 Albert Krewinkel wrote:

>
> Lyndon Drake <isen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > If I use pipe table syntax, I can't get the column widths to adjust as
> > nicely as I can if I use an external filter, and I'm not sure why. With
> > the pipe table, I have done this:
> >
> > |-:|:----------|----------:|:-|
> > which gives me the correct column alignments, but the far left and far
> > right columns are wider than I would have expected. If instead I do an
>
> Columns produced from pipe tables have always the default column width.
> You could use a grid table instead:
>
> ```
> +--+-----------+-----------+--+
> | 1| hello | wassup? |a |
> +=:+:==========+==========:+:=+
> | 2| hey | notmuch |b |
> +--+-----------+-----------+--+
> ```
>
> Wish you good luck with your thesis!
>
> -- 
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/3c62cf21-70af-4a01-abb3-6e13f5dbf23cn%40googlegroups.com.

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

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

end of thread, other threads:[~2022-04-25  4:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  8:32 Tables and column widths Lyndon Drake
     [not found] ` <fa08b2da-e039-4720-8ea1-bcf957d13acdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-04-24  9:17   ` Albert Krewinkel
     [not found]     ` <871qxmon09.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-04-25  4:06       ` Lyndon Drake

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