Re: [NTG-context] float/figure and wrapping text

2006-01-04 Thread Hans Hagen

Randolph Bertin wrote:

I am typesetting books, primarily text and images. My original 
background is Quark/InDesign, but quite recently, I decided to look 
into TeX/LaTeX (LaTeX because that is just what most of the TeX 
references refer to). I first spent some time trying to learn LaTeX 
and although I was able to accomplish a number of my desired goals, I 
began to run into some problems related to maintaining text on a 
baseline grid. When searching for solutions, I came across a reference 
to ConTeXt. My first impressions are that ConTeXt looks great, and 
would handle most of what I would like to accomplish with a nice 
uniform approach. I haven't explored many of the features I will need 
to use, but am trying to read the manuals and listserv archives and 
basically trying things out to see how things function.


So, I am sure I will have a number of questions that will later turn 
out to seem obvious (often the case, I guess for the uninitiated). 
Eventually, I might even be able to answer a couple of questions


But, to begin, one thing I would like to do for a project I am working 
on is to wrap continuous text around an image (placed on one side of 
the main text body), and I am encountering a little difficulty.


The basic situation in my document is that the figure can float, to be 
inserted at the next available spot, placed at the left or right 
margin, with text above (if there is space), to the side, and below 
(if there is space).


First, it appears that TeX, LaTeX and ConTeXt can only place a figure 
next to text at the beginning of a paragraph. Is this correct?


Second, using ConText, when I use \placefigure, if there is enough 
space on a page, it appears to place it, and wrap text around the 
side. Everything looks fine. But, if there is not enough space 
remaining on the page, the remainder of the page is left blank, and 
then the figure is placed at the beginning of the next page, with text 
wrapped around it. (That is both what I observed, and also I read in 
the Details document as the expected behavior). If I use 
\placefloat, if there is not enough space remaining on the page, the 
text will continue printing on the page and the float will be placed 
on the next page, BUT without any text to the side of it.


What I would like is to be able to combine these two behaviors when 
placing a floating figure: If there is enough space on the page, it 
would place the figure there and wrap text around it (as it currently 
does for \placefigure). If there is not enough space, it will 'float' 
the figure and continue with the text on the current page (as it does 
with \placefloat, but not with \placefigure) and insert the figure on 
a subsequent page when there is space, wrapping the text around the 
figure at that point (again as it does with \placefigure, but does not 
seem to do with \placefloat).


Is it possible to do this using a current set of ConTeXt control 
sequences and maybe I am just missing something? If not, is this 
something that can be implemented? (I don't have any experience with 
lower level TeX macro programming). All of what I am looking for is 
already there, but not all in one control sequence.


you can move the graphic with:

\starttext

\hangsidefloat[3] \placefigure[left]{}{} \input zapf \input zapf \input zapf

\movesidefloat[3*line] \placefigure[left]{}{} \input zapf \input zapf 
\input zapf


\stoptext

this is still page bound

\movesidefloat[x=10pt,y=-30pt]

also works, as does:

\placefigure[left,3*line]{}{} \input zapf \input zapf \input zapf

and in the next version:

\placefigure[left,3*hang]{}{} \input zapf \input zapf \input zapf

will work as well (i cannot post a patch because i first need to upload 
the version with the french interface)


Hans

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] widgets in layers (property)

2006-01-04 Thread Peter Rolf
New year, old problem...

Hi all,

I want to use widgets (tooltip, buttons,..) in some stacked pdf layers.
My problem is, that the widgets are somehow not bound to the state of
their layer. They are still active, even if the surrounding layer is
deactivated.

I add a mimimal example (it's best to open the 'Layers' tab in acrobat).
The first layer with tooltip is not active, the second one is active,
but has no tooltip.
Just move the mouse over the text and you can see the tooltip from the
deactivated layer one. I have also tried it with a fieldstack, but
'annotations cannot be inside an XForm'.

Any hints are welcome.

Peter



% interface=en output=pdftex
% Time-stamp: Freitag, 30 Dezember 2005 13:54:11; test.tex
%
\setupcolors[state=start]
\setupinteraction[state=start]


\starttext

\def\Stackbox#1{\nointerlineskip\vbox\bgroup\wd#1=\zeropoint\ht#1=\zeropoint\dp#1=\zeropoint
  \dontleavehmode\noindent\box#1\egroup}

\defineproperty[layer1][layer][title={one}, state=stop]
\defineproperty[layer2][layer][title={two}, state=start]


\newbox\Layerbox

\startproperty[layer1]
\setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=red]
  {\tooltip{First Layer with tooltip}{widget of layer one is active}}}
