ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* bad argument #1 to 'gsub'
@ 2011-06-24  1:57 Kip Warner
  2011-06-24 11:27 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Kip Warner @ 2011-06-24  1:57 UTC (permalink / raw)
  To: ntg-context

Hey folks,

This code, as far as I remember, was working fine a few days ago but
now craps out with:

system          > begin file Source/Handbook.tex at line 1
system          > begin file Source/Environment at line 2
! LuaTeX
error ...text/tex/texmf-context/tex/context/base/data-env.lua:234: bad
argument #1 to 'gsub' (string expected, got nil).

system          > tex > error on line 1 in file Source/Handbook.tex:
LuaTeX error  ...

 1 >>  \startproduct Handbook
 2     \environment Source/Environment

/Makefile
---------------------------------------------
CONTEXT_PRODUCT             = Source/Handbook.tex
ALL_SOURCE                  = $(shell find Source/ -type f -name '*.tex'
-exec echo "{}" \; | sed 's/ /\\ /g')
OUTPUT                      = Handbook.pdf
CONTEXT_OPTIONS             = --purgeresult --nonstopmode


all: $(OUTPUT) Makefile

$(OUTPUT): $(ALL_SOURCE)
	context $(CONTEXT_PRODUCT) --result=$(OUTPUT) $(CONTEXT_OPTIONS)

clean:
	@ context --purgeall --nonstopmode --noconsole #&> /dev/null
	@ rm -vf $(OUTPUT) Handbook.pdf
--------------------------------------

/Source/Environment.tex
---------------------------------------------

\startenvironment Environment

% Speedup typescripting considerably at the cost of using additional
memory...
\preloadtypescripts

%\usemodule[units,simplefonts]
\usemodule[units]

% Setup PDF metadata...
\setupinteraction
  [state=start,
   color=red,
   title=Handbook]

% Show the PDF bookmarks and expand to the chapter and section level...
\placebookmarks[chapter,section,subsection,subsubsection][chapter,section]
\setupinteractionscreen[option=bookmark]

\setupbackgrounds
   [rightpage]
   [background=]

% Set compression level, default is 3, so set to maximum...
\setupbackend
  [level=9]

\setupsystem
  [\c!random=\v!big]

\setuplayout
  [\c!location=\v!middle,
   \c!style=\ss,
   \c!backspace=2.5cm,
   \c!topspace=1.5cm,
   \c!width=16cm,
   \c!margindistance=.25cm,
   \c!margin=2.5cm,
   \c!height=\v!middle]

% re-defined because the default rscale=1.075 for modern doesn't 
% look right

\starttypescript [palatino]
\definetypeface [palatino] [rm] [serif] [palatino] [default]
\definetypeface [palatino] [ss] [sans]  [modern]   [default]
\definetypeface [palatino] [tt] [mono]  [modern]   [default]
\definetypeface [palatino] [mm] [math]  [palatino] [default]
\stoptypescript

\usetypescript[palatino][ec]

\setupbodyfont[palatino,11pt]
%\setupbodyfont[ubuntu,11pt][file:ubuntu-r][features=default]

\definefontsynonym[chapternumberfont][RegularBold]
\definefontsynonym[chaptertextfont]  [RegularBold]

\definebodyfont[11pt][rm][bfe=RegularBold at 30pt]
\definebodyfont[11pt][rm][bft=RegularBold at 30pt]

%\setmainfont[Ubuntu]
%\switchtobodyfont[11pt]

\definelayout
  [fullpage]
  [\c!backspace=0pt,
   \c!topspace=0pt,
   \c!width=\v!middle,
   \c!height=\v!middle,
   \c!header=0pt,
   \c!footer=0pt]

\setuppagenumbering
  [\c!alternative=\v!doublesided]

