public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Citing inside latex block with citeproc
@ 2021-10-29 13:40 Clément Aubert
       [not found] ` <CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE=i0uAHaQvgk1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Clément Aubert @ 2021-10-29 13:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

Good morning,

Tldr: I don't understand how I can cite inside latex blocks using
--citeproc.

Long version:

If I use

pandoc test.md --citeproc -o test.pdf

to convert an md file into a pdf, then I can use [@key] for references, and
I can also use most of LaTeX commands inside my md file (such as \label{…},
typically).
Inside a latex environment, everything has to be in latex, if I understand
correctly, so that

\begin{definition}
- This
- Is
- A list
\end{definition}

would not work. Hence,

\begin{definition}
[@key]
\end{definition}

would not work either, but since I use citeproc, I cannot use \cite{key}
either.
So, is there any way to make a reference from within a "latex environment"
using -citeproc?
(And, just to be clear: the definition environment is just an example here,
I don't particularly care about this specific environment).

Thanks!
Clément.

-- 
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/CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE%3Di0uAHaQvgk1A%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2009 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found] ` <CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE=i0uAHaQvgk1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-10-29 16:46   ` John MacFarlane
       [not found]     ` <m28rybn5i7.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-10-29 16:46 UTC (permalink / raw)
  To: Clément Aubert, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


There isn't really a good way to do this, no.

One option would be to use the --biblatex or --natbib option
with pandoc instead of --citeproc, if you're targeting LaTeX
anyway.  Then you *could* just use regular LaTeX \cite
commands.  (Note however that pandoc's pdf output won't
run bibtex or biber itself; you'd need to use
--pdf-engine=latexmk, or generate the tex using pandoc
and compile it yourself.)

Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Good morning,
>
> Tldr: I don't understand how I can cite inside latex blocks using
> --citeproc.
>
> Long version:
>
> If I use
>
> pandoc test.md --citeproc -o test.pdf
>
> to convert an md file into a pdf, then I can use [@key] for references, and
> I can also use most of LaTeX commands inside my md file (such as \label{…},
> typically).
> Inside a latex environment, everything has to be in latex, if I understand
> correctly, so that
>
> \begin{definition}
> - This
> - Is
> - A list
> \end{definition}
>
> would not work. Hence,
>
> \begin{definition}
> [@key]
> \end{definition}
>
> would not work either, but since I use citeproc, I cannot use \cite{key}
> either.
> So, is there any way to make a reference from within a "latex environment"
> using -citeproc?
> (And, just to be clear: the definition environment is just an example here,
> I don't particularly care about this specific environment).
>
> Thanks!
> Clément.
>
> -- 
> 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/CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE%3Di0uAHaQvgk1A%40mail.gmail.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/m28rybn5i7.fsf%40Johns-Air.hsd1.ca.comcast.net.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found]     ` <m28rybn5i7.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2021-10-29 16:53       ` Clément Aubert
       [not found]         ` <CAPGHSex4ezmFVkRyV7MnDZ5Hk2DKKRR9zOnkDa8iAgZYTQkWQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Clément Aubert @ 2021-10-29 16:53 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2779 bytes --]

Ok, thanks a lot.

A "reasonable" pipe-line would be
pandoc test.md -t latex --biblatex | pandoc --pdf-engine=latexmk -o test.pdf
or is there anything more clever?

Thanks!



Le ven. 29 oct. 2021 à 12:47, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> a écrit :

>
> There isn't really a good way to do this, no.
>
> One option would be to use the --biblatex or --natbib option
> with pandoc instead of --citeproc, if you're targeting LaTeX
> anyway.  Then you *could* just use regular LaTeX \cite
> commands.  (Note however that pandoc's pdf output won't
> run bibtex or biber itself; you'd need to use
> --pdf-engine=latexmk, or generate the tex using pandoc
> and compile it yourself.)
>
> Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Good morning,
> >
> > Tldr: I don't understand how I can cite inside latex blocks using
> > --citeproc.
> >
> > Long version:
> >
> > If I use
> >
> > pandoc test.md --citeproc -o test.pdf
> >
> > to convert an md file into a pdf, then I can use [@key] for references,
> and
> > I can also use most of LaTeX commands inside my md file (such as
> \label{…},
> > typically).
> > Inside a latex environment, everything has to be in latex, if I
> understand
> > correctly, so that
> >
> > \begin{definition}
> > - This
> > - Is
> > - A list
> > \end{definition}
> >
> > would not work. Hence,
> >
> > \begin{definition}
> > [@key]
> > \end{definition}
> >
> > would not work either, but since I use citeproc, I cannot use \cite{key}
> > either.
> > So, is there any way to make a reference from within a "latex
> environment"
> > using -citeproc?
> > (And, just to be clear: the definition environment is just an example
> here,
> > I don't particularly care about this specific environment).
> >
> > Thanks!
> > Clément.
> >
> > --
> > 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/CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE%3Di0uAHaQvgk1A%40mail.gmail.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/CAPGHSex4ezmFVkRyV7MnDZ5Hk2DKKRR9zOnkDa8iAgZYTQkWQw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4118 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found]         ` <CAPGHSex4ezmFVkRyV7MnDZ5Hk2DKKRR9zOnkDa8iAgZYTQkWQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-10-29 17:02           ` John MacFarlane
       [not found]             ` <m25ytfn4qr.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-10-29 17:02 UTC (permalink / raw)
  To: Clément Aubert; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Ok, thanks a lot.