\Stackbox\Layerbox
\stopproperty
\startproperty[layer2]
\setbox\Layerbox\vbox{\framed[width=160mm,height=120mm,framecolor=green,frameoffset=1pt]
  {Second Layer without tooltip}}
\Stackbox\Layerbox
\stopproperty


\stoptext


%%% Local Variables:
%%% mode: context
%%% TeX-master: 
%%% End:


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] present for mojca

2006-01-04 Thread Tobias Burnus

Hi,

Hans Hagen wrote:

see attached file for usage
%D   [   file=m-gnuplot,
  


This does not work here, the produced .gpd file looks like:
---
^Mset title trigonometry^Mset terminal postscript
set output gpl-gnuplot-1.ps
^Mplot sin(x)
end
---
^M stands for \r (Carridge, decimal 13, hex 0d, oct 015).

I frankly don't understand why one does not get a \n (linefeed, decimal 
10/0A/012) or a ;\n for that matter [\def\par{;\rawcharacter{10}}].


Tobias
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \input inside of modules

2006-01-04 Thread Peter Rolf
Hi,

I've some trouble with modules and their (nested) input. The module is
found (in context/user), but the input file, that is called inside that
module (same dir), is not found.

example:

\usemodule[foo] % is found


inside [t-foo.tex]:
...
  \input foo-bar \relax % same dir, but it's not found
...

It seems, that only typescripts and modules are found inside my user
dir. How can I change this behaviour? kpsewhich can find all files.

Currently I'm using CTXDEVTXPATH to fix this, but there must be a better
way.

Thanks in advance

Peter
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] float/figure and wrapping text

2006-01-04 Thread Hans Hagen

Randolph Bertin wrote:



On Wednesday, January 4, 2006, at 05:00  AM, 
[EMAIL PROTECTED] wrote:



you can move the graphic with:

\starttext

\hangsidefloat[3] \placefigure[left]{}{} \input zapf \input zapf 
\input zapf


\movesidefloat[3*line] \placefigure[left]{}{} \input zapf \input zapf
\input zapf

\stoptext

this is still page bound

\movesidefloat[x=10pt,y=-30pt]

also works, as does:

\placefigure[left,3*line]{}{} \input zapf \input zapf \input zapf

and in the next version:

\placefigure[left,3*hang]{}{} \input zapf \input zapf \input zapf

will work as well (i cannot post a patch because i first need to upload
the version with the french interface)

Hans






I tried all of the above examples, but all end up with the same result 
I already have, namely, 



that's intended (ok, you can play with the hang to force a graphic to a 
next page but then you hav esemi automated makeup)


if there is not enough room to fit the figure (in my project, this is 
an image) on the current page, a page break is issued (leaving the 
bottom portion of the page blank). What I would like to happen, is to 
go ahead and begin the next paragraph to fill the current page, and 
then place the graphic on the subsequent page (with text to the side).


that's what the attached file was doing ... keep in mind that this 
really stretches tex to the limits

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] present for mojca

2006-01-04 Thread Hans Hagen

Tobias Burnus wrote:


Hi,

Hans Hagen wrote:


see attached file for usage
%D   [   file=m-gnuplot,
  



This does not work here, the produced .gpd file looks like:
---
^Mset title trigonometry^Mset terminal postscript
set output gpl-gnuplot-1.ps
^Mplot sin(x)
end
---
^M stands for \r (Carridge, decimal 13, hex 0d, oct 015).

I frankly don't understand why one does not get a \n (linefeed, 
decimal 10/0A/012) or a ;\n for that matter 
[\def\par{;\rawcharacter{10}}].



do you use the natural.ctx file when building the format?

don't ask me why, but for some obscure reasons tex distributions like to 
default to a not so 255  tcx setup (called 255 -)


you really need to make sure that locales are ignored

maybe \def\par{; } also works here, i dunny how long gnuplot lines may be

Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \input inside of modules

2006-01-04 Thread Taco Hoekwater



Peter Rolf wrote:

Hi,

I've some trouble with modules and their (nested) input. The module is
found (in context/user), but the input file, that is called inside that
module (same dir), is not found.


Works for me, so something else must be wrong. What is the
exact log message?

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to do this in ConTeXt

