From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29840 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: bapt auguie Newsgroups: gmane.text.pandoc Subject: filter to inject raw TeX command based on header attributes Date: Thu, 23 Dec 2021 16:14:50 +0100 Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c90dd805d3d1b351" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23208"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDG3FYUYQUCBB5VESKHAMGQEA5QEEAY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Dec 23 16:15:05 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f63.google.com ([209.85.210.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n0Po8-0005rG-UZ for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 23 Dec 2021 16:15:04 +0100 Original-Received: by mail-ot1-f63.google.com with SMTP id z16-20020a056830129000b0055c7b3ceaf5sf2335778otp.8 for ; Thu, 23 Dec 2021 07:15:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1640272503; cv=pass; d=google.com; s=arc-20160816; b=DJmyIvyefltjsNf+b5Nk7WVFMExJ0cJhOyB/a+1cLj85S6AvRoxf9BLjoeSl5gedcu qLZDZaCJTIIEHO542Jr2QPKc2B1PlksbCrOGPJDC8WOmbUyNUh+nFiLC0FajqfIm6vlu WPoDt1rR+zFZs9ITv6d5i1jBtObcNlmBsGGSDwKClGp9wRYhJDuBhHEYE8MKMHQrhbOf Zp826klAmqlc7XYOnnlfQAlJWGzjfOWPm6Tl7Ixb6290VENLru8JI4DfTRts8Drjfj1X UnEIgIppYgOGqTj5EcXlNh6azQd3mLfTvrBQsxnwoaTvVIeIBTD3MzYmurWYfYKoA3aY VR0w== 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:to:subject:message-id:date :from:mime-version:sender:dkim-signature:dkim-signature; bh=HCk1HEhQCVMUfHBzpgUXtIC80DQuQan2DEoFwuX4DTk=; b=mJQ5zAOXPYqpq4v3HnAVo1IZK2wtLth6Aw2NCIPsc/gBH6FiFJMYbWRu/zWTwG8fl4 tObiirsKV/oXk1o2fPVDjWYB2Q/hP61+QI62YEl4gjg+ZDzrQbYqmc/pzypcfbSy6B0m vUUqBGOrDe8ZjoD1Sd4P741mnM5fXfP0yVEhQjfIy0UMy/wym7162PbaD/6vgiwj7nYZ sLVNEfOi2xv2YhtH5saHIHaZH2kcRnLzHs+81i3Xvh8i+dcYNaejn/neaT/PtrusRIxc wIvMN9PV18hUFfOAGtBzGb7R61aZ2CRydSEQd0X2JriqtYAIsVzrqZKvTjIcz26RwitL bQYw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KUifE7hn; spf=pass (google.com: domain of auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d34 as permitted sender) smtp.mailfrom=auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=HCk1HEhQCVMUfHBzpgUXtIC80DQuQan2DEoFwuX4DTk=; b=V6rtaAfEyGKqpPqvJXc+cYcCj5m4o8nrqj5DeS652UzT4lZ5uq2PFyXCBIqWKkw2mX ppb24aZIUkHMDxj0c3drSGIf1dn7AeMySamxfPfZ3LvFxhO6mkd1VoFCGg+6TVnozGaO z5XuA/hBtzP1NsvHB3KjxSV3PbU9Rzp8rjozrCRu8HFOoWHme5gXRa7YhD4Z3pV+IgCG cXAtgkBEAf6c5FSEJV7AL0kQdvXp5KS0ylk8wbTUf8H1PsEi2GPhVXT4J6rHgTOghn6L iYZNWk5stIwP44wo4ceecez2zd7kw6p71sckVvLcb/cYa7M5HBDSO9bOcirbWewbdv5X U7iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=HCk1HEhQCVMUfHBzpgUXtIC80DQuQan2DEoFwuX4DTk=; b=YCYCu2Ro727OCQ24OiQQyP/DkDfaCbkqz60eh6HrerA7lu9u38ybRkAfOWdEu/7vNf 74xLW0U38rd+z1KKV/gL51XAVV1l1sWxn9Kdfb0y1GtfNgrGYbx2m1+aFxhO8ul0ilV+ /VxoUZrdlTvx5ipCr224yjU1DfN35JMxAEZcKGThFoev22qmQ0OJTa9tvvGdWG4/rfUw IVEXs2o9SoiRuw81Of7cgDl0VEE+rI+4vy9VsJNkIogLC8SCh+jctXBe/lU3l1mig56I acUtgoUNUlazsPmgBT0ynO0XldpoqU2u33dmd89+6EGeTn1APrJPlKY6f1F8QayIhf8i 8kYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:mime-version:from:date:message-id:subject :to:x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=HCk1HEhQCVMUfHBzpgUXtIC80DQuQan2DEoFwuX4DTk=; b=Ox8Db9EgtOb5hrn4a9dXdv+BtWYyVTITZ1z0jXVZK37ooM8m7wi6ygLFEbJF1yPXbs xbGzacmEZBMXt3zYWd7bq6g8odQETTahOC+xIdq7MS4DlPPzf2sdkigDKSPB3Vc76uB8 CB6EzzT+n0ryrjSX57Gqw75mIhlrc0koO5MfjKsFTnuPckudjPYOEiZfQvMj2fHTnVnc Hdu57zcbctT5/POaDcs5eV6Uo/IPizvKVI+Ql+dBHpbcS3Ve+KnAijoRgCXoQkW9YrVq LEXPp+d8D1p8vvNK1Ekb65riDypJSuRl7vNqGV85+7E5lNa+14RK/h0YA1iIum9Sj5u8 vmVg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531tqGBP1r7Az/5kHC8KVn7DY8jF/66BEElrFSdBAyat82/RyPiJ qdfLHCk2LQNKObKD90XCMOE= X-Google-Smtp-Source: ABdhPJzEQ313pvu0jSg/pe1O6UcAV2OZufTTP7B2Rqt4aN+96ytN3wJXCbsEe/Cc+4Wneb/kg+ZQvA== X-Received: by 2002:a05:6830:1358:: with SMTP id r24mr1793540otq.8.1640272503333; Thu, 23 Dec 2021 07:15:03 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:e613:: with SMTP id f19ls182352oot.8.gmail; Thu, 23 Dec 2021 07:15:02 -0800 (PST) X-Received: by 2002:a4a:85cf:: with SMTP id u15mr1612514ooh.45.1640272501912; Thu, 23 Dec 2021 07:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640272501; cv=none; d=google.com; s=arc-20160816; b=KEahNbCYxYA/umKmSK11K6CquOE8ww0g6ZrvAszAl3MNPj33t2csvhAHEjpNBjvn3R v7ndz9lfgIOJYumPXizKLIfcoWhYyXnJoM9HPaFcwhMZR/xpdaXcXNfr4pWsjTH86Q9+ sxFnmPqY9Qcdufvfrch4mcZfhVmWFjvyZo9lQCZoxDVp8lzagc6lZR/6mvhIcvTJXEdu US3V8vATZzuDkrVT4Pv+dlePnyJwHWO8ZL7j2JWebs6ikcmyhlOSbExqG1SOEpengiJH NBBWKsNVaJvgLuxmoSgn3edP4FxTcqCoZ/7uLi7HLwg1fmIMPuOMsotwv1YrZiE9eYuQ ajrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=uj40uunCdu6FJGtnnXQFautDf7Uqdb6N4KXhWwDPY8M=; b=oUqV0t8fbvIHorxF6lA22h1NOIzeYlHgy9MrHs+5eUwrwD2bwO0VXF76YfBKmEgCkj ZFeG5eV31EvCbpfBZR6i90gF6FZjYTx2stjtXa1EGvkFLBLIQoQnenTAvVToIWo0yEVh TS4anGiwhN29hX7+lP9MNjl3haFgZk4+U+tyVetwCQWN8xuZlMvx32XNpjydPxG81uma Ne1LdLuKr++FEEJjnnPPSAnOqXZtlDP9pfpiJFuW69z+oMV7Om4INi2uMPY/5oNS2Bd9 la4bcBoTODVfnhP1ynbYeKw4jME154/z4hAnmxQ5HR9PbECdnvbMJqZdlDXj/4U/zMi3 DATQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KUifE7hn; spf=pass (google.com: domain of auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d34 as permitted sender) smtp.mailfrom=auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com. [2607:f8b0:4864:20::d34]) by gmr-mx.google.com with ESMTPS id bj28si520607oib.2.2021.12.23.07.15.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Dec 2021 07:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d34 as permitted sender) client-ip=2607:f8b0:4864:20::d34; Original-Received: by mail-io1-xd34.google.com with SMTP id 19so6946092ioz.4 for ; Thu, 23 Dec 2021 07:15:01 -0800 (PST) X-Received: by 2002:a02:2117:: with SMTP id e23mr1366332jaa.53.1640272501475; Thu, 23 Dec 2021 07:15:01 -0800 (PST) X-Original-Sender: auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KUifE7hn; spf=pass (google.com: domain of auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d34 as permitted sender) smtp.mailfrom=auguieba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:29840 Archived-At: --000000000000c90dd805d3d1b351 Content-Type: text/plain; charset="UTF-8" Hi, I'd like to make use of pandoc's header attributes ( https://pandoc.org/MANUAL.html#extension-header_attributes) to inject a custom LaTeX \renewcommand{} definition in specific sections. My goal is to have a minimalist markdown file for my CV (no tables or raw LaTeX, just simple lists and #headers), and have a Lua filter identify which sections have specific formatting needs (e.g wrap inside a 3-column table), which will be taken care of by LaTeX. Consider this input markdown, > # qualifications {#id1 .CV content=list} > > ## 2011 | can type, delete, copy and paste > ## 2021 | can *format*, sometimes > > # work in progress {#id2 .CV content=freetext} > > ## Beside lists, I am hoping to learn to format free text too, *someday*. > I would like to walk the AST, and immediately after headers with a specific attribute, inject a \renewcommand{} based on the header's attributes, such as (dummy example), \renewcommand\subsection[1]{\textbf{#1}} for sections with content=list and \renewcommand\subsection[1]{\textit{#1}} with content=freetext. This is obviously a contrived example, the actual command I'm using is actually to split a sub-header and format it as a table (dates | job position | location) or various other tasks (e.g. changing emphasis colours for different sections etc.). I'm not familiar enough with the pandoc AST or lua to figure this out; I looked at a related example ( * noexport-subtrees.lua * ) but here the situation is a bit different, as I need to create an additional element (raw tex string) and append it to the original header. Many thanks, baptiste -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAGCXF28DUfNvU8cVDjydiqg%2BTUwzOhdrWL5w5xc8Ua-MXA6BBA%40mail.gmail.com. --000000000000c90dd805d3d1b351 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,

I'd like to mak= e use of pandoc's header attributes (https://pandoc.org/MANUAL.html#extensi= on-header_attributes) to inject a custom LaTeX \renewcommand{} definiti= on in specific sections. My goal is to have a minimalist markdown file for = my CV (no tables or raw LaTeX, just simple lists and #headers), and have a = Lua filter identify which sections have specific formatting needs (e.g wrap= inside a 3-column table), which will be taken care of by LaTeX.
=
Consider this input markdown,
=C2= =A0
# qualifications {#id1 .CV content=3Dlist}

## 2011 |= can type, delete, copy and paste
## 2021 | can *format*, sometimes
=
# work in progress {#id2 .CV content=3Dfreetext}

## Beside lists= , I am hoping to learn to format free text too, *someday*.


I would like to walk the AST, and immediately after headers with = a specific attribute, inject a \renewcommand{} based on the header's at= tributes, such as (dummy example),

\renewcommand\subsection[1]{\textbf{#1}}

for sect= ions with content=3Dlist and

\renewcommand\subsection[1]{\textit{#1}}

with content=3Dfreetext. =
=
This is obviously a contrived example, the actual command I'm usi= ng is actually to split a sub-header and format it as a table (dates | job = position | location) or various other tasks (e.g. changing emphasis colours= for different sections etc.).

I'm not familiar enough with the pan= doc AST or lua to figure this out; I looked at a related example ( noexport-subtrees.lua ) but here the situation is a bit different, as I need to cre= ate an additional element (raw tex string) and append it to the original he= ader.

Many thanks,

baptiste



--
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://group= s.google.com/d/msgid/pandoc-discuss/CAGCXF28DUfNvU8cVDjydiqg%2BTUwzOhdrWL5w= 5xc8Ua-MXA6BBA%40mail.gmail.com.
--000000000000c90dd805d3d1b351--