Re: [NTG-context] TeXlive 2012 and letter module

2012-07-31 Thread Martin Scholz
Thx Wolfgang,

this makes sense, as I still had your old examples online and build my
letters after that I was just wondering if I did something wrong or missed
something in using it, but that way it is more flexible and with an

/input{addrfile}

in the below way one should also be able to still use a kind of the old way
having a separated addressfile but with a more flexible layout.

Again million thx for clearing it

Greetings

Martin 'golodhrim' Scholz

On Sun, Jul 29, 2012 at 12:39 PM, Wolfgang Schuster 
wolfgang.schus...@gmail.com wrote:


 Am 28.07.2012 um 19:53 schrieb Martin 'golodhrim' Scholz 
 scholz@googlemail.com:

  Hi followers of ConTeXt,
 
  does something in the lettermodule in the texlive version and the
  minimal version of ConTeXt has changed, as both no longer recognize the
 
  \useletterextension[addrentry,label]
  \useaddressfile[addrfile]
 
  lines and complain about an unknown command, if yes, what would be the
  way to fix this, or is this functionallity finally droped?

 I haven’t added this function to the new version because I don’t need it.

 When you really need it I can add it but context itself has a similar
 function with the \setvariables and \getvariable which takes only a few
 more lines than \addressentry does.

 Below you can see how the example from the KOMA-Script manuals looks with
 \setvariables (you’re free to use different keys) but it’s no problem to
 write a simple \addressentry wrapper around this and provide it with the
 letter module when you want to share your data with LaTeX.

 example source=scrguide.pdf
 \usemodule[letter]

 \setvariables
   [addressentry:frodo]
   [lastname={Beutlin},
firstname={Frodo},
address={Der Bühl\\ Beutelsend/Hobbingen im Auenland},
1={Bilbo Beutlin},
2={Rauchen von Pfeifenkraut},
3={der Ringträger},
4={Bilbos Erbe}]

 \setvariables
   [addressentry:sam]
   [lastname={Gamdschie},
firstname={Samweis},
address={Beutelhaldenweg 3\\Hobbingen im Auenland},
1={Rosie Kattun},
2={Knullen},
3={des Ringträgers treuester Gefährte}]

 \setvariables
   [addressentry:tom]
   [lastname={Bombadil},
firstname={Tom},
address={Im Alten Wald},
1={Goldbeere},
2={trällern von Nonsensliedern},
3={Meister von Wald, Wasser und Berg}]

 \startletter

 [toname={\getvariable{addressentry:tom}{firstname}~\getvariable{addressentry:tom}{lastname}},
toaddress={\getvariable{addressentry:tom}{address}},
opening={Lieber \getvariable{addressentry:tom}{firstname}
 \getvariable{addressentry:tom}{lastname},},
closing={„O Frühling und Sommerzeit und danach wieder Frühling!\\O Wind
 auf dem Wasserfall und Lachen des Laubes!“}]

 oder \getvariable{addressentry:tom}{3}, wie Dich Deine geliebte
 \getvariable{addressentry:tom}{1} nennt. Kannst Du Dich noch an einen Herrn
 \getvariable{addressentry:frodo}{lastname}, genauer gesagt
 \getvariable{addressentry:frodo}{firstname}~\getvariable{addressentry:frodo}{lastname},
 denn es gab ja auch noch den Herrn \getvariable{addressentry:frodo}{1},
 erinnern. Er war \getvariable{addressentry:frodo}{3} im dritten Zeitalter
 und \getvariable{addressentry:frodo}{3}. Begleitet wurde er von
 \getvariable{addressentry:sam}{firstname}~\getvariable{addressentry:sam}{lastname},
 \getvariable{addressentry:sam}{3}.

 Beider Vorlieben waren sehr weltlich. Der
 \getvariable{addressentry:frodo}{firstname} genoss das
 \getvariable{addressentry:frodo}{2}, sein Gefährte schätzte eine gute
 Mahlzeit mit \getvariable{addressentry:sam}{2}.

 Weißt du noch? Mithrandir hat Dir bestimmt viel von ihnen erzählt.

 \stopletter
 /example

 Wolfgang
___
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
___

[NTG-context] footnote numbers turn red

2012-07-31 Thread Martin

The footnote numbers turn red(ish) as soon as \setupinteraction is present.

Is that intended?

thanks for replies!

Martin

with
ConTeXt  ver: 2012.07.21 16:50 MKIV  fmt: 2012.7.21


example:

