From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28355 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: Sat, 15 May 2021 22:04:51 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ahoWcpn0KDifentP" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21405"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBHMLQGCQMGQE45AZ36I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun May 16 00:05:22 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f63.google.com ([209.85.167.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1li2PQ-0005LJ-Vx for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 16 May 2021 00:05:20 +0200 Original-Received: by mail-lf1-f63.google.com with SMTP id b17-20020a1967110000b02901cf971c3987sf174531lfc.18 for ; Sat, 15 May 2021 15:05:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621116320; cv=pass; d=google.com; s=arc-20160816; b=Y6r0an4X7BfZA2rqLxo62srPVKqKJT8y8g0C+vPMvOw5WnQDr/AnMrhZfg9FH0B7Lv iXmilG9v/7dQRhn/Dd3yFbCayeKXhu7RqBarxPrRVJ+VapR3bU8NmawTpBknAOTGmsBn Y0LIvprJS+jQRDND65OLmMMTsNec1wyRe9c6HmQXnbHhu3Csi3BOqqJwI7+72tCHK5kz HBUUTfCTxEDomdQCdTujLyUbRFFc03kO011bipqz1IA/EQEXMmOmaBDUBUNyX9ry4mqM FgGekZuIgKg8OCPyyJoA3Dpw8HsGjaob/X88/Zk/PAh1O2WksabNzOC9OqQnlRBNarIS C0sA== 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=GPCw4n4sRcn9vw4pin1+xkjQRdy3UMsXKBISCxi48zo=; b=VHYJSkPI0EDYx1oTDdQckPc62AYARBHXFoCae4kUT749qU86+zA7Pwbg3Fgcw36dx9 X+w9TOmCZD484Gc6ko1l5YXf7HIqRvzicQpLc9t/ZkaFTzbI+N5C9Abkxs3mj0HhwfXm Nvz8WLCGRWnmaDeiyPueq3CuKSMUSzhDqcXjvtoQEr58cExsurly0PdnVaPZoGwJfaB5 b9XdmadET8hW8KmeFQ+GJugU3vPXJaIS8n/1nk0QNCuYNHyjBTLTQj/P/1XZSDqzdVaL E4dXHlO6WSuek6I/DiyvFpkjtUZl8W1tHRpEegW64yqFRXgCp2OHjopahqvNpe8xST1y 7Y9g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=dr2AHzux; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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=GPCw4n4sRcn9vw4pin1+xkjQRdy3UMsXKBISCxi48zo=; b=HsWLDjT6+z2R1qqVU0C/yXFQaNXcmQ8lFjdpwhHEYG4O9mv+k3PotZjso+WM3/c+dt rEkELpTckv1MKUg3oD8Puf0c7CIw1cEtbl5CJNG46WqXuh9ZmxIxb8CRIFsWbfRMgZcx O+Td/PQi2EJZBxqUE0hx+hEYZXwGbyztZsHKQkvqj8fHsdwdihlAe6nWqgYeB4EI8Wz0 cqhfkNbnce+h3VTeKC5dAf6uH+fCwpOagCqOakZWldttUgZGkpPHrlGRQ/1igt51x0cE pd8Qhb6oNvzRRGvyJD9+k5gLT51TFY7A9YdHO48F/UQ20AXzeINAvurFBaPg9/ig6zmO nGYA== 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=GPCw4n4sRcn9vw4pin1+xkjQRdy3UMsXKBISCxi48zo=; b=mvFEP+QaGeC+pMKJu0uYsLJXKaTehHYOZkQLTndvl6xh+wo5EI9x/PHUZKMYJPoZXW +niibtve0zwn7Eykv/4jf6ERgMgoxtIxhkT5/vJyuzB8Lh5KRWDaoLvdViwV61WssjTz bckmymVcRBFxz1T2X1N9cy6QRBb7FJ5jpiDTvh8bH8I6/xkjY4KsbEXEnQfGFsOT/6HF kE+vXxyFe8CZAtns2QM95+dTE407SCrDL/l7w/qJCYdHjSuSZAwjR9WvPh8jBET+rHP7 F8tqp0tI7Aq6cdofBwTwyRpK2/ONBUCy2uFVSaHiorJj Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530iMP7J9b+M4XGIX3u9osVKNgPSF5IJmhmL4GgLobk53bL/XzkN 6tzRxUjY4rg+AVmuhw/yhy8= X-Google-Smtp-Source: ABdhPJzOgh5YN97ZpnbU3fOPC2xjxzLht4JZUNtbnZGohGQ8jD22HFb+kZbtXd3R4nWAprHAMHGBgw== X-Received: by 2002:a2e:8946:: with SMTP id b6mr25306043ljk.389.1621116319987; Sat, 15 May 2021 15:05:19 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac2:592a:: with SMTP id v10ls124335lfi.2.gmail; Sat, 15 May 2021 15:05:17 -0700 (PDT) X-Received: by 2002:ac2:5382:: with SMTP id g2mr7531948lfh.25.1621116317111; Sat, 15 May 2021 15:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621116317; cv=none; d=google.com; s=arc-20160816; b=wqPwmpNl7aUMy2HaC7fyTWWa8YWWAB9utEVKjAenHZcNN4T2bA3in3aylYp51LrGWy 6z4zRNjshGJuaBsClSIKzKq0T21uUJQQarqbBmOr3kYfd057S5aTnug256s5ZOCSuFO6 QJCTxpohbBL8quQy81lHcdjh4LLQzaV865JQi6ClmQ8qgVqpsqjpwVeeQsIJD0qf/sEl wuVboXPllyebazQWQnk4Uoro+kif9+ilZvOlfL/c8mdglhz9PJPaIb+KNXf4rQ7g6qND 0n9Pux2DmKZNB3cLwcjkqQZcquP32olXEVqLCkDiCT/Xoj4uIRvZgMQSce7i79RIc70Y zKoQ== 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=YhT1GTzFqzEAV3Lj1dFKCD4dtfcvwM6U+TZhmpVuj6A=; b=ZZ/lRxarYJm6RhQSRc+/gC4tMFpSpPgFYeZFQDmtaIOZhfICTPk4vLt7tdZamxKrL8 ahANI/hny7O07rqJMApoW0t90bqvCVkeqcs5aYN1+v+K6VXPVBS+r2TNcYYwZTf6z2N1 y/Gz+gj7eDRZricH5EyE+mDZtYVaaW6lEGaHAzpZy1fSzQF3kzG83w4/sTjXYq9181jr UzdgZMCdTLgYp2cuDITAzFDYSJmuXHNcV4U1rraqjHgoCQe0iCX5JsBXIIMoI4fZqMXD KIyLIx/UxtgEZ+T9U0Om97AU+iqgs9bEbmH4b6DPdEec2NFsB3LJuf+jWAFqS5YLAq4z +Y1g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=dr2AHzux; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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 mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id 17si369720lfp.2.2021.05.15.15.05.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 May 2021 15:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3E6EB240028 for ; Sun, 16 May 2021 00:05:16 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FjKFl4524z6tmH for ; Sun, 16 May 2021 00:05:15 +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=dr2AHzux; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 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:28355 Archived-At: --ahoWcpn0KDifentP Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I had a similar problem that I resolved with the attached Lua filter (sligh= tly modified to adapt it to your needs). I hope that it will work for you. Simp= ly call it after --citeproc. Note that it will throw an error if you have \cite commands outside footnot= es. If that it the case, please let me know. Le Saturday 15 May 2021 =C3=A0 12:13:37PM, Jeffrey T a =C3=A9crit : >=20 > Hi all, > I'm new to the group and Pandoc and would greatly appreciate your assista= nce. > 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 the file us= ing > 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 concerns the \cite containe= d > within \footnote. In particular, the resulting citation is now placed wit= hin > 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 qu= ite > tedious to find/remove the offending parentheses manually. > Thank you in advance! >=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/f4c18da4-6145-4f93-8779-fe2bd2816c38n%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/YKBFg75x90nojslz%40localhost. --ahoWcpn0KDifentP Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="remove-parentheses-from-cite.lua" local function getLastInnermostElem(elemsList) local lastInnermostElem = elemsList[#elemsList] if not lastInnermostElem.t == "Str" then getLastInnermostElem(lastInnermostElem) end return lastInnermostElem end local function getFirstInnermostElem(elemsList) local firstInnermostElem = elemsList[1] if not firstInnermostElem.t == "Str" then getFirstInnermostElem(firstInnermostElem) end return firstInnermostElem end local function removeTrailingSpace(formattedCitation) if formattedCitation[1].t == "Space" then formattedCitation:remove(1) end end local function removeParentheses(formattedCitation) local lastInnermostElem = getLastInnermostElem(formattedCitation) lastInnermostElem.text = string.gsub(lastInnermostElem.text, "%)$", "") local firstInnermostElem = getFirstInnermostElem(formattedCitation) firstInnermostElem.text = string.gsub(firstInnermostElem.text, "^%(", "") end function Cite(cite) removeTrailingSpace(cite.content) removeParentheses(cite.content) return cite end --ahoWcpn0KDifentP--