public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Citeproc CSL formating overriden by Latex?
@ 2019-04-26 17:56 and0
       [not found] ` <ea8553b6-c582-4061-bd5c-0227e0e82fa8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: and0 @ 2019-04-26 17:56 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2349 bytes --]

Hey everyone,

I'm currently writing an academic paper as a .md file, then converting it 
to .pdf using the following command: 

pandoc --pdf-engine=xelatex --filter pandoc-citeproc metadata/meta.yaml --
template mytemplate.latex -s paper.md -o export/out.pdf

meta.yaml contains a link to my .bib file (as well as other things). So far 
everything has worked fine, but now I've run into an issue regarding the 
formating of my bibliography. I've created a .csl file defining what I want 
things to look like, but some elements seem to either be ignored by 
citeproc or overriden later. My main issue is indentation: The main text 
should have the first line of a paragraph indented, which I'm achieving 
through indent = true
in my meta.yaml. The bibliography on the other hand should only use hanging 
indents, which I have specified in my .csl file.

The thing is, when I run pandoc, the bibliography in the resulting pdf has indent 
= true applied to it as well, which messes up the entire formating. I've 
exported my paper to .latex and didn't see any formating related to lines 
in the code (only things like \emph and \textsc), so XeLaTeX just treats 
the entries as another paragraph and indents their first lines. This whole 
issue of settings in my .csl being overriden also happens with line spacing 
for example (I've set linestretch = 1.5 in my meta.yaml so that's what I'm 
getting in the bibliography).

So now I'm wondering: Is this a bug? Or am I approaching this wrong? I can 
sort of understand why citeproc doesn't apply my .csl line settings, but on 
the other hand I feel it's a bit inconsistent since it applies *most *of 
the .csl. Is there a solution for this or should I be using --biblatex to 
export a .tex file and then converting it via XeLaTeX?

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ea8553b6-c582-4061-bd5c-0227e0e82fa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5163 bytes --]

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

* Re: Citeproc CSL formating overriden by Latex?
       [not found] ` <ea8553b6-c582-4061-bd5c-0227e0e82fa8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-04-27  9:37   ` Lukas Atkinson
       [not found]     ` <CAJTYOd2Ac6135ZV4AGK5wWVRzknjf6wwYGbM_jL-3S0gXFM8WA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Atkinson @ 2019-04-27  9:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Pandoc's CSL engine is fairly limited, just like Pandoc itself. The CSL
engine produces normal Pandoc elements, it does not directly produce LaTeX.
Pandoc's data model does not describe indentation. Consequently, any
indentation in the CSL file will be ignored, and LaTeX will apply normal
paragraph styles.

The solution is to manually insert necessary LaTeX formatting commands just
before the place where the bibliography will be inserted. Alternatively,
use a LaTeX-native bibliography system such as biblatex. This doesn't let
you use CSL, but this avoids Pandoc limitations.

Personally, I stick with citeproc for short reports where the exact
bibliography rendering isn't that important. But in most cases, using
Pandoc as the first stage of a normal LaTeX compilation process is more
sensible.

On Fri, 26 Apr 2019 at 19:56, and0 <andrejpreradovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hey everyone,
>
> I'm currently writing an academic paper as a .md file, then converting it
> to .pdf using the following command:
>
> pandoc --pdf-engine=xelatex --filter pandoc-citeproc metadata/meta.yaml --
> template mytemplate.latex -s paper.md -o export/out.pdf
>
> meta.yaml contains a link to my .bib file (as well as other things). So
> far everything has worked fine, but now I've run into an issue regarding
> the formating of my bibliography. I've created a .csl file defining what I
> want things to look like, but some elements seem to either be ignored by
> citeproc or overriden later. My main issue is indentation: The main text
> should have the first line of a paragraph indented, which I'm achieving
> through indent = true
> in my meta.yaml. The bibliography on the other hand should only use
> hanging indents, which I have specified in my .csl file.
>
> The thing is, when I run pandoc, the bibliography in the resulting pdf has indent
> = true applied to it as well, which messes up the entire formating. I've
> exported my paper to .latex and didn't see any formating related to lines
> in the code (only things like \emph and \textsc), so XeLaTeX just treats
> the entries as another paragraph and indents their first lines. This whole
> issue of settings in my .csl being overriden also happens with line spacing
> for example (I've set linestretch = 1.5 in my meta.yaml so that's what I'm
> getting in the bibliography).
>
> So now I'm wondering: Is this a bug? Or am I approaching this wrong? I can
> sort of understand why citeproc doesn't apply my .csl line settings, but on
> the other hand I feel it's a bit inconsistent since it applies *most *of
> the .csl. Is there a solution for this or should I be using --biblatex to
> export a .tex file and then converting it via XeLaTeX?
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/ea8553b6-c582-4061-bd5c-0227e0e82fa8%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/ea8553b6-c582-4061-bd5c-0227e0e82fa8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJTYOd2Ac6135ZV4AGK5wWVRzknjf6wwYGbM_jL-3S0gXFM8WA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

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

