public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Convert paragraphs to
@ 2020-09-18 14:20 Denis Maier
       [not found] ` <e9ca8ffe-2004-24a4-154f-3ea94a2ded75-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Denis Maier @ 2020-09-18 14:20 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Hi,

converting markdown to JATS XML, I need to wrap the bibliography in 
special tags. Looks like the Jats writer does that already when the 
bibliography is produced via pandoc-citeproc. But I receive them as 
preformatted paragraphs.

So, I get this:

```
# References

First citation

Second citation

Another citation
```

And this is what I need:

```
<ref-list>
   <title>References</title>
   <ref>
     <mixed-citation>
       First citation
     </mixed-citation>
   </ref>
   <ref>
     <mixed-citation>
       Second citation
     </mixed-citation>
   </ref>
   <ref>
     <mixed-citation>
       Another citation
     </mixed-citation>
   </ref>
</ref-list>
```

The whole thing must be a child element under `<back/>`.

Any suggestions?

Best
Denis

-- 
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/e9ca8ffe-2004-24a4-154f-3ea94a2ded75%40mailbox.org.


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

* Convert paragraphs to xml structure (markdown to jats)
       [not found] ` <e9ca8ffe-2004-24a4-154f-3ea94a2ded75-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
@ 2020-09-18 14:27   ` Denis Maier
  2020-09-18 16:29   ` Convert paragraphs to John MacFarlane
  2020-09-18 17:26   ` Albert Krewinkel
  2 siblings, 0 replies; 11+ messages in thread
From: Denis Maier @ 2020-09-18 14:27 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Sorry, again with a useful subject line.

Am 18.09.2020 um 16:20 schrieb Denis Maier:
> Hi,
>
> converting markdown to JATS XML, I need to wrap the bibliography in 
> special tags. Looks like the Jats writer does that already when the 
> bibliography is produced via pandoc-citeproc. But I receive them as 
> preformatted paragraphs.
>
> So, I get this:
>
> ```
> # References
>
> First citation
>
> Second citation
>
> Another citation
> ```
>
> And this is what I need:
>
> ```
> <ref-list>
>   <title>References</title>
>   <ref>
>     <mixed-citation>
>       First citation
>     </mixed-citation>
>   </ref>
>   <ref>
>     <mixed-citation>
>       Second citation
>     </mixed-citation>
>   </ref>
>   <ref>
>     <mixed-citation>
>       Another citation
>     </mixed-citation>
>   </ref>
> </ref-list>
> ```
>
> The whole thing must be a child element under `<back/>`.
>
> Any suggestions?
>
> Best
> Denis
>

-- 
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/8e714e44-b5b7-8cb6-50b7-ed0d1c93a52e%40mailbox.org.


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

* Re: Convert paragraphs to
       [not found] ` <e9ca8ffe-2004-24a4-154f-3ea94a2ded75-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  2020-09-18 14:27   ` Convert paragraphs to xml structure (markdown to jats) Denis Maier
@ 2020-09-18 16:29   ` John MacFarlane
       [not found]     ` <m2zh5nujym.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  2020-09-18 17:26   ` Albert Krewinkel
  2 siblings, 1 reply; 11+ messages in thread
From: John MacFarlane @ 2020-09-18 16:29 UTC (permalink / raw)
  To: Denis Maier, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


You might be able to use pandoc's templating language to do this.

If you can put the citations in metadata, then you can add
something to your template that iterates over the elements
and adds them to the document between the appropriate tags.

This will generate the citations section.  You'd need to
insert it into the main document in a separate step, using
a filter (since the main JATS template just has $body$).

Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> writes:

