From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28407 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: LaTeX footnote citations parentheses Date: Fri, 21 May 2021 06:00:29 +0000 Message-ID: References: <26bec817-c8b4-4d63-ad5d-436aa281c0d7n@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="15723"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBHMZTWCQMGQEG7L6KCQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 21 08:01:05 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f189.google.com ([209.85.208.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ljyDY-0003uc-Lf for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 21 May 2021 08:01:04 +0200 Original-Received: by mail-lj1-f189.google.com with SMTP id o5-20020a05651c0505b02900e5a95dd51esf8390937ljp.10 for ; Thu, 20 May 2021 23:01:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621576863; cv=pass; d=google.com; s=arc-20160816; b=FHpxPCa/s++iEevdG8dHW+T8/1rndKCUwGRHxHe9wP6pXdjwTei0EHNn78Dkt2rZN4 hIE0CNKDi1/O1UtPa9Z9IeM4yV+5+EqORApr9/2ECUv3l5t2XWxR28LmvgQ7QTAGaMIQ 1kaAAdjM2+HfoBEqWQdTEMnL7N9lCUzIhhZEWtV7JcqE8yJtbVSG9YhpSV7XjFBxrDqn UGYOJKlOtEnyMe9yo0m21JBsBnmQUljzbVLOAgeFe7vIwu2dMoQ34ZsEeQN1gPCeTD3l 7iJfVx+OfR0FFynwNPTFhvEHM9My/zEFZJUdrLJGjTF6xhngbb+CrIq3yeiKFmeSIxWI HuLw== 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=tNs81t1+FZAMHVFJMWbrYLasymYDq0qaLH+BgSjSEvY=; b=YCiBTqXB++JAtAVsiCR0NF0BXCgjnKWbXTc/ZjIYj3ZaFqDAiNWFzB5oEAjE5ZzSsa ICWH0MksTXD6nlOAidmUnwKwvSrxUaUDwP6JhiVhQdpY0EkDL7+rKMjhPeRtYWWTWEF5 fUiK6tMDpJmqmXRra3V40qKYkIKYOl5BjUGHWwiTe0U4dCioahCZhn4hganZz/QskPzu RBSZcFIsjgE/HsAjjtyOIIAz3V0ncWEBkWQDb2A6VQE5+gu2PniIWEafQ5csfxv6nHkN ulazawaco6yaQ2tmRrPLPK1Fw7fcQQBehb61rABIogDLFbWieQhxu1DDRik2H92XPtr9 1DAA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=pUaF3kOf; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding: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=tNs81t1+FZAMHVFJMWbrYLasymYDq0qaLH+BgSjSEvY=; b=X/2mXEHKm+st2sSGRfmPCeKs/WOH7HJgokRO64M9QB6nmTAGRmH2BmI9ASdyPvmg9t xQPI9mXva6s/+LFP8BZ4VWnDo3EEDh+9XASeq3/i2nMVY4ipkYqNwoEce/TqUqZyMzyS /Y+pIp2ZpGqAJ6vpVuFezk/jG+cBoKqeCHDtEburDhvW6hnOFXmq6njn04SpESbiq/aD lPXkmCW7UUuIS7gjZw1IIwSXhU30ULNeIhPe6YyF1oc6HYEqid6vNwn97EwWfhUvOG6n TC91i+WYkBZ0Mg2R5FuBYxMd8hj2TUt5LEQNNYqKe38nJrGdXE4R6XAQZquRfVzinpve jkbQ== 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:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding: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=tNs81t1+FZAMHVFJMWbrYLasymYDq0qaLH+BgSjSEvY=; b=lPlsGT2FdMH874BmpKCtimvppS+hz70ADBFIEg1vI/vzsaGpNjIK8V7UDLIRHRZeyz 6qcJOvC+Eg4U5B8gZxH57X3raUa63kuMLAXkeNklg23YpBkQ+SkGb2rUISIoenp/n3Ye r5DnnulmGJPMiNXosl2Tj+BDUnmCS7E44lMJ0VMPio9VwYgoS4dZon9Vp7sa7J5DHrMY 31xP9aQMnyukcR+HLphD6EL3BlKU+nOB4ZutM/3fieL5jrhEuuA9a3B/YjJughYt7DWL 1iVnxWtgslrXfBsnLob5BLrFcrqtrUzZ4OwTV872cZZa Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531AleuyNEigB/+rJRAIwJ/PMpMjK6nb3laH4Rcr1wmEwohoggPi lR6yZeyllhKzZ2hGLFYQfNg= X-Google-Smtp-Source: ABdhPJzKuCgE7O77k0XIqGxQ7hcNaT7Vy09JiKwRCYIHN73PAWrjxhbUrRbLLTHCkc5UeFlpmblZag== X-Received: by 2002:a2e:9546:: with SMTP id t6mr5716238ljh.10.1621576863789; Thu, 20 May 2021 23:01:03 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:230f:: with SMTP id o15ls1512509lfu.1.gmail; Thu, 20 May 2021 23:01:00 -0700 (PDT) X-Received: by 2002:a19:c1c1:: with SMTP id r184mr1034002lff.545.1621576860186; Thu, 20 May 2021 23:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621576860; cv=none; d=google.com; s=arc-20160816; b=S1qc7yuO9PRCYbm/VnAOS7p3eTTf2JqthJLkW0ZaChy04XXPsgNdH3acBeGxBgGP4A 3TrSbNWSBVCsp94wcJqFAZehmXJVFm2jeV0jdjg5QjrWF4K4H5NSLRVxciMd4ADdM2NS GeX1LBbU3u1KgpMhCT6e7/LzgPC3T2eVl34L6rxqZJ3QaplZCjqtGd2WHNypxTBLVqR4 3enYXg4TZxJUH6ULKG0MNUahhNW5sv5B4PpyYkVhrLXZpIJMqGXPLQVfDo+/iCu1cqyR kXlNNayrMeEuLJwyUoxUyxickwbumPrqAWinxFayUbY0TeviFe58+aqmLtXaGmmljLBA 1/zQ== 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=tsUkwl35xilROoYYXmn0BH18/H7iXITm6b1NvTv1rgY=; b=rw3yxelbAtyEs4ddM8np+xlGiOCk1zBQ5yhbLe3GLtbGLJHn9c9HQBJKb2I+sTKSLQ 4orqcoU78LTecSkLJAmNmQhV9qiuhAukNX4vF4eMXTzWyTCa+HI6nxVCHBhd9O8lffnE iG1ytqkHnLHLDPtvbbdu1Rbn61lf/tYVGfLZVfKbUq7ruaXyYPt6OSkB4CTZOTn9S8t7 PDfqxejOjixQNzibu23Mv8eVXTcJTVmHe410Z6j8OJOlWQpQKEXNqyK+DtQJ3+P77Jd6 4+d8jP61dhV3BtktKuWFJuHHwEG3Ee5f/xWYBZDM1TEAkbaLSFnZt2JIWjaT9K+b7MBm B46A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=pUaF3kOf; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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 mout02.posteo.de (mout02.posteo.de. [185.67.36.66]) by gmr-mx.google.com with ESMTPS id k35si139069lfv.3.2021.05.20.23.00.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 23:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) client-ip=185.67.36.66; Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id BF5AD240107 for ; Fri, 21 May 2021 08:00:58 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FmbZJ5Dvpz9rxh for ; Fri, 21 May 2021 08:00:56 +0200 (CEST) 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=pUaF3kOf; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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:28407 Archived-At: Hi, To see wether the script will work or not, you can convert your file or a sample to Pandoc Markdown. The citation key must always appear inside brack= ets, wether it be in a footnote or not. So in the following example: pandoc -t markdown -f latex <<< '\cite{key} \autocite{key} \footnote{\cite{key} \autocite{key}}' [@key] [@key] [^1] [^1]: [@key] [@key] you can see that all the conditions are met. Pandoc makes no difference bet= ween \cite and \autocite. As long as it works, you don't have to modify the filter. Changing "cite" t= o "autocite" won't do anything, it's only an arbitrary variable name that poi= nt to an object of type "Cite" in Pandoc's internal representation of the document. The script is only concerned with removing parentheses around citations. In order to convert your footnotes to endnotes and to reset the numeration, yo= u will have to use Word's utilities. To my knowledge, Pandoc itself makes no distinction between footnotes and endnotes and handles notes as footnotes b= y default. Le Thursday 20 May 2021 =C3=A0 07:19:55PM, Jeffrey T a =C3=A9crit : > Hi Bastien, >=20 > Wonderful! The good news is your script appears to work if I use \autocit= e in > body or \autocite in footnotes which is actually perfect because I have a= few > other documents that use this citation method! That said, assuming I need= to > make the change from \cite to \autocite for footnotes, I would change Cit= e =3D > function(cite) to Cite =3D function(autocite) in the Lua script? >=20 > 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 coul= d be > extremely helpful assuming we need to convert our work into a Word docume= nt. > I've attached a minimal working example of a report. Unfortunately the Pa= ndoc > conversion doesn't quite turn out as desired: (1) it doesn't appear to re= ad the > footnotes as endnotes, and (2) the number of endnotes doesn't restart aft= er a > new chapter. Being new to Pandoc I'm not sure where the problem lies? I s= uppose > 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= ? >=20 > On Wednesday, May 19, 2021 at 3:55:21 AM UTC-4 Bastien Dumont wrote: >=20 > 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 = run > into errors if other conditions are met. Ensure that you stick to \ci= te > in footnotes and \autocite in the body text, or modify the script > accordingly. >=20 > Le Tuesday 18 May 2021 =C3=A0 07:21:54PM, Jeffrey T a =C3=A9crit : > > > > Hi Bastien, > > > > Thank you very much! This script with Pandoc is an absolute game ch= anger > in > > terms of my workflow! Do you mind if I share your script with other= s? > > > > Again, thank you! > > On Sunday, May 16, 2021 at 12:54:24 PM UTC-4 Bastien Dumont wrote: > > > > 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. > > > > 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 er= rors > > 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 th= e file > > attached. > > > > 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 downl= oaded > > 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 > 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 \foot= note. > > > Unfortunately the remainder of my book manuscript uses \autocite = for > > references > > > outside of footnotes. When \autocite is included, I received an e= rror > > message: > > > "bad argument #1 to 'gsub' (string expected, got nil)" > > > > > > If helpful, I've attached the test .tex file I'm using? Your assi= stance > > is much > > > appreciated! > > > > > > > > > On Saturday, May 15, 2021 at 6:05:21 PM UTC-4 Bastien Dumont wrot= e: > > > > > > I had a similar problem that I resolved with the attached Lua fil= ter > > > (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 outsi= de > > > 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 yo= ur > > > assistance. > > > > I'm attempting to convert my LaTeX book manuscript into a Word = doc > for > > my > > > > editor. Using a test .tex file, I have successfully converted t= he > 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 tes= t.docx > > > > It works wonderfully, however, the only issue concerns the \cit= e > > > contained > > > > within \footnote. In particular, the resulting citation is now = placed > > > within > > > > parentheses which my editor has asked me to remove. Is there so= me > 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 manually. > > > > Thank you in advance! > > > > > > > > -- > > > > You received this message because you are subscribed to the Goo= gle > > Groups > > > > "pandoc-discuss" group. > > > > To unsubscribe from this group and stop receiving emails from i= t, > send > > 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/f4c18da4-6145-4f93-8779-fe2bd2816c38n% > 40googlegroups.com > > . > > > > > > > > > -- > > > You received this message because you are subscribed to the Googl= e > Groups > > > "pandoc-discuss" group. > > > To unsubscribe from this group and stop receiving emails from it,= send > an > > email > > > to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To view this discussion on the web visit https://groups.google.co= m/d/ > > msgid/ > > > pandoc-discuss/26bec817-c8b4-4d63-ad5d-436aa281c0d7n%40googlegrou= ps.com > . > > > > > > > > -- > > 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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit https://groups.google.com/= d/ > msgid/ > > pandoc-discuss/f787dab5-f3ce-41cf-815c-21f24727b781n%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= email > to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/ > pandoc-discuss/deac7562-7f50-4699-9cc6-90a0de0d1b3bn%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/YKdMfbS2kSXj%2BhIJ%40localhost.