public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to run chem troff with pandoc
@ 2021-03-26 10:34 Илья Волк
       [not found] ` <017d0265-5af3-40ad-bbd8-d46861e779d6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Илья Волк @ 2021-03-26 10:34 UTC (permalink / raw)
  To: pandoc-discuss


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

 I use pandoc with ms preproc. How to use chem troff for chemistry formulas 
with roff -ms preproc?

Thanks!

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

* Re: How to run chem troff with pandoc
       [not found] ` <017d0265-5af3-40ad-bbd8-d46861e779d6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-29 17:58   ` John MacFarlane
       [not found]     ` <m2r1jxkfjz.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-03-29 17:58 UTC (permalink / raw)
  To: Илья Волк,
	pandoc-discuss


Are you using pandoc to read or to write ms?

Илья Волк <thesun409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

>  I use pandoc with ms preproc. How to use chem troff for chemistry formulas 
> with roff -ms preproc?
>
> Thanks!
>
> -- 
> 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/m2r1jxkfjz.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re: How to run chem troff with pandoc
       [not found]     ` <m2r1jxkfjz.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-03-29 18:28       ` Илья Волк
       [not found]         ` <67af0eff-be18-43fd-be82-871116dab6bbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Илья Волк @ 2021-03-29 18:28 UTC (permalink / raw)
  To: pandoc-discuss


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

I use pandoc for produce PDF and docx files.
-t ms: pdfroff parameter.
Actually a want to write chemical formulas with pandoc using pdfroff engine.

понедельник, 29 марта 2021 г. в 20:58:38 UTC+3, John MacFarlane: 

>
> Are you using pandoc to read or to write ms?
>
> Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > I use pandoc with ms preproc. How to use chem troff for chemistry 
> formulas 
> > with roff -ms preproc?
> >
> > Thanks!
> >
> > -- 
> > 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/67af0eff-be18-43fd-be82-871116dab6bbn%40googlegroups.com.

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

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

* Re: How to run chem troff with pandoc
       [not found]         ` <67af0eff-be18-43fd-be82-871116dab6bbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-29 21:32           ` John MacFarlane
       [not found]             ` <m235wdk5mj.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-03-29 21:32 UTC (permalink / raw)
  To: Илья Волк,
	pandoc-discuss


You'll need two things:

first, you'll need

--pdf-engine-opt=-j

This will cause the chem preprocessor to be invoked.
Then, you'll need to insert raw .ms sections into your
document with the chem macros. If your source document
is pandoc markdown, you can do that with a raw block:

A benzene ring is

```{=ms}
ring double 1,2 3,4 5,6
```

Илья Волк <thesun409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I use pandoc for produce PDF and docx files.
> -t ms: pdfroff parameter.
> Actually a want to write chemical formulas with pandoc using pdfroff engine.
>
> понедельник, 29 марта 2021 г. в 20:58:38 UTC+3, John MacFarlane: 
>
>>
>> Are you using pandoc to read or to write ms?
>>
>> Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> > I use pandoc with ms preproc. How to use chem troff for chemistry 
>> formulas 
>> > with roff -ms preproc?
>> >
>> > Thanks!
>> >
>> > -- 
>> > 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/67af0eff-be18-43fd-be82-871116dab6bbn%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/m235wdk5mj.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re: How to run chem troff with pandoc
       [not found]             ` <m235wdk5mj.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-03-29 22:28               ` John MacFarlane
       [not found]                 ` <m2lfa5ioh7.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: John MacFarlane @ 2021-03-29 22:28 UTC (permalink / raw)
  To: Илья Волк,
	pandoc-discuss


I left out a couple things.  I think you also need
--pdf-engine-opt=-p to activate pic, and in the markdown
document you'd need

```{=ms}
.cstart
ring double 1,2 3,4 5,6
.cend
```

To make this more convenient you could create a Lua
filter that intercepts code blocks marked like so

``` chem
ring double 1, 2, 3,4 5,6
```

and converts them into RawBlock with format "ms" as above.
This would be a 3-liner.

John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

> You'll need two things:
>
> first, you'll need
>
> --pdf-engine-opt=-j
>
> This will cause the chem preprocessor to be invoked.
> Then, you'll need to insert raw .ms sections into your
> document with the chem macros. If your source document
> is pandoc markdown, you can do that with a raw block:
>
> A benzene ring is
>
> ```{=ms}
> ring double 1,2 3,4 5,6
> ```
>
> Илья Волк <thesun409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> I use pandoc for produce PDF and docx files.
>> -t ms: pdfroff parameter.
>> Actually a want to write chemical formulas with pandoc using pdfroff engine.
>>
>> понедельник, 29 марта 2021 г. в 20:58:38 UTC+3, John MacFarlane: 
>>
>>>
>>> Are you using pandoc to read or to write ms?
>>>
>>> Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>>
>>> > I use pandoc with ms preproc. How to use chem troff for chemistry 
>>> formulas 
>>> > with roff -ms preproc?
>>> >
>>> > Thanks!
>>> >
>>> > -- 
>>> > 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/67af0eff-be18-43fd-be82-871116dab6bbn%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/m2lfa5ioh7.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re: How to run chem troff with pandoc
       [not found]                 ` <m2lfa5ioh7.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-03-30  9:08                   ` Илья Волк
       [not found]                     ` <29cbec4e-df69-4b2c-8448-1d0966479f81n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Илья Волк @ 2021-03-30  9:08 UTC (permalink / raw)
  To: pandoc-discuss


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


