public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Pandoc transforms *inside* latex macro arguments?
Date: Tue, 9 Dec 2014 10:43:40 +0100	[thread overview]
Message-ID: <CADAJKhADyH8bkfQ42YJQ+1fr-h5U4s5ZkUaCXYHkOJx3rgmLPw@mail.gmail.com> (raw)
In-Reply-To: <cecd5ef5-cc75-45ff-8f7d-996b673ee8bf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

What I do is that I put the markdown which should go inside the command
argument in a div element with a `cmd="foo"` attribute `<span cmd=foo>some
*emph* here` and then let my filter prepend a
{"RawInline":["latex","\\foo{"]} at the beginning of the Span's content
list and append a {"RawInline":["latex","}"]} at the end. Then I can easily
have another filter remove the `cmd` attribute and insert its value as a
class when producing HTML from the same source. I also have an `args`
attribute of the form `args="\foo{before}{span}#{after}{span}"` or
`args="foo#before%span#after%span"` where with the second form I do a
`split` on `#` and a `s/%/}{/g` when producing LaTeX and when producing
HTML a `tr/#%/.-/` and insert the resulting 'foo.before-span.after-span' as
a class.
Den 8 dec 2014 20:26 skrev "Ranjit Jhala" <rjhala-fWt/sZ2FBdz2fBVCVOL8/A@public.gmane.org>:

> Hi John,
>
> Unfortunately, the \footnotetext macro is already defined inside
> tufte-latex; if I
>
> 1. modify your suggestion with \renewcommand, then the text just gets
> inlined (i.e. doesn't appear as footnotes)
>
> 2. modify your suggestion with
>
>     \newcommand\myfootnote[1]{\footnotetext{#1}}
>
>     then I still don't get the desired effect.
>
> In both cases, I took "preamble" to mean, the "template" i.e. I am running
>
> pandoc --from=markdown+lhs --chapters --latex-engine=pdflatex
> --template=templates/default.latex
>
> so I made the edits to default.latex. Did you mean something else?
>
> Many thanks!
>
> Ranjit.
>
> On Sunday, December 7, 2014 12:24:10 AM UTC-8, John MacFarlane wrote:
>>
>> Just define a macro and add it to the preamble before
>> converting using pandoc:
>>
>>     \newcommand\footnotetext[1]{#1}
>>
>>
>> +++ Ranjit Jhala [Dec 06 14 16:08 ]:
>> >Hello,
>> >
>> >Is there a way to tell pandoc to transform strings that appear *inside*
>> the
>> >arguments for latex macros? For example,
>> >I'd like to use the tufts-book class' \footnotetext{ ... } command, and
>> I'd
>> >like to write things like:
>> >
>> >   \footnotetext{This is *really* important.}
>> >
>> >The trouble is that this gets rendered, in the latex, with the `*`
>> rather
>> >than with the usual markdown italics.
>> >
>> >Is there a way to tell pandoc to actually convert the *really* to
>> >\emph{really} or will it always ignore all arguments to latex macros
>> (like
>> >\footnotetext) ?
>> >
>> >Many thanks!
>> >
>> >Ranjit.
>> >
>> >--
>> >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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >To view this discussion on the web visit https://groups.google.com/d/
>> msgid/pandoc-discuss/0076c586-cd14-4c4b-ac33-21d67ca1abb8%
>> 40googlegroups.com.
>> >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/cecd5ef5-cc75-45ff-8f7d-996b673ee8bf%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/cecd5ef5-cc75-45ff-8f7d-996b673ee8bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CADAJKhADyH8bkfQ42YJQ%2B1fr-h5U4s5ZkUaCXYHkOJx3rgmLPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

      parent reply	other threads:[~2014-12-09  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07  0:08 Ranjit Jhala
     [not found] ` <0076c586-cd14-4c4b-ac33-21d67ca1abb8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-12-07  0:37   ` Matthew Pickering
     [not found]     ` <CALuQ0m9ffBwFuzxcPGsUkE3d3f5+MkPMyeM28C1-okwFet1rSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-07  0:54       ` Matthew Pickering
     [not found]         ` <CALuQ0m8BNO9H78+SwR4wJ_KN4y8smdHPORM9dhT=3_EY99OUMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-08 19:23           ` Ranjit Jhala
2014-12-08 19:22       ` Ranjit Jhala
2014-12-07  8:23   ` John MacFarlane
     [not found]     ` <20141207082355.GI50605-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2014-12-08 19:26       ` Ranjit Jhala
     [not found]         ` <cecd5ef5-cc75-45ff-8f7d-996b673ee8bf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-12-09  9:43           ` BPJ [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADAJKhADyH8bkfQ42YJQ+1fr-h5U4s5ZkUaCXYHkOJx3rgmLPw@mail.gmail.com \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).