From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33004 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christophe Demko Newsgroups: gmane.text.pandoc Subject: Re: custom color for highlight Date: Tue, 1 Aug 2023 10:55:46 -0700 (PDT) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_370_1221125544.1690912546520" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9545"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDN5TJEC4AEBBI4OUWTAMGQE4M2TQBY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Aug 01 19:55:52 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qQtb5-0002Gi-DA for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 01 Aug 2023 19:55:51 +0200 Original-Received: by mail-ot1-f55.google.com with SMTP id 46e09a7af769-6b9e6a0c2ffsf11410810a34.3 for ; Tue, 01 Aug 2023 10:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1690912550; x=1691517350; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=/Vb7vb5Ps0U2ZulDNaUeSXB39It5XKykmUvfiV9fDxg=; b=RcFvB7MPjRTnHK4sWmWV7AOhdbjhSDv8no+FQzPx1tZrogQeMaNd56DvVich9gwvnA jBVAr9S79WItzAclKq949B+vGPR1w1r7tUw+HwT/geeGsRrHnsE23rBLJrqrc1CWYaF7 FPte3KxLP3wpRTgeVz9HVYMAhQPpAvk+n4VExkCGQR7aF8VcNleBqF1YTgfSNh4kmiaZ +nlosBQOjSDqhamfcVhVIEVzTs6dXDuoQCwm4d+EP9X1nkfAMoH/kppgyVZOF+7rWKaV ofcLBLt2dvl3I2j2f9Zx6v4qMQ32eMfiTLMns2+R5iLXePbDOJ2lpRPC9oiTEMx6J2dS VtqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690912550; x=1691517350; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=/Vb7vb5Ps0U2ZulDNaUeSXB39It5XKykmUvfiV9fDxg=; b=TT+MomKOGBY4q/9jG8yAiue1aL4ptgUPx+7WgP1q24KNl2lusO8IhbjSRWOr1k/hO7 +yQkib31GtG6bfeSkotodt376/CmCVDiSeQGJE0vOU6LZywRuaGRUCPQnt06/CpVrpAa ToPnbsCAQBSSfUqsszU5c463np1/VFReCafTmtxm2WEAcCubIRj+/jhnLanaN0GWm7Qb wAqa3wr56zIWSSVBiqYsxjws9YkbYPmJ9Ba3//FC9mk8nTX0LR7gA0hWCwk/k06miPEc poenki2fg/fqYoayr3M5iJxax+PBzCVxstS9ZjXX0LlblZTMgsk/qfdw0UAVa5udZrg2 fgsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690912550; x=1691517350; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=/Vb7vb5Ps0U2ZulDNaUeSXB39It5XKykmUvfiV9fDxg=; b=eSGCGWVqtGHP0R6KrqVLmNx4w49cONDIwGCy6mAIarphXuY2uCus6PhdT3wWxkJVnQ 7aHLd9izNIL+7gbqsNTA3dBwpZ+ypzvvvutDZz8BziiAiTS8oOyKX+0ucc6u47BcmAqb ASj3FS9DdDJcFl/ywNd/y1c5J2H8AHVxVfMIfWoIbFxHuAEPEJh1/7GLELhmuvzlNyOU JCgXCodLKCx32jVNoJH52OYWk//0wbG9JgJn3zXnDdVtQqf59L5ENie6HqixqpqECTD3 aWeDrDMbgUATKXoCtEw9HOL6/aEPkWc1OES8jgatXVccr1D5q5 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLZZEwTv3acs/t/RTMaVFjctH1p3M8Cp56QVCq8RbeOgbnedrXdi f5+Oev36OyjyBrLA7/9cvwM= X-Google-Smtp-Source: APBJJlHCoygasSmkMf8YIS6HK1us4f3s1B3AqB97yATrSamgmPfDX8OEivtkgFdXLE234H5WUP35zg== X-Received: by 2002:a05:6870:818a:b0:1bb:6133:fb07 with SMTP id k10-20020a056870818a00b001bb6133fb07mr16178575oae.3.1690912550163; Tue, 01 Aug 2023 10:55:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:b4a0:b0:1bb:af41:1099 with SMTP id y32-20020a056870b4a000b001bbaf411099ls1787560oap.0.-pod-prod-03-us; Tue, 01 Aug 2023 10:55:47 -0700 (PDT) X-Received: by 2002:a05:6870:a889:b0:1bb:52f7:4da8 with SMTP id eb9-20020a056870a88900b001bb52f74da8mr15299902oab.9.1690912547153; Tue, 01 Aug 2023 10:55:47 -0700 (PDT) In-Reply-To: X-Original-Sender: chdemko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:33004 Archived-At: ------=_Part_370_1221125544.1690912546520 Content-Type: multipart/alternative; boundary="----=_Part_371_624534546.1690912546520" ------=_Part_371_624534546.1690912546520 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have published the pandoc-latex-color filter for this use=20 https://github.com/chdemko/pandoc-latex-color Le mardi 1 ao=C3=BBt 2023 =C3=A0 14:45:44 UTC+2, BPJ a =C3=A9crit : > Den m=C3=A5n 31 juli 2023 05:02Sylvain Hubert skrev: > >> We can highlight text with {.mark} >> >> pandoc -o main.docx <<<'aaa [bbb]{.mark} ccc' >> >> but it's always in light yellow. Can we customize the color? >> > > If I'm not mdepends on the output format. In HTML-based formats you can= =20 > use custom CSS to style `mark` elements however you like: > > ``````css > mark { color: COLOR } > `````` > > where COLOR is a CSS color code like `#00ff00` or any CSS color name > > https://www.w3.org/wiki/CSS/Properties/color/keywords > > In LaTeX since it uses the `\hl` command from the soul package you can= =20 > use the `\sethlcolor{COLORNAME}` somewhere early, preferably in the=20 > preamble, but a raw latex block at the top of the document will probably = do. > Since the default latex template loads xcolor with the `dvipsnames`,=20 > `svgnames` and `x11names` named color sets COLORNAME can be any color fro= m=20 > those sets as shown in section 4 of the xcolor manual > > http://mirrors.ctan.org/macros/latex/contrib/xcolor/xcolor.pdf > > (I *think* x11names wins where it and svgnames differ, but those=20 > differences are fairly minor.) > > I'm not sure how to do it in other formats, but those two at least will= =20 > cover most to-PDF use cases. > > --=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/e0ab28c3-471e-4bc7-9957= -c5660ea1a20cn%40googlegroups.com=20 >> >> . >> > --=20 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 e= mail 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/d7e5fe3f-fa66-490f-852d-262a91547971n%40googlegroups.com. ------=_Part_371_624534546.1690912546520 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have published the pandoc-latex-color filter for this use https://github.= com/chdemko/pandoc-latex-color

