public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Passing additional info to a pandoc filter
@ 2015-06-29 15:34 Guillermo Rodriguez Garcia
       [not found] ` <794c18c6-2623-452c-b775-a72bc2d3acff-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2015-06-29 15:34 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Hello all,

I would like to have some additional control over the way Pandoc generates 
tables when writing LaTeX. Specifically I would like to switch from 
longtable to tabularx (this shouldn't be difficult), and also have a way to 
specify column types and widths (e.g. m{1cm}, X, etc)

I thought that the way to go would be to write a filter, but I am having a 
hard time trying to figure out how to pass "additional info" to this filter 
(in this case, the column types and widths), when this additional info is 
not already available in Pandoc's AST.

Am I overlooking something? What would be the best way to approach this 
problem?

Thank you,

Guillermo 

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/794c18c6-2623-452c-b775-a72bc2d3acff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Passing additional info to a pandoc filter
       [not found] ` <794c18c6-2623-452c-b775-a72bc2d3acff-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2015-06-29 16:55   ` John MacFarlane
       [not found]     ` <20150629165500.GG26705-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2015-06-29 16:55 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Guillermo Rodriguez Garcia [Jun 29 15 08:34 ]:
>   Hello all,
>   I would like to have some additional control over the way Pandoc
>   generates tables when writing LaTeX. Specifically I would like to
>   switch from longtable to tabularx (this shouldn't be difficult), and
>   also have a way to specify column types and widths (e.g. m{1cm}, X,
>   etc)
>   I thought that the way to go would be to write a filter, but I am
>   having a hard time trying to figure out how to pass "additional info"
>   to this filter (in this case, the column types and widths), when this
>   additional info is not already available in Pandoc's AST.

Column types (alignments) and widths (relative to the text
width) are in the AST.

If you want to add information beyond what is in the AST,
then you'll have to produce RawBlock elements with literal
LaTeX rather than a pandoc Table element -- and of course
this will limit you to one output format.


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

* Re: Passing additional info to a pandoc filter
       [not found]     ` <20150629165500.GG26705-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2015-06-29 17:24       ` Guillermo Rodriguez Garcia
       [not found]         ` <CABDcavZEMmx1Ochgj3oey8ryATH+O5++NWcSxOdHJkOkkjS4gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2015-06-29 17:24 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Hello John,

El lunes, 29 de junio de 2015, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> escribió:

> +++ Guillermo Rodriguez Garcia [Jun 29 15 08:34 ]:
>
>>   Hello all,
>>   I would like to have some additional control over the way Pandoc
>>   generates tables when writing LaTeX. Specifically I would like to
>>   switch from longtable to tabularx (this shouldn't be difficult), and
>>   also have a way to specify column types and widths (e.g. m{1cm}, X,
>>   etc)
>>   I thought that the way to go would be to write a filter, but I am
>>   having a hard time trying to figure out how to pass "additional info"
>>   to this filter (in this case, the column types and widths), when this
>>   additional info is not already available in Pandoc's AST.
>>
>
> Column types (alignments) and widths (relative to the text
> width) are in the AST.


I mean being able to explicitly define types and widths. For example
m{1cm}, or X.

>
> If you want to add information beyond what is in the AST,
> then you'll have to produce RawBlock elements with literal
> LaTeX rather than a pandoc Table element -- and of course
> this will limit you to one output format.


Pity.

Is there any way to embed an "annotation" (for example in a "comment"
element) that could be picked up by filters, but ignored in the default
generated output?

Thank you,

Guillermo


>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pandoc-discuss/fOvk-pFPoiA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/20150629165500.GG26705%40localhost.hsd1.ca.comcast.net
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Guillermo Rodriguez Garcia
guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CABDcavZEMmx1Ochgj3oey8ryATH%2BO5%2B%2BNWcSxOdHJkOkkjS4gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 4360 bytes --]

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

* Re: Passing additional info to a pandoc filter
       [not found]         ` <CABDcavZEMmx1Ochgj3oey8ryATH+O5++NWcSxOdHJkOkkjS4gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-06-29 18:06           ` John MacFarlane
  0 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2015-06-29 18:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ Guillermo Rodriguez Garcia [Jun 29 15 19:24 ]:

>   Is there any way to embed an "annotation" (for example in a "comment"
>   element) that could be picked up by filters, but ignored in the default
>   generated output?

Well, you could put the whole Table in a Div with
attributes.  Or you could put a Div around each header, with
further information about how the corresponding column is to
be formatted.


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

end of thread, other threads:[~2015-06-29 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 15:34 Passing additional info to a pandoc filter Guillermo Rodriguez Garcia
     [not found] ` <794c18c6-2623-452c-b775-a72bc2d3acff-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-06-29 16:55   ` John MacFarlane
     [not found]     ` <20150629165500.GG26705-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-06-29 17:24       ` Guillermo Rodriguez Garcia
     [not found]         ` <CABDcavZEMmx1Ochgj3oey8ryATH+O5++NWcSxOdHJkOkkjS4gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-29 18:06           ` 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).