> Hi,
>
> converting markdown to JATS XML, I need to wrap the bibliography in 
> special tags. Looks like the Jats writer does that already when the 
> bibliography is produced via pandoc-citeproc. But I receive them as 
> preformatted paragraphs.
>
> So, I get this:
>
> ```
> # References
>
> First citation
>
> Second citation
>
> Another citation
> ```
>
> And this is what I need:
>
> ```
> <ref-list>
>    <title>References</title>
>    <ref>
>      <mixed-citation>
>        First citation
>      </mixed-citation>
>    </ref>
>    <ref>
>      <mixed-citation>
>        Second citation
>      </mixed-citation>
>    </ref>
>    <ref>
>      <mixed-citation>
>        Another citation
>      </mixed-citation>
>    </ref>
> </ref-list>
> ```
>
> The whole thing must be a child element under `<back/>`.
>
> Any suggestions?
>
> Best
> Denis
>
> -- 
> 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/e9ca8ffe-2004-24a4-154f-3ea94a2ded75%40mailbox.org.

-- 
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/m2zh5nujym.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re: Convert paragraphs to
       [not found] ` <e9ca8ffe-2004-24a4-154f-3ea94a2ded75-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  2020-09-18 14:27   ` Convert paragraphs to xml structure (markdown to jats) Denis Maier
  2020-09-18 16:29   ` Convert paragraphs to John MacFarlane
@ 2020-09-18 17:26   ` Albert Krewinkel
       [not found]     ` <87imcbm1xy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  2 siblings, 1 reply; 11+ messages in thread
From: Albert Krewinkel @ 2020-09-18 17:26 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Not sure if helpful, but pandoc-scholar jumps through some hoops to get
better citations in JATS. There are limitations, but it works reasonably
well.

See `scholar-filters/jats-fixes.lua` and the `Makefile` in project
https://github.com/pandoc-scholar/pandoc-scholar.

Denis Maier writes:

> Hi,
>
> converting markdown to JATS XML, I need to wrap the bibliography in special
> tags. Looks like the Jats writer does that already when the bibliography is
> produced via pandoc-citeproc. But I receive them as preformatted paragraphs.
>
> So, I get this:
>
> ```
> # References
>
> First citation
>
> Second citation
>
> Another citation
> ```
>
> And this is what I need:
>
> ```
> <ref-list>
>   <title>References</title>
>   <ref>
>     <mixed-citation>
>       First citation
>     </mixed-citation>
>   </ref>
>   <ref>
>     <mixed-citation>
>       Second citation
>     </mixed-citation>
>   </ref>
>   <ref>
>     <mixed-citation>
>       Another citation
>     </mixed-citation>
>   </ref>
> </ref-list>
> ```
>
> The whole thing must be a child element under `<back/>`.
>
> Any suggestions?
>
> Best
> Denis


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: Convert paragraphs to
       [not found]     ` <87imcbm1xy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2020-09-18 19:00       ` Denis Maier
  2020-09-18 22:26       ` John MacFarlane
  1 sibling, 0 replies; 11+ messages in thread
From: Denis Maier @ 2020-09-18 19:00 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Thanks, I'll have a look at the makefile and the filters. (Perhaps a 
similar filter like "abstract-to-meta" could be helpful for my question.

Am 18.09.2020 um 19:26 schrieb Albert Krewinkel:
> Not sure if helpful, but pandoc-scholar jumps through some hoops to get
> better citations in JATS. There are limitations, but it works reasonably
> well.
>
> See `scholar-filters/jats-fixes.lua` and the `Makefile` in project
> https://github.com/pandoc-scholar/pandoc-scholar.
>
> Denis Maier writes:
>
>> Hi,
>>
>> converting markdown to JATS XML, I need to wrap the bibliography in special
>> tags. Looks like the Jats writer does that already when the bibliography is
>> produced via pandoc-citeproc. But I receive them as preformatted paragraphs.
>>
>> So, I get this:
>>
>> ```
>> # References
>>
>> First citation
>>
>> Second citation
>>
>> Another citation
>> ```
>>
>> And this is what I need:
>>
>> ```
>> <ref-list>
>>    <title>References</title>
>>    <ref>
>>      <mixed-citation>
>>        First citation
>>      </mixed-citation>
>>    </ref>
>>    <ref>
>>      <mixed-citation>
>>        Second citation
>>      </mixed-citation>
>>    </ref>
>>    <ref>
>>      <mixed-citation>
>>        Another citation
>>      </mixed-citation>
>>    </ref>
>> </ref-list>
>> ```
>>
>> The whole thing must be a child element under `<back/>`.
>>
>> Any suggestions?
>>
>> Best
>> Denis
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>


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

