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
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() C"Before" C.page() create_columns("german", "french") C"After" 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 ___________________________________________________________________________________