public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Jeffrey T <jefftreistman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: LaTeX footnote citations parentheses
Date: Tue, 20 Jul 2021 09:19:27 -0700	[thread overview]
Message-ID: <m27dhl5568.fsf@MacBook-Pro-2.hsd1.ca.comcast.net> (raw)
In-Reply-To: <7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


I guess what you want is for an autocite in a footnote not to
include the surrounding parentheses.

There's actually no CSL setting that says "omit parentheses."
We can have a normal citation (which may have parentheses if
that's what the style dictates) or an author-in-text citation
(which will typically have parentheses around everything but
the author name).

So we may not be able to do better here, given the impedance
mismatch between biblatex and CSL...

Jeffrey T <jefftreistman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi Bastien,
>
> I'm working on converting a manuscript for a revise and submit. 
> Unfortunately I've suddenly encountered a new error with 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 to be the culprit. 
> Indeed, by adding any arbitrary character in front of \autocite command 
> contained within a footnote the conversion seems to work as intended. 
>
> Any suggestions? Is this new error perhaps related to a newer release of 
> 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 à 07:21:54PM, Jeffrey T a écrit :
>> > 
>> > Hi Bastien,
>> > 
>> > Thank you very much! This script with Pandoc is an absolute game changer 
>> in
>> > terms of my workflow! Do you mind if I share your script with others?
>> > 
>> > 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ĕd 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 file
>> > attached.
>> > 
>> > Le Saturday 15 May 2021 à 08:34:22PM, Jeffrey T a écrit :
>> > > 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 with Pandoc!) and
>> > included
>> > > it in my Pandoc command:
>> > >
>> > > pandoc --citeproc --lua-filter=remove-parentheses-from-cite.lua 
>> Test.tex
>> > > --bibliography=testref.bib --csl=
>> > > 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 assistance
>> > 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 à 12:13:37PM, Jeffrey T a écrit :
>> > > >
>> > > > 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 
>> 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=testref.bib --csl=
>> > > > chicago-fullnote-bibliography-short-title-subsequent.csl -o test.docx
>> > > > It works wonderfully, however, the only issue concerns the \cite
>> > > contained
>> > > > within \footnote. In particular, the resulting citation 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 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, 
>> 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 Google 
>> 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.com/d/
>> > msgid/
>> > > pandoc-discuss/26bec817-c8b4-4d63-ad5d-436aa281c0d7n%
>> 40googlegroups.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, 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/f787dab5-f3ce-41cf-815c-21f24727b781n%40googlegroups.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, 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/msgid/pandoc-discuss/7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn%40googlegroups.com.
> \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}

-- 
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/msgid/pandoc-discuss/m27dhl5568.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net.


  parent reply	other threads:[~2021-07-20 16:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15 19:13 Jeffrey T
     [not found] ` <f4c18da4-6145-4f93-8779-fe2bd2816c38n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-15 22:04   ` Bastien DUMONT
2021-05-16  1:58     ` Jeffrey T
2021-05-16  3:34     ` Jeffrey T
     [not found]       ` <26bec817-c8b4-4d63-ad5d-436aa281c0d7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-16 16:53         ` Bastien DUMONT
2021-05-19  2:21           ` Jeffrey T
     [not found]             ` <f787dab5-f3ce-41cf-815c-21f24727b781n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-19  7:54               ` Bastien DUMONT
2021-05-21  2:19                 ` Jeffrey T
     [not found]                   ` <deac7562-7f50-4699-9cc6-90a0de0d1b3bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-21  6:00                     ` Bastien DUMONT
2021-05-25 21:27                       ` Jeffrey T
2021-07-19 18:48                 ` Jeffrey T
     [not found]                   ` <7c5a2709-9b84-40b4-a77e-bd3dc5acb50cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-20 16:19                     ` John MacFarlane [this message]
     [not found]                       ` <m27dhl5568.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-07-20 17:44                         ` Jeffrey T
     [not found]                           ` <daaa9fdd-787c-4a51-bde0-c307396fd835n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-08-02  9:59                             ` Bastien DUMONT
2021-08-02 14:25                     ` Bastien DUMONT
2021-05-15 23:53   ` John MacFarlane
     [not found]     ` <m2k0nzmu47.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-05-16  2:05       ` Jeffrey T
2021-05-16  2:37       ` Jeffrey T
     [not found]         ` <b1d2d845-7dd8-4b3d-a059-9562bfb89d2fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-05-16 19:41           ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27dhl5568.fsf@MacBook-Pro-2.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=jefftreistman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).