2006-01-04 Thread R S Ananda Murthy

Hello,

I need the format shown below:

-
|Example 1-1|
-

Here Example 1-1 should be in a black box and text should be in white. 
The line attached to this box should run up to the right margin.
I need a counter for examples to count up and display the example number 
as shown above for more examples. I am new to ConTeXt. So, I need help.


Thanks for your help.

Anand
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \input inside of modules

2006-01-04 Thread Hans Hagen

Peter Rolf wrote:


Hi,

I've some trouble with modules and their (nested) input. The module is
found (in context/user), but the input file, that is called inside that
module (same dir), is not found.

example:

\usemodule[foo] % is found


inside [t-foo.tex]:
...
 \input foo-bar \relax % same dir, but it's not found
...

It seems, that only typescripts and modules are found inside my user
dir. How can I change this behaviour? kpsewhich can find all files.

Currently I'm using CTXDEVTXPATH to fix this, but there must be a better
way.
 


did you run mktexlsr?

there is no way that context can influence \input

Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \input inside of modules

2006-01-04 Thread Peter Rolf
Taco Hoekwater wrote:
 
 
 Peter Rolf wrote:
 Hi,

 I've some trouble with modules and their (nested) input. The module is
 found (in context/user), but the input file, that is called inside that
 module (same dir), is not found.
 
 Works for me, so something else must be wrong. What is the
 exact log message?

Sorry, *tex user malfunction*. The inclusion works here as well.

It seems to be a problem of my environment file (which loads the module
and a private style file with non default parameter setup for this
module). I mixed this style file with the directly included files of the
module. Too much confusion for me today. :(

I skipped finding the error some time ago and 'fixed' it by copying all
files into the local dir. What a mess!
So thanks for the fast reply and I must apologize again for the noise.

Greetings, Peter

 Taco
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
 
 

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] th nd and rd

2006-01-04 Thread Adam Lindsay

John R. Culleton wrote:

On Friday 30 December 2005 04:35 pm, Mojca Miklavec wrote:


