Re: [NTG-context] Hanging indent

2015-03-12 Thread Willi Egger
Wow! this helps! Thank you so much for your answer.

best wishes

Willi
 On 12 mrt. 2015, at 01:02, Wolfgang Schuster schuster.wolfg...@gmail.com 
 wrote:
 
 
 Am 11.03.2015 um 18:23 schrieb Willi Egger cont...@boede.nl:
 
 Hello Wolfgang,
 
 thank you so much for looking into this matter again. Indeed now the hanging 
 indent works, provided that the paragraph das not start with {\bf 
 Aanslaan,}. It seems that there is interference with the bold-switch. So I 
 am puzzled again.
 
 You have to add \dontleavehmode in front of the font switch.
 
 \startHangPar
 \dontleavehmode{\bf Afleggen,}  beloeren, ongemerkt nagaan, verkennen. De 
 russen (rechercheurs) hebben hem afgelegen (beloerd). Dat spiese (huis) moet 
 eerst afgelegen worden. Een smeris legt je af. (Een agent bespiedt je).
 \stopHangPar
 
 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
 ___

___
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] Hanging indent

2015-03-11 Thread Wolfgang Schuster

 Am 11.03.2015 um 16:50 schrieb Willi Egger cont...@boede.nl:
 
 Dear Wolfgang,
 
 adding to my environment or using your code instead seems not to have the 
 desired result. I still have the situation as before… Using Context 2015-03-11

The following definition for the environment works:

\define\startHangPar
  {\begingroup\EveryPar{\hangafter\plusone\hangindent\emwidth\relax}}

\define\stopHangPar
  {\par\endgroup\blank[Afterhangingparagraph]}

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] Hanging indent

2015-03-11 Thread Willi Egger
Hello Wolfgang,

thank you so much for looking into this matter again. Indeed now the hanging 
indent works, provided that the paragraph das not start with {\bf Aanslaan,}. 
It seems that there is interference with the bold-switch. So I am puzzled again.

 \define\startHangPar
  {\begingroup\EveryPar{\hangafter\plusone\hangindent\emwidth\relax}}

\define\stopHangPar
 {\par\endgroup\blank[Afterhangingparagraph]}
 
\starttext
\startHangPar
\input knuth
\stopHangPar

\startHangPar
 Aanslaan,  aanspreken. Een poging in 't werk stellen. 
Ik zal dat heertje reis aanslaan. Sla dien broger (man) aan, misschien heeft 
hij poen (geld). Jongens, er moet aangeslagen worden, daar loopt mooi gajes 
(menschen daar wat van te halen is).
\stopHangPar

\startHangPar
Afleggen,  beloeren, ongemerkt nagaan, verkennen. De russen (rechercheurs) 
hebben hem afgelegen (beloerd). Dat spiese (huis) moet eerst afgelegen worden. 
Een smeris legt je af. (Een agent bespiedt je).
\stopHangPar

\startHangPar
{\bf  Aanslaan,}  aanspreken. Een poging in 't werk stellen. 
Ik zal dat heertje reis aanslaan. Sla dien broger (man) aan, misschien heeft 
hij poen (geld). Jongens, er moet aangeslagen worden, daar loopt mooi gajes 
(menschen daar wat van te halen is).
\stopHangPar

\startHangPar
{\bf Afleggen,}  beloeren, ongemerkt nagaan, verkennen. De russen 
(rechercheurs) hebben hem afgelegen (beloerd). Dat spiese (huis) moet eerst 
afgelegen worden. Een smeris legt je af. (Een agent bespiedt je).
\stopHangPar
\stoptext

Best wishes

Willi
 On 11 mrt. 2015, at 17:04, Wolfgang Schuster schuster.wolfg...@gmail.com 
 wrote:
 
 
 Am 11.03.2015 um 16:50 schrieb Willi Egger cont...@boede.nl:
 
 Dear Wolfgang,
 
 adding to my environment or using your code instead seems not to have the 
 desired result. I still have the situation as before… Using Context 
 2015-03-11
 
 The following definition for the environment works:
 
 \define\startHangPar
  {\begingroup\EveryPar{\hangafter\plusone\hangindent\emwidth\relax}}
 
 \define\stopHangPar
  {\par\endgroup\blank[Afterhangingparagraph]}
 
 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
 ___

___
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] Hanging indent

2015-03-11 Thread Wolfgang Schuster

 Am 11.03.2015 um 18:23 schrieb Willi Egger cont...@boede.nl:
 
 Hello Wolfgang,
 
 thank you so much for looking into this matter again. Indeed now the hanging 
 indent works, provided that the paragraph das not start with {\bf Aanslaan,}. 
 It seems that there is interference with the bold-switch. So I am puzzled 
 again.

You have to add \dontleavehmode in front of the font switch.

