public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Align tables to left, as opposed to centered, using markdown to pdf via xelatex
@ 2015-01-08 14:08 Larry Hynes
  2015-01-08 15:28 ` Mark Szepieniec
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Hynes @ 2015-01-08 14:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Currently the only way that I've found to do this is to first
get Pandoc to output .tex from the markdown source, then change
the [c] in

    \begin{longtable}[c]{@{}llr@{}}

to an [l], copy and paste that table into the original markdown
document and then convert to .pdf using the -R flag.

I've tried everything I can think of in my xelatex template to
get the table to align left but Pandoc seems to override all and
stick doggedly to [c].

Can anyone offer any suggestions please, as to how I might be
able to convert directly from markdown to pdf, via xelatex, and
have tables align to the left?


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

* Re: Align tables to left, as opposed to centered, using markdown to pdf via xelatex
  2015-01-08 14:08 Align tables to left, as opposed to centered, using markdown to pdf via xelatex Larry Hynes
@ 2015-01-08 15:28 ` Mark Szepieniec
  2015-01-08 19:46   ` Larry Hynes
       [not found]   ` <CAE4-1rWuKgOaoSfsupmKpA++keahDkMS_xEZPCRvXzFNrpQk6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Szepieniec @ 2015-01-08 15:28 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I don't think there's a straightforward way to do that.

You _could_ write a filter which catches tables, and uses a slightly
modified version of pandoc's latex table writer function to make it output
\begin{longtable}[l].....

On Thu, Jan 8, 2015 at 3:08 PM, Larry Hynes <larry-kWvUfStYLBx0ubjbjo6WXg@public.gmane.org> wrote:

> Currently the only way that I've found to do this is to first
> get Pandoc to output .tex from the markdown source, then change
> the [c] in
>
>     \begin{longtable}[c]{@{}llr@{}}
>
> to an [l], copy and paste that table into the original markdown
> document and then convert to .pdf using the -R flag.
>
> I've tried everything I can think of in my xelatex template to
> get the table to align left but Pandoc seems to override all and
> stick doggedly to [c].
>
> Can anyone offer any suggestions please, as to how I might be
> able to convert directly from markdown to pdf, via xelatex, and
> have tables align to the left?
>
> --
> 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/m8m31g%241td%241%40ger.gmane.org
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAE4-1rWuKgOaoSfsupmKpA%2B%2BkeahDkMS_xEZPCRvXzFNrpQk6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Align tables to left, as opposed to centered, using markdown to pdf via xelatex
  2015-01-08 15:28 ` Mark Szepieniec
@ 2015-01-08 19:46   ` Larry Hynes
       [not found]   ` <CAE4-1rWuKgOaoSfsupmKpA++keahDkMS_xEZPCRvXzFNrpQk6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Larry Hynes @ 2015-01-08 19:46 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Thanks Mark - you got me thinking!

Instead of a filter I can use:
    
    pandoc -f markdown -t latex f.md | sed 's/\[c\]/\[l\]/g' | ...

So, a filter of sorts. :)

It's crude, but working. Maybe a bit of tightening up on the regex and I
would be quite happy to use this when necessary.

On 2015-01-08, Mark Szepieniec <mszepien-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> --001a11c1f8b009e41e050c25b169
> Content-Type: text/plain; charset=UTF-8
>
> I don't think there's a straightforward way to do that.
>
> You _could_ write a filter which catches tables, and uses a slightly
> modified version of pandoc's latex table writer function to make it output
> \begin{longtable}[l].....
>
> On Thu, Jan 8, 2015 at 3:08 PM, Larry Hynes <larry-kWvUfStYLBx0ubjbjo6WXg@public.gmane.org> wrote:
>
>> Currently the only way that I've found to do this is to first
>> get Pandoc to output .tex from the markdown source, then change
>> the [c] in
>>
>>     \begin{longtable}[c]{@{}llr@{}}
>>
>> to an [l], copy and paste that table into the original markdown
>> document and then convert to .pdf using the -R flag.
>>
>> I've tried everything I can think of in my xelatex template to
>> get the table to align left but Pandoc seems to override all and
>> stick doggedly to [c].
>>
>> Can anyone offer any suggestions please, as to how I might be
>> able to convert directly from markdown to pdf, via xelatex, and
>> have tables align to the left?


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

* Re: Align tables to left, as opposed to centered, using markdown to pdf via xelatex
       [not found]   ` <CAE4-1rWuKgOaoSfsupmKpA++keahDkMS_xEZPCRvXzFNrpQk6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-01-17 15:12     ` Eugéne Roux
  2015-01-17 15:21       ` Larry Hynes
  0 siblings, 1 reply; 6+ messages in thread
From: Eugéne Roux @ 2015-01-17 15:12 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


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

Is there any docs on how to go about doing this?

Most of the time I'm very happy with the center-aligned tables, but when 
one needs left-aligned tables, one REALLY needs them.

