Re: [NTG-context] Locating pdf files in the texmf directory structure

2013-08-05 Thread Marco Patzer
On 2013–08–04 Michael Ash wrote:

 But env_letter.tex calls two pdf files with \externalfigure (see
 below).  These two pdf files are also in the directory pointed to by
 TEXMFHOME but they show up in the finished document as gray state:
 unknown boxes

This works here.

  \setupexternalfigure [location=default]
  \starttext
%% \externalfigure [cow]
\externalfigure [somefigure]
  \stoptext

The graphic somefigure is located in TEXMFHOME. You probably did not
set location to default.

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

 % Define logo for the first page header
 \defineletterelement[layer][head][example]{%
   \framed[background=logohead,frame=off,align=left]{%
 \externalfigure[UMA_Seal_200_Maroon.pdf][height=3.1cm]}
 }
 
 \setupletter[ signature={\externalfigure[signature-blue.pdf]} ]

If you provide code, please create working examples, not just
snippets.

Marco


signature.asc
Description: Digital signature
___
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] kerning with buggy libertine

2013-08-05 Thread Hans Hagen

On 8/4/2013 3:43 PM, Philipp Gesang wrote:

Hi Hans,

this is a bug report thanks to Khaled:

   http://tex.stackexchange.com/a/126650/14066

In short: the font loader applies the kerning of libertine
version 5.3.0 even though this appears to be broken in the font.
Context translation of the example:

   \definefontfeature [kerning] [mode=node,smcp=yes,kern=yes]
   \definefont [libertineserifsmallcaps] [file:LinLibertine_R.otf*kerning]
   \definefont [libertinesanssmallcaps]  [file:LinBiolinum_R.otf*kerning]

   \def\demotext{Vacillate Vaccine Vapour Vanish Va...}

   \starttext
 {\libertineserifsmallcaps \demotext}\par
 {\libertinesanssmallcaps  \demotext}\par
   \stoptext

(Doesn’t occur in base mode.) The technical details are in the
thread Khaled references.


\showotfcomposition{file:LinLibertine_R.otf*kerning}{+1}{Va} \page
\showotfcomposition{file:LinBiolinum_R.otf*kerning} {+1}{Va} \page

You need to be more explicit (which font, where to download the 
problematic one, etc ... i downloaded the 5.3 version - i think - of 
ll). In what sense is it broken in the font?


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
___


[NTG-context] Passing macro parameters to lua

2013-08-05 Thread Matt Gushee
Hello, good people--

I've encountered what appears to be a bug in either the TeX-Lua
interface or the documentation thereof (I have the latest stable
ConTeXt standalone from contextgarden.net).

I'm trying to create a macro that will insert different text depending
on whether one of the arguments is empty or not. My initial test
implementation (following the wiki section entitled Passing arguments
and buffers: ConTeXt commands that hook into Lua) looked like this:

\startluacode
userdata = userdata or {}

function userdata.empty_or_not(str)
if str ==  or str == nil then
context({\\sc Empty})
else
context(str)
end
end
\stopluacode

\def\emptyOrNot#1{%
\ctxlua{userdata.empty_or_not(#1)}%
}

\starttext

\emptyOrNot{Amazing Text!}

\emptyOrNot{}

\stoptext

This did not work. I determined that even when I passed a non-empty
string, the Lua interpreter detected it as nil. It turns out the fix
was simple--I had to quote the string, as follows.

\def\emptyOrNot#1{%
\ctxlua{userdata.empty_or_not(#1)}%
}

It took me a while to figure that out, though, since the wiki example
does not show quotes.

--
Matt Gushee
___
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] Passing macro parameters to lua

2013-08-05 Thread Hans Hagen

On 8/5/2013 10:53 PM, Matt Gushee wrote:

Hello, good people--

I've encountered what appears to be a bug in either the TeX-Lua
interface or the documentation thereof (I have the latest stable
ConTeXt standalone from contextgarden.net).

I'm trying to create a macro that will insert different text depending
on whether one of the arguments is empty or not. My initial test
implementation (following the wiki section entitled Passing arguments
and buffers: ConTeXt commands that hook into Lua) looked like this:

\startluacode
 userdata = userdata or {}

 function userdata.empty_or_not(str)
 if str ==  or str == nil then
 context({\\sc Empty})
 else
 context(str)
 end
 end
\stopluacode

\def\emptyOrNot#1{%
 \ctxlua{userdata.empty_or_not(#1)}%
}

\starttext

 \emptyOrNot{Amazing Text!}

 \emptyOrNot{}

\stoptext

This did not work. I determined that even when I passed a non-empty
string, the Lua interpreter detected it as nil. It turns out the fix
was simple--I had to quote the string, as follows.

\def\emptyOrNot#1{%
 \ctxlua{userdata.empty_or_not(#1)}%
}

It took me a while to figure that out, though, since the wiki example
does not show quotes.


indeed you need quotes


-
  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] \externalfigure doesn't find mps file in subdirectory

2013-08-05 Thread Sietse Brouwer
Hi Sanjoy,

Sorry for the late reply; I had to dig around in grph-inc.lua, and I'm
a bit rusty at source-diving.

Yep, that’s a problem all right. A bug, even: when you put `simple.1`
in the same directory as the `.tex` file, it is correctly identified
as MetaPost; when you put the exact same file in a subdirectory like
`./fig`, you get the problem you describe. No clue why.

Until Hans fixes this, you can force ConTeXt to treat a file as
MetaPost, JPEG, etc. by passing the `method=` paramater to
`\externalfigure`. For MetaPost, write `method=mps`; I don’t know why
the MetaPost code is not `mp`. (Perhaps that could be made a synonym?)

Complete example below. I hope this workaround helps? Good luck with your work!

Cheers,
Sietse

% test.tex
\setupexternalfigures[directory={fig}]
\enabletrackers[graphics.locating]

\starttext
\externalfigure[simple.1][width=10cm, method=mps]
\stoptext

% fig/simple.1
%!PS
%%BoundingBox: 0 0 29 29
%%HiResBoundingBox: 0 0 28.34645 28.34645
%%Creator: MetaPost 1.803
%%CreationDate: 2013.08.04:0841
%%Pages: 1
%%BeginProlog
%%EndProlog
%%Page: 1 1
 0 0 0 setrgbcolor
newpath 0 0 moveto
28.34645 0 lineto
28.34645 28.34645 lineto
0 28.34645 lineto
 closepath fill
showpage
%%EOF
___
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] Passing macro parameters to lua

2013-08-05 Thread Sietse Brouwer
Matt Gushee wrote:
 It took me a while to figure that out, though, since the wiki example
 does not show quotes.

Hans Hagen wrote:
 indeed you need quotes

Yep. I've updated the wiki.
http://wiki.contextgarden.net/index.php?title=Programming_in_LuaTeXaction=historysubmitdiff=21966oldid=13667

Thanks, Matt!

Cheers,
Sietse
___
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] \externalfigure doesn't find mps file in subdirectory