\startHangPar
\dontleavehmode{\bf Afleggen,}  beloeren, ongemerkt nagaan, verkennen. De 
russen (rechercheurs) hebben hem afgelegen (beloerd). Dat spiese (huis) moet 
eerst afgelegen worden. Een smeris legt je af. (Een agent bespiedt je).
\stopHangPar

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] Hanging indent

2015-03-10 Thread Willi Egger
Hello everybody,


Currently I am typesetting a small dictionary. I want to have hanging indents 
if the text joined to the expression is longer than one line.

In the past I had this definitions:

\defineblank[Afterhangingparagraph][1pc]

\starttext
\def\Hangindent{\hangafter=1\hangindent=1em}

\definestartstop[HangPar]
 [before={\bgroup\appendtoks\Hangindent\to\everypar},
  after={\egroup\blank[Afterhangingparagraph]}]


\starttext
\startHangPar
\input knuth
\stopHangPar

\startHangPar
{\bf Aanslaan,}  aanspreken. Een poging in 't werk stellen. 

Ik zal dat heertje reis aanslaan. Sla dien broger (man) aan, misschien heeft 
hij poen (geld). Jongens, er moet aangeslagen worden, daar loopt mooi gajes 
(menschen daar wat van te halen is).
\stopHangPar
\stoptext


The strange thing is, that the first two paragraphs of the Knuth-text is 
showing a hanging indent, however the last paragraph does not which is 
unexpected.  In the example from the dictionary no hanging indentation is shown.

What do I mis here?

Kind regards

Willi
___
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] Hanging indent

2015-03-10 Thread Wolfgang Schuster

 Am 10.03.2015 um 22:00 schrieb Willi Egger cont...@boede.nl:
 
 Hello everybody,
 
 
 Currently I am typesetting a small dictionary. I want to have hanging indents 
 if the text joined to the expression is longer than one line.
 
 In the past I had this definitions:
 
 \defineblank[Afterhangingparagraph][1pc]
 
 \starttext
 \def\Hangindent{\hangafter=1\hangindent=1em}
 
 \definestartstop[HangPar]
 [before={\bgroup\appendtoks\Hangindent\to\everypar},
 after={\egroup\blank[Afterhangingparagraph]}]
 
 
 \starttext
 \startHangPar
   \input knuth
 \stopHangPar
 
 \startHangPar
 {\bf Aanslaan,}  aanspreken. Een poging in 't werk stellen. 
 
 Ik zal dat heertje reis aanslaan. Sla dien broger (man) aan, misschien heeft 
 hij poen (geld). Jongens, er moet aangeslagen worden, daar loopt mooi gajes 
 (menschen daar wat van te halen is).
 \stopHangPar
 \stoptext
 
 
 The strange thing is, that the first two paragraphs of the Knuth-text is 
 showing a hanging indent, however the last paragraph does not which is 
 unexpected.  In the example from the dictionary no hanging indentation is 
 shown.
 
 What do I mis here?

You have to add \par at the end of your environment, i.e.

\definestartstop
  [HangPar]
  [before=\begingroup\EveryPar{\hangafter\plusone\hangindent\emwidth\relax},
   after={\par\endgroup\blank[1pc]}]

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] Hanging indent in startstoplines for poems

2010-03-31 Thread Wolfgang Schuster

Am 30.03.10 23:34, schrieb Torsten Suhling:

Hello,

thanks for the help, attached snippet seems to work.

So I guess my question basicly was caused by misunderstandings
in using define/setup commands.

Is there a document describing the grammar of context---how to
use or to combine \setupsomething, \definesomething
ttartstosomethig or \setupanything{something=[]}?

Just combine them in the way you need it in your document.

http://pragma-ade.com/show-man-10.htm

 Wolfgang Schuster wrote:

 % style={\setupalign[flushleft,nothyphenated]},
 style={\raggedright\nohyphens},

Sorry for stupid question, but is there a difference
between \nohyphens and \nothyphenated ?

The second line are the commands which are used when your write
\setupalign[flushleft,nothyphenated] but when I wrote my mail
it wasn't possible to use \setupalign with the style key
(works now but i guess only in mkiv).

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] Hanging indent in startstoplines for poems

2010-03-30 Thread Torsten Suhling

Hello,

thanks for the help, attached snippet seems to work.

So I guess my question basicly was caused by misunderstandings
in using define/setup commands.

Is there a document describing the grammar of context---how to
use or to combine \setupsomething, \definesomething
ttartstosomethig or \setupanything{something=[]}?

 Wolfgang Schuster wrote:

 % style={\setupalign[flushleft,nothyphenated]},
 style={\raggedright\nohyphens},

Sorry for stupid question, but is there a difference
between \nohyphens and \nothyphenated ?


Thanks

Torsten

%- snip --

\setupoutput[dvi]

\setupwhitespace[1.2em]