My script: `pandoc -t ms --highlight-style=kate *--pdf-engine-opt=-j 
--pdf-engine-opt=-p* -F pandoc-plot  -N -s -C -o "$base".pdf "$file"`

*My file*:

---
fontfamily: tnr
bibliography: lib.bib
title: Title
author: Author
csl: file.csl
plot-configuration: config.yaml
---

# Some text

```{=ms}
.cstart
ring double 1,2 3,4 5,6
.cend
```

Results:  
[image: pic-selected-210330-1205-59.png]

What a problem?
вторник, 30 марта 2021 г. в 01:28:50 UTC+3, John MacFarlane: 

>
> I left out a couple things. I think you also need
> --pdf-engine-opt=-p to activate pic, and in the markdown
> document you'd need
>
> ```{=ms}
> .cstart
> ring double 1,2 3,4 5,6
> .cend
> ```
>
> To make this more convenient you could create a Lua
> filter that intercepts code blocks marked like so
>
> ``` chem
> ring double 1, 2, 3,4 5,6
> ```
>
> and converts them into RawBlock with format "ms" as above.
> This would be a 3-liner.
>
> John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:
>
> > You'll need two things:
> >
> > first, you'll need
> >
> > --pdf-engine-opt=-j
> >
> > This will cause the chem preprocessor to be invoked.
> > Then, you'll need to insert raw .ms sections into your
> > document with the chem macros. If your source document
> > is pandoc markdown, you can do that with a raw block:
> >
> > A benzene ring is
> >
> > ```{=ms}
> > ring double 1,2 3,4 5,6
> > ```
> >
> > Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> >
> >> I use pandoc for produce PDF and docx files.
> >> -t ms: pdfroff parameter.
> >> Actually a want to write chemical formulas with pandoc using pdfroff 
> engine.
> >>
> >> понедельник, 29 марта 2021 г. в 20:58:38 UTC+3, John MacFarlane: 
> >>
> >>>
> >>> Are you using pandoc to read or to write ms?
> >>>
> >>> Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> >>>
> >>> > I use pandoc with ms preproc. How to use chem troff for chemistry 
> >>> formulas 
> >>> > with roff -ms preproc?
> >>> >
> >>> > Thanks!
> >>> >
> >>> > -- 
> >>> > 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/67af0eff-be18-43fd-be82-871116dab6bbn%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/29cbec4e-df69-4b2c-8448-1d0966479f81n%40googlegroups.com.

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