2013-08-05 Thread Hans Hagen

On 8/5/2013 11:18 PM, Sietse Brouwer wrote:

Hi Sanjoy,

Sorry for the late reply; I had to dig around in grph-inc.lua, and I'm
a bit rusty at source-diving.

Yep, that’s a problem all right. A bug, even: when you put `simple.1`
in the same directory as the `.tex` file, it is correctly identified
as MetaPost; when you put the exact same file in a subdirectory like
`./fig`, you get the problem you describe. No clue why.

Until Hans fixes this, you can force ConTeXt to treat a file as
MetaPost, JPEG, etc. by passing the `method=` paramater to
`\externalfigure`. For MetaPost, write `method=mps`; I don’t know why
the MetaPost code is not `mp`. (Perhaps that could be made a synonym?)

Complete example below. I hope this workaround helps? Good luck with your work!


you can test with this (line 767 in grph-inc):

askedformat = format -- new per 2013-08-05
elseif trace_figures then
report_inclusion(unknown format %a,askedformat)
end



Cheers,
Sietse

 % test.tex
 \setupexternalfigures[directory={fig}]
 \enabletrackers[graphics.locating]

 \starttext
 \externalfigure[simple.1][width=10cm, method=mps]
 \stoptext

 % fig/simple.1
 %!PS
 %%BoundingBox: 0 0 29 29
 %%HiResBoundingBox: 0 0 28.34645 28.34645
 %%Creator: MetaPost 1.803
 %%CreationDate: 2013.08.04:0841
 %%Pages: 1
 %%BeginProlog
 %%EndProlog
 %%Page: 1 1
  0 0 0 setrgbcolor
 newpath 0 0 moveto
 28.34645 0 lineto
 28.34645 28.34645 lineto
 0 28.34645 lineto
  closepath fill
 showpage
 %%EOF
___
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
___




--

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

[NTG-context] \completepublications in component creates wrong hyperlinks

2013-08-05 Thread Marco Patzer
Hi,

if a \completepublications call is used in a component, the
hyperlink, which is supposed to link to the bibliography, instead
links to a (probably non-existing) pdf file named after the
component.

\startbuffer [sample]
  @BOOK{Eijkhout1991,
title = {\TeX\ by Topic. A \TeX nician's Reference},
publisher = {Addison-Wesley},
year  = {1991},
author= {Victor Eijkhout},
address   = {London},
keywords  = {general},
  }
\stopbuffer
\savebuffer [list=sample, file=bibliography.bib, prefix=no]

\startbuffer [component]
  \startcomponent *
\completepublications [criterium=text]
  \stopcomponent
\stopbuffer
\savebuffer [list=component, file=bib-component.tex, prefix=no]

\setupinteraction [state=start]
\setupbibtex [database=bibliography]
\starttext
  Some text. \cite [Eijkhout1991]

  %% creates a hyperlink to bib-component.pdf
  \component bib-component

  %% this one works
  %% \completepublications [criterium=text]
\stoptext

Marco


signature.asc
Description: Digital signature
___
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
___