From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28852 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: Mon, 19 Jul 2021 11:48:57 -0700 (PDT) Message-ID: <7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn@googlegroups.com> 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_28_1744745519.1626720537343" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12075"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCTKDNPE2AFBBGUS26DQMGQEBNYEIOY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jul 19 20:49:01 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f56.google.com ([209.85.161.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m5YK4-0002su-Rl for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 19 Jul 2021 20:49:00 +0200 Original-Received: by mail-oo1-f56.google.com with SMTP id b1-20020a4ac2810000b029024bec618157sf13133427ooq.2 for ; Mon, 19 Jul 2021 11:49:00 -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=ddqCSL+FCmkAtdrGGy0AbvaBwlhochA1uAQY7/deksg=; b=CNWr8WWMSxWfG9OpXjgAmi277pu/u0JHE+r5AbFaM4sODiyjzwuyijtwKGzNT+zJGZ 2YKvFeBDzzhzsc/sxtpOszWG64vZOqhu0o320gkQQOzzdGCCzZdDkh/K4S1vWRu/eKb4 t+rYtqtjqtKVeoLqK+jNuumLver2UjhbK5J2AI+ZwR+k4eqTqw8uMX6FLaRk1kSdQq4y uECvw0uOCqX/pQFP0ryzeBImdyi7QbATxURBzintmC1Hrvn3X8lbLEPJpovKV7HaJMDM 3DoQV21sqA88zwlgrTiMDE1q/NoolXYyF1OWYKaJBGn285CaWQw39rCZRH1EtvO5deaJ Q5Ew== 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=ddqCSL+FCmkAtdrGGy0AbvaBwlhochA1uAQY7/deksg=; b=N9M/tNny2CBla5hRluq5ydwFFQEl3arwtkRRErpk0xn9VJEqloIRPprm8lAUMRklFw sN5+ApCT3nYkwdEVCj4KU2OLABvxv1qbL0NzfpentUZmCVrWAV2vC8za+llNg7BZBAAU UjEm/a5PdWUwaf5d7K8PLTBCOQfvX8EguGXrfY2AJhQ0gt5jsEImbGNfn3SptcT6RmP7 pCc7Phuqm3wv2is3+f/smxHsyQoDX9TJA30OhXWbUQVmSy3LjvcVzBYkrKBsUpmv/kQ6 62w7TbnlJzcGO3ZX2AYIee4kZCqFQkWpDd17fd6RpJiKWkV4k3O3NnfcVLF/j4+2bgdd VYjA== 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=ddqCSL+FCmkAtdrGGy0AbvaBwlhochA1uAQY7/deksg=; b=S7InQ5pNinQzJr113cqaOCPDYXEsHH6nW2fqXlKV/dfgLL30UHsN/WHyxcCOUut9XZ 8AplZh/iGGZkcBdFweBoNaThcXdneF11IHnivxgTf2MHmN1x260OaiGUDySr0pQlW4o/ +d9xq18NmWrSSGGhBkqRC8hssCUj5PZwPgag5EEBlaSwV+egEPoYYvL5PrBA/tYOqzaB b7fSQhzWA3X8pRoDHcZ4KnjGLvuAA1qDiAPJQJidSP3EM03UH4xYSbfJX7lYmpxj3rtX 9MEbEmv5GDOGOm3Nh5VWDvQIPfJMyxpOXCqzYML3MGhDraPfy+3LzF9wiu1StpPMUOJ7 04Pw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533HwoBqM5TxNozEd6X6ocfYBfCm0A23h4y3NBvoVKib8LWoADQG U77b/pT4/v2bZe/30vGZi30= X-Google-Smtp-Source: ABdhPJz+3DDYSOgJmTNBC/lFDBlP3h2JZHqFs7OQbPJJaebWGmELBM/cLSGqCoVAIg7/MB80/qZMUA== X-Received: by 2002:aca:382:: with SMTP id 124mr22744116oid.49.1626720539823; Mon, 19 Jul 2021 11:48:59 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:641:: with SMTP id 62ls9246254oig.0.gmail; Mon, 19 Jul 2021 11:48:58 -0700 (PDT) X-Received: by 2002:a05:6808:20a9:: with SMTP id s41mr23158767oiw.25.1626720538161; Mon, 19 Jul 2021 11:48:58 -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:28852 Archived-At: ------=_Part_28_1744745519.1626720537343 Content-Type: multipart/alternative; boundary="----=_Part_29_1542984302.1626720537343" ------=_Part_29_1542984302.1626720537343 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Bastien, I'm working on converting a manuscript for a revise and submit.=20 Unfortunately I've suddenly encountered a new error with the Pandoc script= =20 / filter which appears to be isolated to citations that appear in a=20 footnote but *without* any preceding text. I've attached a minimal working= =20 example. Note the third citation in the example appears to be the culprit.= =20 Indeed, by adding any arbitrary character in front of \autocite command=20 contained within a footnote the conversion seems to work as intended.=20 Any suggestions? Is this new error perhaps related to a newer release of=20 Pandoc? As always, your expertise and help is greatly appreciated! 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/7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn%40googlegroups.com. ------=_Part_29_1542984302.1626720537343 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Bastien,

I'm working on converting a manuscript for a= revise and submit. Unfortunately I've suddenly encountered a new error wit= h the Pandoc script / filter which appears to be isolated to citations that= appear in a footnote but without any preceding text. I've attached = a minimal working example. Note the third citation in the example appears t= o be the culprit. Indeed, by adding any arbitrary character in front of \autocite command contained within a footnot= e the conversion seems to work as intended. 

= Any suggestions? Is this new error perhaps related to a newer release of Pa= ndoc? As always, your expertise and help is greatly appreciated!

On Wed= nesday, May 19, 2021 at 3:55:21 AM UTC-4 Bastien Dumont wrote:
Unless you modify it in o= rder 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 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/7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn%40googlegroups.= com.
------=_Part_29_1542984302.1626720537343-- ------=_Part_28_1744745519.1626720537343 Content-Type: text/x-tex; charset=US-ASCII; name=Test.tex Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=Test.tex X-Attachment-Id: f088924e-3a58-4a05-a25b-1e7e9fe5d1fb Content-ID: \documentclass{article} \usepackage{markdown} \usepackage{biblatex-chicago} \usepackage{filecontents}% to embed the file `myreferences.bib` in your `.tex` file \begin{filecontents}{testref.bib} @article{Doe, author = {John Doe}, journal = {Sample Journal}, number = {1}, pages = {1-20}, title = {This is a sample title of the Pandoc reference}, volume = {14}, year = {2022}} @article{Smith, author = {Sally Smith}, journal = {Journal of Something}, number = {4}, pages = {69-90}, title = {The title would normally goes here}, volume = {02}, year = {1992}} \end{filecontents} \addbibresource{testref.bib} \begin{document} Here is a standard citation using autocite.\autocite[1]{Doe} Here is a citation contained within a footnote.\footnote{See \autocite[6]{Smith}.} Here is a citation contained within a footnote but without any preceding text before the citation.\footnote{\autocite[10]{Doe}. See also \autocite{Smith}.} \end{document} ------=_Part_28_1744745519.1626720537343--