\def\enordinalnumber#1%
 {#1\ifnum\lasttwodigits{#1}=11
\highordinalstr{th}%
  \else\ifcase\lastdigit{#1}%
\highordinalstr{th}%
  \or % 1
\highordinalstr{st}%
  \or % 2
\highordinalstr{nd}%
  \or % 3
\highordinalstr{rd}%
  \else
\highordinalstr{th}%
  \fi\fi}

And use it as:

\enordinalnumber{1}
\enordinalnumber{2}
\enordinalnumber{3}
\enordinalnumber{4}
\enordinalnumber{5}
\enordinalnumber{100}
...



It is stored now as part of my standard macro pack for Context.
Thanks to all. 


As I was just reminded by a British Telecom website (which confirmed 
that I was moving on the 13rd), I'm used to two more exceptions 
(suggested as a patch):


\def\enordinaldaynumber#1%
  {#1\ifnum\lasttwodigits{#1}=11
 \highordinalstr{th}%
   \else\ifnum\lasttwodigits{#1}=12
 \highordinalstr{th}%
   \else\ifnum\lasttwodigits{#1}=13
 \highordinalstr{th}%
   \else\ifcase\lastdigit{#1}%
 \highordinalstr{th}%
   \or % 1
 \highordinalstr{st}%
   \or % 2
 \highordinalstr{nd}%
   \or % 3
 \highordinalstr{rd}%
   \else
 \highordinalstr{th}%
   \fi\fi\fi\fi}


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] th nd and rd

2006-01-04 Thread Hans Hagen

Adam Lindsay wrote:

As I was just reminded by a British Telecom website (which confirmed 
that I was moving on the 13rd), I'm used to two more exceptions 
(suggested as a patch):


\def\enordinaldaynumber#1%
  {#1\ifnum\lasttwodigits{#1}=11
 \highordinalstr{th}%
   \else\ifnum\lasttwodigits{#1}=12
 \highordinalstr{th}%
   \else\ifnum\lasttwodigits{#1}=13
 \highordinalstr{th}%
   \else\ifcase\lastdigit{#1}%
 \highordinalstr{th}%
   \or % 1
 \highordinalstr{st}%
   \or % 2
 \highordinalstr{nd}%
   \or % 3
 \highordinalstr{rd}%
   \else
 \highordinalstr{th}%
   \fi\fi\fi\fi}


ok, patched

Hans

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] How to do this in ConTeXt

2006-01-04 Thread R S Ananda Murthy

Hello,

I need the format shown below:

-
|Example 1-1|
-

Here Example 1-1 should be in a black box and text should be in white.
The line attached to this box should run up to the right margin.
I need a counter for examples to count up and display the example number
as shown above for more examples. I am new to ConTeXt. So, I need help.

Thanks for your help.

Anand

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \input inside of modules

2006-01-04 Thread Hans Hagen

Peter Rolf wrote:


Taco Hoekwater wrote:
 


Peter Rolf wrote:
   


Hi,

I've some trouble with modules and their (nested) input. The module is
found (in context/user), but the input file, that is called inside that
module (same dir), is not found.
 


Works for me, so something else must be wrong. What is the
exact log message?

   


Sorry, *tex user malfunction*. The inclusion works here as well.

It seems to be a problem of my environment file (which loads the module
and a private style file with non default parameter setup for this
module). I mixed this style file with the directly included files of the
module. Too much confusion for me today. :(

I skipped finding the error some time ago and 'fixed' it by copying all
files into the local dir. What a mess!
So thanks for the fast reply and I must apologize again for the noise.
 

we should find a suitable punishment for this, like, write an article 
for the maps or help patrick cleaning up the wiki or so -)

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] How to do this in ConTeXt

2006-01-04 Thread Fabrice Larribe

Hi,

R S Ananda Murthy wrote:


Hello,

I need the format shown below:

-
|Example 1-1|
-


\setupoutput[pdftex]
\setupcolors[state=start]


Here is (almost) what you want to acheive, but without any macros:
\blank
\starttext
%\def\Ex#1{ \line{\framed{\red #1}} }
\line{
 \framed[background=color,backgroundcolor=black]{
   { {\white Exemple 1.1\ }}}\hfill
 }
\hrule
\blank
To have numbers, you should use ennumeration.. And a try.. but I don't 
know how to adjust things... Others have to complete...


\defineenumeration[Exemple][location=serried,headstyle=bold,width=broad,
text={\framed[background=color,backgroundcolor=black]{\red\sc 
Exemple}\textrule},margin=0.5cm,before=\blank,after=\blank]


\startExemple
This is a nice exemple.
\stopExemple


This is the end.
\stoptext

F.


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] About 'repeat' option of \startitemize

2006-01-04 Thread Radhelorn

Radhelorn wrote:
I have another observation in 
behaviour of 'repeat' option but will try to experiment with this a 
little more. This itm module is too elaborate.




After Taco's t-itmfix I've came up with my own little fix. Please observe.


--
Radhelorn [EMAIL PROTECTED]
\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
  {\ifconditional\textlistitem
% begin of item
   \else
  \par
   \fi
%\ignorespaces
   \increment\noflistelements
   \ifnum\itemcolumndepth=\zerocount \ifconditional\optimizelistitem
 \ifnum\noflistelements=\plusone% tgv bv kolommen/nesting
   \findtwopassdata\s!list{\noflists:}% % wordt soms de volgorde
 \fi% verstoord, vandaar \find
 \iftwopassdatafound
   \ifcase0\twopassdata\relax \twopassdatafoundfalse \fi
 \fi
 \iftwopassdatafound
   \ifnum\twopassdata=3
 \ifnum\noflistelements1
   \doitembreak\itemnobreak
 \fi
   \else\ifnum\twopassdata3
 \ifnum\noflistelements=2
   \ifconditional\introlistitem
 \doitembreak\nobreak
   \else
 \doitembreak\itemnobreak
   \fi
 \else\ifnum\twopassdata=\noflistelements\relax
   \doitembreak\itemnobreak
\else\ifnum\noflistelements2
   \doitembreak\itembreak
 \else
   \ifconditional\introlistitem\else\doitembreak\itembreak\fi
 \fi\fi\fi
   \fi\fi
 \fi
   \fi\fi
   \noindent
   \setbox8\hbox
 {\ifconditional\headlistitem
\ifconditional\symbollistitem
  \symsymbol
\else
  \doitemattributes\itemlevel\c!headstyle\c!headcolor{\listitem}%
\fi
  \else
\ifconditional\symbollistitem
  \symsymbol % no attributes, why?
\else
  \doitemattributes\itemlevel\c!style\c!color{\listitem}%
\fi
  \fi}%
   \doifsomething\somdestination
 {\setbox8\hbox{\goto{\box8}[\somdestination]}}%
   \globallet\somdestination\empty
   \dimen2=\getitemparameter\itemlevel\c!width\relax
   % new, prevents loops when symbol is (not yet found) graphic
   \ht8=\strutheight
   \dp8=\strutdepth
   % so that content differs per run (esp mp graphics afterwards)
\checkforrepeatedlistitem
   \ifdim\dimen2\zeropoint\relax
 \llap{\ifconditional\sublistitem\llap{+}\fi\box8\hskip\leftmargindistance}%
   \else
 \ifdim\dimen2=\zeropoint\relax
   \calculatelistwidth1{\dimen0}%
 \else
   \calculatelistwidth\itemlevel{\dimen0}%
 \fi
 \ifconditional\textlistitem
   \hbox{\ifconditional\sublistitem+\fi\box8\hskip\fontdimen2\font}\nobreak
 \else\ifconditional\inlinelistitem
   \hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}%
 \else\ifconditional\txtlistitem
   \dodotxtitem
   % \hskip-\dimen0 this makes them touch
 \else
   % todo: align+marge binnen de hbox
   \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}}%
   \hskip\fullwidth % added for 'repeat' option fix
 \fi\fi\fi
   \fi
\forceunexpanded % needed for m conversion (\os) / i need to look into this
   \setevalue{\@@currentitemsymbol\itemlevel}%
 {\getvalue{\@@localitemsymbol\itemlevel}}% still problems with \uchar ?
%{\noexpand\getvalue{\@@localitemsymbol\itemlevel}}% no, spoils subrefs
   \resetunexpanded
   \setfalse\headlistitem
   \setfalse\sublistitem
   \setfalse\symbollistitem
   \EveryPar{\ignorespaces}% needed ?
   \ignorespaces}

