[NTG-context] Equivalent of LaTeX \cancel? and Thanks!

2008-10-12 Thread Benjamin R. Haskell
Hi all,

I recently transitioned from LaTeX to ConTeXt. There was some particular 
thing I needed to do (which escapes me at the moment) that was far, far 
easier to do in ConTeXt than in LaTeX. And, as I've learned, I've found 
that that's quite often the case. So, a huge thank you to everyone 
involved.

A couple hours ago I was annoyed that I couldn't find an equivalent for 
the LaTeX 'cancel' environment/command/style(?)[1]. Now, I'm truly amazed 
that 'cancel' required a whole package.

After discovering that 'underline' and 'strikethrough' were implemented as 
overlays, I quickly coded up the following:

\startuseMPgraphic{MyCancel}
 draw (0,.2*\overlayheight)--(\overlaywidth,\overlayheight);
\stopuseMPgraphic
\defineoverlay[mycancel][\useMPgraphic{MyCancel}]

\def\cancel#1{\framed[background=mycancel,frame=off]{#1}}


Now, I'm sure this is not *quite* the right way to do it. The 'cancel'ed 
items end up being placed too high on the line, and other spacings are 
slightly off. But, taking a cue from underlining, I kept the MyCancel 
graphic and tried:

\definetextbackground
[cancel]
[location=text,
 alternative=1,
 background=mycancel]
% plus boilerplate for setting up \startcancel\stopcancel

...But, while composing this email, I found what I wanted, which still 
isn't ``right'' in some sense:

\def\cancel#1{\framed[background=mycancel,frame=off,width=fit,height=fit,strut=no]{#1}}

I found the parameters for \framed. I'm still learning to Read The 
Fantastic Manuals, but sent this anyway since I wanted to say thanks.

Best,
Ben

[1] e.g. http://www.sosmath.com/CBB/viewtopic.php?t=9412
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] bib module or other in luatex

2008-10-12 Thread Andrea Valle

Hi,

this works in mk II but not in ma IV

\enableregime[utf]
\usemodule[bib]
\mainlanguage[en]


\setuppublications[alternative=apa,criterium=all]
\setupbibtex [database=/mio/pubblicazioni/pubblicazioni.bib,  
sort=author]

\starttext
\setupheadtext[en][pubs={Andrea Valle: publications}]
\nocite[*]
\completepublications
\stoptext

(Stack below)

What am I missing?

Thanks

Best

-a-


Setting /Applications/ConTeXtMinimals/tex as TEXROOT.
(/mio/pubblicazioni/pubdoc.tex

ConTeXt  ver: 2008.07.14 18:07 MKIV  fmt: 2008.7.15  int: english/ 
english


language   : language en is active
system : cont-new loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
cont-new.tex

systems : beware: some patches loaded from cont-new.tex
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
cont-new.mkiv
lua: used config path - /Applications/ConTeXtMinimals/tex/ 
texmf/web2c/texmf.cnf
lua: used cache path - /Applications/ConTeXtMinimals/tex/ 
texmf-cache/luatex-cache/context/aac20ce207a097b4b480d7b5eb76554a
) (/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
cont-mtx.tex))

system : cont-old loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
cont-old.tex

loading: Context Old Macros
)
system : cont-fil loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
cont-fil.tex

loading: Context File Synonyms
)
system : cont-sys loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/user/ 
cont-sys.tex (/Applications/ConTeXtMinimals/tex/texmf-context/tex/ 
context/base/type-tmf.tex) (/Applications/ConTeXtMinimals/tex/texmf- 
context/tex/context/base/type-siz.tex) (/Applications/ConTeXtMinimals/ 
tex/texmf-context/tex/context/base/type-otf.tex))

bodyfont   : 12pt rm is loaded
specials   : tex loaded
system : pubdoc.top loaded
(pubdoc.top
specials   : loading definition file tpd
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
spec-tpd.tex

specials   : loading definition file fdf
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
spec-fdf.tex (/Applications/ConTeXtMinimals/tex/texmf-context/tex/ 
context/base/spec-fdf.mkiv))

specials   : fdf loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/base/ 
spec-tpd.mkiv))

specials   : fdf loaded
)
system : module bib loaded
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/bib/t- 
bib.tex

publications   : loading formatting style from bibl-apa
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/bib/bibl- 
apa.tex))

publications   : loading formatting style from bibl-apa
(/Applications/ConTeXtMinimals/tex/texmf-context/tex/context/bib/bibl- 
apa.tex)

