From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Colored text in PDF
Date: Wed, 06 May 2020 12:38:12 +0200 [thread overview]
Message-ID: <87tv0txsa3.fsf@zeitkraut.de> (raw)
In-Reply-To: <d3523f75-4ff6-455f-a5f7-d177cf048486-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
R. Wils writes:
> function Span(el)
> if FORMAT == "latex" and el.attributes.color then
> return { pandoc.RawInline("latex", "\\textcolor{" ..
> el.attributes.color .. "}"), el }
> elseif FORMAT == "latex" and el.attributes['text-decoration'] then
> return { pandoc.RawInline("latex", "\\underline{" ..
> el.attributes['text-decoration'] .. "}"), el }
> end
> end
>
> But something is strange:
>
> Input:
>
> [this is my text]{color=red}
> [this is my text]{text-decoration=underline}
>
> Output:
> this is my text
> *underline*this is my text
>
> It underlines the word underline!
> Is my input wrong?
The input is fine, but the filter should be
function Span(el)
if FORMAT == "latex" and el.attributes.color then
return { pandoc.RawInline("latex", "\\textcolor{" ..
el.attributes.color .. "}"), el }
elseif FORMAT == "latex" and el.attributes['text-decoration'] then
return {pandoc.RawInline("latex", "\\underline"), el}
end
end
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
next prev parent reply other threads:[~2020-05-06 10:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 14:36 R. Wils
[not found] ` <5f7aae6a-8087-439d-874b-dcf547dd10b1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-05 16:14 ` John MacFarlane
[not found] ` <m2o8r24avd.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-05-05 17:36 ` R. Wils
[not found] ` <d38ce0bc-44cc-4e70-9914-728835ead837-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-05 18:00 ` Pablo Rodríguez
2020-05-05 20:58 ` John MacFarlane
[not found] ` <m2o8r2m73g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-05-06 9:00 ` R. Wils
[not found] ` <675c273d-a1c9-4e7a-8ec1-ec604ee056d7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-06 9:48 ` Albert Krewinkel
[not found] ` <87v9l9xukv.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-05-06 10:16 ` R. Wils
2020-05-06 16:42 ` John MacFarlane
[not found] ` <m2tv0tkoao.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2020-05-06 17:52 ` R. Wils
2020-05-06 10:24 ` R. Wils
[not found] ` <d3523f75-4ff6-455f-a5f7-d177cf048486-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-06 10:38 ` Albert Krewinkel [this message]
[not found] ` <87tv0txsa3.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-05-06 12:29 ` R. Wils
2020-05-06 12:28 ` R. Wils
2020-05-06 13:51 ` R. Wils
[not found] ` <03334be3-9d8c-4834-a0f1-e623ef668f42-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-06 14:18 ` Jeremy Theler
[not found] ` <443fca3d3f7aec7a51ddb5b7efad86c0b3958b00.camel-24em0bpozeFWk0Htik3J/w@public.gmane.org>
2020-05-06 15:12 ` R. Wils
[not found] ` <23108add-70bd-42e1-a320-8c5a38363b6f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-05-06 16:40 ` jeremy theler
[not found] ` <CAK0LiymWf-favbZ6t4VWrqW5CkpLRFvjd8096h9RSL3_7nxvoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-05-06 17:51 ` R. Wils
2020-05-14 8:20 ` Christophe Demko
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=87tv0txsa3.fsf@zeitkraut.de \
--to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@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).