% I don't think this is the best way but it will require minimal
% change to the original sources.

\def\checkforrepeatedlistitem
 {\global\newdimen\fullwidth
  \ifnum\itemlevel=\plusone
\initializeboxstack{item}%
  \fi
  \ifconditional\repeatlistitem
 \savebox{item}{\itemlevel}{\hbox{\copy8}}%
 \setbox8\hbox to \wd8
  {\setbox\scratchbox\hbox
 {\scratchcounter\itemlevel
  \advance\scratchcounter\minusone
  \dorecurse\scratchcounter{\foundbox{item}{\recurselevel}}}%
   \ifnum\itemlevel\plusone
 \ifdim\wd\scratchbox\zeropoint
   %\hskip-\dimen2
   \global\advance\fullwidth\wd\scratchbox
   \box\scratchbox
 \fi
   \fi
   \box8}%
  \fi}
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] float/figure and wrapping text

2006-01-04 Thread Randolph Bertin


On Wednesday, January 4, 2006, at 10:12  AM, Hans Hagen wrote:


Randolph Bertin wrote:



On Wednesday, January 4, 2006, at 05:00  AM, Hans wrote:


you can move the graphic with:

\starttext

\hangsidefloat[3] \placefigure[left]{}{} \input zapf \input zapf 
\input zapf


\movesidefloat[3*line] \placefigure[left]{}{} \input zapf \input zapf
\input zapf

\stoptext

this is still page bound

\movesidefloat[x=10pt,y=-30pt]

also works, as does:

\placefigure[left,3*line]{}{} \input zapf \input zapf \input zapf

and in the next version:

\placefigure[left,3*hang]{}{} \input zapf \input zapf \input zapf

will work as well (i cannot post a patch because i first need to 
upload

the version with the french interface)

Hans






I tried all of the above examples, but all end up with the same 
result I already have, namely,



that's intended (ok, you can play with the hang to force a graphic to 
a next page but then you hav esemi automated makeup)


if there is not enough room to fit the figure (in my project, this is 
an image) on the current page, a page break is issued (leaving the 
bottom portion of the page blank). What I would like to happen, is to 
go ahead and begin the next paragraph to fill the current page, and 
then place the graphic on the subsequent page (with text to the  side).


that's what the attached file was doing ... keep in mind that this 
really stretches tex to the limits




Hans, I'm not sure what you mean by attached file. Are you referring to 
the examples above?


Maybe I am asking the question in the wrong way.

First, I want to make sure that the behavior I am observing is what one 
would expect:
Namely, if there is not enough room on a page, \placefloat will 
*continue setting text on that page* and then put the float at the 
beginning of the next page. But, for \placefigure if there is not 
enough room on a page it will *issue a page break* and begin a new page 
with with figure, leaving the remainder of the previous page blank.