\setupinteraction[state=start,color=darkblue,style=\tf]

\starttext
some text\footnote{a footnote}
\stoptext
___
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
___


Re: [NTG-context] t-degrade.tex

2012-07-31 Thread Jan Kula

Hi Peter,

On 07/27/2012 12:52 PM, Peter Münster wrote:

Hi,

Does it make sense, to port http://modules.contextgarden.net/t-degrade
to mkiv, or is there already an existing solution in ConTeXt to
downsample jpeg-images on the fly?

TIA for any hints,


There is Luigi's gmwand approach in grph-wnd.lua and something on 
conversions in grph-inc.lua, but I don't know a higher level context 
interface. Anybody else?


Jano

___
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
___


Re: [NTG-context] footnote numbers turn red

2012-07-31 Thread Marco Patzer
On 2012-07-31 Martin martin.alth...@yahoo.com wrote:

Hi Martin,

 The footnote numbers turn red(ish) as soon as \setupinteraction is present.
 
 Is that intended?

Yes, it is. There is a special setting, when the link appears on the
same page, it's contrastcolor.

\setupinteraction
  [state=start,
   color=darkblue,
   contrastcolor=green]


Marco

___
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
___


Re: [NTG-context] footnote numbers turn red

2012-07-31 Thread Martin Althoff
Hi Marco,
Thanks for that. Though it seems that is only part of the situation. With the 
definition, as you give it, the footnote numbers at the bottom of the page turn 
green, but the ones in the text remain black. I deleted all generated files 
just to be sure.

Martin

  The footnote numbers turn red(ish) as soon as \setupinteraction is 

 present.
 
  Is that intended?
 
 Yes, it is. There is a special setting, when the link appears on the
 same page, it's contrastcolor.
 
 \setupinteraction
   [state=start,
    color=darkblue,
    contrastcolor=green]
___
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
___


[NTG-context] WG: Problem with simplefonts, placing of period

2012-07-31 Thread Martin Althoff
I just realized my mail was marked as spam..., not sure what impact that has.

Might be worth mentioning the Context version:
ConTeXt  ver: 2012.07.21 16:50 MKIV  fmt: 2012.7.21


Looking through the generated PDF the placement of other interpunctuation is 
also off and the text is running rather tight when \setscript[hanzi] is used. 

Thanks for any replies!
Martin


 I am experiencing a problem with the placement of the period . after 
 a sentence. In the example below it's the one after (Englisch). 
 Once the line \setscript[hanzi] is uncommented, the period sits under, 
 before or far after the closing bracket depending on borders or text 
 before/after.
 
 The question is: Is that a bug or feature? The key impact of setscript I see 
 is 
 on spacing/flow of text. A small amount of Chinese text in the complete 
 document 
 appears the same.
 
 Thanks,
 Martin
 
 
 \usemodule[simplefonts]
 
 \mainlanguage[de]
 
 \setupsimplefonts[size=11pt]
 \setmainfont[TeX Gyre Pagella]
 \setcjkmainfont[AdobeSongStd][regular={* Light},italic={AdobeKaitiStd 
 Regular},bold={AdobeHeitiStd Regular},bolditalic={AdobeHeitiStd Regular}]
 \setcjksansfont[AdobeKaitiStd][bold={AdobeHeitiStd 
 Regular},bolditalic={AdobeHeitiStd Regular}]
 \setcjkmonofont[AdobeFangsongStd][bold={AdobeHeitiStd 
 Regular},bolditalic={AdobeHeitiStd Regular}]
 
 
 %\setscript[hanzi]
 
 
 \setuppapersize[A4][A4]
 
 \setuplayout
 [
 backspace=45mm,
 height=fit,
 width=fit,
 rightmargin=10mm,
 leftmargin=30mm,
 ]
 
 \starttext
 
 auf der Stufe von A1-C1 (Deutsch) bzw. \quotation{Beginner} bis 
 \quotation{Upper Intermediate} (Englisch). \input{lorem}
 
 \stoptext
 
___
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
___


Re: [NTG-context] footnote numbers turn red

2012-07-31 Thread Marco Patzer
On 2012-07-31 Martin Althoff martin.alth...@yahoo.com wrote:

 With the definition, as you give it, the footnote numbers at the
 bottom of the page turn green, but the ones in the text remain
 black.

Not here with 2012.07.27 16:41. Which context version are you
running?


Marco

___
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
___


Re: [NTG-context] t-degrade.tex

