Re: [NTG-context] suggestion on [option=TEX]

2014-02-06 Thread Wolfgang Schuster

Am 06.02.2014 um 19:29 schrieb Pablo Rodriguez :

> On 02/06/2014 12:57 AM, Wolfgang Schuster wrote:
>> Am 05.02.2014 um 19:50 schrieb Pablo Rodriguez :
>> 
>>> Hi Hans,
>>> 
>>> I have the following sample:
>>> 
>>> \setuptyping[option=TEX]
>>> \starttext
>>> \starttyping
>>> \input zapf % knuth
>>> \stoptyping
>>> \stoptext
>>> 
>>> The percent character is in bold font and gray color, but the rest of
>>> the commented text isn’t.
>>> [...]
>> 
>> http://pragma-ade.com/general/magazines/mag-1102.pdf
> 
> Many thanks for your reply, Wolfgang.
> 
> After reading the document, I think it could be achieved with:
> 
> \definefontfamily[mainface][mono][DejaVu Sans Mono]
> \setupbodyfont[mainface]
> \defineprocessor[myescape][style=bold,color=gray, left=\%]
> \setuptyping[TEX][escape=myescape->{\%}]
> \starttext
> \startTEX
> This is a c%omment.
> 
> % And this is another one.
> 
> \command
>  [with colored]
>  {brackets}
> \stopTEX
> \stoptext
> 
> But this doesn’t work. I must be missing something obvious.
> 
> What am I doing wrong here?
> 
> Many thanks for your help,


You have to add a comma after \letterpercent. You should also be careful with
the text in the comments because commands are expanded, e.g. take a look
at the \TeX in the comment.

\setupbodyfont[dejavu]

\defineprocessor[myescape][style=\ttbf,color=gray,left={\letterpercent}]

\setuptyping[TEX][escape=myescape->{\letterpercent,}]

\starttext
\startTEX
This is \TeX\ code % and this is a \TeX\ comment.
\stopTEX
\stoptext

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
___

Re: [NTG-context] Project structure

2014-02-06 Thread Marco Patzer
On 2014–02–05 pol stra wrote:

> The problem is that only text of first introduction is used.

You can use \allinputpaths to see what's going on. The paths are
indeed added and ConTeXt walks through the list and uses a matching
file, if found. This happens to always be the file of the first
chapter.

I don't know know of a command which resets the custom set up paths.
If none exists, I doubt it will be hard to implement.

> I attached the project structure.

Thanks for that.

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] suggestion on [option=TEX]

2014-02-06 Thread Pablo Rodriguez
On 02/06/2014 12:57 AM, Wolfgang Schuster wrote:
> Am 05.02.2014 um 19:50 schrieb Pablo Rodriguez :
> 
>> Hi Hans,
>>
>> I have the following sample:
>>
>> \setuptyping[option=TEX]
>> \starttext
>> \starttyping
>> \input zapf % knuth
>> \stoptyping
>> \stoptext
>>
>> The percent character is in bold font and gray color, but the rest of
>> the commented text isn’t.
>> [...]
> 
> http://pragma-ade.com/general/magazines/mag-1102.pdf

Many thanks for your reply, Wolfgang.

After reading the document, I think it could be achieved with:

\definefontfamily[mainface][mono][DejaVu Sans Mono]
\setupbodyfont[mainface]
\defineprocessor[myescape][style=bold,color=gray, left=\%]
\setuptyping[TEX][escape=myescape->{\%}]
\starttext
\startTEX
This is a c%omment.

% And this is another one.

\command
  [with colored]
  {brackets}
\stopTEX
\stoptext

But this doesn’t work. I must be missing something obvious.

What am I doing wrong here?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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] getting text outside cropmarks to work

2014-02-06 Thread Lars Huttar
On 2/6/2014 10:12 AM, Wolfgang Schuster wrote:
>
> Am 05.02.2014 um 17:30 schrieb Lars Huttar  >:
>
>> ... If we need to implement this using layers, does anyone have a recent
>> example of using a layer to place a running footer outside the crop
>> marks?
>
> \setuppapersize[A4][A3]
>
> \setuplayout[location=middle,marking=on]
>
> \setupbodyfont[modern]
>
> \definelayer[cropmark][width=\paperwidth,height=\paperheight]
>
> \setupbackgrounds[page][background=cropmark]
>
> \setlayer[cropmark][preset=middlebottom,y=-\lineheight]{Bottom Text}
> \setlayer[cropmark][preset=middletop,y=-\lineheight]{Top Text}
>
> \starttext
> \input knuth
> \stoptext
>
> Wolfgang
>