publications   : wrote a new auxiliary file pubdoc.aux
utilityfile | not present (pubdoc.tuo) (pubdoc.tuo)
publications   : loading database from pubdoc.bbl
(pubdoc.bbl)
systems: begin file pubdoc at line 8
{vertical mode: \tracingstats}
{\tracingpages}
{\tracingoutput}
{\tracinglostchars}
{\tracingmacros}
{\tracingparagraphs}
{\tracingrestores}
{\showboxbreadth}
{\showboxdepth}
{\tracinggroups}
{\tracingifs}
{\tracingscantokens}
{\tracingnesting}
{\tracingassigns}
{into \tracingassigns=2}
{\errorstopmode}

{\tracingonline}
{changing \tracingonline=1}
! Undefined control sequence.
\dogetupsometextprefix ...rrenttextprefixlanguage
  {#1}\ifcsname #2 
\currentte...

\docompletepublications ...anguage \c!title {pubs}
  }\doifdefinedelse  
{\??pv d...

to be read again
   \stoptext
l.12 \stoptext

?
! Emergency stop.
\dogetupsometextprefix ...rrenttextprefixlanguage
  {#1}\ifcsname #2 
\currentte...

\docompletepublications ...anguage \c!title {pubs}
  }\doifdefinedelse  
{\??pv d...

to be read again
   \stoptext
l.12 \stoptext

!  == Fatal error occurred, no output PDF file produced!
MtxRun | loading configuration for /Applications/ConTeXtMinimals/tex/ 
texmf/web2c from /Applications/ConTeXtMinimals/tex/texmf-cache/luatex- 
cache/context/aac20ce207a097b4b480d7b5eb76554a/trees/ 
d9ef00871d7b11751a275cffd8a85753
MtxRun | run 1: luatex --fmt=/Applications/ConTeXtMinimals/tex/texmf- 
cache/luatex-cache/context/aac20ce207a097b4b480d7b5eb76554a/formats/ 
cont-en --lua=/Applications/ConTeXtMinimals/tex/texmf-cache/luatex- 
cache/context/aac20ce207a097b4b480d7b5eb76554a/formats/cont-en.lua / 
mio/pubblicazioni/pubdoc.tex

MtxRun | fatal error, code: 1


--
Andrea Valle
--
CIRMA - DAMS
Università degli Studi di Torino
-- http://www.cirma.unito.it/andrea/
-- http://www.myspace.com/andreavalle
-- [EMAIL PROTECTED]

Re: [NTG-context] Extra space before itemize

2008-10-12 Thread Hans Hagen
Aditya Mahajan wrote:
 On Sat, 11 Oct 2008, Hans Hagen wrote:
 
 Aditya Mahajan wrote:
 Hi,

 I am setting up a head which simply puts its contents in a layer, so that
 I can control where to place the head. If the head is followed by an
 itemize, I get spurious white space. See the following test file. Page 1
 is head followed by text, which is OK. Page 2 is head followed by itemize,
 which has extra space. page 3 is just itemize which is ok.

 \definelayer[test]
  [width=\paperwidth,
  height=\paperheight,
  x=5cm,y=1cm]

 \def\mylayer#1#2{\setlayer[test]{#1#2}}

 \definehead[testhead][subject]

 \setuphead[testhead]
 [before=,
 after=,
 alternative=text,
 command=\mylayer]

 \setupbackgrounds[page][background=test]

 \showframe
 \showboxes

 \starttext

 \testhead{First}

 \input knuth

 \page

 \testhead{Hello}

 \startitemize
\item A
\item B
 \stopitemize

 \page

 \startitemize
\item A
\item B
 \stopitemize


 \stoptext


 How do I get rid of the extra space?
 hack

 \def\mylayer#1#2{\startnointerference\setlayer[test]{#1#2}\stopnointerference}

 \definehead[testhead][subject]

 \setuphead[testhead]
 [page=,
  before=,
  after={\topskipcorrection\vskip-\topskip \blank[disable]},
  alternative=normal,
  command=\mylayer]
 
 Thanks. I think that in this case it will be cleaner to not use heads in 
 this case and implement color, style, align interface by hand. I will 
 wikify your answer.

you can achieve the same effect by just header=high and using a layer in 
the command and flush it then

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Equivalent of LaTeX \cancel? and Thanks!

2008-10-12 Thread Hans Hagen
Benjamin R. Haskell wrote:
 Hi all,
 
 I recently transitioned from LaTeX to ConTeXt. There was some particular 
 thing I needed to do (which escapes me at the moment) that was far, far 
 easier to do in ConTeXt than in LaTeX. And, as I've learned, I've found 
 that that's quite often the case. So, a huge thank you to everyone 
 involved.
 
 A couple hours ago I was annoyed that I couldn't find an equivalent for 
 the LaTeX 'cancel' environment/command/style(?)[1]. Now, I'm truly amazed 
 that 'cancel' required a whole package.
 
 After discovering that 'underline' and 'strikethrough' were implemented as 
 overlays, I quickly coded up the following:
 
 \startuseMPgraphic{MyCancel}
  draw (0,.2*\overlayheight)--(\overlaywidth,\overlayheight);
 \stopuseMPgraphic
 \defineoverlay[mycancel][\useMPgraphic{MyCancel}]
 
 \def\cancel#1{\framed[background=mycancel,frame=off]{#1}}
 
 
 Now, I'm sure this is not *quite* the right way to do it. The 'cancel'ed 
 items end up being placed too high on the line, and other spacings are 
 slightly off. But, taking a cue from underlining, I kept the MyCancel 
 graphic and tried:
 
 \definetextbackground
 [cancel]
 [location=text,
  alternative=1,
  background=mycancel]
 % plus boilerplate for setting up \startcancel\stopcancel
 
 But, while composing this email, I found what I wanted, which still 
 isn't ``right'' in some sense:
 
 \def\cancel#1{\framed[background=mycancel,frame=off,width=fit,height=fit,strut=no]{#1}}
 
 I found the parameters for \framed. I'm still learning to Read The 
 Fantastic Manuals, but sent this anyway since I wanted to say thanks.


\startuseMPgraphic{mpos:par:cancel}
 for i=1 upto nofmultipars :
 draw
 .2[llcorner multipars[i],ulcorner multipars[i]] --
 .2[urcorner multipars[i],lrcorner multipars[i]] ;
 endfor ;
\stopuseMPgraphic

\definetextbackground[cancel][location=text,mp=mpos:par:cancel]

\def\startcancel{\starttextbackground[cancel]}
\def\stopcancel {\stoptextbackground}
\def\cancel {\groupedcommand\startcancel\stopcancel}

however, this is kind of fuzzy when you cross lines

an alternative is to use:

\definetextbackground[cancel][location=text,alternative=4,background=,frame=off]

\definestartstop
   [cancel]
   [before={\starttextbackground[cancel]},
after=\stoptextbackground]

however, there is a glitch in the drawing so you need a patch

\startMPinclusions
def draw_multi_pars  =
   for i=1 upto nofmultipars :
 do_draw_par(multipars[i]) ;
 if boxgridtype= 1 :
   draw baseline_grid (multipars[i],if multilocs[i]=1: down else: up 
fi,true) ; % withcolor boxgridcolor ;
 elseif boxgridtype= 2 :
   draw baseline_grid (multipars[i],if multilocs[i]=1: down else: up 
fi,false) ; % withcolor boxgridcolor ;
 elseif boxgridtype= 3 :
   draw baseline_grid (multipars[i],if multilocs[i]=1: down else: up 
fi,true) ; % withcolor boxgridcolor ;
   draw baseline_grid (multipars[i],if multilocs[i]=1: down else: up 
fi,true) shifted (0,ExHeight) ; % withcolor boxgridcolor ;
 elseif boxgridtype= 4 :
   draw baseline_grid (multipars[i],if multilocs[i]=1: down else: up 
fi,true) shifted (0,ExHeight/2) ; % withcolor boxgridcolor ;
 elseif boxgridtype=11 :
   draw 
graphic_grid(multipars[i],boxgriddistance,boxgriddistance,boxgriddistance/2,boxgriddistance/2)
 
;
 elseif boxgridtype=12 :
   draw graphic_grid(multipars[i],boxgriddistance,boxgriddistance,0,0) ;
 fi ;
   endfor ;
enddef ;
\stopMPinclusions

(will be fixed in the next release)


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \definelogo Undefine control sequence in luatex

2008-10-12 Thread Olivier Guéry
Hello,

I tried to put logo on my pages.
I got an undefine control sequence with luatex.
This small exemple look to run fine with pdftex but not luatex in context live.

\definelogo[mypic][bottom][left]
[state=start,command={\externalfigure[pic]}]
\placelogos[mypic]
\starttext
Hello world!
\stoptext

Did the syntax change ?

Cheers,
Olivier.


-- 
[Message tapé sur un clavier Bépo : http://www.clavier-dvorak.org ]
http://nemolivier.blogspot.com
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \definelogo Undefine control sequence in luatex

2008-10-12 Thread Hans Hagen
Olivier Guéry wrote:
 Hello,
 
 I tried to put logo on my pages.
 I got an undefine control sequence with luatex.
 This small exemple look to run fine with pdftex but not luatex in context 
 live.
 
 \definelogo[mypic][bottom][left]
   [state=start,command={\externalfigure[pic]}]
 \placelogos[mypic]
 \starttext
 Hello world!
 \stoptext
 
 Did the syntax change ?

no, i just disabled in mkiv, use layers instead; they should provide the 
same functionality and are more flexible

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Running Mark IV / luatex: unknown script: context

2008-10-12 Thread Mildred Ki'Lya
Hi,

Hello everybody, I'm new here. I just subscribed because I'm trying to
use LuaTeX / ConTeX Mark IV and i have some problems with it. I'm
running TeXlive 2008 installed from ArchLinux and I can't run 'context'
from the command line.

I'm following the instructions on the page
http://wiki.contextgarden.net/Running_Mark_IV

It says to first run 'context --make cont-en', and when I do that, I
get:

MtxRun | error unable to identify cnf file
MtxRun | error unable to identify cnf file
MtxRun | no cnf files found (TEXMFCNF may not be set/known)
MtxRun | unknown script: context

After I figured out on the Internet how to set the environment variable
TEXMFCNF (I set it to '/usr/share/texmf/web2c/texmf.cnf'), I only get:

MtxRun | unknown script: context

It seems mtxrun can't find the script mtx-context.lua. I lookad on the
Internet, but haven't found any useful information, but I noticed that
there was an environment variable I could set to make mtxrun more
verbose:

MTX_INPUT_TRACE=3 context --make cont-en ~

MtxRun | ! using suffix based filetype: lua
MtxRun | ? blobpath asked: context.lua
MtxRun | ? filename: context.lua
MtxRun | - readable: ./context.lua
MtxRun | ! using suffix based filetype: lua
MtxRun | ? blobpath asked: mtx-context.lua
MtxRun | ? filename: mtx-context.lua
MtxRun | - readable: ./mtx-context.lua
MtxRun | ! using suffix based filetype: lua
MtxRun | ? blobpath asked: mtx-contexts.lua
MtxRun | ? filename: mtx-contexts.lua
MtxRun | - readable: ./mtx-contexts.lua
MtxRun | ! remembered: mtx-context.lua
MtxRun | unknown script: context

Obviously, the mtx-context.lua file is searched in the current
directory, which is my homedir. The file is in fact located at:
'/usr/share/texmf-dist/scripts/context/lua/mtx-context.lua'

So I cd to that path, and un context again, I get:

MTX_INPUT_TRACE=3 context --make cont-en

MtxRun | ! using suffix based filetype: lua
MtxRun | ? blobpath asked: context.lua
MtxRun | ? filename: context.lua
MtxRun | - readable: ./context.lua
MtxRun | ! using suffix based filetype: lua
MtxRun | ? blobpath asked: mtx-context.lua
MtxRun | ? filename: mtx-context.lua
MtxRun | + readable: ./mtx-context.lua
MtxRun | = found by scanning: ./mtx-context.lua

LuaTools | ! using suffix based filetype: tex
LuaTools | ? filename: cont-en.tex
LuaTools | ? filetype: tex
LuaTools | ? wanted files: cont-en.tex
LuaTools | - readable: cont-en.tex
LuaTools | ? blobpath asked: cont-en.tex
LuaTools | no tex file with name cont-en.tex
LuaTools | 
LuaTools | runtime: 0.019 seconds
MtxRun | running command: luatools --make --compile cont-en
MtxRun | total runtime: 0.047



Well, it seems cont-en.tex cannot be found either. It is located
at '/usr/share/texmf-dist/tex/context/base/cont-en.tex'.

How could I fix my paths?

Except for TEXMFCNF, there is No TEX* environment variable defined:

env | grep TEX
TEXMFCNF=/usr/share/texmf/web2c/texmf.cnf


Thanks for any help.

Mildred

-- 
Mildred Ki'Lya
╭─ mildred593@online.fr ──
│ Jabber, GoogleTalk: [EMAIL PROTECTED]
│ Site: http://ki.lya.online.fr  GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Running Mark IV / luatex: unknown script: context

2008-10-12 Thread Arthur Reutenauer
Hello Mildred,

 After I figured out on the Internet how to set the environment variable
 TEXMFCNF (I set it to '/usr/share/texmf/web2c/texmf.cnf'), I only get:

  It should rather be /usr/share/texmf/web2c (the name of the
directory), I surmise.  Can you try with that new setting?

Arthur
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___