From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26863 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Gabriel_N=c3=bctzi?= Newsgroups: gmane.text.pandoc Subject: Re: how to generate the bibliography for a document? Date: Wed, 18 Nov 2020 14:18:16 +0100 Message-ID: <92029b56-4758-2713-16d1-ffca9f3ac786@gmail.com> References: <89f878c1-770d-4d21-b372-15961fb5e385n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------EF3F7A62EC2B1CB034B0173A" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24477"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDRZVNGQEQIJXPWU7UCRUBD6LCGNG-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 18 14:18:23 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f61.google.com ([209.85.167.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kfNLr-0006IB-F1 for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 18 Nov 2020 14:18:23 +0100 Original-Received: by mail-lf1-f61.google.com with SMTP id c2sf714265lfr.0 for ; Wed, 18 Nov 2020 05:18:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605705503; cv=pass; d=google.com; s=arc-20160816; b=HAyf54brsmHvq0UoM1/atdYXm+aHDUcVBqZjhz3GJX7frcE/te2bbsjK08flPDz2i8 JCT3irEBDC8bhWXmH81kMIcQR+H9oXcjn9vfpHkxXOw9q8I/MEwe1R4RVvi4ymC6v83/ MndCFfYCPn3Fdl5LRi3d4pBaIljKMb9RQQx/jJSY9IhZdvWDwl0rf18VrMn0v72Hp6He lCQV7+MMS+d5oxPOxpfE8YZ3vt1aKneS31RnpC8ZD1G5Z8+3mlqQPg7oVSta+DcSph06 VGGxbZ3SNHI3dx8+o3OF1uOHO+m/GltZsjIMNQdbPdUIJIDUbO89e39U2sERe/A41cR3 4ZqA== 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:mime-version :user-agent:date:message-id:from:references:to:subject:sender :dkim-signature:dkim-signature; bh=dgCq+8zXBa/yvnoxJLcFb2iZRn8xsHKrDb8dGMNxSUw=; b=BMt0jw2l2qPoksiPNxuu8/dW7jGhhFUsWkjrUWDwkWlWod3sCIold1etHFN80B9DId mxhaqDltv0rJ0n+iUg/ZrwfPWHixG8nVpPRCLZx5BVplufOUC14PTubjhKe7ngCTxb+y A6azs9NIk2PxMJS6c3/F2tmtWinyr/TQSv1fadqrgfBK3BpFjpsjHXcQXXGFBkFhLnQc 4Cnv1y95JU+oMJhGqtQyypZQm1iOxsdKna2htpfInvHitNJzPD2jeQ5NRqF/1iocDpQ2 QjEwgAdoPvUUzkEQNmZ/PQsNxqs1KQaoMFugYcHlHIUh5sZgcq9CfJA7b027F/5GCJdT 0Yng== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tk8gHQOH; spf=pass (google.com: domain of gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32b as permitted sender) smtp.mailfrom=gnuetzi-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=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-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=dgCq+8zXBa/yvnoxJLcFb2iZRn8xsHKrDb8dGMNxSUw=; b=okcX55xvPDi+eiLO7OmLTiDQ1pMHlItXMjNjmdpMvcHQYVl/mmDF5YI1OhAjIB01zv sBSxCFiZCP7FBNN2Bcru39ZIod6Il2+awDvFHkYkqMbV4tlcY+W2qBUXS/1qTEawPI9r UdF4jzqvX6M0cCrkvh0ErA684rhwfW/xzpa+QhI6pBZcIlTMfHg/wrmyfry95q0FfPnZ lFpuzJi7MgOkaPmeZxXzhXvs5pqqE2EpKcSvn8FQ/CdqLzZBurf0ObMQ2UlUkcCakMyb dGgB1oRjEV+XzN9Sd9jnoWRuDAw1ssTzdqAOJ+QAnXR1VNkPvNlZthVM9KA/e7dz6kmj U9tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-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=dgCq+8zXBa/yvnoxJLcFb2iZRn8xsHKrDb8dGMNxSUw=; b=lmLVaFe3hyO1yGGAbQjerSHRkDJV6cOxawuEveqzB2YS05Vj1cGhtc6GeuGzH1M4Nz MuaCTL3droMyQbRichWFvPFLucfCVYCFJXpI4jWL4iXhIALPJOheXIzdfw7rf9HhtyWs EljpejHv7YbYTOJ5Xm8I5n+CBqqhmDyL2iNCT6gD5Ul+oWFcuRbZFFgccebWt2Q1wi0K TDGUh8vOegnUjI/NoJhaTOXSpjaDi4ufbBvDH2I8xAXALoCH0zJOq/LVG18k8RF1yGd3 VxBD9KK4rzymmRMzJ+WJJrgHNAYjCix5S51IKEOijr46C3p4kMKNtxHqXGWKd+XX1O+C 6u+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-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=dgCq+8zXBa/yvnoxJLcFb2iZRn8xsHKrDb8dGMNxSUw=; b=h/UssuwsYQ1sLntyC5xeC6vo9UP9MnSAZtUtSMfxBlYIx7nIAKZGpbeJ55i5ktvXSM FdXAiH4zpF/y70nK43pTiUFhyGErw6MZhLPtvpItnLoXBiJLSBXyFpo3n+NKVxSOGLR6 i0fxly/bfDbcDVEypq8x4H7sDAMZwQcKN9Y+NP96stkK3VUArzRj7CL/y9A+l3aPzugm 9kLUXNX17qEviP/qZGopxJxJcFUJKXoSWgXxxGBYpXBBGy6SqmEFMoNkam7SAIEjligV wUCwPWjkjSI90VBHoqs/xdHqvN4GUgrERf0GcNOCigSRzAX50mbO1TbfkDo3BQ0/Eeen Qdzw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM53306xRpJtXzPgbuGPGLxFEOYO4gGhtInr1ItyLC03GlWN+sPwrG OJuTRdDSBS9UM7Jcww8n7gA= X-Google-Smtp-Source: ABdhPJxjFvCxx3Xk8MUTau05WyAOyRbCYPmCohvnkjJBJxiooFzrtnr6SBmruaf5NnRCcWkzN0L6EA== X-Received: by 2002:a19:ac4c:: with SMTP id r12mr3950872lfc.109.1605705503067; Wed, 18 Nov 2020 05:18:23 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a19:480e:: with SMTP id v14ls12298381lfa.2.gmail; Wed, 18 Nov 2020 05:18:18 -0800 (PST) X-Received: by 2002:a19:f247:: with SMTP id d7mr3839895lfk.231.1605705498891; Wed, 18 Nov 2020 05:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605705498; cv=none; d=google.com; s=arc-20160816; b=FOXt7ht80vI83McKylk/mzATZ2QORciX1cF3NOiIokk0AQ1sEIL54IRvZOFmpybQjN 16CVzpnWlafJf4N7BzqGMElerHTFELqPlcmgCOeAelZVWSIRzH9SJ2LOm7nENp9Y8I6k +AMSJdje78zyO3Kry9/OWyiBNB5p0TwtJffL1E+Mt5GDLE19bka7v+rNtaYGMikZQuXm F7mGK9nbkShxKwkYbdu4s8Foa0d81OzzrUUzAiv0y5wB9oc1P1mnH20e99lJ3hPBiaRc gf02EO3QzsZ4YEbLxutjVww/J9HDnW1yihLRp0xSHwN3MMUvrintrPZs2o+ZaKQcDS/q 3RBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=M6iEIXazz915hScHpao7UuD4Z4PmWbvENIvjpPx6E1U=; b=zWL5VQjxEAYtd078zDgMdiplJs2mg7oUipJbrYZO1egVygcYno2t7UtzUZqjutkOUi gy47r6OzmwbVG/+G1UFgMWE+ZhH+WJAadxPCb7RgmxH9mvYIAnFLwFR2SrS0g9UkU8n+ mFUbQRTtJlb4LiPnPN+LbfJ5nfFhtH1fCZ/KrVeXvFSSwfuHpA02jV+V4penXjyYKh46 eWd7qx4WN+Jj8Sz8ZzwlKtBsS6CW1kTrAkKZN/KeE2SP7OhkZSpJXdiq1hc10t7G0F3v 2tQDC3eY7VrLtSUv32nhaLMtEAX2yASDBZjHg5M2Afvh6RXja1oUBmb12vRBhCz2pp2n W1Gw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tk8gHQOH; spf=pass (google.com: domain of gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32b as permitted sender) smtp.mailfrom=gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com. [2a00:1450:4864:20::32b]) by gmr-mx.google.com with ESMTPS id i12si698411lfl.0.2020.11.18.05.18.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Nov 2020 05:18:18 -0800 (PST) Received-SPF: pass (google.com: domain of gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32b as permitted sender) client-ip=2a00:1450:4864:20::32b; Original-Received: by mail-wm1-x32b.google.com with SMTP id c198so1092758wmd.0 for ; Wed, 18 Nov 2020 05:18:18 -0800 (PST) X-Received: by 2002:a1c:1d09:: with SMTP id d9mr4411464wmd.93.1605705497944; Wed, 18 Nov 2020 05:18:17 -0800 (PST) Original-Received: from [192.168.73.147] ([212.55.198.55]) by smtp.gmail.com with ESMTPSA id p12sm32699113wrw.28.2020.11.18.05.18.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Nov 2020 05:18:17 -0800 (PST) In-Reply-To: <89f878c1-770d-4d21-b372-15961fb5e385n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tk8gHQOH; spf=pass (google.com: domain of gnuetzi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::32b as permitted sender) smtp.mailfrom=gnuetzi-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:26863 Archived-At: This is a multi-part message in MIME format. --------------EF3F7A62EC2B1CB034B0173A Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable You can use --standalone flag:=20 https://pandoc.org/MANUAL.html#option--standalone Then you can write a Lua filter which removes everything except a=20 *attributed tagged* paragraph # References=C2=A0 {keep=3Dtrue} You need to check that attribute `keep` in the filter as a start: https://pandoc.org/lua-filters.html#setting-the-date-in-the-metadata https://github.com/pandoc/lua-filters Maybe something like: ```lua function remove(block) =C2=A0=C2=A0=C2=A0 if block.attributes["keep"] =3D=3D "true" then =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return nil -- keep the block =C2=A0=C2=A0=C2=A0 end =C2=A0=C2=A0 else pandoc.List() -- remove the whole block end function Pandoc(el) =C2=A0=C2=A0=C2=A0 pandoc.walk_block(pandoc.Div(el.blocks), {Blocks =3D re= move} ) =C2=A0=C2=A0=C2=A0 os.exit(0) end ``` Am 18.11.2020 um 13:07 schrieb King John Unn: > > hello community, > > I am a new user to pandoc. I am trying to generate the bibliography=20 > for a document. My template looks like this: > > ``` > $body$ > ``` > > This allows me to create a plain text document from markdown without=20 > header, title, toc, etc. > > ``` > body text with references... > > References > > reference 1 > ... > reference n > ``` > > I want to remove the body, too and only stick with: > > ``` > References > > reference 1 > ... > reference n > ``` > ``` > > Is it possible to generate the reference only? If possible i would=20 > like to further modify the format of references, too. > --=20 > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send=20 > an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 > . > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/89f878c1-770d-4d21-b372-= 15961fb5e385n%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/92029b56-4758-2713-16d1-ffca9f3ac786%40gmail.com. --------------EF3F7A62EC2B1CB034B0173A Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

You can use --standalone flag:=C2=A0 https://pandoc.org/MANUAL.html#option--standalone<= /a>

Then you can write a Lua filter which removes everything except a attributed tagged paragraph

# References=C2=A0 {keep=3Dtrue}

You need to check that attribute `keep` in the filter
as a start:

https://pandoc.org/lua-filters.html#s= etting-the-date-in-the-metadata
https://github.com/pandoc/lua-filters

Maybe something like:
```lua
function remove(block)
=C2=A0=C2=A0=C2=A0 if block.attributes["= keep"] =3D=3D "true" then
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 re= turn nil -- keep the block
=C2=A0=C2=A0=C2=A0 end
=C2=A0=C2=A0 else pandoc.List() -- remov= e the whole block
end

function Pandoc(el)=C2=A0
=C2=A0=C2=A0=C2=A0 pandoc.walk_block(pandoc.Div(el.blocks), {Blocks = =3D remove} )
=C2=A0=C2=A0=C2=A0 os.exit(0)
end
```

Am 18.11.2020 um 13:07 schrieb King John Unn:

hello community,

I am a new user to pandoc. I am trying to generate the bibliography for a document. My template looks like this:

```
$body$
```

This allows me to create a plain text document from markdown without header, title, toc, etc.

```
body text with references...

References

reference 1
...
reference n
```

I want to remove the body, too and only stick with:

```
References

reference 1
...
reference n
```
```

Is it possible to generate the reference only? If possible i would like to further modify the format of references, too.
--
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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-d= iscuss/89f878c1-770d-4d21-b372-15961fb5e385n%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/p= andoc-discuss/92029b56-4758-2713-16d1-ffca9f3ac786%40gmail.com.
--------------EF3F7A62EC2B1CB034B0173A--