\definestartstop[verse]
 [command={%
   \setupwhitespace[1.2em]%   
  },style={%

   \raggedright\nohyphens%
 },before={%
   \setuplines[indenting={yes,-2em,first}]%
   \setupnarrower[left=2em]%
   \startnarrower[left]% blockindent only left
   \startlines%
  },after={%
   \stoplines%
   \stopnarrower%
   \setuplines[indenting={no}]% must be reseted
   \endgraf%
 }]

\starttext

Three lines, first should be broken:

\startverse
FIRST---this should be one line, please remove linebreaks, made by the 
mail programms, until HERE.

SECOND---next line without carriage return or line feed,
THIRD---startstoplines accept linebreaks, so this is a new line.
FOURTH---fourth line also do not make much words.
\stopverse

\stoptext

%- snip --














___
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] Hanging indent in startstoplines for poems

2010-03-29 Thread Torsten Suhling


Hello,

I have a question regarding hanging indentation in
startstoplines-environment.

So I try to use ConTeXt to typeset poems. In some texts/poems
ar long lines, which have to be broken. They should be broken
into hanging indentations.

That means:

Every line of poem should start left.
If a poemline is longer than text width, the rest of this line
   should be indented in a new text line. (just like here)
The width of this indentation should be fixed (e.g. 3em).
The width of this indentation shouldn't depend on a word.
It would be fine, if I don't have to set (poem)linebreaks.

   Additionally, it should still be able to indent a verse
   (e.g. a chorus), for instance using narrower.
   Hyphenation should be switched off inside the poems.

So I found \setuphanging, but these instruction seems made
another job---indenting a paragraph to be placed right beside
the first words of the paragraph.

That's the example, which does not work (all lines are indented)


%-- snip ---

\definestartstop[verse]
 [command={\setupwhitespace[1.2em]}%   % follow the grid
  ,before={\setupindenting[-2em,yes]%  % trial to construct
   \startnarrower[2em]%%   hanging indent
   \startalignment[flushleft]% % even inter-word-dist.
   \startlines%%   no justification
   \indenting[first]}%
   ,after={\stoplines%
   \stopalignment%
   \stopnarrower%
   \endgraf}]

\starttext

Three lines, first should be broken:

\startverse
FIRST---this should be one line, please remove linebreaks made by the
mail programms or similiar possibly until HERE.
SECOND---next line without carriage return or line feed,
THIRD---because startstoplines accept linebreaks.
FOURTH---is also one who don't make much words.
\stopverse

\stoptext

%-- snap ---

Any idea how to do that?

Thanks for help

Torsten


___
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] Hanging indent in startstoplines for poems

2010-03-29 Thread Wolfgang Schuster

Am 29.03.10 17:29, schrieb Torsten Suhling:


Hello,

I have a question regarding hanging indentation in
startstoplines-environment.

So I try to use ConTeXt to typeset poems. In some texts/poems
ar long lines, which have to be broken. They should be broken
into hanging indentations.

Any idea how to do that?

\definelines
  [verse]
  [indenting={yes,-2em,first},
   before={\startnarrower[2em]},
   after=\stopnarrower,
%   style={\setupalign[flushleft,nothyphenated]},
   style={\raggedright\nohyphens},
   ]

@Hans, can you change \setupalign to

\unexpanded\def\setupalign
  {\dosingleargument\dosetupalign}

else it can't be used in the style key.

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] Hanging indent in startstoplines for poems

2010-03-29 Thread Hans Hagen

On 29-3-2010 17:53, Wolfgang Schuster wrote:

Am 29.03.10 17:29, schrieb Torsten Suhling:


Hello,

I have a question regarding hanging indentation in
startstoplines-environment.

So I try to use ConTeXt to typeset poems. In some texts/poems
ar long lines, which have to be broken. They should be broken
into hanging indentations.

Any idea how to do that?

\definelines
[verse]
[indenting={yes,-2em,first},
before={\startnarrower[2em]},
after=\stopnarrower,
% style={\setupalign[flushleft,nothyphenated]},
style={\raggedright\nohyphens},
]

@Hans, can you change \setupalign to

\unexpanded\def\setupalign
{\dosingleargument\dosetupalign}

else it can't be used in the style key.


sure, but i'd expected you to implement a proper align=... then -)

i made a few more in that module unexpanded

i'll upload a beta in a couple of minutes so you were just in time

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


Re: [NTG-context] Hanging indent in startstoplines for poems

2010-03-29 Thread Wolfgang Schuster

Am 29.03.10 18:51, schrieb Hans Hagen:

@Hans, can you change \setupalign to

\unexpanded\def\setupalign
  {\dosingleargument\dosetupalign}

else it can't be used in the style key.

sure, but i'd expected you to implement a proper align=... then -)
no problem but what comes next, spacebefore/after, setups, 
interlinespace ...


new keys are a way is it a good idea to add a new one just to use have a 
setup function like alignment?


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
___