Thanks, this looks very helpful. I'll give it a try.
Lars


___
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] getting text outside cropmarks to work

2014-02-06 Thread Wolfgang Schuster

Am 05.02.2014 um 17:30 schrieb Lars Huttar :

> On 2/5/2014 11:03 AM, Wolfgang Schuster wrote:
>> Am 05.02.2014 um 16:45 schrieb Lars Huttar :
>> 
>>> Hello,
>>> 
>>> Under mkii we used to have a running footer that appeared below the crop
>>> marks. Under mkiv I can't get that to work.
>>> 
>>> The MWE I'm trying (with ConTeXt mkiv from the TeXLive 2013 CD):
>>> 
>>> \def\TopText { Top Text }
>>> 
>>> \def\BottomText { Bottom Text }
>>> 
>>> \def\pagecutmarksymbol {\the\realpageno}
>>> 
>>> \def\pagecutmarklength {.5cm}
>>> 
>>> \let\pagecutmarktoptext \TopText
>>> 
>>> \let\pagecutmarkbottomtext \BottomText
>>> 
>>> \setuplayout[marking=text]
>>> 
>>> %\setuplayout[marking=on]
>>> 
>>> \starttext
>>> 
>>> \input knuth
>>> 
>>> \stoptext
>>> 
>>> Code like this used to work for us in mkii.
>> Redefining internal commands isn’t a good solution, what you can do is to 
>> use a layer to place your texts.
>> 
> 
> Thanks for your reply.
> 
> When you say "redefining internal commands", is that referring to
> statements like
> 
>  \let\pagecutmarktoptext \TopText
> 
> ?
> 
> AFAICT this is the recommended solution, both on the current wiki 
> (http://wiki.contextgarden.net/Imposition#Cut_marks) and by Hans 
> (http://context.markmail.org/thread/kpayudrtabsti76i) albeit several years 
> ago; the current ref man (section 3.4 Page design / page composition) also 
> lists marking=TEXT as an option for \setuplayout. If this is correct, how is 
> one supposed to specify the text to display?
> 
> Am I misunderstanding the documentation, or is it just obsolete?
> 
> If we need to implement this using layers, does anyone have a recent
> example of using a layer to place a running footer outside the crop marks?

\setuppapersize[A4][A3]

\setuplayout[location=middle,marking=on]

\setupbodyfont[modern]

\definelayer[cropmark][width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background=cropmark]

\setlayer[cropmark][preset=middlebottom,y=-\lineheight]{Bottom Text}
\setlayer[cropmark][preset=middletop,y=-\lineheight]{Top Text}

\starttext
\input knuth
\stoptext

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
___

Re: [NTG-context] Appendix Page Numbering

2014-02-06 Thread Troy Henderson
Wolfgang,

Thank you for your response.  Unfortunately, this does not quite work.  The
page numbers are correct, but they're not showing up like the previous
screenshot in Evince's index.  I've attached my ConTeXt source as well as
the output PDF and a screenshot of Evince's Index view.

Troy


foo.tex
Description: TeX document


foo.pdf
Description: Adobe PDF document
<>___
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] Expansion or Referencing problem

2014-02-06 Thread Andreas Schneider
Title: Re: [NTG-context] Expansion or Referencing problem


On Thursday, February 6, 2014, at 11:39 Wolfgang Schuster wrote:





Am 06.02.2014 um 11:32 schrieb Andreas Schneider :

Expansion or Referencing problem 
Hello,

I'm probably just stuck with another misunderstanding of TeX's expansion, but I can't figure out how to fix it.

The attached example doesn't work as intended. My defined command produces the correct reference name (as can be seen in the resulting .tuc file) but still \about (and the other referencing commands) won't show/find it.

What am I missing here?
ConTeXt uses “::” as separator for references to external files.

Wolfgang




/o\

That was about the last thing I would have thought of.

Thank you very much! :-)