[-- Attachment #2: pic-selected-210330-1205-59.png --]
[-- Type: image/png, Size: 65428 bytes --]

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

* Re: How to run chem troff with pandoc
       [not found]                     ` <29cbec4e-df69-4b2c-8448-1d0966479f81n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-30 16:11                       ` John MacFarlane
  0 siblings, 0 replies; 7+ messages in thread
From: John MacFarlane @ 2021-03-30 16:11 UTC (permalink / raw)
  To: Илья Волк,
	pandoc-discuss


I'm sorry, I've never used chem and I'm just giving hints
to you to get it working.

To debug this, start with the simplest  possible command line
(remove the filter and highlighting, e.g.).

Use --trace and you'll see the intermediate ms produced and
the exact command line pandoc is using to run pdfroff.
This may give an idea.

Илья Волк <thesun409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> My script: `pandoc -t ms --highlight-style=kate *--pdf-engine-opt=-j 
> --pdf-engine-opt=-p* -F pandoc-plot  -N -s -C -o "$base".pdf "$file"`
>
> *My file*:
>
> ---
> fontfamily: tnr
> bibliography: lib.bib
> title: Title
> author: Author
> csl: file.csl
> plot-configuration: config.yaml
> ---
>
> # Some text
>
> ```{=ms}
> .cstart
> ring double 1,2 3,4 5,6
> .cend
> ```
>
> Results:  
> [image: pic-selected-210330-1205-59.png]
>
> What a problem?
> вторник, 30 марта 2021 г. в 01:28:50 UTC+3, John MacFarlane: 
>
>>
>> I left out a couple things. I think you also need
>> --pdf-engine-opt=-p to activate pic, and in the markdown
>> document you'd need
>>
>> ```{=ms}
>> .cstart
>> ring double 1,2 3,4 5,6
>> .cend
>> ```
>>
>> To make this more convenient you could create a Lua
>> filter that intercepts code blocks marked like so
>>
>> ``` chem
>> ring double 1, 2, 3,4 5,6
>> ```
>>
>> and converts them into RawBlock with format "ms" as above.
>> This would be a 3-liner.
>>
>> John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:
>>
>> > You'll need two things:
>> >
>> > first, you'll need
>> >
>> > --pdf-engine-opt=-j
>> >
>> > This will cause the chem preprocessor to be invoked.
>> > Then, you'll need to insert raw .ms sections into your
>> > document with the chem macros. If your source document
>> > is pandoc markdown, you can do that with a raw block:
>> >
>> > A benzene ring is
>> >
>> > ```{=ms}
>> > ring double 1,2 3,4 5,6
>> > ```
>> >
>> > Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> >
>> >> I use pandoc for produce PDF and docx files.
>> >> -t ms: pdfroff parameter.
>> >> Actually a want to write chemical formulas with pandoc using pdfroff 
>> engine.
>> >>
>> >> понедельник, 29 марта 2021 г. в 20:58:38 UTC+3, John MacFarlane: 
>> >>
>> >>>
>> >>> Are you using pandoc to read or to write ms?
>> >>>
>> >>> Илья Волк <thes...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> >>>
>> >>> > I use pandoc with ms preproc. How to use chem troff for chemistry 
>> >>> formulas 
>> >>> > with roff -ms preproc?
>> >>> >
>> >>> > Thanks!
>> >>> >
>> >>> > -- 
>> >>> > 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/017d0265-5af3-40ad-bbd8-d46861e779d6n%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/67af0eff-be18-43fd-be82-871116dab6bbn%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/29cbec4e-df69-4b2c-8448-1d0966479f81n%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/m2eefwiptm.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

end of thread, other threads:[~2021-03-30 16:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 10:34 How to run chem troff with pandoc Илья Волк
     [not found] ` <017d0265-5af3-40ad-bbd8-d46861e779d6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-29 17:58   ` John MacFarlane
     [not found]     ` <m2r1jxkfjz.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-03-29 18:28       ` Илья Волк
     [not found]         ` <67af0eff-be18-43fd-be82-871116dab6bbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-29 21:32           ` John MacFarlane
     [not found]             ` <m235wdk5mj.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-03-29 22:28               ` John MacFarlane
     [not found]                 ` <m2lfa5ioh7.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-03-30  9:08                   ` Илья Волк
     [not found]                     ` <29cbec4e-df69-4b2c-8448-1d0966479f81n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-30 16:11                       ` 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).