Is there a way to get wrapped around a figure placed using \placefloat?

Randolph

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] How to do this in ConTeXt

2006-01-04 Thread Hans Hagen

Fabrice Larribe wrote:


Hi,

R S Ananda Murthy wrote:


Hello,

I need the format shown below:

-
|Example 1-1|
-


\setupoutput[pdftex]
\setupcolors[state=start]


Here is (almost) what you want to acheive, but without any macros:
\blank
\starttext
%\def\Ex#1{ \line{\framed{\red #1}} }
\line{
 \framed[background=color,backgroundcolor=black]{
   { {\white Exemple 1.1\ }}}\hfill
 }
\hrule
\blank
To have numbers, you should use ennumeration.. And a try.. but I don't 
know how to adjust things... Others have to complete...


\defineenumeration[Exemple][location=serried,headstyle=bold,width=broad,
text={\framed[background=color,backgroundcolor=black]{\red\sc 
Exemple}\textrule},margin=0.5cm,before=\blank,after=\blank]


\startExemple
This is a nice exemple.
\stopExemple


This is the end.
\stoptext

F.


one of you has to wikify this answer ...

\setupcolors[state=start]
\setupbackgrounds[text][text][background=color,backgroundcolor=red,backgroundoffset=3pt]

\defineenumeration
 [example]
 [way=bychapter,
  separator=\compoundhyphen,
  chapternumber=yes,
  color=white,
  command=\exampleframed]

\defineframed
 [exampleframed]
 [background=color,
  backgroundcolor=white,
  foregroundcolor=black,
  style=bold,
  frame=off]

\starttext

\chapter{One}

\input tufte

\startexample
   \input tufte
\stopexample

\input tufte

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] e-trema

2006-01-04 Thread Willi Egger

Hi Taco,

thanks indeed for this! - I felt already, that it would be a difficult 
matter to organize this switch from e-trema to normal e. Still I am glad 
that there is this solution
I will try it in \hypenation{po\discretionary{-}{e}{ë}zie. If this 
works, then it is enough for the moment.


Thanks

Willi

Taco Hoekwater wrote:



Hi Willi,

On the lowest level, \discretionary{-}{e}{ë} does this, so
   po\discretionary{-}{e}{ë}zie
is hyphenated correctly.

I doubt that there is a way to automate this (without changing
your input), though.

Cheers,
Taco


Willi Egger wrote:


Good evening!

While typesetting a Dutch text I am confronted with the problem, that 
in case of a hyphenation of the word poëzie must become po-ezie.

Does anybody know a solution in order to keep automatic hyphenation?

Kind regards

Willi
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] How to do this in ConTeXt

2006-01-04 Thread FabriceL.

Hi,

   Hans, it's so instructive to read yout post... I have learned from 
this last post 2 new commands !
However, I think the original poster wish a line who run to the right 
margin, so I added to your code
in the defineenumeration a inbetween=\vskip-4pt{\hrule height 
1.5pt}\blank. This is not very elegant,
but this works. By the way, I'm interested to know if there is a better 
solution.


 Hans wrote:
 one of you has to wikify this answer ...

I'm not sure how to do this, but I can try how this works.
The complete code follows.
FL.

\setupcolors[state=start]
\setupbackgrounds[text][text][background=color,backgroundcolor=darkred,backgroundoffset=3pt]

\defineenumeration
 [example]
 [way=bychapter,
  separator=\compoundhyphen,
  chapternumber=yes,
  color=white,
  command=\exampleframed,
  inbetween=\vskip-4pt{\hrule height 1.5pt}\blank]

\defineframed
 [exampleframed]
 [background=color,
  backgroundcolor=black,
  foregroundcolor=white,
  style=bold,
  frame=off]

\starttext

\chapter{One}

\input tufte

\startexample
   \input tufte
\stopexample

\input tufte

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] How to do this in ConTeXt

2006-01-04 Thread Hans Hagen

FabriceL. wrote:


Hi,

   Hans, it's so instructive to read yout post... I have learned from 
this last post 2 new commands !
However, I think the original poster wish a line who run to the right 
margin, so I added to your code
in the defineenumeration a inbetween=\vskip-4pt{\hrule height 
1.5pt}\blank. This is not very elegant,
but this works. By the way, I'm interested to know if there is a 
better solution.


 Hans wrote:
 one of you has to wikify this answer ...