2012-07-31 Thread luigi scarso
On Tue, Jul 31, 2012 at 9:22 AM, Jan Kula jano.k...@gmail.com wrote:

 Hi Peter,


 On 07/27/2012 12:52 PM, Peter Münster wrote:

 Hi,

 Does it make sense, to port 
 http://modules.contextgarden.**net/t-degradehttp://modules.contextgarden.net/t-degrade
 to mkiv, or is there already an existing solution in ConTeXt to
 downsample jpeg-images on the fly?

 TIA for any hints,


 There is Luigi's gmwand approach in grph-wnd.lua and something on
 conversions in grph-inc.lua, but I don't know a higher level context
 interface. Anybody else?


If I have time I will try to rebuild the module, because it seems that the
bug with libpng is fixed.


-- 
luigi
___
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
___

Re: [NTG-context] footnote numbers turn red

2012-07-31 Thread Martin Althoff
OK, was using: 2012.07.21 16:50 MKIV.

Ran an update (now 2012.07.27 16:41 MKIV). Problem was in another place though 
(working on several docs at the moment).

A module had the line:

\setupfootnotes[textcolor=black]

Then adding this what you gave at a later point:

\setupinteraction
  [state=start,
  color=darkblue,
  contrastcolor=green]

only changed the footnote at the bottom of the page to green, not in the text 
body. That remained black. This cross dependence had confused me. 

Is that the intent contrastcolor as given on?

http://wiki.contextgarden.net/Command/setupinteraction

Martin


 Not here with 2012.07.27 16:41. Which context version are you

 running?
 
___
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
___


Re: [NTG-context] inheritance of footnotes

2012-07-31 Thread Hans Hagen

On 30-7-2012 13:00, Daniel Schopper wrote:

dear list,
until some months ago it was possible to define/setup a series of notes
and then use them as kind of interface, i.e. to let their copies inherit
their setups yet be independent sets of notes –  However now such copies
seem to be get mereley added to the set of notes they are based upon. --
In the following minimal example none of the notes get printed when the
first series of notes are not placed; on the other hand their
respective \placenotes-commands are completely ignored.


fixed in next beta (but needs testing) ...

-
  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
___

Re: [NTG-context] 2 columns: 1 language per column

2012-07-31 Thread Hans Hagen

On 29-7-2012 17:57, Peter Münster wrote:

Hi,

Is it possible today with mkiv, to automatically typeset one text
(german) on the left column and the translation (french) on the right
column (perhaps with streams)?

And if yes, how?


there's also

%D \defineparallel[main][one,two]
%D
%D \startmain
%D \startone
%D first 1
%D [reference] first 2
%D first 3
%D \stopone
%D \starttwo
%D second 1
%D \stoptwo
%D \stopmain
%D
%D \placeparallel[main][one,two][criterium=all]

-
  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
___


Re: [NTG-context] 2 columns: 1 language per column

2012-07-31 Thread Peter Münster
On Tue, Jul 31 2012, Hans Hagen wrote:

 there's also

 %D \defineparallel[main][one,two]

Is it possible with this to make 2 columns, one language on the left,
another language on the right?

-- 
   Peter
___
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
___


Re: [NTG-context] Page floats

2012-07-31 Thread Hans Hagen

On 30-7-2012 00:44, Wolfgang Schuster wrote:

Hi Hans,

page flots don’t work with the current beta.

\starttext

\dorecurse{6}{\input knuth\par}

%\placefigure{A dutch cow}{\externalfigure[cow]} % works
\placefigure[page]{A dutch cow}{\externalfigure[cow]} % doesn’t work

\dorecurse{6}{\input knuth\par}

\stoptext


something:

\def\page_otr_construct_and_shipout#1#2%
  {\forgetall
   \page_boxes_shipout{\page_boxes_constructed_page#1#2}%
   \page_otr_flush_pending_content
   \page_otr_check_for_pending_inserts
   \inpagebodytrue
   \page_otr_command_flush_saved_floats
   \page_otr_command_set_vsize
   \strc_pagenumbers_increment_counters
   \page_adapts_synchronize
   \page_otr_check_for_pending_inserts
   \page_floats_flush_page_floats
   \page_spread_flush
   \page_postponed_blocks_flush}

-
  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
___


Re: [NTG-context] alternative=d (right margin needed)

2012-07-31 Thread Hans Hagen

On 30-7-2012 17:27, Steffen Wolfrum wrote:


please have a look at the attached screenshot:
there you see two TOC entries set alternative=d (after pagenumber 360 and 381).

what can be done to make them stop at the vertical blue line, too?


no minimal example == no answer

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
___


Re: [NTG-context] 2 columns: 1 language per column

2012-07-31 Thread Hans Hagen

On 31-7-2012 11:27, Peter Münster wrote:

On Tue, Jul 31 2012, Hans Hagen wrote:


there's also

%D \defineparallel[main][one,two]


Is it possible with this to make 2 columns, one language on the left,
another language on the right?


maybe something

\setupparallel
  [setups=parallel:place:mine]

\startsetups parallel:place:mine
\setups[parallel:place:default]
\column[yes]
\stopsetups

\startmixedcolumns
\placeparallel[main][one,two][criterium=all]
\stopmixedcolumns

there will be better support for that kind of things at some point

-
  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
___


Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Peter Münster
On Tue, Jul 31 2012, Hans Hagen wrote:

 \startmixedcolumns
 \placeparallel[main][one,two][criterium=all]
 \stopmixedcolumns

 there will be better support for that kind of things at some point

I don't get the desired result with \placeparallel, but I've found a
solution, that works quite well. I just can't place figures, that span
the 2 columns, but that's no problem for my project.

Here the (not very contextish) solution (cld-file):

--8---cut here---start-8---
local C = context
local format = string.format

local function create_environment()
  local fp = io.open(env.tex, w)
  fp:write([[
\startenvironment env

\def\ColumnDistance{1cm}

\startmode[columns]
  \definepapersize[columns][
width=\dimexpr (\textwidth - \ColumnDistance) / 2 \relax,
height=\textheight]
  \setuppapersize[columns]
  \setuplayout[page]
  \setuppagenumbering[location=]
  \setupalign[verytolerant, stretch, line]
  \setupwhitespace[small]
\stopmode

\startbuffer[german]
  \it\dorecurse{15}{\dorecurse{20}{german }\par}
\stopbuffer

\startbuffer[french]
  \bf\dorecurse{15}{\dorecurse{20}{french }\par}
\stopbuffer

\stopenvironment
]])
  fp:close()
end

local function create_pages(s)
  local fp = io.open(pages.tex, w)
  fp:write(format([[
\enablemode[columns]
\environment env
\starttext
\getbuffer[%s]
\stoptext
]], s))
  fp:close()
  os.execute(format(context --result=pages-%s pages, s))
end

local function create_columns(l, r)
  local function pdf(x) return pages- .. x .. .pdf end
  create_pages(l)
  create_pages(r)
  local pdfobj = epdf.open(pdf(l))
  local n = pdfobj:getNumPages()
  for i = 1, n do
C.dontleavehmode()
C.externalfigure({pdf(l)}, {page = i})
C\\hskip\\ColumnDistance
C.externalfigure({pdf(r)}, {page = i})
C.page()
  end
end

create_environment()
C.environment(false, env )
C.starttext()
CBefore
C.page()
create_columns(german, french)
CAfter
C.stoptext()
--8---cut here---end---8---

-- 
   Peter
___
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
___


[NTG-context] width/height in figure converter (was: t-degrade.tex)

2012-07-31 Thread Peter Münster
On Fri, Jul 27 2012, Peter Münster wrote:

 Does it make sense, to port http://modules.contextgarden.net/t-degrade
 to mkiv, or is there already an existing solution in ConTeXt to
 downsample jpeg-images on the fly?

I've played a bit with the converters:

--8---cut here---start-8---
\startluacode
figures.converters[jpg] = {
  [lowres.jpg] = function(oldname,newname,resolution)
os.executesomething
print(table.serialize(figures.current()))
  end
}
\stopluacode
\starttext
\externalfigure[hacker][width=0.5\textwidth, conversion=lowres.jpg]
\stoptext 
--8---cut here---end---8---

2 questions:

- How can I get the width and/or the height of the figure inside the
  function?  0.5\9extwidth  is not very useful on the lua-side...

- How can I specify a sub-directory where to place the converted images?
  (not so important, just to avoid cluttering the current directory)


TIA for any help,
-- 
   Peter
___
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
___

Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Otared Kavian
Hi Peter,

Can you give please an example showing how to use your code?

Thanks: OK

On 31 juil. 2012, at 16:15, Peter Münster pmli...@free.fr wrote:

 On Tue, Jul 31 2012, Hans Hagen wrote:
 
 \startmixedcolumns
\placeparallel[main][one,two][criterium=all]
 \stopmixedcolumns
 
 there will be better support for that kind of things at some point
 
 I don't get the desired result with \placeparallel, but I've found a
 solution, that works quite well. I just can't place figures, that span
 the 2 columns, but that's no problem for my project.
 
 Here the (not very contextish) solution (cld-file):
 
 --8---cut here---start-8---
 local C = context
 local format = string.format
 
 local function create_environment()
  local fp = io.open(env.tex, w)
  fp:write([[
 \startenvironment env
 
 \def\ColumnDistance{1cm}
 
 \startmode[columns]
  \definepapersize[columns][
width=\dimexpr (\textwidth - \ColumnDistance) / 2 \relax,
height=\textheight]
  \setuppapersize[columns]
  \setuplayout[page]
  \setuppagenumbering[location=]
  \setupalign[verytolerant, stretch, line]
  \setupwhitespace[small]
 \stopmode
 
 \startbuffer[german]
  \it\dorecurse{15}{\dorecurse{20}{german }\par}
 \stopbuffer
 
 \startbuffer[french]
  \bf\dorecurse{15}{\dorecurse{20}{french }\par}
 \stopbuffer
 
 \stopenvironment
 ]])
  fp:close()
 end
 
 local function create_pages(s)
  local fp = io.open(pages.tex, w)
  fp:write(format([[
 \enablemode[columns]
 \environment env
 \starttext
 \getbuffer[%s]
 \stoptext
 ]], s))
  fp:close()
  os.execute(format(context --result=pages-%s pages, s))
 end
 
 local function create_columns(l, r)
  local function pdf(x) return pages- .. x .. .pdf end
  create_pages(l)
  create_pages(r)
  local pdfobj = epdf.open(pdf(l))
  local n = pdfobj:getNumPages()
  for i = 1, n do
C.dontleavehmode()
C.externalfigure({pdf(l)}, {page = i})
C\\hskip\\ColumnDistance
C.externalfigure({pdf(r)}, {page = i})
C.page()
  end
 end
 
 create_environment()
 C.environment(false, env )
 C.starttext()
 CBefore
 C.page()
 create_columns(german, french)
 CAfter
 C.stoptext()
 --8---cut here---end---8---
 
 -- 
   Peter
 ___
 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
 ___

___
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
___


Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Peter Münster
On Tue, Jul 31 2012, Otared Kavian wrote:

 Can you give please an example showing how to use your code?

Save it in test.cld, then run context test.cld.
Then open test.pdf in a PDF-viewer.

-- 
   Peter
___
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
___


Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Otared Kavian
Thanks Peter! It is a very nice piece of code, but could this be included in a 
TeX file? (Otherwise one cannot use something like TeXShop on a Mac to typeset 
the file).

Best regards: OK


On 31 juil. 2012, at 18:23, Peter Münster pmli...@free.fr wrote:

 On Tue, Jul 31 2012, Otared Kavian wrote:
 
 Can you give please an example showing how to use your code?
 
 Save it in test.cld, then run context test.cld.
 Then open test.pdf in a PDF-viewer.
 
 -- 
   Peter
 ___
 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
 ___

___
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
___


Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Peter Münster
On Tue, Jul 31 2012, Otared Kavian wrote:

 Thanks Peter! It is a very nice piece of code, but could this be included in a
 TeX file?

Probably yes, but I'm too busy to do this now. I'm sorry...

-- 
   Peter
___
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
___


Re: [NTG-context] t-degrade.tex (solved)

2012-07-31 Thread Peter Münster
Now I can downsample jpeg-files on the fly, see attached example file.
But I need 2 patches:

1.) To get the width and the height into the name of the file,
because when the figure dimensions change, there must be a new
conversion:

--8---cut here---start-8---
--- grph-inc.lua~   2012-06-05 10:37:01.0 +0200
+++ grph-inc.lua2012-07-31 22:40:39.214426838 +0200
@@ -528,6 +528,9 @@
 if resolution and resolution ~=  then -- the order might 
change
 newbase = newbase .. _ .. resolution
 end
+local width = figures.current().request.width
+local height = figures.current().request.height
+newbase = newbase .. _ .. width .. _ .. height
 --
 -- see *, we had:
 --
--8---cut here---end---8---


2.) To avoid crap in the width and height options:

--8---cut here---start-8---
--- grph-inc.mkiv~  2012-07-20 23:26:52.0 +0200
+++ grph-inc.mkiv   2012-08-01 00:02:23.851094854 +0200
@@ -293,6 +293,10 @@
%
\the\t_grph_include_local_settings
\dostarttagged\t!image\empty
+   \edef\current_width{\externalfigureparameter\c!width}%
+   \edef\current_height{\externalfigureparameter\c!height}%
+   \def\nocrap##1{\doifnotemptyvalue{##1}{%
+   \the\dimexpr\csname##1\endcsname\relax}}%
\ctxlua{figures.push {
 name   = \p_grph_include_name,
 label  = \p_grph_include_label,
@@ -312,8 +316,8 @@
 resolution = \externalfigureparameter\c!resolution,
 color  = 
\internalspotcolorparent{\externalfigureparameter\c!color}, % hack is needed
 [repeat] = \externalfigureparameter\c!repeat,
-width  = \externalfigureparameter\c!width,  % can be crap
-height = \externalfigureparameter\c!height, % can be crap
+width  = \nocrap{current_width},  % no more crap
+height = \nocrap{current_height}, % no more crap
 } }%