\def\startchapter#1%
{\chapter[#1]{#1}\index{#1}}

\def\startsection#1%
{\section[#1]{#1}\index{#1}}

\def\startsubsection#1%
{\subsection[#1]{#1}\index{#1}}

\def\startsubsubsection#1%
{\subsubsection[#1]{#1}\index{#1}}

\def\StartTimelineDate#1%
{\subsubsubject{\bf #1}}

\def\StopTimelineDate%
{
\crlf
}

\def\StartTimelineDocument%
{
\crlf
\startframedtext[width=broad,bottom=\vss,top=
\vss,align=right,corner=round]
\it 
}

\def\StopTimelineDocument%
{
\stopframedtext
\crlf
}

% Usage: \href{http://www.someurl.com}{Text}
\def\href#1#2{\useURL[#2][{#2}][][{#1}]\goto{\url[#2]}[url(#1)]}

\def\ahref#1{\color[linkcolor]{\ttx \href{#1}{<#1>}}}

\def\fullahref#1{\color[linkcolor]{\ttx \href{#1}{#1}}}

\def\mailto#1{\useURL[#1][mailto:#1][][#1]\from[{#1}]}

\def\MailTo#1#2{\useURL[#1][mailto:#1][][#2]\from[{#1}]}

\def\ShellExample#1
{
\blank
\startframedtext[width=broad,bottom=\vss,top=
\vss,align=right,corner=round]
\tt {#1}
\stopframedtext
\blank
}

\def\startexample
  {\blank
   \begingroup}

\def\stopexample
  {\endgroup
   \blank}

\def\startreality
  {\blank
   \page[\v!preference]
   \begingroup}

\def\stopreality
  {\relax
   \endgroup
   \blank}

\defineframedtext
  [MiniFile]
  [\c!width=25em,
   \c!offset=0.25ex,
   \c!bodyfont=7pt,
   \c!background=\v!color,
   \c!backgroundcolor=GrayColor,
   \c!backgroundoffset=.25ex,
   \c!frame=\v!off,
   \c!before=,
   \c!after=]

% Number formulae etc. using the chapter number...
\setupnumbering
    [way=bychapter]

\setuppagenumbering
  [\c!location=]

\setuptolerance
  [\v!verytolerant,\v!stretch]

\setupblank
  [\v!medium]

\setupwhitespace
  [\v!medium]

\setuptyping
  [\c!blank=\v!medium]

\setupheadertexts
  [\v!margin]
  [][\hfill\pagenumber\hfill]

\setupfootertexts
  [\v!margin]
  [][{\hfill\doifnotmode{*\v!frontpart}{\getmarking[\v!chapter\v!
number]}\hfill}]

\setupheadertexts
  [\v!text]
  [][{\hfill\getmarking[\v!chapter]\hfill}]

%\setupfootertexts
%  [\v!text]
%  [][{\hfill\getmarking[\v!section]\hfill}]

\setupbodyfontenvironment
  [default]
  [em=italic]

\setupsectionblock[\v!frontpart] [\c!page=\v!yes]
\setupsectionblock[\v!bodypart]  [\c!page=\v!yes]
\setupsectionblock[\v!appendix]  [\c!page=\v!yes]
\setupsectionblock[\v!frontpart] [\c!before=,\c!after=]

\setuphead
  [\v!chapter]
  [\c!command=\PlaceSection,
   \c!page=\v!yes,
   \c!before=,
   \c!header=\v!nomarking,
   \c!style=\bfd]

\setuphead
  [\v!title]
  [\c!command=\PlaceSection,
   \c!page=\v!right,
   \c!before=,
   \c!header=\v!nomarking,
   \c!style=\bfd]

\setuphead
  [\v!section]
  [\c!command=\PlaceSection,
   \c!inbetween=,
   \c!style=\bfb]

\setuphead
  [\v!subsection]
  [\c!command=\PlaceSection,
   \c!before=\blank,
   \c!style=\bfa]

\setuphead
  [\v!subsubsection]
  [\c!command=\PlaceSection,
   \c!before=\blank,
   \c!style=\bsa]

\def\PlaceSection#1#2%
  {\goodbreak
   \vbox
     {\localheadsetup
      \begstrut
      \inleftmargin{\hbox to \leftmarginwidth{\hss#1\hss}}%
      #2}}

\setupcaptions[width=14cm,align=right]

\setMPtext{text}{some test text}

\startusableMPgraphic{text}
  picture r ;
  r := image ( graphictext
    \MPstring{text}
    randomized .4pt
    scaled 6pt
    withfillcolor .8\MPcolor{maincolor}
    withpen pencircle scaled 1pt ; ) ;
  draw r ;
\stopusableMPgraphic

\setuptype
  [\c!option=\v!slanted]

\setuptyping
  [\c!option=\v!slanted]

\setuplist
  [\v!section]
  [\c!width=3em]

\defineregister
  [texmacro]
  [texmacros]

\setupregister
  [texmacro]
  [\c!indicator=\v!off,
   \c!distance=1em minus .25em]

\setupfootnotes
  [\c!rule=\v!on]

\setuphead
  [\v!chapter]
  [\c!header=\v!empty]

\setupitemgroup[\v!itemize]
  [\v!each]
  [\c!headstyle=\v!bold]

\setupitemgroup[\v!itemize]
  [\v!each]
  [\v!stopper]

\setupsubpagenumber
  [\c!way=\v!by\v!chapter,
   \c!state=\v!start]

\stopenvironment

---------------------------------------------

/Source/Handbook.tex
---------------------------------------------
\startproduct Handbook
\environment Source/Environment

\startfrontmatter
    \completecontent
\stopfrontmatter

\startbodymatter
    \component Source/Preface/Preface
\stopbodymatter

\startappendices
	\completeindex
\stopappendices

\startbackmatter

\stopbackmatter

\stopproduct
---------------------------------------------

/Source/Preface/Preface.tex
---------------------------------------------
\startchapter{Preface}

Foo
---------------------------------------------

Any help would be much appreciated. I am using ConTeXt version
2011.06.23 23:59.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: bad argument #1 to 'gsub'
  2011-06-24  1:57 bad argument #1 to 'gsub' Kip Warner
@ 2011-06-24 11:27 ` Hans Hagen
  2011-06-24 17:54   ` Kip Warner
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-06-24 11:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Kip Warner

On 24-6-2011 3:57, Kip Warner wrote:
> Hey folks,
>
> This code, as far as I remember, was working fine a few days ago but
> now craps out with:
>
> system>  begin file Source/Handbook.tex at line 1
> system>  begin file Source/Environment at line 2
> ! LuaTeX
> error ...text/tex/texmf-context/tex/context/base/data-env.lua:234: bad
> argument #1 to 'gsub' (string expected, got nil).
>
> system>  tex>  error on line 1 in file Source/Handbook.tex:
> LuaTeX error  ...

what version? todays beta?

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] 3+ messages in thread

* Re: bad argument #1 to 'gsub'
  2011-06-24 11:27 ` Hans Hagen
@ 2011-06-24 17:54   ` Kip Warner
  0 siblings, 0 replies; 3+ messages in thread
From: Kip Warner @ 2011-06-24 17:54 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 900 bytes --]

On Fri, 2011-06-24 at 13:27 +0200, Hans Hagen wrote:
> what version? todays beta?
> 
> Hans 

Hey Hans,

2011.06.23.

Adam suggested to me:

> There where major changes to mtxrun and I have problems as well, we
> are working on it.
> 
> In the meantime please use the version 2011.06.21:
> https://launchpad.net/~reviczky/+archive/ppa/+build/2583194

Hopefully that will work, since right now it can't run anything:

$ context --version

resolvers       | resolving | loading configuration file
'selfautodir:/share/texmf/web2c/contextcnf.lua'
resolvers       | resolving | loading configuration file
'/usr/share/texmf/web2c/contextcnf.lua'
resolvers       | caches | created: /home/kip/.texmf-var
mtxrun          | unknown script 'context.lua' or 'mtx-context.lua'

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- 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] 3+ messages in thread

end of thread, other threads:[~2011-06-24 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-24  1:57 bad argument #1 to 'gsub' Kip Warner
2011-06-24 11:27 ` Hans Hagen
2011-06-24 17:54   ` Kip Warner

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