From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32399 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Help with Lua filter for markdown to LaTeX with Pandoc Date: Sat, 25 Mar 2023 22:40:45 +0000 Message-ID: References: <79ac7814-9558-4d49-a682-cf31f970d27dn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39189"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRB4HQ7WQAMGQEOHVMYYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Mar 25 23:40:54 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f63.google.com ([209.85.128.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pgCZA-0009yX-Bc for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 25 Mar 2023 23:40:52 +0100 Original-Received: by mail-wm1-f63.google.com with SMTP id p10-20020a05600c358a00b003edf7d484d4sf2736794wmq.0 for ; Sat, 25 Mar 2023 15:40:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679784052; cv=pass; d=google.com; s=arc-20160816; b=hQkb5W2qB+bBnYL+r6TK8HeEoKU2AVGnwNKMAvI5FxS4LejFJ0lYcMKBvrv8w2L7VR g/fPQzNC0ur5jSyIJByVq/4847Ip9Zjdvy/xzhRS0Dewi0WZ+SCfZooq3lc7yk7Gwbds aq9hzqzH61tFSrbR6VXWqi9EUhT29aqTuNJBbXx4d2/yMlB9PzzTCppqS77fX0Ex+Vjg 8uxD0EpnGhvR/Ymk4aYzBtmRcz8qumGGzXOuT/K+ecVvDYu9meRf0B3r1ZSsKjgoA1cD 2xUUjeVMvXjfoDks9nNpTvFO6bJPcY9tQZetDt/lm6Cu2sfiZL3rGadam75H20RjPc6L 0PTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=7plqXL9mSUfkWPJ97b88Q7IbCJn8NRWiAq4WmZPWIZU=; b=N0tTD39HdX6TfQPbdMNbgRDnESM/Rjcl9khB1K+kFmkX8Y/tWUP6YzOAAHOF+k2ZMw TnBjzj4wAdJipnnLFAY02qW38xuF/cGKHk9vQ0tWAL/8Qvk3lILt7CPaHx1BAF5d7v/A qaPWW/h7ScJHxNvbcIlY2rEWmoXMr3olfPDj8rB9tPx27vQZtgtiHkmGqxmhiLt6jKnf +iLGSNPIFNpbgkcVgXx6HD+HQAwNOVtKrkvb1V+mI1IfFwPw2Btmm2sCegES7b1TGhH2 surdYBuXKu6Mh83fKXsvZSaDMuQqL/25ovS2BayT0T98NokeTDwWADw35ffu4gxd4hBg WH7A== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=YM4VdXdP; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1679784052; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=7plqXL9mSUfkWPJ97b88Q7IbCJn8NRWiAq4WmZPWIZU=; b=eAuKo0uj/du2qHOqO2TzgU9L+Lzsd1YMNYeO5VuC2JfFe3Z3OQkOOCAZlThVABFd+N 2hL4plRWYTvX46ixYb/6Cz3KxKTvbE8jXil6y0WYaecuQr1hjJcmZ4Au65GCC0XAY0k5 woLuFzGxj2DvRwGLntzp+ngvHJkFQnn4nLy/ELe9WH7VYN2POXjZJKFAvi6fBzRM+P6n DqVUkS3JrosTXFI0IATi7pVvJTRWNP6iNRHsObT10M14maVMFbDln9vd9Hm1suuTcViL JLAO8ZYy6ovdDiKrDfwMcY7LGlVdfnP X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679784052; 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-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=7plqXL9mSUfkWPJ97b88Q7IbCJn8NRWiAq4WmZPWIZU=; b=COqBHMNYFF3MOgJGG/JwxMibpsUEKgHtbbTeIeiL7pCqAmUzECHBQmr1hwnLCQwbbD XXJ39W2IViI7xHTwOukPW/hh/a2IkQd/JGm8Z/+Y2KrzH1sH/HsDS1ZFg6nixhc37y8C 6Avt3IzkgsmGZd8Cm+QwbCtuD+siaOIwgLsSY72lWYGjydtqVzjTKAYnbGv2DK83CScf cxVfnn3Yt9eyuL6dPNQctOah9pFjdEq5LRrlE4CvOC01xqONB30YJS8YtTYjeNhU Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AAQBX9ex405mtHsgePivjRElo7r2DIPzn+zD2MMdmvvkDlvUbU25ErX2 a481xnVVLJKhtwkNi0WJA8A= X-Google-Smtp-Source: AKy350ZgNUrGhwme6s37kDGmh4i55m5atD2mrB+rjE4Z52I6t/Uo1CRuSxPX60SKjbFNFNP5CMoGvQ== X-Received: by 2002:a5d:554f:0:b0:2ce:aaff:2a8c with SMTP id g15-20020a5d554f000000b002ceaaff2a8cmr1404128wrw.14.1679784051896; Sat, 25 Mar 2023 15:40:51 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6000:993:b0:2c5:557d:88a3 with SMTP id by19-20020a056000099300b002c5557d88a3ls6501779wrb.3.-pod-prod-gmail; Sat, 25 Mar 2023 15:40:47 -0700 (PDT) X-Received: by 2002:a5d:54c9:0:b0:2ce:aed5:7dd with SMTP id x9-20020a5d54c9000000b002ceaed507ddmr8681331wrv.20.1679784047336; Sat, 25 Mar 2023 15:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679784047; cv=none; d=google.com; s=arc-20160816; b=boNLdrbgayGiXPl+XtXdFFWrcKJQzYPXwMWEkjK1k4srEHv6IPMwRtO8nRCUnkeqnM fKmiGS+y1rxlRE9O2MEGtbLfZxAT1MsRBlkPmZ2i6OyKeyqNkxNyfIJ1hy132+lf4KYT /9JYK1tgb2m81tBvkINs/P28UXfL9OOCmdMsZQOIapXQgL9C5clu+k4wS1BkmuSBUhR+ Qof2330WRdJDgz35ggtKNQfpKM9CD4FV0rLiS+zEf2YFJ4ZA2cA0xgCtdjBiaijs4WJg ULU90PDm72VIma1Ec46hMxtzPGUxXKan8PxMgbNi0wfacev+qS4ZO/19GkcM4dtTCfkY qoqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=B3PGxAFd3D1yZx7Umv7kfnHql6TTUqwZHbBgyTQF+p0=; b=Id5VOsp0bfaLPMFb/IMk+a6WdBA3tOxRG3pfBzPh9y3pMUsJUI/dEfLv39B4rLkYLN VXkK9QiFK83o0psWkpcYak7ZwvYPJaOdb+3hhiSVITUsUCf2bnRIJ2FVbehiztvRjjQ1 AgQg8hhoVYGhUAoGiy/ahmwUGtzbZ5qfCx3c0RZYmcVLXwY7KxBmWYsKyp1K6iFLnmJm wXMElZivT+ZCc/kuUUcbRczcl9BMp7LPhNgMSxPaOmK51d+3/WaJ//+B8j4fzidF8Gge S9J9WIdw0ddCvXs/dS1gxH6M7joFkRbpxys7gYJ7AH7UwOKPrlrdZH9XEtTxHPpoDFuU JBsQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=YM4VdXdP; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id o10-20020a5d648a000000b002c59c98f5dasi1103825wri.3.2023.03.25.15.40.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 15:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C4D6824012B for ; Sat, 25 Mar 2023 23:40:46 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PkYvL2rlyz6tmx for ; Sat, 25 Mar 2023 23:40:46 +0100 (CET) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=YM4VdXdP; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:32399 Archived-At: It works for me. Could you provide a minimal test case, your filters and th= e command? Le Saturday 25 March 2023 =C3=A0 03:01:10PM, Pa Sc a =C3=A9crit : > I followed that, thanks! But I'm still getting `\emph{\hl{abc}` as the ou= tput, > any other ideas? >=20 > Bastien DUMONT schrieb am Samstag, 25. M=C3=A4rz 2023 um 15:38:47 UTC+1: >=20 > First, you need to replace `\\hl{` with `\\colorbox{declared-color}{`= (mind > the double backslash). Then Span.lua can be replaced with the followi= ng > filter acting on emphasized (italicized) pieces of text: >=20 > in-red.lua: > ``` > function Emph (emph) > local content =3D emph.content > if #content =3D=3D 1 > and content[1].t =3D=3D 'Span' > and content[1].classes:includes 'mark-red' then > return { > pandoc.RawInline('latex', '\\colorbox{lightred}{'), > content[1], > pandoc.RawInline('latex', '}') > } > end > end > ``` >=20 > Here, I replaced "mark" with "mark-red" as you suggested because I do= n't > remove the Span element, in case it contains other classes or attribu= tes > that should be processed by other filters or by Pandoc itself. If the= Span > was kept with the "mark" class, Pandoc would wrap it in the \hl macro > afterwards. >=20 > Le Saturday 25 March 2023 =C3=A0 05:42:45AM, Pa Sc a =C3=A9crit : > > In markdown (written in Obsidian.md) I use a plugin/theme so that `= *=3D=3D > text=3D=3D*` > > is rendered as red instead of italic and highlighted. > > > > I use this lua-filter to convert regular `=3D=3Dhighlighting=3D=3D`= to LaTeX `\hl > > {highlighting}` which works perfectly: (I somehow require these two > files, I > > can't remember why) > > > > **highlight.lua**: > > ``` > > =C2=A0 =C2=A0 --[[ > > =C2=A0 =C2=A0 Add support for a custom inline syntax. > > =C2=A0 =C2=A0 This pandoc Lua filter allows to add a custom markup = syntax > > =C2=A0 =C2=A0 extension. It is designed to be adjustable; it should= not be > > =C2=A0 =C2=A0 necessary to modify the code below the separator line= . > > =C2=A0 =C2=A0 The example here allows to add highlighted text by en= closing the > > =C2=A0 =C2=A0 text with `=3D=3D` on each side. Pandoc supports this= for HTML output > > =C2=A0 =C2=A0 out of the box. Other outputs will need additional fi= lters. > > =C2=A0 =C2=A0 Copyright: =C2=A9 2022 Albert Krewinkel > > =C2=A0 =C2=A0 License: MIT > > =C2=A0 =C2=A0 ]] > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 -- Lua pattern matching the opening markup string. > > =C2=A0 =C2=A0 local opening =3D [[=3D=3D]] > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 -- Lua pattern matching the closing markup string. > > =C2=A0 =C2=A0 local closing =3D [[=3D=3D]] > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 -- Toggle whether the opening markup may be followed = by whitespace. > > =C2=A0 =C2=A0 local nospace =3D true > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 -- Function converting the enclosed inlines to their = internal pandoc > > =C2=A0 =C2=A0 -- representation. > > =C2=A0 =C2=A0 local function markup_inlines (inlines) > > =C2=A0 =C2=A0 =C2=A0 return pandoc.Span(inlines, {class=3D"mark"}) > > =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 > ---------------------------------------------------------------------= --- > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 local function is_space (inline) > > =C2=A0 =C2=A0 =C2=A0 return inline and > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (inline.t =3D=3D 'Space' or > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inline.t =3D=3D 'LineBreak' or > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inline.t =3D=3D 'SoftBreak') > > =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 function Inlines (inlines) > > =C2=A0 =C2=A0 =C2=A0 local result =3D pandoc.Inlines{} > > =C2=A0 =C2=A0 =C2=A0 local markup =3D nil > > =C2=A0 =C2=A0 =C2=A0 local start =3D nil > > =C2=A0 =C2=A0 =C2=A0 for i, inline in ipairs(inlines) do > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 if inline.tag =3D=3D 'Str' then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not markup then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local first =3D inline.te= xt:match('^' .. opening .. '(.*)') > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if first then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 start =3D inline -= - keep element around in case the > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- markup is not closed. Check if the > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- closing pattern is already in this > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- string. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local selfclosing = =3D first:match('(.*)' .. closing .. '$') > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if selfclosing the= n > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:inse= rt(markup_inlines{pandoc.Str(selfclosing)}) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elseif nospace and= first =3D=3D '' and is_space(inlines[i+1]) > then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- the open= ing pattern is followed by a space, but the > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- config d= isallows this. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:inse= rt(inline) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup =3D = pandoc.Inlines{pandoc.Str(first)} > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(inli= ne) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local last =3D inline.tex= t:match('(.*)' .. closing .. '$') > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if last then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:insert(pand= oc.Str(last)) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(mark= up_inlines(markup)) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup =3D nil > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:insert(inli= ne) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 local acc =3D markup or result > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 acc:insert(inline) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 -- keep unterminated markup > > =C2=A0 =C2=A0 =C2=A0 if markup then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 markup:remove(1) -- the stripped-down f= irst element > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:insert(start) > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 result:extend(markup) > > =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 =C2=A0 return result > > =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 > > =C2=A0 =C2=A0 local function markup_inlines (inlines) =C2=A0 return= {pandoc.RawInline > ('tex', ' > > \\hl{')} .. inlines .. {pandoc.RawInline('tex', '}')} end > > ``` > > > > **Span.lua**: > > ``` > > =C2=A0 =C2=A0 function Span (span) > > =C2=A0 =C2=A0 =C2=A0 if span.classes:includes 'mark' then > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 return {pandoc.RawInline('latex', '\\hl= {')} .. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 span.content .. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {pandoc.RawInline('latex', '}')} > > =C2=A0 =C2=A0 =C2=A0 end > > =C2=A0 =C2=A0 end > > ``` > > This works great, I got this here: [[1]https://gist.github.com/tarl= eb/ > > a0646da1834318d4f71a780edaf9f870]([2]https://gist.github.com/tarleb= / > > a0646da1834318d4f71a780edaf9f870) > > > > However, for my other usecase I'd like it to be able to render `*= =3D=3Dthis > kind of > > highlighting=3D=3D*` as `\colorbox{lightred}{this new kind of highl= ighting}` > > > > I've tried replacing the `\\hl{` with `\colorbox{declared-color}{` = but > that > > didn't work. > > > > I was wondering if it had something to do with the class? But renam= ing > that > > class from `mark` to `mark-red` didn't work either. > > > > Any advice or ideas? Thanks! > > > > -- > > 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, s= end an > email > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [2][3]https://groups.googl= e.com/ > d/msgid/ > > pandoc-discuss/79ac7814-9558-4d49-a682-cf31f970d27dn%[4] > 40googlegroups.com. > > > > References: > > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [2] [5]https://groups.google.com/d/msgid/pandoc-discuss/ > 79ac7814-9558-4d49-a682-cf31f970d27dn%40googlegroups.com?utm_medium= =3Demail& > utm_source=3Dfooter >=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= email > to [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [7]https://groups.google.com/d/m= sgid/ > pandoc-discuss/bb3c6fab-dee9-48c4-81e4-7db67bc6931an%40googlegroups.com. >=20 > References: >=20 > [1] https://gist.github.com/tarleb/ > [2] https://gist.github.com/tarleb/ > [3] https://groups.google.com/d/msgid/ > [4] http://40googlegroups.com/ > [5] https://groups.google.com/d/msgid/pandoc-discuss/79ac7814-9558-4d49-a= 682-cf31f970d27dn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [7] https://groups.google.com/d/msgid/pandoc-discuss/bb3c6fab-dee9-48c4-8= 1e4-7db67bc6931an%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter --=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/ZB94bf//ef6J/nsc%40localhost.