ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* two questions on file handling
@ 2015-02-20 21:53 Pablo Rodriguez
  2015-02-20 22:05 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Rodriguez @ 2015-02-20 21:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have two questions on how to improve the way I use ConTeXt to handle
files.

Is there a way that I can specify the document from the command line in
the line below?

    \insertpages[mydocument.pdf][width=0pt]

Is there any way that context compiles using the a pipe? (Sorry if this
is wrong, but this is totally new to me.)

I would like to compile something like (well, using pandoc):

    cat a.tex | contextjit --purgeall

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-20 21:53 two questions on file handling Pablo Rodriguez
@ 2015-02-20 22:05 ` Hans Hagen
  2015-02-20 22:28   ` Pablo Rodriguez
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2015-02-20 22:05 UTC (permalink / raw)
  To: ntg-context

On 2/20/2015 10:53 PM, Pablo Rodriguez wrote:
> Dear list,
>
> I have two questions on how to improve the way I use ConTeXt to handle
> files.
>
> Is there a way that I can specify the document from the command line in
> the line below?
>
>      \insertpages[mydocument.pdf][width=0pt]
>
> Is there any way that context compiles using the a pipe? (Sorry if this
> is wrong, but this is totally new to me.)

you can pass command line arguments, see mtx-context-*.tex files for 
examples

> I would like to compile something like (well, using pandoc):
>
>      cat a.tex | contextjit --purgeall

won't work (imagine multiple runs) .. why pipe and not just "contextjit 
a.tex"

> Many thanks for your help,



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-20 22:05 ` Hans Hagen
@ 2015-02-20 22:28   ` Pablo Rodriguez
  2015-02-20 22:43     ` Hans Hagen
  2015-02-21  7:44     ` Aditya Mahajan
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo Rodriguez @ 2015-02-20 22:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 02/20/2015 11:05 PM, Hans Hagen wrote:
> On 2/20/2015 10:53 PM, Pablo Rodriguez wrote:
>> [...]
>> Is there a way that I can specify the document from the command line in
>> the line below?
>>
>>      \insertpages[mydocument.pdf][width=0pt]
> 
> you can pass command line arguments, see mtx-context-*.tex files for 
> examples

Many thanks for your reply, Hans.

I’ll check it right after this message.

>> I would like to compile something like (well, using pandoc):
>>
>>      cat a.tex | contextjit --purgeall
> 
> won't work (imagine multiple runs) .. why pipe and not just "contextjit 
> a.tex"

Well, it was a more complex command:

  pandoc -S -s --section-divs book.md -t html -o book.xml

Since I won’t use that book.xml for other purpose, I thought it would be
better not to write it to disk.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-20 22:28   ` Pablo Rodriguez
@ 2015-02-20 22:43     ` Hans Hagen
  2015-02-21  9:57       ` Pablo Rodriguez
  2015-02-21  7:44     ` Aditya Mahajan
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2015-02-20 22:43 UTC (permalink / raw)
  To: ntg-context

On 2/20/2015 11:28 PM, Pablo Rodriguez wrote:
> On 02/20/2015 11:05 PM, Hans Hagen wrote:
>> On 2/20/2015 10:53 PM, Pablo Rodriguez wrote:
>>> [...]
>>> Is there a way that I can specify the document from the command line in
>>> the line below?
>>>
>>>       \insertpages[mydocument.pdf][width=0pt]
>>
>> you can pass command line arguments, see mtx-context-*.tex files for
>> examples
>
> Many thanks for your reply, Hans.
>
> I’ll check it right after this message.
>
>>> I would like to compile something like (well, using pandoc):
>>>
>>>       cat a.tex | contextjit --purgeall
>>
>> won't work (imagine multiple runs) .. why pipe and not just "contextjit
>> a.tex"
>
> Well, it was a more complex command:
>
>    pandoc -S -s --section-divs book.md -t html -o book.xml
>
> Since I won’t use that book.xml for other purpose, I thought it would be
> better not to write it to disk.

if you make complex one-liners on the command line adding a delete 
afterwards is no big deal

(actually there is a whole subsystem driven by ctx files that can be set 
up to take a file, convert it, use environments and modules etc .. we 
sometimes use that for projects .. but i sometimes wonder if it should go)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-20 22:28   ` Pablo Rodriguez
  2015-02-20 22:43     ` Hans Hagen
@ 2015-02-21  7:44     ` Aditya Mahajan
  2015-02-21  9:59       ` Pablo Rodriguez
  1 sibling, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2015-02-21  7:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 724 bytes --]

On Fri, 20 Feb 2015, Pablo Rodriguez wrote:

> On 02/20/2015 11:05 PM, Hans Hagen wrote:
>> On 2/20/2015 10:53 PM, Pablo Rodriguez wrote:
>>> I would like to compile something like (well, using pandoc):
>>>
>>>      cat a.tex | contextjit --purgeall
>> 
>> won't work (imagine multiple runs) .. why pipe and not just "contextjit 
>> a.tex"
>
> Well, it was a more complex command:
>
>  pandoc -S -s --section-divs book.md -t html -o book.xml
>
> Since I won’t use that book.xml for other purpose, I thought it would be
> better not to write it to disk.

