From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28403 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeffrey T Newsgroups: gmane.text.pandoc Subject: Re: LaTeX footnote citations parentheses Date: Thu, 20 May 2021 19:19:55 -0700 (PDT) Message-ID: References: <26bec817-c8b4-4d63-ad5d-436aa281c0d7n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_46_1794748268.1621563595990" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31537"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCTKDNPE2AFBBTNRTSCQMGQEM5CDPCQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 21 04:20:00 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f189.google.com ([209.85.167.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ljulb-0007yC-PZ for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 21 May 2021 04:19:59 +0200 Original-Received: by mail-oi1-f189.google.com with SMTP id k18-20020a05680808d2b02901edfe86c6dcsf7767691oij.9 for ; Thu, 20 May 2021 19:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=wecbEl6gH2C4C8e4HeQm3HOaGfCRKUSsMUcdVAMkGPA=; b=G9h6PQngJ86D7BHM1LnqeGI7epuMPLCAHykF0ARCIZ824gjZi7yhssGphTn3oSvhXC wrSvEeXAPmIWJiE/OqLVNtzdVQC7PqGrXTU+XRdl7/0hyeBuSoSG8PzWW5s7FERUp043 7ZpYiNxoe3AUc+PLf7OxsHlOkqHZDMBqeVDgOiDfd/4IOeVu0kT3GVeTx6WFF5uo9eMN tqq3f4ddBibVWMiIKg/A4Z9tOxZmgrnJBrv3q5Tf5Fqp6/kfVJVnFEV7Y0zCsksY8kCp eAhb18ss7NalCheBSqgns9ziBEr+/GYhTR6nrxSQFfncMOsh5GEEckFk7dDs1uE5pkJ5 X8TA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=wecbEl6gH2C4C8e4HeQm3HOaGfCRKUSsMUcdVAMkGPA=; b=OFZXAQyGtHmdU5IarmrAG8NvLrpUsVz5tEP80j8AcaBMIqC62QmG/6Z7P5L4S6qrj6 yKTrBUxmRlZBhwmAzGgtfwFY+6I7UzYfnDyNR2923tmPIy7Tx4DfIkbm8is12PfNmaKk gxzo5DbqMsAUJKaVyTg7eIbkoJuDwZoQeIyfntB47mIf0wr4lkhw5CvXkeC8cvfPCQOm ZORCJxwkMz8ypee2gdf0up/YKfsUe2LcvgqXnM7C8+RtUFjkv4oDOlgdzywqX/R9ebNh NH3J7T3zu8jzkCUK5o5ZrRVM79USqUMQunwgkJeWyPcr+fM2ZugtvB6JW7uQdla0GDKj 4Ikg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=wecbEl6gH2C4C8e4HeQm3HOaGfCRKUSsMUcdVAMkGPA=; b=m6OS/pQc4Jii89nrJsc9WUMe+L3LALmeMIY2Frog55XBFAWHX5DIUp/eeMaRVG2g0J qQhtDrFhs3K2uZ5N97m5zhVB7jH/78JFgDGw5gBfs3uUgk3rkAJIyTaAzvMQDSKZ9Vx9 wHF4zO2RaqB/fh0/vS8Q+ewm73bfUKsjmkeU1AinxYSpn+iAZo3OGGAfCNH87MYcGy/2 dLd2t3Lm1aOVxHxhntSQGX2suGzcxPOG1W+NaVnz/KUW+QbQ7cbNwMJTPRW/q28mjjKq 2SbISOEcYOfaf3j4dd6wU33b2i8p7oO29B5KiA07VD1YsfM6CXAAaVYbyOjcYGzjT6q4 i7ow== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533dEzX1+6WBVWpr4H6KT4BJDc19Q5/ZChnD4HYN9Jcbj6sVvNhF /IPMnuH6la+OuOWJoHeZRSA= X-Google-Smtp-Source: ABdhPJwGe/Tdk+EhOQAXe+ovCZiYRmpWL2rgfS5uiK66hfDkgtLEHNQ/xIO7CREMVBXeFhjvMUNrbQ== X-Received: by 2002:a05:6830:348c:: with SMTP id c12mr6175250otu.344.1621563598692; Thu, 20 May 2021 19:19:58 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:1d6e:: with SMTP id l14ls1510559oti.10.gmail; Thu, 20 May 2021 19:19:57 -0700 (PDT) X-Received: by 2002:a05:6830:1c31:: with SMTP id f17mr6329523ote.332.1621563596873; Thu, 20 May 2021 19:19:56 -0700 (PDT) In-Reply-To: X-Original-Sender: JeffTreistman-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:28403 Archived-At: ------=_Part_46_1794748268.1621563595990 Content-Type: multipart/alternative; boundary="----=_Part_47_509083351.1621563595990" ------=_Part_47_509083351.1621563595990 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Bastien, Wonderful! The good news is your script appears to work if I use \autocite = in=20 body or \autocite in footnotes which is actually perfect because I have a= =20 few other documents that use this citation method! That said, assuming I=20 need to make the change from \cite to \autocite for footnotes, I would=20 change Cite =3D function(cite) to Cite =3D function(autocite) in the Lua= =20 script?=20 Meanwhile, this script has been extremely helpful but I wonder if it can be= =20 extended to document class "reports" with both chapters and endnotes? I'm= =20 on two grant projects with multiple faculty members and this Lua script=20 could be extremely helpful assuming we need to convert our work into a Word= =20 document. I've attached a minimal working example of a report.=20 Unfortunately the Pandoc conversion doesn't quite turn out as desired: (1)= =20 it doesn't appear to read the footnotes as endnotes, and (2) the number of= =20 endnotes doesn't restart after a new chapter. Being new to Pandoc I'm not= =20 sure where the problem lies? I suppose it's not a major issue because we=20 could always use your script on each individual LaTeX chapter, then piece= =20 them all together manually into Word?=20 On Wednesday, May 19, 2021 at 3:55:21 AM UTC-4 Bastien Dumont wrote: > Unless you modify it in order to produce nuclear bombs, do as you wish! > However, I must warn you that I adapted it to work with the use case > that you provided only: there are no checks that would prevent it to run > into errors if other conditions are met. Ensure that you stick to \cite > in footnotes and \autocite in the body text, or modify the script > accordingly. > > Le Tuesday 18 May 2021 =C3=A0 07:21:54PM, Jeffrey T a =C3=A9crit : > >=20 > > Hi Bastien, > >=20 > > Thank you very much! This script with Pandoc is an absolute game change= r=20 > in > > terms of my workflow! Do you mind if I share your script with others? > >=20 > > Again, thank you! > > On Sunday, May 16, 2021 at 12:54:24 PM UTC-4 Bastien Dumont wrote: > >=20 > > You're welcome, I already had done much of the work for myself, so I am > > happy if > > it could be useful for others as well. > >=20 > > I had'nt anticipat=C4=95d that you would also use \autocite in the body= . I > > restricted > > the scope of the filter to the footnotes, so you should not have errors > > anymore > > provided that all your use cases are documented in the text file. I > > supposed that > > you don't want the output of \autocite to be changed. Please try the fi= le > > attached. > >=20 > > Le Saturday 15 May 2021 =C3=A0 08:34:22PM, Jeffrey T a =C3=A9crit : > > > Hi Bastien, > > > > > > Oh my, thank you very much for taking the time to assist! I downloade= d > > your Lua > > > filter (I didn't realize that filters were possible with Pandoc!) and > > included > > > it in my Pandoc command: > > > > > > pandoc --citeproc --lua-filter=3Dremove-parentheses-from-cite.lua=20 > Test.tex > > > --bibliography=3Dtestref.bib --csl=3D > > > chicago-fullnote-bibliography-short-title-subsequent.csl -o test.docx > > > > > > It worked perfectly for the \cite commands contained within \footnote= . > > > Unfortunately the remainder of my book manuscript uses \autocite for > > references > > > outside of footnotes. When \autocite is included, I received an error > > message: > > > "bad argument #1 to 'gsub' (string expected, got nil)" > > > > > > If helpful, I've attached the test .tex file I'm using? Your assistan= ce > > is much > > > appreciated! > > > > > > > > > On Saturday, May 15, 2021 at 6:05:21 PM UTC-4 Bastien Dumont wrote: > > > > > > I had a similar problem that I resolved with the attached Lua filter > > > (slightly > > > modified to adapt it to your needs). I hope that it will work for you= . > > > Simply > > > call it after --citeproc. > > > > > > Note that it will throw an error if you have \cite commands outside > > > footnotes. > > > If that it the case, please let me know. > > > > > > Le Saturday 15 May 2021 =C3=A0 12:13:37PM, Jeffrey T a =C3=A9crit : > > > > > > > > Hi all, > > > > I'm new to the group and Pandoc and would greatly appreciate your > > > assistance. > > > > I'm attempting to convert my LaTeX book manuscript into a Word doc= =20 > for > > my > > > > editor. Using a test .tex file, I have successfully converted the= =20 > file > > > using > > > > the following command in Mac Terminal : > > > > pandoc --citeproc Test.tex --bibliography=3Dtestref.bib --csl=3D > > > > chicago-fullnote-bibliography-short-title-subsequent.csl -o test.do= cx > > > > It works wonderfully, however, the only issue concerns the \cite > > > contained > > > > within \footnote. In particular, the resulting citation is now plac= ed > > > within > > > > parentheses which my editor has asked me to remove. Is there some= =20 > sort > > of > > > > solution to my dilemma? Given the length of the book I fear it will= =20 > be > > > quite > > > > tedious to find/remove the offending parentheses manually. > > > > Thank you in advance! > > > > > > > > -- > > > > 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,= =20 > send > > an > > > 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/f4c18da4-6145-4f93-8779-fe2bd2816c38n% > 40googlegroups.com > > . > > > > > > > > > -- > > > 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, sen= d=20 > an > > email > > > to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit https://groups.google.com/d/ > > msgid/ > > > pandoc-discuss/26bec817-c8b4-4d63-ad5d-436aa281c0d7n% > 40googlegroups.com. > >=20 > >=20 > >=20 > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an 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/f787dab5-f3ce-41cf-815c-21f24727b781n%40googlegroups.com= . > > --=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/deac7562-7f50-4699-9cc6-90a0de0d1b3bn%40googlegroups.com. ------=_Part_47_509083351.1621563595990 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Bastien,

Wonderful! The good news is your = script appears to work if I use \= autocite in body or \autoc= ite in footnotes which is actually perfect because I have a few othe= r documents that use this citation method! That said, assuming I need to ma= ke the change from \cite t= o \autocite for footnotes,= I would change Cite =3D function= (cite) to   Cite =3D = function(autocite) in the Lua script?

= Meanwhile, this script has been extremely helpful but I wonder if it can be= extended to document class "reports" with both chapters and endnotes? I'm = on two grant projects with multiple faculty members and this Lua script cou= ld be extremely helpful assuming we need to convert our work into a Word do= cument. I've attached a minimal working example of a report. Unfortunately = the Pandoc conversion doesn't quite turn out as desired: (1) it doesn't app= ear to read the footnotes as endnotes, and (2) the number of endnotes doesn= 't restart after a new chapter. Being new to Pandoc I'm not sure where the = problem lies? I suppose it's not a major issue because we could always use = your script on each individual LaTeX chapter, then piece them all together = manually into Word?

On Wednesday, May 19, 2021 at 3:55:21 AM UTC-4 Bas= tien Dumont wrote:
Unless you modify it in order to produce nuclear bombs, do as you wis= h!
However, I must warn you that I adapted it to work with the use case
that you provided only: there are no checks that would prevent it to ru= n
into errors if other conditions are met. Ensure that you stick to \cite
in footnotes and \autocite in the body text, or modify the script
accordingly.

Le Tuesday 18 May 2021 =C3=A0 07:21:54PM, Jeffrey T a =C3=A9crit :
>=20
> Hi Bastien,
>=20
> Thank you very much! This script with Pandoc is an absolute game c= hanger in
> terms of my workflow! Do you mind if I share your script with othe= rs?
>=20
> Again, thank you!
> On Sunday, May 16, 2021 at 12:54:24 PM UTC-4 Bastien Dumont wrote:
>=20
> You're welcome, I already had done much of the work for my= self, so I am
> happy if
> it could be useful for others as well.
>=20
> I had'nt anticipat=C4=95d that you would also use \autocit= e in the body. I
> restricted
> the scope of the filter to the footnotes, so you should not ha= ve errors
> anymore
> provided that all your use cases are documented in the text fi= le. I
> supposed that
> you don't want the output of \autocite to be changed. Plea= se try the file
> attached.
>=20
> Le Saturday 15 May 2021 =C3=A0 08:34:22PM, Jeffrey T a =C3=A9c= rit :
> > Hi Bastien,
> >
> > Oh my, thank you very much for taking the time to assist!= I downloaded
> your Lua
> > filter (I didn't realize that filters were possible w= ith Pandoc!) and
> included
> > it in my Pandoc command:
> >
> > pandoc --citeproc --lua-filter=3Dremove-parentheses-from-= cite.lua Test.tex
> > --bibliography=3Dtestref.bib --csl=3D
> > chicago-fullnote-bibliography-short-title-subsequent.csl = -o test.docx
> >
> > It worked perfectly for the \cite commands contained with= in \footnote.
> > Unfortunately the remainder of my book manuscript uses \a= utocite for
> references
> > outside of footnotes. When \autocite is included, I recei= ved an error
> message:
> > "bad argument #1 to 'gsub' (string expected,= got nil)"
> >
> > If helpful, I've attached the test .tex file I'm = using? Your assistance
> is much
> > appreciated!
> >
> >
> > On Saturday, May 15, 2021 at 6:05:21 PM UTC-4 Bastien Dum= ont wrote:
> >
> > I had a similar problem that I resolved with the attached= Lua filter
> > (slightly
> > modified to adapt it to your needs). I hope that it will = work for you.
> > Simply
> > call it after --citeproc.
> >
> > Note that it will throw an error if you have \cite comman= ds outside
> > footnotes.
> > If that it the case, please let me know.
> >
> > Le Saturday 15 May 2021 =C3=A0 12:13:37PM, Jeffrey T a = =C3=A9crit :
> > >
> > > Hi all,
> > > I'm new to the group and Pandoc and would greatl= y appreciate your
> > assistance.
> > > I'm attempting to convert my LaTeX book manuscri= pt into a Word doc for
> my
> > > editor. Using a test .tex file, I have successfully = converted the file
> > using
> > > the following command in Mac Terminal :
> > > pandoc --citeproc Test.tex --bibliography=3Dtestref.= bib --csl=3D
> > > chicago-fullnote-bibliography-short-title-subsequent= .csl -o test.docx
> > > It works wonderfully, however, the only issue concer= ns the \cite
> > contained
> > > within \footnote. In particular, the resulting citat= ion is now placed
> > within
> > > parentheses which my editor has asked me to remove. = Is there some sort
> of
> > > solution to my dilemma? Given the length of the book= I fear it will be
> > quite
> > > tedious to find/remove the offending parentheses man= ually.
> > > Thank you in advance!
> > >
> > > --
> > > You received this message because you are subscribed= to the Google
> Groups
> > > "pandoc-discuss" group.
> > > To unsubscribe from this group and stop receiving em= ails from it, send
> an
> > email
> > > to pandoc= -discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > > To view this discussion on the web visit https://groups.google.com/d/
> > msgid/
> > > pandoc-discuss/f4c18da4-6145-4f93-8779-fe2bd2816c38n= %40googlegroups.com
> .
> >
> >
> > --
> > You received this message because you are subscribed to t= he Google Groups
> > "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails = from it, send an
> email
> > to pandoc-disc= us...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> > To view this discussion on the web visit https://groups.google.com/d/
> msgid/
> > pandoc-discuss/26bec817-c8b4-4d63-ad5d-436aa281c0d7n%40googlegroups.com.
>=20
>=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 pandoc-discus...@goo= glegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/
> pandoc-discuss/f787dab5-f3ce-41cf-815c-21f24727b781n%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/deac7562-7f50-4699-9cc6-90a0de0d1b3bn%40googlegroups.= com.
------=_Part_47_509083351.1621563595990-- ------=_Part_46_1794748268.1621563595990 Content-Type: application/x-tex; name=Report.tex Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=Report.tex X-Attachment-Id: 65e28f97-4856-4e4f-8e6c-213ce936c235 Content-ID: <65e28f97-4856-4e4f-8e6c-213ce936c235> \documentclass{report} \usepackage{biblatex-chicago} \usepackage{endnotes} \let\footnote=\endnote \renewcommand\enoteheading{\chapter*{\notesname}\mbox{}\par\vskip-\baselineskip} \counterwithin*{endnote}{chapter} \usepackage{filecontents} \begin{filecontents}{report.bib} @misc{A01, author = {Author, A.}, year = {2001}, title = {Alpha}, } @misc{B02, author = {Buthor, B.}, year = {2002}, title = {Bravo}, } @misc{C03, author = {Cuthor, C.}, year = {2003}, title = {Charlie}, } \end{filecontents} \addbibresource{report.bib} \begin{document} \chapter{Alpha} Some text \autocite{A01}. Some text with footnote.\footnote{\autocite{B02}.} Some text \autocite{C03}. \theendnotes \newpage \chapter{Bravo} Some text \autocite{A01}. Some text \footnote{\autocite{B02}.} \theendnotes \end{document} ------=_Part_46_1794748268.1621563595990--