* Re: Convert paragraphs to
       [not found]     ` <m2zh5nujym.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2020-09-18 19:02       ` Denis Maier
       [not found]         ` <7e377dff-fee5-bf9b-690e-b60837e6313b-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Denis Maier @ 2020-09-18 19:02 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw, John MacFarlane

Thanks. That looks like a good approach. Not fully automatic, but good 
enough for my purposes.
By the way, the jats template has

```
<back>
$if(back)$
$back$
$endif$
</back>
```

So adding the references in there shouldn't be too hard.

Am 18.09.2020 um 18:29 schrieb John MacFarlane:
> You might be able to use pandoc's templating language to do this.
>
> If you can put the citations in metadata, then you can add
> something to your template that iterates over the elements
> and adds them to the document between the appropriate tags.
>
> This will generate the citations section.  You'd need to
> insert it into the main document in a separate step, using
> a filter (since the main JATS template just has $body$).
>
> Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> writes:
>
>> Hi,
>>
>> converting markdown to JATS XML, I need to wrap the bibliography in
>> special tags. Looks like the Jats writer does that already when the
>> bibliography is produced via pandoc-citeproc. But I receive them as
>> preformatted paragraphs.
>>
>> So, I get this:
>>
>> ```
>> # References
>>
>> First citation
>>
>> Second citation
>>
>> Another citation
>> ```
>>
>> And this is what I need:
>>
>> ```
>> <ref-list>
>>     <title>References</title>
>>     <ref>
>>       <mixed-citation>
>>         First citation
>>       </mixed-citation>
>>     </ref>
>>     <ref>
>>       <mixed-citation>
>>         Second citation
>>       </mixed-citation>
>>     </ref>
>>     <ref>
>>       <mixed-citation>
>>         Another citation
>>       </mixed-citation>
>>     </ref>
>> </ref-list>
>> ```
>>
>> The whole thing must be a child element under `<back/>`.
>>
>> Any suggestions?
>>
>> Best
>> Denis
>>
>> -- 
>> 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/e9ca8ffe-2004-24a4-154f-3ea94a2ded75%40mailbox.org.

-- 
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/7e377dff-fee5-bf9b-690e-b60837e6313b%40mailbox.org.


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

* Re: Convert paragraphs to
       [not found]         ` <7e377dff-fee5-bf9b-690e-b60837e6313b-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
@ 2020-09-18 19:49           ` Denis Maier
       [not found]             ` <54131db9-87b3-47bd-0f93-c65f9f19a4bd-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Denis Maier @ 2020-09-18 19:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Ok, it's really simple:

convert the bibliography to

---
ref-list-title: Bibliography
ref-list:
- Ref 1
- Ref 2
- Ref 3
---

(This can be done in place due to pandocs support for multiple metadata 
blocks.)

Then, in the template I've added:

<back>
$if(back)$
$back$
$endif$
$if(ref-list)$
<ref-list>
$if(ref-list-title)$
<title>$ref-list-title$</title>
$endif$
$for(ref-list)$
<ref>
<mixed-citation>
$ref-list$
</mixed-citation>
</ref>
$endfor$
</ref-list>
$endif$
</back>

The hardest part is now bringing the reference list into shape. But 
maybe a filter could help here. It should be possible to transform this 
into a metadata field shouldn't it?

:::{.ref-list title=Bibliography}
Ref 1