If you don't require multiple runs, you can use `context --pipe`, for 
example:

echo "\starttext Hello world \stoptext" | context --pipe

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-20 22:43     ` Hans Hagen
@ 2015-02-21  9:57       ` Pablo Rodriguez
  2015-02-21 11:31         ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Rodriguez @ 2015-02-21  9:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 02/20/2015 11:43 PM, Hans Hagen wrote:
> [...]
> if you make complex one-liners on the command line adding a delete 
> afterwards is no big deal

I agree. I tend to make things way more complicated than they are.

> (actually there is a whole subsystem driven by ctx files that can be set 
> up to take a file, convert it, use environments and modules etc .. we 
> sometimes use that for projects .. but i sometimes wonder if it should go)

Maybe including them in ConTeXt might help others.


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-21  7:44     ` Aditya Mahajan
@ 2015-02-21  9:59       ` Pablo Rodriguez
  0 siblings, 0 replies; 9+ messages in thread
From: Pablo Rodriguez @ 2015-02-21  9:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 02/21/2015 08:44 AM, Aditya Mahajan wrote:
> [...]
> If you don't require multiple runs, you can use `context --pipe`, for 
> example:
> 
> echo "\starttext Hello world \stoptext" | context --pipe

Many thanks for your reply, Aditya.

I require more than one runs. It is a book with a TOC.


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-21  9:57       ` Pablo Rodriguez
@ 2015-02-21 11:31         ` Hans Hagen
  2015-02-21 21:31           ` Pablo Rodriguez
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2015-02-21 11:31 UTC (permalink / raw)
  To: ntg-context

On 2/21/2015 10:57 AM, Pablo Rodriguez wrote:
> On 02/20/2015 11:43 PM, Hans Hagen wrote:
>> [...]
>> if you make complex one-liners on the command line adding a delete
>> afterwards is no big deal
>
> I agree. I tend to make things way more complicated than they are.
>
>> (actually there is a whole subsystem driven by ctx files that can be set
>> up to take a file, convert it, use environments and modules etc .. we
>> sometimes use that for projects .. but i sometimes wonder if it should go)
>
> Maybe including them in ConTeXt might help others.

they have been included for ages (ctx files), just like mtxrun has some 
features that help integrating in services (there is no difference 
between what we run here and what is in the distribution)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: two questions on file handling
  2015-02-21 11:31         ` Hans Hagen
@ 2015-02-21 21:31           ` Pablo Rodriguez
  0 siblings, 0 replies; 9+ messages in thread
From: Pablo Rodriguez @ 2015-02-21 21:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On 02/21/2015 12:31 PM, Hans Hagen wrote:
> On 2/21/2015 10:57 AM, Pablo Rodriguez wrote:
>> On 02/20/2015 11:43 PM, Hans Hagen wrote:
>>> [...]
>>> (actually there is a whole subsystem driven by ctx files that can be set
>>> up to take a file, convert it, use environments and modules etc .. we
>>> sometimes use that for projects .. but i sometimes wonder if it should go)
>>
>> Maybe including them in ConTeXt might help others.
> 
> they have been included for ages (ctx files), just like mtxrun has some 
> features that help integrating in services (there is no difference 
> between what we run here and what is in the distribution)

Many thanks for your reply, Hans.

After your tip from yesterday, I started browsing what was in the
mtx-context-*.tex files you told me.

I discovered that the first one (mtx-context-arrange.tex) could spare me
a special file on imposition (well, actually two).

BTW, I think the example should be improved in the example (diff attached).

The more I use ConTeXt, the more I realize how ignorant I am and how
awesome ConTeXt is.

Many thanks for your excellent work,


Pablo
-- 
http://www.ousia.tk

[-- Attachment #2: minor-detail.diff --]
[-- Type: text/x-patch, Size: 450 bytes --]

--- mtx-context-arrange.tex	2015-02-21 22:21:19.454535843 +0100
+++ ctxbase/mtx-context-arrange.tex	2015-02-21 21:19:44.821220033 +0100
@@ -27,7 +27,7 @@
 % --printformat           : 2UP, etc
 % --paperformat=spec      : paper*print or paperxprint
 %
-% example: context --extra=arrange --printformat=2UP --paperformat=A4,A3,landscape myfile
+% example: context --extra=arrange --printformat=2UP --paperformat=A4*A3,landscape myfile
 %
 % end help
 

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-02-21 21:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 21:53 two questions on file handling Pablo Rodriguez
2015-02-20 22:05 ` Hans Hagen
2015-02-20 22:28   ` Pablo Rodriguez
2015-02-20 22:43     ` Hans Hagen
2015-02-21  9:57       ` Pablo Rodriguez
2015-02-21 11:31         ` Hans Hagen
2015-02-21 21:31           ` Pablo Rodriguez
2015-02-21  7:44     ` Aditya Mahajan
2015-02-21  9:59       ` Pablo Rodriguez

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