On Thursday, 8 January 2015 17:28:28 UTC+2, Mark Szepieniec wrote:
>
> I don't think there's a straightforward way to do that.
>
> You _could_ write a filter which catches tables, and uses a slightly 
> modified version of pandoc's latex table writer function to make it output 
> \begin{longtable}[l].....
>
> On Thu, Jan 8, 2015 at 3:08 PM, Larry Hynes <la...-kWvUfStYLBx0ubjbjo6WXg@public.gmane.org 
> <javascript:>> wrote:
>
>> Currently the only way that I've found to do this is to first
>> get Pandoc to output .tex from the markdown source, then change
>> the [c] in
>>
>>     \begin{longtable}[c]{@{}llr@{}}
>>
>> to an [l], copy and paste that table into the original markdown
>> document and then convert to .pdf using the -R flag.
>>
>> I've tried everything I can think of in my xelatex template to
>> get the table to align left but Pandoc seems to override all and
>> stick doggedly to [c].
>>
>> Can anyone offer any suggestions please, as to how I might be
>> able to convert directly from markdown to pdf, via xelatex, and
>> have tables align to the left?
>>
>> --
>> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/m8m31g%241td%241%40ger.gmane.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/89cc306f-9b66-4d13-857a-b124af417dc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Align tables to left, as opposed to centered, using markdown to pdf via xelatex
  2015-01-17 15:12     ` Eugéne Roux
@ 2015-01-17 15:21       ` Larry Hynes
       [not found]         ` <m8bqob-8p1.ln1-hFr9yDdQiE6PX3baIHBI6tBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Hynes @ 2015-01-17 15:21 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 2015-01-17, Eugéne Roux <eugene.roux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Is there any docs on how to go about doing this?

I think https://github.com/jgm/pandocfilters is a good starting
point, if you don't want to use my sed hack. ;)

> Most of the time I'm very happy with the center-aligned tables, but when 
> one needs left-aligned tables, one REALLY needs them.
>
> On Thursday, 8 January 2015 17:28:28 UTC+2, Mark Szepieniec wrote:
>>
>> I don't think there's a straightforward way to do that.
>>
>> You _could_ write a filter which catches tables, and uses a slightly 
>> modified version of pandoc's latex table writer function to make it output 
>> \begin{longtable}[l].....
>>
>> On Thu, Jan 8, 2015 at 3:08 PM, Larry Hynes <la...-kWvUfStYLBx0ubjbjo6WXg@public.gmane.org 
>> <javascript:>> wrote:
>>
>>> Currently the only way that I've found to do this is to first
>>> get Pandoc to output .tex from the markdown source, then change
>>> the [c] in
>>>
>>>     \begin{longtable}[c]{@{}llr@{}}
>>>
>>> to an [l], copy and paste that table into the original markdown
>>> document and then convert to .pdf using the -R flag.
>>>
>>> I've tried everything I can think of in my xelatex template to
>>> get the table to align left but Pandoc seems to override all and
>>> stick doggedly to [c].
>>>
>>> Can anyone offer any suggestions please, as to how I might be
>>> able to convert directly from markdown to pdf, via xelatex, and
>>> have tables align to the left?
>>>
>>> --
>>> 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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>>> <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/m8m31g%241td%241%40ger.gmane.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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/m8bqob-8p1.ln1%40bsd.larryhynes.com.
For more options, visit https://groups.google.com/d/optout.


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

* Re: Align tables to left, as opposed to centered, using markdown to pdf via xelatex
       [not found]         ` <m8bqob-8p1.ln1-hFr9yDdQiE6PX3baIHBI6tBPR1lH4CV8@public.gmane.org>
@ 2015-12-02 19:14           ` Gang Liang
  0 siblings, 0 replies; 6+ messages in thread
From: Gang Liang @ 2015-12-02 19:14 UTC (permalink / raw)
  To: pandoc-discuss; +Cc: larry-kWvUfStYLBx0ubjbjo6WXg


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

The mechanism of the pandocfilters is to work on the intermediate pandoc 
AST json file. By then, the longtable environment is not generated yet. I 
feel we have to use your sed hack if not wanting to write code to convert 
the parsed AST tree to longtable by ourselves, :).

On Saturday, January 17, 2015 at 8:14:52 AM UTC-8, Larry Hynes wrote:
>
> On 2015-01-17, Eugéne Roux <eugen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> wrote: 
>
> > Is there any docs on how to go about doing this? 
>
> I think https://github.com/jgm/pandocfilters is a good starting 
> point, if you don't want to use my sed hack. ;) 
>
>

-- 
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/808fee0b-b87f-43ea-8062-5e19ae0467d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

end of thread, other threads:[~2015-12-02 19:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 14:08 Align tables to left, as opposed to centered, using markdown to pdf via xelatex Larry Hynes
2015-01-08 15:28 ` Mark Szepieniec
2015-01-08 19:46   ` Larry Hynes
     [not found]   ` <CAE4-1rWuKgOaoSfsupmKpA++keahDkMS_xEZPCRvXzFNrpQk6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-17 15:12     ` Eugéne Roux
2015-01-17 15:21       ` Larry Hynes
     [not found]         ` <m8bqob-8p1.ln1-hFr9yDdQiE6PX3baIHBI6tBPR1lH4CV8@public.gmane.org>
2015-12-02 19:14           ` Gang Liang

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