>
> A "reasonable" pipe-line would be
> pandoc test.md -t latex --biblatex | pandoc --pdf-engine=latexmk -o test.pdf

No, not like that.  Either

pandoc test.md -t latex -s --biblatex -o test.tex
pdflatex test
biber test
pdflatex test
pdflatex test

Or, easier

pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk

(which should run biber for you, if I'm not mistaken.)

-- 
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/m25ytfn4qr.fsf%40Johns-Air.hsd1.ca.comcast.net.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found]             ` <m25ytfn4qr.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
@ 2021-10-29 17:08               ` Clément Aubert
       [not found]                 ` <CAPGHSez6NfusgPkOzr+XCPwpnWhs833BNKibELak8MS-4GbPHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Clément Aubert @ 2021-10-29 17:08 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

Ok, now I'm confused.
The documentation reads (my emphasis):

> Use biblatex <https://ctan.org/pkg/biblatex> for citations in LaTeX
> output. This option is not for use with the --citeproc
> <https://pandoc.org/MANUAL.html#option--citeproc> option *or with PDF
> output*. It is intended for use in producing a LaTeX file that can be
> processed with bibtex <https://ctan.org/pkg/bibtex> or biber
> <https://ctan.org/pkg/biber>.
>
How does that align with the command

pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk

?


Le ven. 29 oct. 2021 à 13:03, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> a écrit :

> Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Ok, thanks a lot.
> >
> > A "reasonable" pipe-line would be
> > pandoc test.md -t latex --biblatex | pandoc --pdf-engine=latexmk -o
> test.pdf
>
> No, not like that.  Either
>
> pandoc test.md -t latex -s --biblatex -o test.tex
> pdflatex test
> biber test
> pdflatex test
> pdflatex test
>
> Or, easier
>
> pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk
>
> (which should run biber for you, if I'm not mistaken.)
>

-- 
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/CAPGHSez6NfusgPkOzr%2BXCPwpnWhs833BNKibELak8MS-4GbPHg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found]                 ` <CAPGHSez6NfusgPkOzr+XCPwpnWhs833BNKibELak8MS-4GbPHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-10-29 23:23                   ` John MacFarlane
       [not found]                     ` <yh480kh7cz4dr2.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-10-29 23:23 UTC (permalink / raw)
  To: Clément Aubert; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