Ref 2

Ref 3
:::




Am 18.09.2020 um 21:02 schrieb Denis Maier:
> Thanks. That looks like a good approach. Not fully automatic, but good 
> enough for my purposes.
> By the way, the jats template has
>
> ```
> <back>
> $if(back)$
> $back$
> $endif$
> </back>
> ```
>
> So adding the references in there shouldn't be too hard.
>
> Am 18.09.2020 um 18:29 schrieb John MacFarlane:
>> You might be able to use pandoc's templating language to do this.
>>
>> If you can put the citations in metadata, then you can add
>> something to your template that iterates over the elements
>> and adds them to the document between the appropriate tags.
>>
>> This will generate the citations section.  You'd need to
>> insert it into the main document in a separate step, using
>> a filter (since the main JATS template just has $body$).
>>
>> Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> writes:
>>
>>> Hi,
>>>
>>> converting markdown to JATS XML, I need to wrap the bibliography in
>>> special tags. Looks like the Jats writer does that already when the
>>> bibliography is produced via pandoc-citeproc. But I receive them as
>>> preformatted paragraphs.
>>>
>>> So, I get this:
>>>
>>> ```
>>> # References
>>>
>>> First citation
>>>
>>> Second citation
>>>
>>> Another citation
>>> ```
>>>
>>> And this is what I need:
>>>
>>> ```
>>> <ref-list>
>>>     <title>References</title>
>>>     <ref>
>>>       <mixed-citation>
>>>         First citation
>>>       </mixed-citation>
>>>     </ref>
>>>     <ref>
>>>       <mixed-citation>
>>>         Second citation
>>>       </mixed-citation>
>>>     </ref>
>>>     <ref>
>>>       <mixed-citation>
>>>         Another citation
>>>       </mixed-citation>
>>>     </ref>
>>> </ref-list>
>>> ```
>>>
>>> The whole thing must be a child element under `<back/>`.
>>>
>>> Any suggestions?
>>>
>>> Best
>>> Denis
>>>
>>> -- 
>>> 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/e9ca8ffe-2004-24a4-154f-3ea94a2ded75%40mailbox.org.
>

-- 
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/54131db9-87b3-47bd-0f93-c65f9f19a4bd%40mailbox.org.


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

* Re: Convert paragraphs to
       [not found]             ` <54131db9-87b3-47bd-0f93-c65f9f19a4bd-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
@ 2020-09-18 20:15               ` BPJ
  0 siblings, 0 replies; 11+ messages in thread
From: BPJ @ 2020-09-18 20:15 UTC (permalink / raw)
  To: pandoc-discuss

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

If the list of references is sensibly formatted you should be able to use
an external script to reformat it as YAML, and perhaps run that external
script as a text filter in your editor. A piece of cake in Vim; possibly
harder in more "modern" editors.

-- 
Better --help|less than helpless

Den fre 18 sep. 2020 21:50Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> skrev:

> Ok, it's really simple:
>
> convert the bibliography to
>
> ---
> ref-list-title: Bibliography
> ref-list:
> - Ref 1
> - Ref 2
> - Ref 3
> ---
>
> (This can be done in place due to pandocs support for multiple metadata
> blocks.)
>
> Then, in the template I've added:
>
> <back>
> $if(back)$
> $back$
> $endif$
> $if(ref-list)$
> <ref-list>
> $if(ref-list-title)$
> <title>$ref-list-title$</title>
> $endif$
> $for(ref-list)$
> <ref>
> <mixed-citation>
> $ref-list$
> </mixed-citation>
> </ref>
> $endfor$
> </ref-list>
> $endif$
> </back>
>
> The hardest part is now bringing the reference list into shape. But
> maybe a filter could help here. It should be possible to transform this
> into a metadata field shouldn't it?
>
> :::{.ref-list title=Bibliography}
> Ref 1
>
> Ref 2
>
> Ref 3
> :::
>
>
>
>
> Am 18.09.2020 um 21:02 schrieb Denis Maier:
> > Thanks. That looks like a good approach. Not fully automatic, but good
> > enough for my purposes.
> > By the way, the jats template has
> >
> > ```
> > <back>
> > $if(back)$
> > $back$
> > $endif$
> > </back>
> > ```
> >
> > So adding the references in there shouldn't be too hard.
> >
> > Am 18.09.2020 um 18:29 schrieb John MacFarlane:
> >> You might be able to use pandoc's templating language to do this.
> >>
> >> If you can put the citations in metadata, then you can add
> >> something to your template that iterates over the elements
> >> and adds them to the document between the appropriate tags.
> >>
> >> This will generate the citations section.  You'd need to
> >> insert it into the main document in a separate step, using
> >> a filter (since the main JATS template just has $body$).
> >>
> >> Denis Maier <denis.maier.lists-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org> writes:
> >>
> >>> Hi,
> >>>
> >>> converting markdown to JATS XML, I need to wrap the bibliography in
> >>> special tags. Looks like the Jats writer does that already when the
> >>> bibliography is produced via pandoc-citeproc. But I receive them as
> >>> preformatted paragraphs.
> >>>
> >>> So, I get this:
> >>>
> >>> ```
> >>> # References
> >>>
> >>> First citation
> >>>
> >>> Second citation
> >>>
> >>> Another citation
> >>> ```
> >>>
> >>> And this is what I need:
> >>>
> >>> ```
> >>> <ref-list>
> >>>     <title>References</title>
> >>>     <ref>
> >>>       <mixed-citation>
> >>>         First citation
> >>>       </mixed-citation>
> >>>     </ref>
> >>>     <ref>
> >>>       <mixed-citation>
> >>>         Second citation
> >>>       </mixed-citation>
> >>>     </ref>
> >>>     <ref>
> >>>       <mixed-citation>
> >>>         Another citation
> >>>       </mixed-citation>
> >>>     </ref>
> >>> </ref-list>
> >>> ```
> >>>
> >>> The whole thing must be a child element under `<back/>`.
> >>>
> >>> Any suggestions?
> >>>
> >>> Best
> >>> Denis
> >>>
> >>> --
> >>> 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/e9ca8ffe-2004-24a4-154f-3ea94a2ded75%40mailbox.org
> .
> >
>
> --
> 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/54131db9-87b3-47bd-0f93-c65f9f19a4bd%40mailbox.org
> .
>

-- 
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/CADAJKhD8yUebPHFGaU-EHUiEsy3nY4wFg9x5ZqhoQWF6rboJ4Q%40mail.gmail.com.

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

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

* Re: Convert paragraphs to
       [not found]     ` <87imcbm1xy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  2020-09-18 19:00       ` Denis Maier
@ 2020-09-18 22:26       ` John MacFarlane
       [not found]         ` <m2tuvuvi0s.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: John MacFarlane @ 2020-09-18 22:26 UTC (permalink / raw)
  To: Albert Krewinkel, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Albert, let me know if it would make sense to port any of these improvements 
to pandoc itself.

Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:

> Not sure if helpful, but pandoc-scholar jumps through some hoops to get
> better citations in JATS. There are limitations, but it works reasonably
> well.
>
> See `scholar-filters/jats-fixes.lua` and the `Makefile` in project
> https://github.com/pandoc-scholar/pandoc-scholar.
>
> Denis Maier writes:
>
>> Hi,
>>
>> converting markdown to JATS XML, I need to wrap the bibliography in special
>> tags. Looks like the Jats writer does that already when the bibliography is
>> produced via pandoc-citeproc. But I receive them as preformatted paragraphs.
>>
>> So, I get this:
>>
>> ```
>> # References
>>
>> First citation
>>
>> Second citation
>>
>> Another citation
>> ```
>>
>> And this is what I need:
>>
>> ```
>> <ref-list>
>>   <title>References</title>
>>   <ref>
>>     <mixed-citation>
>>       First citation
>>     </mixed-citation>
>>   </ref>
>>   <ref>
>>     <mixed-citation>
>>       Second citation
>>     </mixed-citation>
>>   </ref>
>>   <ref>
>>     <mixed-citation>
>>       Another citation
>>     </mixed-citation>
>>   </ref>
>> </ref-list>
>> ```
>>
>> The whole thing must be a child element under `<back/>`.
>>
>> Any suggestions?
>>
>> Best
>> Denis
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>
> -- 
> 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/87imcbm1xy.fsf%40zeitkraut.de.


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