\ctxlua{figures.identify()}%
% also mode: checkpresense only
--8---cut here---end---8---


Hans, could you please patch the files?

Cheers,
-- 
   Peter
\startluacode
local format = string.format
-- figures.cachepaths.path = cache -- should be setup-option
local function sample_down(oldname, newname, resolution)
  local request = figures.current().request
  local width = request.width:sub(1, -3)
  local height = request.height:sub(1, -3)
  if resolution ==  or (width ==  and height == ) then
print(format(Nothing to do: %s, %s, %s, oldname, newname, resolution))
return
  end
  local inch = 72.27
  local image = img.scan{filename = oldname}
  local xy = image.xsize / image.ysize
  if width ==  then
width = height * xy
  end
  if height ==  then
height = width / xy
  end
  local xsize = resolution * width / inch
  local ysize = resolution * height / inch
  if xsize  image.xsize or ysize  image.ysize then
local s = format(gm convert -resize %dx%d %s %s,
 xsize, ysize, oldname, newname)
print(Conversion:  .. s)
os.execute(s)
  else
print(format(Nothing to do: %s, %s, %s, oldname, newname, resolution))
print(format(xsize = %d, ysize = %d, xsize, ysize))
  end
end

figures.converters.jpg = figures.converters.jpg or {}
figures.converters.jpg[lowres.jpg] = sample_down
\stopluacode

\starttext
\setupexternalfigures[resolution=50, conversion=lowres.jpg]
\externalfigure[hacker][width=0.5\textwidth]
\setupexternalfigures[resolution=10]
\externalfigure[hacker][width=0.5\textwidth]
\stoptext
___
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
___

Re: [NTG-context] 2 columns: 1 language per column (solved)

2012-07-31 Thread Rogers, Michael K
If you wish to use TeXShop, you can set it up...in my typically kludgy way.  
This mimics the TeXShop setup for Context Standalone (see 
http://wiki.contextgarden.net/ConTeXt_Standalone/Mac_Installation) and assumes 
that context is in your regular execution path.

Create a new plain-text file in ~/Library/TeXShop/Engines -- call it whatever 
you like -- let's say ConTeXt-CLD.engine.  Add these lines
CUT HERE--
#!/bin/bash
context --forcecld $1
CUT HERE--

This will create a ConTeXt-CLD menu item in the popup menu on new file windows. 
(You may have to restart TeXShop first.)  You can select it and run Peter's 
column program.

If you like, add these three lines to the beginning of your .tex file to force 
TeXShop to use ConTeXt-CLD:

CUT HERE--
--[[
%!TEX TS-program = ConTeXt-CLD
]]--
CUT HERE--

A drawback is that your cld files will be masquerading as .tex files.  But you 
can process cld files in TeXShop if you want to.

Michael

On Jul 31, 2012, at 5:46 PM, Otared Kavian wrote:

 Thanks Peter! It is a very nice piece of code, but could this be included in 
 a TeX file? (Otherwise one cannot use something like TeXShop on a Mac to 
 typeset the file).

 Best regards: OK


 On 31 juil. 2012, at 18:23, Peter Münster pmli...@free.fr wrote:

 On Tue, Jul 31 2012, Otared Kavian wrote:

 Can you give please an example showing how to use your code?

 Save it in test.cld, then run context test.cld.
 Then open test.pdf in a PDF-viewer.

 --
  Peter
 ___
 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
 ___

 ___
 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
 ___




This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
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
___