The manual is a bit misleading on this. Before we added the
latexmk option for --pdf-engine, there was indeed no way
to use --biblatex with direct output to pdf, because pandoc
doesn't run bibtex/biber in producing a pdf.  But latexmk
will do this automatically, so it should work in that way.

Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Ok, now I'm confused.
> The documentation reads (my emphasis):
>
>> Use biblatex <https://ctan.org/pkg/biblatex> for citations in LaTeX
>> output. This option is not for use with the --citeproc
>> <https://pandoc.org/MANUAL.html#option--citeproc> option *or with PDF
>> output*. It is intended for use in producing a LaTeX file that can be
>> processed with bibtex <https://ctan.org/pkg/bibtex> or biber
>> <https://ctan.org/pkg/biber>.
>>
> How does that align with the command
>
> pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk
>
> ?
>
>
> Le ven. 29 oct. 2021 à 13:03, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> a écrit :
>
>> Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> > Ok, thanks a lot.
>> >
>> > A "reasonable" pipe-line would be
>> > pandoc test.md -t latex --biblatex | pandoc --pdf-engine=latexmk -o
>> test.pdf
>>
>> No, not like that.  Either
>>
>> pandoc test.md -t latex -s --biblatex -o test.tex
>> pdflatex test
>> biber test
>> pdflatex test
>> pdflatex test
>>
>> Or, easier
>>
>> pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk
>>
>> (which should run biber for you, if I'm not mistaken.)
>>

-- 
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/yh480kh7cz4dr2.fsf%40johnmacfarlane.net.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citing inside latex block with citeproc
       [not found]                     ` <yh480kh7cz4dr2.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2021-10-30  4:58                       ` Clément Aubert
  0 siblings, 0 replies; 7+ messages in thread
From: Clément Aubert @ 2021-10-30  4:58 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

Ok, thanks a lot, I really appreciate your answer and the time spent on
this wonderful project!

Le ven. 29 oct. 2021 à 19:23, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> a écrit :

>
> The manual is a bit misleading on this. Before we added the
> latexmk option for --pdf-engine, there was indeed no way
> to use --biblatex with direct output to pdf, because pandoc
> doesn't run bibtex/biber in producing a pdf.  But latexmk
> will do this automatically, so it should work in that way.
>
> Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Ok, now I'm confused.
> > The documentation reads (my emphasis):
> >
> >> Use biblatex <https://ctan.org/pkg/biblatex> for citations in LaTeX
> >> output. This option is not for use with the --citeproc
> >> <https://pandoc.org/MANUAL.html#option--citeproc> option *or with PDF
> >> output*. It is intended for use in producing a LaTeX file that can be
> >> processed with bibtex <https://ctan.org/pkg/bibtex> or biber
> >> <https://ctan.org/pkg/biber>.
> >>
> > How does that align with the command
> >
> > pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk
> >
> > ?
> >
> >
> > Le ven. 29 oct. 2021 à 13:03, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> a
> écrit :
> >
> >> Clément Aubert <aubert.clement-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> >>
> >> > Ok, thanks a lot.
> >> >
> >> > A "reasonable" pipe-line would be
> >> > pandoc test.md -t latex --biblatex | pandoc --pdf-engine=latexmk -o
> >> test.pdf
> >>
> >> No, not like that.  Either
> >>
> >> pandoc test.md -t latex -s --biblatex -o test.tex
> >> pdflatex test
> >> biber test
> >> pdflatex test
> >> pdflatex test
> >>
> >> Or, easier
> >>
> >> pandoc test.md --biblatex -o test.pdf --pdf-engine=latexmk
> >>
> >> (which should run biber for you, if I'm not mistaken.)
> >>
>

-- 
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/CAPGHSexcrFZeVH%2BKwL0zEnQ2rus0Z5p%2B_wHvyRm4zW8Bk7Ad5Q%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3915 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-30  4:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 13:40 Citing inside latex block with citeproc Clément Aubert
     [not found] ` <CAPGHSewQHSJ4O3i-PUpEw8iSw_2sfyHum0acE=i0uAHaQvgk1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-29 16:46   ` John MacFarlane
     [not found]     ` <m28rybn5i7.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-10-29 16:53       ` Clément Aubert
     [not found]         ` <CAPGHSex4ezmFVkRyV7MnDZ5Hk2DKKRR9zOnkDa8iAgZYTQkWQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-29 17:02           ` John MacFarlane
     [not found]             ` <m25ytfn4qr.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-10-29 17:08               ` Clément Aubert
     [not found]                 ` <CAPGHSez6NfusgPkOzr+XCPwpnWhs833BNKibELak8MS-4GbPHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-10-29 23:23                   ` John MacFarlane
     [not found]                     ` <yh480kh7cz4dr2.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-10-30  4:58                       ` Clément Aubert

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).