* Re: Convert paragraphs to
       [not found]         ` <m2tuvuvi0s.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2020-09-19  6:59           ` Albert Krewinkel
       [not found]             ` <87d02imetv.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Albert Krewinkel @ 2020-09-19  6:59 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


John MacFarlane writes:

> Albert, let me know if it would make sense to port any of these improvements
> to pandoc itself.

I'll try to describe the issues that the filter works around. I may very
well have missed an easier way to do this:

The JATS writer uses a special CSL which adds rich semantic tags in the
bibliography entries, but it uses numbers as reference markers in the
main text. Overriding the special CSL will allow for style-specific
markers, but we lose the semantic tagging in the bibliography. The
filter combines the two by using the normal CSL to format citations in
the text, but keeps the semantic bibliography.

I'm not sure yet what exactly pandoc could do better. Maybe it could do
the same as the filter, but that requires multiple citeproc runs. I
really haven't thought this through yet. My hope and plan is to do work
on JATS later this year; this could be one of the first things I'll look
at.


> Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:
>
>> Not sure if helpful, but pandoc-scholar jumps through some hoops to get
>> better citations in JATS. There are limitations, but it works reasonably
>> well.
>>
>> See `scholar-filters/jats-fixes.lua` and the `Makefile` in project
>> https://github.com/pandoc-scholar/pandoc-scholar.
>>
>> Denis Maier writes:
>>
>>> Hi,
>>>
>>> converting markdown to JATS XML, I need to wrap the bibliography in special
>>> tags. Looks like the Jats writer does that already when the bibliography is
>>> produced via pandoc-citeproc. But I receive them as preformatted paragraphs.
>>>
>>> So, I get this:
>>>
>>> ```
>>> # References
>>>
>>> First citation
>>>
>>> Second citation
>>>
>>> Another citation
>>> ```
>>>
>>> And this is what I need:
>>>
>>> ```
>>> <ref-list>
>>>   <title>References</title>
>>>   <ref>
>>>     <mixed-citation>
>>>       First citation
>>>     </mixed-citation>
>>>   </ref>
>>>   <ref>
>>>     <mixed-citation>
>>>       Second citation
>>>     </mixed-citation>
>>>   </ref>
>>>   <ref>
>>>     <mixed-citation>
>>>       Another citation
>>>     </mixed-citation>
>>>   </ref>
>>> </ref-list>
>>> ```
>>>
>>> The whole thing must be a child element under `<back/>`.
>>>
>>> Any suggestions?
>>>
>>> Best
>>> Denis
>>
>>
>> --
>> Albert Krewinkel
>> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>>
>> --
>> 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/87imcbm1xy.fsf%40zeitkraut.de.


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: Convert paragraphs to
       [not found]             ` <87d02imetv.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2020-09-19 18:13               ` John MacFarlane
  0 siblings, 0 replies; 11+ messages in thread
From: John MacFarlane @ 2020-09-19 18:13 UTC (permalink / raw)
  To: Albert Krewinkel, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


As I recall, the way we handle CSL and JATS is a hack,
which required changing pandoc-citeproc so that JATS-specific
XML could be included in a style.

It would be good to do something better, indeed!

Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:

> John MacFarlane writes:
>
>> Albert, let me know if it would make sense to port any of these improvements
>> to pandoc itself.
>
> I'll try to describe the issues that the filter works around. I may very
> well have missed an easier way to do this:
>
> The JATS writer uses a special CSL which adds rich semantic tags in the
> bibliography entries, but it uses numbers as reference markers in the
> main text. Overriding the special CSL will allow for style-specific
> markers, but we lose the semantic tagging in the bibliography. The
> filter combines the two by using the normal CSL to format citations in
> the text, but keeps the semantic bibliography.
>
> I'm not sure yet what exactly pandoc could do better. Maybe it could do
> the same as the filter, but that requires multiple citeproc runs. I
> really haven't thought this through yet. My hope and plan is to do work
> on JATS later this year; this could be one of the first things I'll look
> at.
>
>
>> Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:
>>
>>> Not sure if helpful, but pandoc-scholar jumps through some hoops to get
>>> better citations in JATS. There are limitations, but it works reasonably
>>> well.
>>>
>>> See `scholar-filters/jats-fixes.lua` and the `Makefile` in project
>>> https://github.com/pandoc-scholar/pandoc-scholar.
>>>
>>> Denis Maier writes:
>>>
>>>> Hi,
>>>>
>>>> converting markdown to JATS XML, I need to wrap the bibliography in special
>>>> tags. Looks like the Jats writer does that already when the bibliography is
>>>> produced via pandoc-citeproc. But I receive them as preformatted paragraphs.
>>>>
>>>> So, I get this:
>>>>
>>>> ```
>>>> # References
>>>>
>>>> First citation
>>>>
>>>> Second citation
>>>>
>>>> Another citation
>>>> ```
>>>>
>>>> And this is what I need:
>>>>
>>>> ```
>>>> <ref-list>
>>>>   <title>References</title>
>>>>   <ref>
>>>>     <mixed-citation>
>>>>       First citation
>>>>     </mixed-citation>
>>>>   </ref>
>>>>   <ref>
>>>>     <mixed-citation>
>>>>       Second citation
>>>>     </mixed-citation>
>>>>   </ref>
>>>>   <ref>
>>>>     <mixed-citation>
>>>>       Another citation
>>>>     </mixed-citation>
>>>>   </ref>
>>>> </ref-list>
>>>> ```
>>>>
>>>> The whole thing must be a child element under `<back/>`.
>>>>
>>>> Any suggestions?
>>>>
>>>> Best
>>>> Denis
>>>
>>>
>>> --
>>> Albert Krewinkel
>>> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>>>
>>> --
>>> 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/87imcbm1xy.fsf%40zeitkraut.de.
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>
> -- 
> 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/87d02imetv.fsf%40zeitkraut.de.


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

end of thread, other threads:[~2020-09-19 18:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 14:20 Convert paragraphs to Denis Maier
     [not found] ` <e9ca8ffe-2004-24a4-154f-3ea94a2ded75-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-09-18 14:27   ` Convert paragraphs to xml structure (markdown to jats) Denis Maier
2020-09-18 16:29   ` Convert paragraphs to John MacFarlane
     [not found]     ` <m2zh5nujym.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-09-18 19:02       ` Denis Maier
     [not found]         ` <7e377dff-fee5-bf9b-690e-b60837e6313b-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-09-18 19:49           ` Denis Maier
     [not found]             ` <54131db9-87b3-47bd-0f93-c65f9f19a4bd-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2020-09-18 20:15               ` BPJ
2020-09-18 17:26   ` Albert Krewinkel
     [not found]     ` <87imcbm1xy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-09-18 19:00       ` Denis Maier
2020-09-18 22:26       ` John MacFarlane
     [not found]         ` <m2tuvuvi0s.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-09-19  6:59           ` Albert Krewinkel
     [not found]             ` <87d02imetv.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-09-19 18:13               ` John MacFarlane

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