(I changed it from "" to "default" now, so when nothing else is found, it looks for "tr:default:...")

-- 
Best Regards,
Andreas

___
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] Appendix Page Numbering

2014-02-06 Thread Wolfgang Schuster

Am 06.02.2014 um 04:17 schrieb Troy Henderson :

> To give an idea of what I am wanting, the attached screenshot is from Evince 
> for a particular PDF that was created with some other program other than 
> ConTeXt.  Notice the custom page number names such as "Statement", "P-1", 
> "P-5", ..., "P-25", "APP-1", "APP-3", ...
> 
> How can I get this with ConTeXt?

\defineconversionset[frontpart:pagenumber][][romannumerals]

\definesectionblock[project][projectmatter]

\startsectionblockenvironment[project]
  \setcounter[userpage][1]
  \setuppagenumber[numberstarter=P-]
\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
  \setcounter[userpage][1]
\stopsectionblockenvironment

\startsectionblockenvironment[appendix]
  \setcounter[userpage][1]
  \setuppagenumber[numberstarter=APP-]
\stopsectionblockenvironment

\starttext

\startfrontmatter
\dorecurse{10}{\dontleavehmode\page}
\stopfrontmatter

\startprojectmatter
\dorecurse{10}{\dontleavehmode\page}
\stopprojectmatter

\startbodymatter
\dorecurse{10}{\dontleavehmode\page}
\stopbodymatter

\startappendices
\dorecurse{10}{\dontleavehmode\page}
\stopappendices

\stoptext

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
___


Re: [NTG-context] Expansion or Referencing problem

2014-02-06 Thread Wolfgang Schuster

Am 06.02.2014 um 11:32 schrieb Andreas Schneider :

> Hello,
> 
> I'm probably just stuck with another misunderstanding of TeX's expansion, but 
> I can't figure out how to fix it.
> 
> The attached example doesn't work as intended. My defined command produces 
> the correct reference name (as can be seen in the resulting .tuc file) but 
> still \about (and the other referencing commands) won't show/find it.
> 
> What am I missing here?

ConTeXt uses “::” as separator for references to external files.

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] Expansion or Referencing problem

2014-02-06 Thread Andreas Schneider
Title: Expansion or Referencing problem


Hello,

I'm probably just stuck with another misunderstanding of TeX's expansion, but I can't figure out how to fix it.

The attached example doesn't work as intended. My defined command produces the correct reference name (as can be seen in the resulting .tuc file) but still \about (and the other referencing commands) won't show/find it.

What am I missing here?

-- 
Best Regards,
Andreas\mainlanguage[en]

\def\moduleid{TEST}

\def\transaction{\dodoubleempty\dotransaction}
\def\dotransaction[#1][#2]{%
\getparameters[tr][module=\moduleid,#2]%
\global\def\refname{tr:\trmodule:#1}%
\doifreferencefoundelse{\refname}{}{\global\def\refname{tr::#1}}%
\about[\refname] (I want to go to: \refname)%
}

\starttext

\section[tr::Name]{Testsection}

Test.

\section{Reference}

\transaction[Name]

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

[NTG-context] Bookmarks with the specified label on

2014-02-06 Thread Lei WANG
I have specified the headnumber of chapter to be "the Number chpt".

By using \setuplist and \placelist with the attributes "label=yes",
I could get a content with the label as what I want.

But the headnumber of chapter label on bookmarks is still using "Number"
intead of  "the Number chpt".
What should I do to enable this feature?
A minimal example:

\setuplabeltext[en][chapter={the , chpt}]
\setupinteraction[state=start]
\placebookmarks[chapter,section]
\setupinteractionscreen[option=bookmark]


\setuplist[chapter,section,subsection][alternative=c]
\setuplist[chapter][distance=3em]
\setuplist[section][margin=2em]
\setuplist[subsection][margin=4em]

\starttext
\placelist[chapter,section,subsection][label=yes]
\chapter{first}
\input knuth
\chapter{second}
\input knuth
\section{second2}
\input knuth
\subsection{second3}
\input knuth
\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
___