I'm not sure how to do this, but I can try how this works.
The complete code follows.
FL.

\setupcolors[state=start]
\setupbackgrounds[text][text][background=color,backgroundcolor=darkred,backgroundoffset=3pt] 



\defineenumeration
 [example]
 [way=bychapter,
  separator=\compoundhyphen,
  chapternumber=yes,
  color=white,
  command=\exampleframed,
  inbetween=\vskip-4pt{\hrule height 1.5pt}\blank]



if you say \showstruts you will notice why you need to skip back; your 
4pt is a gamble, best do something:


\defineenumeration
[example]
[way=bychapter,
 separator=\compoundhyphen,
 chapternumber=yes,
 color=white,
 command=\exampleframed,
 inbetween=\setups{example:inbetween}]

\startsetups example:inbetween
   \removedepth % nils strut depth
   \nointerlineskip
   \blackrule[height=1.5pt,width=\hsize,depth=0pt]
   \blank
   \nobreak
\stopsetups

btw, this makes a nice example for a regression test


\defineframed
 [exampleframed]
 [background=color,
  backgroundcolor=black,
  foregroundcolor=white,
  style=bold,
  frame=off]

\starttext

\chapter{One}

\input tufte

\startexample
   \input tufte
\stopexample

\input tufte

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] difficult fonts again

2006-01-04 Thread Henning Hraban Ramm

I'm playing with special fonts again...

\starttypescript[map]   [delitsch]  [\defaultencoding]
\loadmapfile[\defaultencoding-klein-delitsch.map]
\stoptypescript

\starttypescript[handwriting]   [delitsch]  [\defaultencoding]
	\definefontsynonym	[DelitschAntiqua]	[\defaultencoding- 
delitschantiqua]	[encoding=\defaultencoding]

\stoptypescript

\starttypescript[handwriting]   [delitsch]  [name]
\definefontsynonym  [Handwriting]   [DelitschAntiqua]
\stoptypescript

\def\DelitschC#1{\getglyph{\defaultencoding-raw-delitschantiqua} 
{\char#1}}

%\def\DelitschC#1{\getglyph{Handwriting}{\char#1}} % no metrics
\definetextmodediscretionary D {\DelitschC{198}}
% ...
\definetextmodediscretionary t. {\DelitschC{209}}

With the Handwriting definition of \DelitschC I get the chars, but  
without metrics. Is that normal behaviour?



I need one big title and defined
\definefont[MainTitleFont][Handwriting at 36pt]

But in {\MainTitleFont |D|ie Winternach|t.|}
my discretionary characters stay in bodyfont size.

Is there a way to let these adapt to the actual size?

(I know I should solve this with virtual fonts etc., I'll try that  
later, if I stay unemployed...)



Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] float/figure and wrapping text (An Example)

2006-01-04 Thread Randolph Bertin
Here is an example illustrating the situation (and perhaps a problem or two):

---
\setuppapersize[letter]
\starttext

\input zapf 

\input zapf 

\input zapf 

\input zapf

If using placefigure without enough space left on the page, this will be the last paragraph, but if we use placefloat, part of the knuth text will appear before the break.

\hangsidefloat[2] \placeFLOGURE [left] {}{} \input knuth

\input zapf 

\input zapf

\stoptext





Where the example reads \placeFLOGURE just edit to read either \placefigure or \placefloat and then typeset the text. Afterwards, change it to the other, typeset, and note the difference in where the page breaks, and what happens on the subsequent page.

I have a couple of questions concerning the example.

(1) If you comment out one (or two) of the first set of \input zapf commands, then the \hangsidefloat[2]\placefigure works *beautifully*, with two lines of text above the figure, the next lines to the side, and then again, underneath the figure. 

However, when the example is run as originally specified (with all the '\input zapf' text), and the figure is pushed to the next page, for some reason the 2 lines that appeared above the figure now appear aligned with the lines to the side of the figure, with blank space above. Is this the correct behavior, or a bug, or am I just failing to understand the subtleties of hanging side floats?

(2) Even though I specify left when using \placefloat, it appears *centered* on the page. Again, is that the correct behavior, or a bug or am I just failing to understand the mechanism for float placement.

(3) Is there a way to have text wrap around a \placefloat or is that only a feature of \placefigure ?


Regards,
Randolph
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context