* Re: Citeproc CSL formating overriden by Latex?
       [not found]     ` <CAJTYOd2Ac6135ZV4AGK5wWVRzknjf6wwYGbM_jL-3S0gXFM8WA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-04-27 11:27       ` and0
  0 siblings, 0 replies; 3+ messages in thread
From: and0 @ 2019-04-27 11:27 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 4584 bytes --]

Thank you for the explanation latk!
I've now gotten the formating I wanted by wrapping the bibliography in 
\hangparas. That's good enough for now, as I had to create my own CSL style 
and I don't want to have to recreate it in Biblatex for this paper. I'll 
look into doing that later though, so that I can use the Pandoc -> LaTeX 
route you suggested. Thank you!



On Saturday, April 27, 2019 at 11:37:24 AM UTC+2, latk wrote:
>
> Pandoc's CSL engine is fairly limited, just like Pandoc itself. The CSL 
> engine produces normal Pandoc elements, it does not directly produce LaTeX. 
> Pandoc's data model does not describe indentation. Consequently, any 
> indentation in the CSL file will be ignored, and LaTeX will apply normal 
> paragraph styles.
>
> The solution is to manually insert necessary LaTeX formatting commands 
> just before the place where the bibliography will be inserted. 
> Alternatively, use a LaTeX-native bibliography system such as biblatex. 
> This doesn't let you use CSL, but this avoids Pandoc limitations.
>
> Personally, I stick with citeproc for short reports where the exact 
> bibliography rendering isn't that important. But in most cases, using 
> Pandoc as the first stage of a normal LaTeX compilation process is more 
> sensible.
>
> On Fri, 26 Apr 2019 at 19:56, and0 <andrejpr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> 
> wrote:
>
>> Hey everyone,
>>
>> I'm currently writing an academic paper as a .md file, then converting it 
>> to .pdf using the following command: 
>>
>> pandoc --pdf-engine=xelatex --filter pandoc-citeproc metadata/meta.yaml 
>> --template mytemplate.latex -s paper.md -o export/out.pdf
>>
>> meta.yaml contains a link to my .bib file (as well as other things). So 
>> far everything has worked fine, but now I've run into an issue regarding 
>> the formating of my bibliography. I've created a .csl file defining what I 
>> want things to look like, but some elements seem to either be ignored by 
>> citeproc or overriden later. My main issue is indentation: The main text 
>> should have the first line of a paragraph indented, which I'm achieving 
>> through indent = true
>> in my meta.yaml. The bibliography on the other hand should only use 
>> hanging indents, which I have specified in my .csl file.
>>
>> The thing is, when I run pandoc, the bibliography in the resulting pdf 
>> has indent = true applied to it as well, which messes up the entire 
>> formating. I've exported my paper to .latex and didn't see any formating 
>> related to lines in the code (only things like \emph and \textsc), so 
>> XeLaTeX just treats the entries as another paragraph and indents their 
>> first lines. This whole issue of settings in my .csl being overriden also 
>> happens with line spacing for example (I've set linestretch = 1.5 in my 
>> meta.yaml so that's what I'm getting in the bibliography).
>>
>> So now I'm wondering: Is this a bug? Or am I approaching this wrong? I 
>> can sort of understand why citeproc doesn't apply my .csl line settings, 
>> but on the other hand I feel it's a bit inconsistent since it applies *most 
>> *of the .csl. Is there a solution for this or should I be using 
>> --biblatex to export a .tex file and then converting it via XeLaTeX?
>>
>> -- 
>> 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/ea8553b6-c582-4061-bd5c-0227e0e82fa8%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/ea8553b6-c582-4061-bd5c-0227e0e82fa8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/36d86598-fefe-4e25-9509-ec97f6963a70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 8322 bytes --]

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

end of thread, other threads:[~2019-04-27 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26 17:56 Citeproc CSL formating overriden by Latex? and0
     [not found] ` <ea8553b6-c582-4061-bd5c-0227e0e82fa8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-27  9:37   ` Lukas Atkinson
     [not found]     ` <CAJTYOd2Ac6135ZV4AGK5wWVRzknjf6wwYGbM_jL-3S0gXFM8WA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-27 11:27       ` and0

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