Le mardi 1 ao=C3=BBt 2023 =C3=A0 14:45:44 = UTC+2, BPJ a =C3=A9crit=C2=A0:
Den m=C3=A5n 31 juli 2023 05:02Sylvain Huber= t <champ...@gmail.= com> skrev:
We can highlight= text with {.mark}

=C2=A0 =C2=A0 pandoc -o main.docx <= ;<<'aaa [bbb]{.mark} ccc'

but it= 's always in light yellow. Can we customize the color?

If I'm not mdepends on the output format. In HTML-based forma= ts you can use custom CSS to style `mark` elements however you like:
<= div dir=3D"auto">
``````css
mark { color: COLOR }
``````

where COLOR is a CSS color code like `#00ff0= 0` or any CSS color name

https://www.w3.org/wiki/CSS/Properties/color/keywords

=C2=A0In LaTeX since it us= es the `\hl` command from the soul package you can use the `\sethlcolor{COL= ORNAME}` somewhere early, preferably in the preamble, but a raw latex block= at the top of the document will probably do.
Since = the default latex template loads xcolor with the `dvipsnames`, `svgnames` a= nd `x11names` named color sets COLORNAME can be any color from those sets a= s shown in section 4 of the xcolor manual

=

=
(I *think* x11names wins where it and svgnames differ, bu= t those differences are fairly minor.)

I'm not sure how to do it in other formats, but those tw= o at least will cover most to-PDF use cases.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pa= ndoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pando= c-discuss/e0ab28c3-471e-4bc7-9957-c5660ea1a20cn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/d7e5fe3f-fa66-490f-852d-262a91547971n%40googlegroups.= com.
------=_Part_371_624534546.1690912546520-- ------=_Part_370_1221125544.1690912546520--