[NTG-context] Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread garulfo
Hi all,

Is it on purpose that 128 pages "https://wiki.contextgarden.net/Command/ 
" start with a space character ?
I didn't find an explanation in https://wiki.contextgarden.net/Command

For example, these two pages exist :
- https://wiki.contextgarden.net/Command/startbuffer
- https://wiki.contextgarden.net/Command/_startbuffer

If it is on purpose: 
- What is the purpose, and which page should contain which documentation?

If it is not: 
- Is there a way to automatically merge the content of the couple of pages, and 
to remove the "wrong" pages, or should it be done manually ?

Thanks for your help.

List :
Command/ attachment
Command/ background
Command/ bar
Command/ beginblock
Command/ button
Command/ characterkerning
Command/ comment
Command/ completecombinedlist
Command/ completelistoffloats
Command/ completelistofsorts
Command/ completelistofsynonyms
Command/ completeregister
Command/ copylabeltext
Command/ ctxfunction
Command/ ctxfunctiondefinition
Command/ currentlabel
Command/ delimitedtext
Command/ description
Command/ enumeration
Command/ fence
Command/ fraction
Command/ framed
Command/ framedtext
Command/ getbuffer
Command/ hbox
Command/ help
Command/ high
Command/ highlight
Command/ label
Command/ labellanguage
Command/ labeltext
Command/ labeltexts
Command/ language
Command/ leftlabeltext
Command/ linenote
Command/ low
Command/ lowhigh
Command/ lowmidhigh
Command/ margindata
Command/ mathcommand
Command/ mathdoubleextensible
Command/ mathextensible
Command/ mathframed
Command/ mathmatrix
Command/ mathornament
Command/ mathoverextensible
Command/ mathovertextextensible
Command/ mathradical
Command/ mathtriplet
Command/ mathunderextensible
Command/ mathundertextextensible
Command/ mathunstacked
Command/ nextparagraphs
Command/ note
Command/ ornament
Command/ paragraphs
Command/ placecombinedlist
Command/ placefloat
Command/ placelistoffloats
Command/ placelistofsorts
Command/ placelistofsynonyms
Command/ placement
Command/ placepairedbox
Command/ placeregister
Command/ presetlabeltext
Command/ referenceformat
Command/ register
Command/ rightlabeltext
Command/ script
Command/ section
Command/ seeregister
Command/ setupcombinedlist
Command/ setupitemgroup
Command/ setuplabeltext
Command/ setuppairedbox
Command/ setupregister
Command/ shift
Command/ sorting
Command/ startattachment
Command/ startbackground
Command/ startbuffer
Command/ startcolumnset
Command/ startcomment
Command/ startdelimitedtext
Command/ startdescription
Command/ starteffect
Command/ startenumeration
Command/ startfittingpage
Command/ startfloattext
Command/ startformula
Command/ startframedtext
Command/ starthelp
Command/ startindentedtext
Command/ startitemgroup
Command/ startlabeltext
Command/ startlinenote
Command/ startlines
Command/ startmakeup
Command/ startmathalignment
Command/ startmathcases
Command/ startmathmatrix
Command/ startmixedcolumns
Command/ startnarrower
Command/ startnote
Command/ startpagecolumns
Command/ startparagraphs
Command/ startparallel
Command/ startplacefloat
Command/ startplacepairedbox
Command/ startsection
Command/ startsectionblock
Command/ startstartstop
Command/ startstop
Command/ startstyle
Command/ starttabulate
Command/ starttextbackground
Command/ starttyping
Command/ startviewerlayer
Command/ startxtable
Command/ stoplinenote
Command/ style
Command/ synonym
Command/ textbackground
Command/ textnote
Command/ tooltip
Command/ type
Command/ typebuffer
Command/ unit
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How can I do this?

2024-03-08 Thread Otared Kavian
Hi Ursula,

The reason for which you did not get the expected result is that you have « } » 
missing in your file, that is the closing brace after your italic command
« {\it » at the end of your document. 
Moreover you did not have a \stoptext in your file, and a math command « \m » 
was not written correctly. Talking of math, I personnaly prefer to enclose 
in-line math between dollar signs $, that is writing « $\exists x \in H$ » 
instead of  « \m{\exists x \in H} ».

Also the way you write your text is somewhat « incorrect » (or as Mikael 
Sundqvist would put it, « interesting »…), since in principle all the setups 
and definitions must be before the body of your document which begns with 
\starttext. Another point i sthat instead of using \par you can leave a blank 
line, which makes the document more readable. And you don’t need to break the 
lines by « hand », since ConTeXt does it in a better way.
Finally instead of 
\blackrule[color=black, height=0.10ex, width=13.50cm]
you can use just \hairline, and the thickness and color of such a \hairline can 
be adjusted by 
\setupthinrules[rulethickness=4pt,color=darkgreen]
(for instance), which should be put before \starttext.

Best regards: Otared

% begin textbackground-Ursula.tex
\definetextbackground[myBG][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.8\bodyfontsize,
  rightoffset=.8\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off]

\setupnarrower[left=0.80cm, right=0.80cm]
\definehspace[oneem][0.5em]
\setupinteraction
   [state=start,
color=blue]

\usecolors[svg]
\setupinteraction
  [state=start,
   contrastcolor=cornflowerblue]
   
   
\starttext
\margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und 
Existenzquantor).}

{\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aussage 
h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich 
die Bedeutung der beiden Aussagen klar.}

\startitemize[n,packed,broad]
\item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}  

\item $∃f ∈ F : ∀m ∈ M : h(m, f)$.

\stopitemize


\startmyBG
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein $∃\forall∀ $ oder ein $\forall∀\m∃$ versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank

\startnarrower[left, right]

Der\hspace[oneem] Wert \hspace[oneem] von \hspace[oneem] 
\m{y = f(x)} ist unabhängig von der Wahl

von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} 

(Beutelspacher [10, S.54])

\blank
\stopnarrower
\stopmyBG


\blank

\blackrule[color=black, height=0.10ex, width=13.50cm]

\reference[Regel:1]{3.1}

{\bf Aufgabe 3.2.18} Formulieren Sie gemäß der Regel (\goto{3.1}[Regel:1]) 
äquivalent

\startitemize[n,packed,broad]

\item \m{\forall n \in \naturalnumbers\mtp{:} n^2 > n \implies n > 1},

\item \m{\forall n \in \naturalnumbers\mtp{:} 3\divides n \implies 4 \divides 
n},

\item \m{\forall n \in \naturalnumbers\mtp{:} n^3 \mtext{ ungerade }\nospace
\implies n \mtext{ ungerade}}.

\stopitemize

\blackrule[color=black, height=0.10ex, width=13.50cm]

{\bf Aufgabe 3.2.19} Bilden Sie die Verneinung der folgenden Aussagen:

\startitemize[n,packed,broad]
\item Alle Rosen sind verwelkt oder teuer.

\item Alle rosen sind entweder verwelkt oder teuer.

\stopitemize


\reference[Abschnitt:1]{3.2.1.1}

{\it Hinweis: Beachten Sie die Konvention aus Abschnitt 
\goto{3.2.1.1}[Abschnitt:1] die Formulierung \quotation {entweder ... oder} 
entspricht dem ausschließenden Oder
und die Formulierung \quotation{oder} dem (mathematischen) einschließenden
Oder.}

\blackrule[color=black, height=0.10ex, width=13.50cm]

\stoptext
% end textbackground-Ursula.tex


> On 6 Mar 2024, at 13:52, Ursula Hermann  wrote:
> 
> Dear List,
> I need a tip how to do this:
> In the command \definepapersize[Mybook] the height should be not 24 cm, but a 
> little bit longer. My Problem is, as you can see on the PDF, that there are 
> troubles with the Gray Background. The Gray Background should begin with : 
> Mitunter. . I think it should be the topoffset, and the bottomoffset, but how 
> many .\bodyfontsize should I try?
> Many thanks 
> Uschi 
> \mainlanguage[de]
> \definepapersize[MyBook][width=19cm,height=24cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[Times New Roman,12.55pt]
> \definemargindata  [MyInMargin][inright]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=p

[NTG-context] Re: textbackground spacing offset

2024-01-31 Thread Marco Patzer
On Wed, 31 Jan 2024 19:41:02 +0100
Hans Hagen  wrote:

> >> How do it get the same spacing as in the framedtext case?  
> > 
> > Is there a solution to this? Or an explanation why the spacing
> > differs?  
> these are fundamentally different mechanisms .. you can play with 
> \inframed in the second case

\inframed did make a difference, indeed. I'll check if I can obtain
the spacing I need. Thanks.

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: textbackground spacing offset

2024-01-31 Thread Hans Hagen

On 1/31/2024 7:15 PM, Marco Patzer wrote:

On Thu, 16 Nov 2023 13:52:05 +0100
Marco Patzer  wrote:


I'm having problems getting the textbackground spacing offset to work.
Example:

\setupframedtext
   [offset=overlay,
width=max,
depthcorrection=off]

\setuptextbackground
   [location=paragraph,
%% offset=overlay,   %% does nothing
%% backgroundoffset=overlay, %% does nothing
%% depthcorrection=off,  %% does nothing
%% topoffset=3mm,%% works, but only for positive values
background=,
frame=on]

\starttext
   \startframedtext
 \framed{Foo}
   \stopframedtext
   \starttextbackground
 \framed{Foo}
   \stoptextbackground
\stoptext

How do it get the same spacing as in the framedtext case?


Is there a solution to this? Or an explanation why the spacing
differs?
these are fundamentally different mechanisms .. you can play with 
\inframed in the second case


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: textbackground spacing offset

2024-01-31 Thread Marco Patzer
On Thu, 16 Nov 2023 13:52:05 +0100
Marco Patzer  wrote:

> I'm having problems getting the textbackground spacing offset to work.
> Example:
> 
> \setupframedtext
>   [offset=overlay,
>width=max,
>depthcorrection=off]
> 
> \setuptextbackground
>   [location=paragraph,
>%% offset=overlay,   %% does nothing
>%% backgroundoffset=overlay, %% does nothing
>%% depthcorrection=off,  %% does nothing
>%% topoffset=3mm,%% works, but only for positive values
>background=,
>frame=on]
> 
> \starttext
>   \startframedtext
> \framed{Foo}
>   \stopframedtext
>   \starttextbackground
> \framed{Foo}
>   \stoptextbackground
> \stoptext
> 
> How do it get the same spacing as in the framedtext case?

Is there a solution to this? Or an explanation why the spacing
differs?

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-18 Thread Ursula Hermann
Dear Bruce, 

Thank you for your Mail 
It works  perfect. Thank you .
Uschi Hermann 

-Ursprüngliche Nachricht-
Von: Bruce Horrocks  
Gesendet: Freitag, 15. Dezember 2023 14:00
An: ntg-context mailing list 
Betreff: [NTG-context] Re: Problem with the paragraph



> On 14 Dec 2023, at 09:44, Ursula Hermann  wrote:
> 
> If I change the name of the textbackground with my example, I sent yesterday, 
> there is no color in the paragraph. 
> 

Try the following version of your example which incoporates Hraban's and 
Wolfgang's suggestions.
Also take care over changing style so use \bold{this is bold} or {\bf this is 
bold} but not \bf{this is bold}.

\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper 
\setupbodyfont[Times New Roman, 12.2pt] \definemargindata  
[MyInMargin][inright] 
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm] \starttext \margintext 
{1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).} \par 
Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aussage h(m, f) 
sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich die 
Bedeutung der beiden Aussagen klar.
\par
\startitemize[n]
 \item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}  \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
% I changed the above to use \startitemize but have a look at \placeformula as 
well

\startGrayBackground
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass ein 
\m{∃\forall} oder ein \m{\forall\m∃} versteckt ist. Dann ist es besonders 
wichtig, die Formulierung sehr lange zu prüfen und eventuell auch formalisiert 
noch einmal aufzuschreiben.”
\blank
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par von \m{x\doubleprime} 
ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par (Beutelspacher [10, S.54]).
\stopGrayBackground
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-15 Thread Bruce Horrocks


> On 14 Dec 2023, at 09:44, Ursula Hermann  wrote:
> 
> If I change the name of the textbackground with my example, I sent yesterday, 
> there is no color in the paragraph. 
> 

Try the following version of your example which incoporates Hraban's and 
Wolfgang's suggestions.
Also take care over changing style so use \bold{this is bold} or {\bf this is 
bold} but not \bf{this is bold}.

\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[Times New Roman, 12.2pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1}
{\bf Beispiel 3.2.17 (Vertauschung von All- und Existenzquantor).}
\par Sei M die Menge aller Männer und F die Menge aller Frauen. Die
Aussage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen
machen Sie sich die Bedeutung der beiden Aussagen klar.
\par
\startitemize[n]
 \item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}
 \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
% I changed the above to use \startitemize but have a look at \placeformula as 
well

\startGrayBackground
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein \m{∃\forall} oder ein \m{\forall\m∃} versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank
Der Wert von \m{y = f(x)} ist unabhängig von der Wahl\par
von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \par
(Beutelspacher [10, S.54]).
\stopGrayBackground
\stoptext

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-14 Thread Ursula Hermann
Dear Henning,


If I change the name of the textbackground with my example, I sent yesterday, 
there is no color in the paragraph.


Many thanks

Uschi


Von: Henning Hraban Ramm 
Gesendet: Mittwoch, 13. Dezember 2023 15:52:08
An: mailing list for ConTeXt users
Betreff: [NTG-context] Re: Problem with the paragraph

Am 13.12.23 um 15:22 schrieb Ursula Hermann:
> Dear list,
>
> I have this example. I need the whole paragraph in color. But there is
> something wrong.

> \definetextbackground[paragraph][

> \startparagraph

\startparagraph starts a paragraph environment. If you overwrite it by
defining another, the behaviour is undefined.

First try to give your textbackground a different name.

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with the paragraph

2023-12-13 Thread Henning Hraban Ramm

Am 13.12.23 um 15:22 schrieb Ursula Hermann:

Dear list,

I have this example. I need the whole paragraph in color. But there is 
something wrong.



\definetextbackground[paragraph][



\startparagraph


\startparagraph starts a paragraph environment. If you overwrite it by 
defining another, the behaviour is undefined.


First try to give your textbackground a different name.

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Colored Paragraph

2023-12-05 Thread Ursula Hermann
Dear Hraban, 

It was \startnarrower \stopnarrower, I put it out, now it is perfekt. I also 
send the pdf. 

Many thanks. 
Uschi 

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm  
Gesendet: Dienstag, 05. Dezember 2023 15:47
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: Colored Paragraph

Hi Uschi,
unfortunately you also forgot the source code.

I’m not sure if the examples in the wiki are good – the combination with 
\startnarrower might be a problem.

Maybe setting the width helps (e.g. to \makeupwidth).

Hraban

Am 05.12.23 um 15:29 schrieb Ursula Hermann:
> Dear Hraban,
> Sorry, forgot my name
> Uschi
> 
> -Ursprüngliche Nachricht-
> Von: Ursula Hermann
> Gesendet: Dienstag, 05. Dezember 2023 15:27
> An: 'mailing list for ConTeXt users' 
> Betreff: AW: [NTG-context] Re: Colored Paragraph
> 
> Dear Hraban,
> 
> I have tried it now, I have sent you the pdf. This works. But the paragraph 
> should fill the whole blackrule.
> 
> -Ursprüngliche Nachricht-
> Von: Henning Hraban Ramm 
> Gesendet: Dienstag, 05. Dezember 2023 14:58
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: Colored Paragraph
> 
> Am 05.12.23 um 14:16 schrieb Ursula Hermann:
>> The paragraph should have a color in the background. How can I get an 
>> colored paragraph?
> 
> Did you try \definetextbackground?
> 
> https://wiki.contextgarden.net/TextBackground
> https://wiki.contextgarden.net/Command/definetextbackground
> 
> Hraban
> __
> _ If your question is of interest to others as well, 
> please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> __
> _ 
> __
> _ If your question is of interest to others as well, 
> please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
> (mirror) archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> __
> _

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


u.pdf
Description: u.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Colored Paragraph

2023-12-05 Thread Henning Hraban Ramm

Hi Uschi,
unfortunately you also forgot the source code.

I’m not sure if the examples in the wiki are good – the combination with 
\startnarrower might be a problem.


Maybe setting the width helps (e.g. to \makeupwidth).

Hraban

Am 05.12.23 um 15:29 schrieb Ursula Hermann:

Dear Hraban,
Sorry, forgot my name
Uschi

-Ursprüngliche Nachricht-
Von: Ursula Hermann
Gesendet: Dienstag, 05. Dezember 2023 15:27
An: 'mailing list for ConTeXt users' 
Betreff: AW: [NTG-context] Re: Colored Paragraph

Dear Hraban,

I have tried it now, I have sent you the pdf. This works. But the paragraph 
should fill the whole blackrule.

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm 
Gesendet: Dienstag, 05. Dezember 2023 14:58
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Colored Paragraph

Am 05.12.23 um 14:16 schrieb Ursula Hermann:

The paragraph should have a color in the background. How can I get an
colored paragraph?


Did you try \definetextbackground?

https://wiki.contextgarden.net/TextBackground
https://wiki.contextgarden.net/Command/definetextbackground

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Colored Paragraph

2023-12-05 Thread Ursula Hermann
Dear Hraban, 
Sorry, forgot my name 
Uschi 

-Ursprüngliche Nachricht-
Von: Ursula Hermann 
Gesendet: Dienstag, 05. Dezember 2023 15:27
An: 'mailing list for ConTeXt users' 
Betreff: AW: [NTG-context] Re: Colored Paragraph

Dear Hraban, 

I have tried it now, I have sent you the pdf. This works. But the paragraph 
should fill the whole blackrule. 

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm 
Gesendet: Dienstag, 05. Dezember 2023 14:58
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Colored Paragraph

Am 05.12.23 um 14:16 schrieb Ursula Hermann:
> The paragraph should have a color in the background. How can I get an 
> colored paragraph?

Did you try \definetextbackground?

https://wiki.contextgarden.net/TextBackground
https://wiki.contextgarden.net/Command/definetextbackground

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Colored Paragraph

2023-12-05 Thread Ursula Hermann
Dear Hraban, 

I have tried it now, I have sent you the pdf. This works. But the paragraph 
should fill the whole blackrule. 

-Ursprüngliche Nachricht-
Von: Henning Hraban Ramm  
Gesendet: Dienstag, 05. Dezember 2023 14:58
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Colored Paragraph

Am 05.12.23 um 14:16 schrieb Ursula Hermann:
> The paragraph should have a color in the background. How can I get an 
> colored paragraph?

Did you try \definetextbackground?

https://wiki.contextgarden.net/TextBackground
https://wiki.contextgarden.net/Command/definetextbackground

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


u.pdf
Description: u.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Colored Paragraph

2023-12-05 Thread Henning Hraban Ramm

Am 05.12.23 um 14:16 schrieb Ursula Hermann:
The paragraph should have a color in the background. How can I get an 
colored paragraph?


Did you try \definetextbackground?

https://wiki.contextgarden.net/TextBackground
https://wiki.contextgarden.net/Command/definetextbackground

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] textbackground spacing offset

2023-11-16 Thread Marco Patzer
Hi!

I'm having problems getting the textbackground spacing offset to work.
Example:

\setupframedtext
  [offset=overlay,
   width=max,
   depthcorrection=off]

\setuptextbackground
  [location=paragraph,
   %% offset=overlay,   %% does nothing
   %% backgroundoffset=overlay, %% does nothing
   %% depthcorrection=off,  %% does nothing
   %% topoffset=3mm,%% works, but only for positive values
   background=,
   frame=on]

\starttext
  \startframedtext
\framed{Foo}
  \stopframedtext
  \starttextbackground
\framed{Foo}
  \stoptextbackground
\stoptext

How do it get the same spacing as in the framedtext case? The
textbackground has a small gap between the inner and outer frame at
the top and a larger gab at the bottom. I'm not concerned with
horizontal spacing here.

Marco

LMTX 2023.09.04 19:15
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Visual highlighted text with title, mix of enumeration and framedtext

2023-03-06 Thread Aditya Mahajan via ntg-context
On Mon, 6 Mar 2023, Henning Hraban Ramm via ntg-context wrote:

> Am 06.03.23 um 12:19 schrieb Gerion Entrup via ntg-context:
> > I want to typeset a "Good to know" section that is visually highlighted
> > and can spawn across multiple pages.
> > 
> > In LaTeX this would be possible with the mdframed package. See the
> > attached screenshot for an example how it might look like (it is copied
> > out of page 4: Definition: Inhomogeneous linear of the mdframed
> > documentation:
> > http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf)
> > 
> > I have searched in the wiki and found \defineenumeration:
> > This is near of that what I need. However I explicitly does not need an
> > enumeration (so no number or counter). Also I am not sure if I can set a
> > background and so on.
> > 
> > The other possibility is \defineframedtext. For example this goes much
> > in the direction that I want:
> > \definecolor[gbackground][s=0.98]
> > \defineframedtext[gtk][frame=on,
> > offset=5pt,
> > background=color,
> > width=0.95\textwidth,
> > backgroundcolor=gbackground]
> > 
> > However, there does not seem a possibility to define a title and it
> > seems to not work on multiple pages.
> > 
> > Is there a mix of an enumeration and framedtext that can produce
> > something like in the attached picture?
> 
> If you don’t need an enumeration, then don’t use one.
> 
> Did you try text backgrounds?
> https://wiki.contextgarden.net/TextBackground

As an example, see this article that I had written years ago:

https://www.tug.org/pracjourn/2006-4/mahajan/

The solution environment there is similar to what you want. Most of the code 
there should still work with minor changes.

Aditya___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Visual highlighted text with title, mix of enumeration and framedtext

2023-03-06 Thread Henning Hraban Ramm via ntg-context

Am 06.03.23 um 12:19 schrieb Gerion Entrup via ntg-context:

I want to typeset a "Good to know" section that is visually highlighted
and can spawn across multiple pages.

In LaTeX this would be possible with the mdframed package. See the
attached screenshot for an example how it might look like (it is copied
out of page 4: Definition: Inhomogeneous linear of the mdframed
documentation:
http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf)

I have searched in the wiki and found \defineenumeration:
This is near of that what I need. However I explicitly does not need an
enumeration (so no number or counter). Also I am not sure if I can set a
background and so on.

The other possibility is \defineframedtext. For example this goes much
in the direction that I want:
\definecolor[gbackground][s=0.98]
\defineframedtext[gtk][frame=on,
offset=5pt,
background=color,
width=0.95\textwidth,
backgroundcolor=gbackground]

However, there does not seem a possibility to define a title and it
seems to not work on multiple pages.

Is there a mix of an enumeration and framedtext that can produce
something like in the attached picture?


If you don’t need an enumeration, then don’t use one.

Did you try text backgrounds?
https://wiki.contextgarden.net/TextBackground

And then use the plethora of \framed options.

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Floating Figure in framed-environment

2022-10-19 Thread Wolfgang Schuster via ntg-context

Oliver Sieber via ntg-context schrieb am 19.10.2022 um 11:31:

Dear ConTeXt Users

I am relatively new to context and I am suffering with a problem with the 
framed environment.

I want to use a framed textbox for Definitions in my script. I also want to use 
floating figures.  But this does not work and I haven’t found out why. Maybe I 
totally use it the wrong way. I would appreciate if someone could help me or 
has a tipp.

Here is an example code, where the figure does not behave as expected, i.e. the 
figure is behind the text:

[...]


You have to use the textbackground mechanism to create a block of text 
where floats work as expected.


\definetextbackground
  [Oliver]
  [ location=paragraph,
  corner=round,
   rulethickness=2pt,
  framecolor=black,
   topoffset=1em,
    bottomoffset=1em,
  leftoffset=1em,
 rightoffset=1em,
  before=\blank,
   after=\blank,
  background=]

\setupfloats
  [freeregion=no]

\definedescription
  [Definition]
  [alternative=top,
  text={Definition: },
 title=yes,
    before=\startOliver,
 after=\stopOliver,
 inbetween={\blank[medium]}]

\startbuffer[sampletext]
Carrot cake tiramisu lollipop dragée lollipop marshmallow carrot cake 
sweet pastry. Tiramisu danish jelly tootsie roll tart gummi bears. 
Carrot cake chupa chups cake wafer lemon drops lemon drops tiramisu. 
Chocolate lemon drops sugar plum cheesecake jelly beans sugar plum. 
Tootsie roll cupcake jujubes pie chocolate bar bear claw chupa chups 
shortbread. Candy candy canes jelly-o jelly beans sugar plum muffin 
danish donut. Bonbon lemon drops powder jujubes marshmallow biscuit 
halvah. Powder carrot cake caramels chocolate cake carrot cake jelly-o. 
Topping danish tootsie roll gummi bears oat cake jujubes. Sweet candy 
canes cotton candy pie topping. Jelly-o carrot cake ice cream lemon 
drops macaroon gummies lemon drops tiramisu chocolate cake. Cupcake 
sugar plum shortbread gummi bears tootsie roll. Chocolate cake sugar 
plum macaroon candy canes chocolate bar donut cake icing tootsie roll.

\stopbuffer

\starttext

\startOliver
{\bf Definition: Hello World}
\blank[medium]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}

\getbuffer[sampletext]
\stopOliver

\startDefinition[title={Hello World}]
\placefigure[right,none]{This is an example of a 
logo.}{\externalfigure[dummy]}

\getbuffer[sampletext]
\stopDefinition

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] textbackground for text of different size

2021-09-12 Thread Sylvain Hubert via ntg-context
Dear List,

the red highlight block in the following example is not covering the two
40pt characters:

\definetextbackground[important][frame=no,background=color,backgroundcolor=red]
\starttext
abc\important{123{\switchtobodyfont[40pt]45}xy}z
\stoptext

Is there an option that fixes this?

Thanks!

Best,
Sylvain
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context
Here’s what I have now (result attached):

\define[1]\ÜbungNrCmd{\inmargin{\offset[y=3em]{\rotate[rotation=90]{\SectionFont
 #1
  
\defineenumeration[Übung][
  text=Übung,
  title=yes,
  titleleft=,
  titleright=,
  titledistance=-1em,
  titlestyle=\SectionFont,
  %numberstyle=\SectionFont,
  numbercommand=\ÜbungNrCmd,
  way=bytext,
  margin=1em,
  before={\blank[2*line]},
]


Now I’d like to have a vertical line beside the text, starting below the title.

And because I want to use the “sketchy“ lines we discussed a while ago (I 
needed them for the same book), it must be a MetaPost-drawn line.

What’s the right approach? Overlay? Textbackground?

Hraban


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] textbackground not working

2021-06-25 Thread Hans Hagen

On 6/25/2021 8:33 AM, Christoph Reller wrote:

Hi,

Consider the MWE:

\definetextbackground[background][
   background=color,
   backgroundcolor=gray]
\starttext
\starttextbackground[background]
Test
\stoptextbackground
\stoptext

In the latest version 2021-06-24 of ConTeXt LMTX, the textbackground is 
not working. Could this be a bug or am I doing something wrong?


Cheers,

Christoph
fixed in next upload (note: tex->mp parameters are redone, more in a 
pull than push fashion)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] textbackground not working

2021-06-25 Thread Christoph Reller
Hi,

Consider the MWE:

\definetextbackground[background][
  background=color,
  backgroundcolor=gray]
\starttext
\starttextbackground[background]
Test
\stoptextbackground
\stoptext

In the latest version 2021-06-24 of ConTeXt LMTX, the textbackground is not
working. Could this be a bug or am I doing something wrong?

Cheers,

Christoph
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] frameoffset in textbackground?

2021-06-08 Thread Wolfgang Schuster

Hans van der Meer schrieb am 07.06.2021 um 21:46:
In the following MWE for a textbackground the parameter 
backgroundoffset has the expected effect. But for positive values 
only. A backgroundoffset=-10pt has no visible effect.
But the real problem is the parameter frameoffset. No effect at all, 
whatever frameoffset= is set to.


The textbackground mechanism uses MetaPost to draw the background, lines 
etc.


Not all options are available for each background, e.g. frameoffset 
works by default only for side lines.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] frameoffset in textbackground?

2021-06-07 Thread Hans van der Meer
In the following MWE for a textbackground the parameter backgroundoffset has the expected effect. But for positive values only. A backgroundoffset=-10pt has no visible effect.But the real problem is the parameter frameoffset. No effect at all, whatever frameoffset= is set to.
dr. Hans van der Meer




textbackgroundoffset.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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 21:01 +0100, Johann Birnick wrote:
> On Thu, 2020-11-26 at 20:11 +0100, Wolfgang Schuster wrote:
> > Johann Birnick schrieb am 26.11.2020 um 19:42:
> > > Ah, sorry again. I use
> > > 
> > > \usemodule[Scite]
> > > 
> > > at the begin of the document. Removing this helps. But I need it for the C
> > > and
> > > Cpp pretty printer. So do you know what's going on with Scite module?
> > 
> > 1. There is still no working minimal example, just another piece.
> > 
> > 2. There is no option line for me in the following example (LuaTeX and 
> > LMTX) with the current version (2020.11.26 15:41).
> > 
> > \usemodule[scite]
> > 
> > \definetextbackground
> >    [CodeBackground]
> >    [  frame=off,
> >  background=color,
> >     backgroundcolor=lightgray,
> >    location=paragraph,
> >  before=\blank,
> >   after=\blank]
> > 
> > \setuptyping
> >    [CPP]
> >    [before=\startCodeBackground,
> >  after=\stopCodeBackground]
> > 
> > \starttext
> > 
> > \samplefile{ward}
> > 
> > \startCPP
> > #include 
> > 
> > int main(void)
> > {
> >  printf("hello, world\n");
> > }
> > \stopCPP
> > 
> > \samplefile{weisman}
> > 
> > \stoptext
> > 
> > Wolfgang
> 
> Hello Wolfgang,
> 
> let's take your code as a MWE. I compiled exactly your code and there is a
> line
> at the end. I attached my compiled PDF.
> 
> I compiled it using "context test" where the file name is "test.tex" with
> exactly your content.
> 
> I am using the latest version from the Arch Linux Repo, `context --version`
> gives:
> 
> mtx-context | ConTeXt Process Management 1.03
> mtx-context |
> mtx-context | main context file: /usr/share/texmf-
> dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2020.03.10 14:44
> mtx-context | main context file: /usr/share/texmf-
> dist/tex/context/base/mkiv/context.mkxl
> mtx-context | current version: 2020.03.10 14:44
> 
> So probably I should upgrade..
> 
> Greetings,
> Johann

I have updated and now it works. Thank you very much for all your efforts.

Now let's come to my second problem: the sidebar. Proudly, I present to you my
first MWE:

\definetyping[CPP] 
   [before=\startsidebar,
 after=\stopsidebar]

\starttext

\samplefile{ward}

\startCPP
#include 

int main(void)
{
 printf("hello, world\n");
}
\stopCPP

\samplefile{weisman}

\stoptext

Can you see that there is an additional line before and after the code?
How can I get rid of these?

I greatly appreciate your help.

Thanks,
Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Wolfgang Schuster

Johann Birnick schrieb am 26.11.2020 um 21:40:
I have updated and now it works. Thank you very much for all your 
efforts. 


The problem was fixed at the end of march.


Now let's come to my second problem: the sidebar. Proudly, I present to you my
first MWE:

\definetyping[CPP]
[before=\startsidebar,
  after=\stopsidebar]

\starttext

\samplefile{ward}

\startCPP
#include 

int main(void)
{
  printf("hello, world\n");
}
\stopCPP

\samplefile{weisman}

\stoptext

Can you see that there is an additional line before and after the code?
How can I get rid of these?


You have to use the textbackground environment with a custom background
to draw the line, the sidebar environment doesn't work because the code
blocks forces a line break at the begin and end.

You can look at Adityas blog for a example to create such a background:
https://adityam.github.io/context-blog/post/frame-with-solid-left-line-redux/

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 20:11 +0100, Wolfgang Schuster wrote:
> Johann Birnick schrieb am 26.11.2020 um 19:42:
> > Ah, sorry again. I use
> > 
> > \usemodule[Scite]
> > 
> > at the begin of the document. Removing this helps. But I need it for the C
> > and
> > Cpp pretty printer. So do you know what's going on with Scite module?
> 
> 1. There is still no working minimal example, just another piece.
> 
> 2. There is no option line for me in the following example (LuaTeX and 
> LMTX) with the current version (2020.11.26 15:41).
> 
> \usemodule[scite]
> 
> \definetextbackground
>    [CodeBackground]
>    [  frame=off,
>  background=color,
>     backgroundcolor=lightgray,
>    location=paragraph,
>  before=\blank,
>   after=\blank]
> 
> \setuptyping
>    [CPP]
>    [before=\startCodeBackground,
>  after=\stopCodeBackground]
> 
> \starttext
> 
> \samplefile{ward}
> 
> \startCPP
> #include 
> 
> int main(void)
> {
>  printf("hello, world\n");
> }
> \stopCPP
> 
> \samplefile{weisman}
> 
> \stoptext
> 
> Wolfgang

Hello Wolfgang,

let's take your code as a MWE. I compiled exactly your code and there is a line
at the end. I attached my compiled PDF.

I compiled it using "context test" where the file name is "test.tex" with
exactly your content.

I am using the latest version from the Arch Linux Repo, `context --version`
gives:

mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file: /usr/share/texmf-
dist/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2020.03.10 14:44
mtx-context | main context file: /usr/share/texmf-
dist/tex/context/base/mkiv/context.mkxl
mtx-context | current version: 2020.03.10 14:44

So probably I should upgrade..

Greetings,
Johann


test.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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Wolfgang Schuster

Johann Birnick schrieb am 26.11.2020 um 19:42:

Ah, sorry again. I use

\usemodule[Scite]

at the begin of the document. Removing this helps. But I need it for the C and
Cpp pretty printer. So do you know what's going on with Scite module?


1. There is still no working minimal example, just another piece.

2. There is no option line for me in the following example (LuaTeX and 
LMTX) with the current version (2020.11.26 15:41).


\usemodule[scite]

\definetextbackground
  [CodeBackground]
  [  frame=off,
background=color,
   backgroundcolor=lightgray,
  location=paragraph,
before=\blank,
 after=\blank]

\setuptyping
  [CPP]
  [before=\startCodeBackground,
after=\stopCodeBackground]

\starttext

\samplefile{ward}

\startCPP
#include 

int main(void)
{
printf("hello, world\n");
}
\stopCPP

\samplefile{weisman}

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 19:39 +0100, Johann Birnick wrote:
> On Thu, 2020-11-26 at 19:35 +0100, Wolfgang Schuster wrote:
> > Johann Birnick schrieb am 26.11.2020 um 19:26:
> > > I didn't want to copy paste it :D Just add [option=XML] to \starttext like
> > > this:
> > 
> > Why do pass a option for the typing environment to \starttext?
> > 
> > > \definetextbackground[code][background=color, backgroundcolor=lightgray,
> > > frame=off, location=paragraph]
> > > 
> > > \setuptyping[before={\startbackground[code]}, after={\stopbackground}]
> > > 
> > > \starttext[option=XML]
> > > \starttyping
> > > This is some code
> > > a second line
> > > \stoptyping
> > > \stoptext
> > > 
> > > When I use \definetyping[Mytyping][option=XML] and then use \startMytyping
> > > ...
> > > \stopMytyping nothing changes.
> > ???
> > 
> > \definetextbackground
> >    [Code]
> >    [  frame=off,
> >  background=color,
> >     backgroundcolor=lightgray,
> >    location=paragraph]
> > 
> > \definetyping
> >    [Mytyping]
> >    [option=XML]
> > 
> > \setuptyping
> >   %[Mytyping]
> >    [before={\blank\starttextbackground[Code]},
> >  after={\stoptextbackground\blank}]
> > 
> > \starttext
> > 
> > \startMytyping
> > 
> > \stopMytyping
> > 
> > \starttyping[option=XML]
> > 
> > \stoptyping
> > 
> > \stoptext
> > 
> > Wolfgang
> > 
> 
> Sorry for confusing \starttext with \starttyping.
> 
> @Wolfgang this is exactly what I mean. It doesn't work. There is an extra line
> at the end. If you remove [option=XML] it works. So what is going wrong?
> 
> Thank you,
> Johann

Ah, sorry again. I use

\usemodule[Scite]

at the begin of the document. Removing this helps. But I need it for the C and
Cpp pretty printer. So do you know what's going on with Scite module?

Thanks,
Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 19:35 +0100, Wolfgang Schuster wrote:
> Johann Birnick schrieb am 26.11.2020 um 19:26:
> > I didn't want to copy paste it :D Just add [option=XML] to \starttext like
> > this:
> 
> Why do pass a option for the typing environment to \starttext?
> 
> > \definetextbackground[code][background=color, backgroundcolor=lightgray,
> > frame=off, location=paragraph]
> > 
> > \setuptyping[before={\startbackground[code]}, after={\stopbackground}]
> > 
> > \starttext[option=XML]
> > \starttyping
> > This is some code
> > a second line
> > \stoptyping
> > \stoptext
> > 
> > When I use \definetyping[Mytyping][option=XML] and then use \startMytyping
> > ...
> > \stopMytyping nothing changes.
> ???
> 
> \definetextbackground
>    [Code]
>    [  frame=off,
>  background=color,
>     backgroundcolor=lightgray,
>    location=paragraph]
> 
> \definetyping
>    [Mytyping]
>    [option=XML]
> 
> \setuptyping
>   %[Mytyping]
>    [before={\blank\starttextbackground[Code]},
>  after={\stoptextbackground\blank}]
> 
> \starttext
> 
> \startMytyping
> 
> \stopMytyping
> 
> \starttyping[option=XML]
> 
> \stoptyping
> 
> \stoptext
> 
> Wolfgang
> 

Sorry for confusing \starttext with \starttyping.

@Wolfgang this is exactly what I mean. It doesn't work. There is an extra line
at the end. If you remove [option=XML] it works. So what is going wrong?

Thank you,
Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Wolfgang Schuster

Johann Birnick schrieb am 26.11.2020 um 19:26:

I didn't want to copy paste it :D Just add [option=XML] to \starttext like this:


Why do pass a option for the typing environment to \starttext?


\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\starttext[option=XML]
\starttyping
This is some code
a second line
\stoptyping
\stoptext

When I use \definetyping[Mytyping][option=XML] and then use \startMytyping ...
\stopMytyping nothing changes.

???

\definetextbackground
  [Code]
  [  frame=off,
    background=color,
   backgroundcolor=lightgray,
  location=paragraph]

\definetyping
  [Mytyping]
  [option=XML]

\setuptyping
 %[Mytyping]
  [before={\blank\starttextbackground[Code]},
    after={\stoptextbackground\blank}]

\starttext

\startMytyping

\stopMytyping

\starttyping[option=XML]

\stoptyping

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Aditya Mahajan
On Thu, 26 Nov 2020, Johann Birnick wrote:

> On Thu, 2020-11-26 at 19:17 +0100, Wolfgang Schuster wrote:
> > Johann Birnick schrieb am 26.11.2020 um 19:10:
> > > On Thu, 2020-11-26 at 17:31 +0100, Wolfgang Schuster wrote:
> > > > Johann Birnick schrieb am 26.11.2020 um 17:00:
> > > > > On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:
> > > > > > On Thu, 26 Nov 2020, Johann Birnick wrote:
> > > > > > 
> > > > > > > How to surround such things properly? I just want a background to
> > > > > > > these
> > > > > > > and
> > > > > > > a
> > > > > > > sidebar. No addition spacing / empty lines.
> > > > > > A MWE will help...
> > > > > > 
> > > > > > Aditya
> > > > > For example, take:
> > > > > 
> > > > > \definetextbackground[code][background=color, 
> > > > > backgroundcolor=lightgray,
> > > > > frame=off, location=paragraph]
> > > > > 
> > > > > \starttextbackground[code]
> > > > > \starttyping
> > > > > This is some code
> > > > > a second line
> > > > > \stoptyping
> > > > > \stoptextbackground
> > > > You missed the W (working) in MWE.
> > > > 
> > > > \definetextbackground
> > > >     [Code]
> > > >     [  frame=off,
> > > >   background=color,
> > > >  backgroundcolor=lightgray,
> > > >     location=paragraph]
> > > > 
> > > > \setuptyping
> > > >     [before={\blank\starttextbackground[Code]},
> > > >   after={\stoptextbackground\blank}]
> > > > 
> > > > \starttext
> > > > 
> > > > \starttyping
> > > > This is some code
> > > > a second line
> > > > \stoptyping
> > > > 
> > > > \stoptext
> > > > 
> > > > Wolfgang
> > > Okay so first sorry that the example missed the \starttext ... \stoptext.
> > > Won't
> > >   
> 
> I didn't want to copy paste it :D Just add [option=XML] to \starttext like 
> this:

\starttext does not take an `option=XML` argument.

> \definetextbackground[code][background=color, backgroundcolor=lightgray,
> frame=off, location=paragraph]
> 
> \setuptyping[before={\startbackground[code]}, after={\stopbackground}]
> 
> \starttext[option=XML]
> \starttyping
> This is some code
> a second line
> \stoptyping
> \stoptext
> 
> When I use \definetyping[Mytyping][option=XML] and then use \startMytyping ...
> \stopMytyping nothing changes.

Again, a MWE help to understand what is going wrong.


\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\definetyping[XMLtyping]
 [
   option=XML,
   before={\startbackground[code]},
   after={\stopbackground},
 ]

\starttext
\startXMLtyping
This is some code
a second line
\stopXMLtyping
\stoptext

Aditya___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 19:17 +0100, Wolfgang Schuster wrote:
> Johann Birnick schrieb am 26.11.2020 um 19:10:
> > On Thu, 2020-11-26 at 17:31 +0100, Wolfgang Schuster wrote:
> > > Johann Birnick schrieb am 26.11.2020 um 17:00:
> > > > On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:
> > > > > On Thu, 26 Nov 2020, Johann Birnick wrote:
> > > > > 
> > > > > > How to surround such things properly? I just want a background to
> > > > > > these
> > > > > > and
> > > > > > a
> > > > > > sidebar. No addition spacing / empty lines.
> > > > > A MWE will help...
> > > > > 
> > > > > Aditya
> > > > For example, take:
> > > > 
> > > > \definetextbackground[code][background=color, backgroundcolor=lightgray,
> > > > frame=off, location=paragraph]
> > > > 
> > > > \starttextbackground[code]
> > > > \starttyping
> > > > This is some code
> > > > a second line
> > > > \stoptyping
> > > > \stoptextbackground
> > > You missed the W (working) in MWE.
> > > 
> > > \definetextbackground
> > >     [Code]
> > >     [  frame=off,
> > >   background=color,
> > >  backgroundcolor=lightgray,
> > >     location=paragraph]
> > > 
> > > \setuptyping
> > >     [before={\blank\starttextbackground[Code]},
> > >   after={\stoptextbackground\blank}]
> > > 
> > > \starttext
> > > 
> > > \starttyping
> > > This is some code
> > > a second line
> > > \stoptyping
> > > 
> > > \stoptext
> > > 
> > > Wolfgang
> > Okay so first sorry that the example missed the \starttext ... \stoptext.
> > Won't
> > 

I didn't want to copy paste it :D Just add [option=XML] to \starttext like this:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\starttext[option=XML]
\starttyping
This is some code
a second line
\stoptyping
\stoptext

When I use \definetyping[Mytyping][option=XML] and then use \startMytyping ...
\stopMytyping nothing changes.

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Wolfgang Schuster

Johann Birnick schrieb am 26.11.2020 um 19:10:

On Thu, 2020-11-26 at 17:31 +0100, Wolfgang Schuster wrote:

Johann Birnick schrieb am 26.11.2020 um 17:00:

On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:

On Thu, 26 Nov 2020, Johann Birnick wrote:


How to surround such things properly? I just want a background to these
and
a
sidebar. No addition spacing / empty lines.

A MWE will help...

Aditya

For example, take:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\starttextbackground[code]
\starttyping
This is some code
a second line
\stoptyping
\stoptextbackground

You missed the W (working) in MWE.

\definetextbackground
    [Code]
    [  frame=off,
  background=color,
     backgroundcolor=lightgray,
    location=paragraph]

\setuptyping
    [before={\blank\starttextbackground[Code]},
  after={\stoptextbackground\blank}]

\starttext

\starttyping
This is some code
a second line
\stoptyping

\stoptext

Wolfgang

Okay so first sorry that the example missed the \starttext ... \stoptext. Won't
happen again.

So unfortunately my MWE was too minimal. Actually this works:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\starttext
\starttyping
This is some code
a second line
\stoptyping
\stoptext

However, I use pretty printing. When you add [option=XML] to \starttext it
breaks.

Why?


Do you have a example.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 17:31 +0100, Wolfgang Schuster wrote:
> Johann Birnick schrieb am 26.11.2020 um 17:00:
> > On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:
> > > On Thu, 26 Nov 2020, Johann Birnick wrote:
> > > 
> > > > How to surround such things properly? I just want a background to these
> > > > and
> > > > a
> > > > sidebar. No addition spacing / empty lines.
> > > 
> > > A MWE will help...
> > > 
> > > Aditya
> > 
> > For example, take:
> > 
> > \definetextbackground[code][background=color, backgroundcolor=lightgray,
> > frame=off, location=paragraph]
> > 
> > \starttextbackground[code]
> > \starttyping
> > This is some code
> > a second line
> > \stoptyping
> > \stoptextbackground
> 
> You missed the W (working) in MWE.
> 
> \definetextbackground
>    [Code]
>    [  frame=off,
>  background=color,
>     backgroundcolor=lightgray,
>    location=paragraph]
> 
> \setuptyping
>    [before={\blank\starttextbackground[Code]},
>  after={\stoptextbackground\blank}]
> 
> \starttext
> 
> \starttyping
> This is some code
> a second line
> \stoptyping
> 
> \stoptext
> 
> Wolfgang

Okay so first sorry that the example missed the \starttext ... \stoptext. Won't
happen again.

So unfortunately my MWE was too minimal. Actually this works:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\starttext
\starttyping
This is some code
a second line
\stoptyping
\stoptext

However, I use pretty printing. When you add [option=XML] to \starttext it
breaks.

Why?

Thank you,
Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Wolfgang Schuster

Johann Birnick schrieb am 26.11.2020 um 17:00:

On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:

On Thu, 26 Nov 2020, Johann Birnick wrote:


How to surround such things properly? I just want a background to these and
a
sidebar. No addition spacing / empty lines.


A MWE will help...

Aditya


For example, take:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\starttextbackground[code]
\starttyping
This is some code
a second line
\stoptyping
\stoptextbackground


You missed the W (working) in MWE.

\definetextbackground
  [Code]
  [  frame=off,
background=color,
   backgroundcolor=lightgray,
  location=paragraph]

\setuptyping
  [before={\blank\starttextbackground[Code]},
after={\stoptextbackground\blank}]

\starttext

\starttyping
This is some code
a second line
\stoptyping

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Aditya Mahajan
On Thu, 26 Nov 2020, Johann Birnick wrote:

> On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:
> > On Thu, 26 Nov 2020, Johann Birnick wrote:
> > 
> > > How to surround such things properly? I just want a background to these 
> > > and
> > > a
> > > sidebar. No addition spacing / empty lines.
> > 
> > A MWE will help...
> > 
> > Aditya
> 
> For example, take:
> 
> \definetextbackground[code][background=color, backgroundcolor=lightgray,
> frame=off, location=paragraph]
> 
> \starttextbackground[code]
> \starttyping
> This is some code
> a second line
> \stoptyping
> \stoptextbackground


\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\setuptyping[before={\startbackground[code]}, after={\stopbackground}]

\starttext
\starttyping
This is some code
a second line
\stoptyping
\stoptext

Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
On Thu, 2020-11-26 at 09:38 -0500, Aditya Mahajan wrote:
> On Thu, 26 Nov 2020, Johann Birnick wrote:
> 
> > How to surround such things properly? I just want a background to these and
> > a
> > sidebar. No addition spacing / empty lines.
> 
> A MWE will help...
> 
> Aditya

For example, take:

\definetextbackground[code][background=color, backgroundcolor=lightgray,
frame=off, location=paragraph]

\starttextbackground[code]
\starttyping
This is some code
a second line
\stoptyping
\stoptextbackground

Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Aditya Mahajan
On Thu, 26 Nov 2020, Johann Birnick wrote:

> How to surround such things properly? I just want a background to these and a
> sidebar. No addition spacing / empty lines.

A MWE will help...

Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Vertical space when surrounding with textbackground

2020-11-26 Thread Johann Birnick
Hi there,

in my document(s) I have enumerations (created with \defineenumeration) and
"typing"s (created with \definetyping) and I need to give a specific layout to
them. In particular, I want to add textbackground (created with
\definetextbackground) and sometimes a sidebar (created with \definesidebar) to
them.

However, when I surround for example my typing with a textbackground like this

\starttextbackground[code]
\startCpp
...
\stopCpp
\stoptextbackground

or by putting the textbackground commands in "before=" and "after=" of my
typing, then there will be an additional empty line at the end of the typing.

Same with the enumerations and when I surround it with a sidebar instead of a
textbackground. Often there is even an additional line / additional space before
the typing/enumeration.

How to surround such things properly? I just want a background to these and a
sidebar. No addition spacing / empty lines.

I would greatly appreciate your help.

Thank you,
Johann

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-16 Thread Fabrice Couvreur
Hi Otared and Wolfgang,
It's great, the following code does the job!
Thank you so much.
Fabrice

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]

\setupfloats[freeregion=no]

\definetextbackground[fondpaille]
[background=color,
backgroundcolor=fondpaille,
frame=off,
location=always,
   ]
\showframe
\starttext

\starttextbackground[fondpaille]
\startplacefigure[number=no,location=right]
\externalfigure[dummy]
\stopplacefigure
\startitemize[n]
\dorecurse{3}{\startitem \input ward \stopitem}
\stopitemize
\stoptextbackground

\stoptext

Le jeu. 16 juil. 2020 à 14:59, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Otared Kavian schrieb am 16.07.2020 um 11:58:
> > Hi Fabrice,
> >
> > Maybe you can play with different settings of your textbackground, as in
> >
> > \definetextbackground[fondpaille]
> >   [background=color,
> >   backgroundcolor=fondpaille,
> >   frame=off,
> >   location=paragraph, % or: text, always, paragraph
> >   backgroundoffset=4pt] % change the value here
>
> It's a float feature which can be disabled.
>
> \setupfloats[freeregion=no]
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-16 Thread Wolfgang Schuster

Otared Kavian schrieb am 16.07.2020 um 11:58:

Hi Fabrice,

Maybe you can play with different settings of your textbackground, as in

\definetextbackground[fondpaille]
[background=color,
backgroundcolor=fondpaille,
frame=off,
location=paragraph, % or: text, always, paragraph
backgroundoffset=4pt] % change the value here


It's a float feature which can be disabled.

\setupfloats[freeregion=no]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-16 Thread Otared Kavian
Hi Fabrice,

Maybe you can play with different settings of your textbackground, as in

\definetextbackground[fondpaille]
[background=color,
backgroundcolor=fondpaille,
frame=off,
location=paragraph, % or: text, always, paragraph
backgroundoffset=4pt] % change the value here

Best regards: Otared

> On 16 Jul 2020, at 11:10, Fabrice Couvreur  
> wrote:
> 
> Hi Otared and Wolfgang,
> Thanks for your help ; the result is almost what I want (the space between 
> the text and the figure is not colored) but it is likely that we could not do 
> better.
> Fabrice
> 
> Le mer. 15 juil. 2020 à 22:25, Otared Kavian  a écrit :
> Hi Fabrice,
> 
> I think what Wolfgang suggests is something like the following:
> 
> \useMPlibrary[dum]
> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> \definetextbackground[fondpaille]
> [background=color,
> backgroundcolor=fondpaille,
> frame=off,
> location=always]
> 
> \starttext
> 
> \starttextbackground[fondpaille]
> \startplacefigure[number=no,location=right]
> \externalfigure[dummy]
> \stopplacefigure
> \startitemize[n]
> \dorecurse{3}{\startitem \input ward \stopitem}
> \stopitemize
> \stoptextbackground
> 
> \stoptext
> 
> Best regards: Otared K.
> 
> > On 15 Jul 2020, at 22:13, Wolfgang Schuster 
> >  wrote:
> > 
> > Fabrice Couvreur schrieb am 15.07.2020 um 19:54:
> >> Hello,
> >> I always encounter difficulties with the placement of figures in such a 
> >> way that the text envelops the figure.
> >> Thank you.
> >> Fabrice
> >> \useMPlibrary[dum]
> >> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> >> \starttext
> >> \startframedtext[width=max,background=color,backgroundcolor=fondpaille]
> >>  \placefloat[][right,none]{}
> >>    {\externalfigure[dummy]}
> >>  \startitemize[n]
> >>\dorecurse{3}{\startitem \input ward \stopitem}
> >>  \stopitemize
> >>\stopframedtext
> >>\stoptext
> > 
> > 
> > Side floats don't work in frames, use the textbackground environment to add 
> > a colored box behind the text.
> > 
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-16 Thread Fabrice Couvreur
Hi Otared and Wolfgang,
Thanks for your help ; the result is almost what I want (the space between
the text and the figure is not colored) but it is likely that we could not
do better.
Fabrice

Le mer. 15 juil. 2020 à 22:25, Otared Kavian  a écrit :

> Hi Fabrice,
>
> I think what Wolfgang suggests is something like the following:
>
> \useMPlibrary[dum]
> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> \definetextbackground[fondpaille]
> [background=color,
> backgroundcolor=fondpaille,
> frame=off,
> location=always]
>
> \starttext
>
> \starttextbackground[fondpaille]
> \startplacefigure[number=no,location=right]
> \externalfigure[dummy]
> \stopplacefigure
> \startitemize[n]
> \dorecurse{3}{\startitem \input ward \stopitem}
> \stopitemize
> \stoptextbackground
>
> \stoptext
>
> Best regards: Otared K.
>
> > On 15 Jul 2020, at 22:13, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> > Fabrice Couvreur schrieb am 15.07.2020 um 19:54:
> >> Hello,
> >> I always encounter difficulties with the placement of figures in such a
> way that the text envelops the figure.
> >> Thank you.
> >> Fabrice
> >> \useMPlibrary[dum]
> >> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> >> \starttext
> >> \startframedtext[width=max,background=color,backgroundcolor=fondpaille]
> >>  \placefloat[][right,none]{}
> >>{\externalfigure[dummy]}
> >>  \startitemize[n]
> >>\dorecurse{3}{\startitem \input ward \stopitem}
> >>  \stopitemize
> >>\stopframedtext
> >>\stoptext
> >
> >
> > Side floats don't work in frames, use the textbackground environment to
> add a colored box behind the text.
> >
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-15 Thread Otared Kavian
Hi Fabrice,

I think what Wolfgang suggests is something like the following:

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
\definetextbackground[fondpaille]
[background=color,
backgroundcolor=fondpaille,
frame=off,
location=always]

\starttext

\starttextbackground[fondpaille]
\startplacefigure[number=no,location=right]
\externalfigure[dummy]
\stopplacefigure
\startitemize[n]
\dorecurse{3}{\startitem \input ward \stopitem}
\stopitemize
\stoptextbackground

\stoptext

Best regards: Otared K.

> On 15 Jul 2020, at 22:13, Wolfgang Schuster 
>  wrote:
> 
> Fabrice Couvreur schrieb am 15.07.2020 um 19:54:
>> Hello,
>> I always encounter difficulties with the placement of figures in such a way 
>> that the text envelops the figure.
>> Thank you.
>> Fabrice
>> \useMPlibrary[dum]
>> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
>> \starttext
>> \startframedtext[width=max,background=color,backgroundcolor=fondpaille]
>>  \placefloat[][right,none]{}
>>{\externalfigure[dummy]}
>>  \startitemize[n]
>>\dorecurse{3}{\startitem \input ward \stopitem}
>>  \stopitemize
>>\stopframedtext
>>\stoptext
> 
> 
> Side floats don't work in frames, use the textbackground environment to add a 
> colored box behind the text.
> 
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Text around a figure

2020-07-15 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 15.07.2020 um 19:54:

Hello,
I always encounter difficulties with the placement of figures in such a 
way that the text envelops the figure.

Thank you.
Fabrice

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]

\starttext

\startframedtext[width=max,background=color,backgroundcolor=fondpaille]
      \placefloat[][right,none]{}
        {\externalfigure[dummy]}
      \startitemize[n]
        \dorecurse{3}{\startitem \input ward \stopitem}
      \stopitemize
    \stopframedtext

    \stoptext



Side floats don't work in frames, use the textbackground environment to 
add a colored box behind the text.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bar within math (amended)

2020-06-15 Thread Henning Hraban Ramm

> Am 11.06.2020 um 13:41 schrieb Axel Kielhorn :
> 
>> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster 
>> :
>> 
>> Use a textbackground to highlight parts of your text.
>> 
>> \definetextbackground
>> [Highlight]
>> [frame=off,
>>  background=color,
>>  backgroundcolor=yellow]
>> 
>> \starttext
>> 
>> \m{1 + 2 = \unit{3 kilo newton}}
>> 
>> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
>> 
>> \stoptext
>> 
>> Wolfgang
>> 
> 
> Is there a way to highlight just the words and leave the space white?
> Something like \overstrikes?


Wolfgang or whoelse,
when would you advise to use textbackgrounds and when bars? E.g. if I need a 
“marker” highlighting.

Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bar within math (amended)

2020-06-11 Thread Axel Kielhorn


> Am 09.06.2020 um 20:41 schrieb Wolfgang Schuster 
> :
> 
> Use a textbackground to highlight parts of your text.
> 
> \definetextbackground
>  [Highlight]
>  [frame=off,
>   background=color,
>   backgroundcolor=yellow]
> 
> \starttext
> 
> \m{1 + 2 = \unit{3 kilo newton}}
> 
> \m{1 + 2 = \Highlight{\unit{3 kilo newton}}}
> 
> \stoptext
> 
> Wolfgang
> 

Is there a way to highlight just the words and leave the space white?
Something like \overstrikes?

Greetings
Axel
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bar within math (amended)

2020-06-09 Thread Wolfgang Schuster

Lukas/ConTeXt schrieb am 09.06.2020 um 20:28:

Hello,

it seems that bar (even with option 'continue=yes') is not rendered in place of 
'~' within math. See the sample:


\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]

\starttext
   1 + 2 = \startbar[MyBar]3~kN\stopbar % OK

   $1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$ % No background behind space

   $1 + 2 = 
\inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$
 % OK!
\stoptext


In the sample 'kN' is a unit, which should be separated by space from the 
result (here: 3);
I am used to put the unit into the math environment and enclose it into 
\text{...}.

Is there a way to make the bar be rendered in places of blanks within math, too 
(like if it was inside $ ... $ - as the first line of the sample)?

- Note that I can use \inframed to get background filled fully, but anyway - how about 
usage of "bar" for this?


Use a textbackground to highlight parts of your text.

\definetextbackground
  [Highlight]
  [frame=off,
   background=color,
   backgroundcolor=yellow]

\starttext

\m{1 + 2 = \unit{3 kilo newton}}

\m{1 + 2 = \Highlight{\unit{3 kilo newton}}}

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] background of \typing fills column

2020-06-01 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 01.06.2020 um 20:22:

Hi,
I finally wanted to attack CG journal 2019 again and stumble upon this error:

If an article contains several \starttyping ... \stoptyping examples with a 
textbackground, it sometimes fills the whole column (pagecolumns). It doesn’t occur if 
the "typing" is at top or bottom of the column or even breaks.

It’s the same with MkIV and LMTX.

I’ll try to come up with a MWE, but perhaps you already know what’s wrong?


Can you show the typing and textbackground settings.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] background of \typing fills column

2020-06-01 Thread Henning Hraban Ramm
Hi,
I finally wanted to attack CG journal 2019 again and stumble upon this error:

If an article contains several \starttyping ... \stoptyping examples with a 
textbackground, it sometimes fills the whole column (pagecolumns). It doesn’t 
occur if the "typing" is at top or bottom of the column or even breaks.

It’s the same with MkIV and LMTX.

I’ll try to come up with a MWE, but perhaps you already know what’s wrong?

Here’s the PDF: https://sedna.fiee.net/f/a75380127d7b4f17a940/

Best, Hraban


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Textbackground inside Layer?

2019-12-09 Thread Wolfgang Schuster

Jon Wong schrieb am 06.12.2019 um 04:13:

\setupwhitespace[line] % A line's spacing between paragraphs.

\starttext

\definetextbackground[InfoText][
   location=paragraph, frame=on]


You can't use "location=paragraph" because the argument of the \setlayer 
command is a simple horizontal box which doesn't create a paragraph 
unless you us additional command which create a paragraph.



\definelayer[testlayer]
\setlayer[testlayer][x=1cm,y=3cm]{%
   \startInfoText
   \stopInfoText
}


Simpler method:

\setlayer
  [testlayer]
  [x=1cm,
  y=3cm]
  {\framed[framecolor=red]{TEXT}}

or

\setlayerframed
  [testlayer]
  [x=1cm,
  y=3cm]
  [framecolor=red]
  {TEXT}

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Textbackground inside Layer?

2019-12-05 Thread Jon Wong
\setupwhitespace[line] % A line's spacing between paragraphs.

\starttext

\definetextbackground[InfoText][
  location=paragraph, frame=on]

\definelayer[testlayer]
\setlayer[testlayer][x=1cm,y=3cm]{%
  \startInfoText
  \stopInfoText
}
\flushlayer[testlayer]

\stoptext

Doesn’t work. Only works if I put text inside the layer.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Strange pagebreaks in LMTX

2019-09-05 Thread Duncan Hothersall
I have found in similar situations sometimes the easiest fix is to set the
backgroundcolor of footnotes to white (or your page colour if different).

Bests,

DH

On Thu, 5 Sep 2019 at 07:00, Otared Kavian  wrote:

> Hi Aditya,
>
> Thank you for your reply and for the link to your article: your
> explanations are cristal clear and the solution for me is to use what you
> explain.
>
> There is only one issue remaining, when using your code, that is:
>
> \definetextbackground
>   [leftbartext]
>   [
> location=paragraph,
> mp=mpos:region:leftbar,
> width=broad,
> frame=off,
> framecolor=darkred,
> rulethickness=.5pt,
> leftoffset=2ex,
> %rightoffset=2.25ex,
> %topoffset=2.25ex,
> %bottomoffset=2.25ex,
> background=color,
> backgroundcolor=white,
>   ]
>
> \startuseMPgraphic{mpos:region:leftbar}
>   draw_multi_pars;
>   draw_multi_side;
> \stopuseMPgraphic
>
> then when there is a footnote the leftbartext runs into the footnote,
> between the number and the footnote itself, and the result is not nice. I
> did not find a way to push the footnote and its number a little to the
> right, or the leftbartext to the left.
>
> Best regards: OK
>
> > On 5 Sep 2019, at 06:45, Aditya Mahajan  wrote:
> >
> > On Thu, 5 Sep 2019, Otared Kavian wrote:
> >
> >> Hi Wolfgang,
> >>
> >> Thanks for your answer. I tried Hans' suggestion to use \textbackground
> instead of background: indeed it solves the problem of incorrect page
> breaks, but it seems that \setuptextbackground « leftframe=on » is not
> honoured, that is one cannot say for instance:
> >>
> >>  \setuptextbackground[frame=off,leftframe=on]
> >>
> >> while using \background this would be possible.
> >
> > See
> >
> >
> https://adityam.github.io/context-blog/post/frame-with-solid-left-line-redux/
> >
> >
> Aditya___
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
Duncan Hothersall, Operations Director
CAPDM Limited - Online Program Enablers
0131 477 8620  www.capdm.com
Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 20 Forth Street Edinburgh EH1 3LH UK
<https://maps.google.com/?q=22+Forth+Street,+Edinburgh,+EH1+3LH,+UK=gmail=g>

Capture, author, publish, deliver and manage your learning materials.

*Sign up to the CAPDM newsletter here <http://eepurl.com/bqzBQn>*
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Strange pagebreaks in LMTX

2019-09-04 Thread Otared Kavian
Hi Aditya,

Thank you for your reply and for the link to your article: your explanations 
are cristal clear and the solution for me is to use what you explain.

There is only one issue remaining, when using your code, that is:

\definetextbackground
  [leftbartext]
  [
location=paragraph,
mp=mpos:region:leftbar,
width=broad,
frame=off,
framecolor=darkred,
rulethickness=.5pt,
leftoffset=2ex,
%rightoffset=2.25ex,
%topoffset=2.25ex,
%bottomoffset=2.25ex,
background=color,
backgroundcolor=white,
  ]

\startuseMPgraphic{mpos:region:leftbar}
  draw_multi_pars;
  draw_multi_side;
\stopuseMPgraphic

then when there is a footnote the leftbartext runs into the footnote, between 
the number and the footnote itself, and the result is not nice. I did not find 
a way to push the footnote and its number a little to the right, or the 
leftbartext to the left.

Best regards: OK

> On 5 Sep 2019, at 06:45, Aditya Mahajan  wrote:
> 
> On Thu, 5 Sep 2019, Otared Kavian wrote:
> 
>> Hi Wolfgang,
>> 
>> Thanks for your answer. I tried Hans' suggestion to use \textbackground 
>> instead of background: indeed it solves the problem of incorrect page 
>> breaks, but it seems that \setuptextbackground « leftframe=on » is not 
>> honoured, that is one cannot say for instance:
>> 
>>  \setuptextbackground[frame=off,leftframe=on]
>> 
>> while using \background this would be possible.
> 
> See
> 
> https://adityam.github.io/context-blog/post/frame-with-solid-left-line-redux/
> 
> Aditya___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Strange pagebreaks in LMTX

2019-09-04 Thread Aditya Mahajan

On Thu, 5 Sep 2019, Otared Kavian wrote:


Hi Wolfgang,

Thanks for your answer. I tried Hans' suggestion to use \textbackground instead 
of background: indeed it solves the problem of incorrect page breaks, but it 
seems that \setuptextbackground « leftframe=on » is not honoured, that is one 
cannot say for instance:

\setuptextbackground[frame=off,leftframe=on]

while using \background this would be possible.


See

https://adityam.github.io/context-blog/post/frame-with-solid-left-line-redux/

Aditya___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Strange pagebreaks in LMTX

2019-09-04 Thread Otared Kavian
Hi Wolfgang,

Thanks for your answer. I tried Hans' suggestion to use \textbackground instead 
of background: indeed it solves the problem of incorrect page breaks, but it 
seems that \setuptextbackground « leftframe=on » is not honoured, that is one 
cannot say for instance:

\setuptextbackground[frame=off,leftframe=on]

while using \background this would be possible. 
The other issue, as you pointed out is the way the end of \textbackground can 
be controlled (even though for my case it is not an issue). 

The \sidebar mechanism in order to have a vertical line on the left of each 
exercise does not work properly neither, because it is difficult to control 
precisely where it ends.

Best regards: OK


> On 4 Sep 2019, at 18:32, Wolfgang Schuster 
>  wrote:
> 
> Hans Hagen schrieb am 04.09.2019 um 17:58:
>> On 9/4/2019 2:24 PM, Otared Kavian wrote:
>>> Hi all,
>>> 
>>> I have a document which typesets correctly in mkiv giving a PDF file with 7 
>>> pages, but the same document typeset with lmtx gives two pages with a 
>>> strange pagebreak on the second page. Up to now, unfortunately, I could not 
>>> create a minimal example to show this behaviour, so I put the files in the 
>>> folder here:
>>> 
>>> 
>>> https://www.dropbox.com/sh/7rolmpe47njvy0l/AADmcILO0XgY3Sb6FC2dwMw-a?dl=0 
>>> 
>>> and the PDF file obtained with mkiv is here
>>> 
>>> https://www.dropbox.com/s/udbz0lulat9vum7/bug-pagebreaks-mkiv.pdf?dl=0 
>>> 
>>> while the one obtained with lmtx is here
>>> 
>>> https://www.dropbox.com/s/t6kge5lq8otju4y/bug-pagebreaks-lmtx.pdf?dl=0 
>>> 
>>> Also, the TeX file typesets correctly with lmtx, if I don't use textrules, 
>>> so  I wonder whether there has been some changes in the way such textrules 
>>> have to be used.
>>> As far as I can remember, two months ago the same file was typeset with 
>>> lmtx without any problem.
>>> 
>>> Thanks in advance for any help,
>>> Best regards: OK
>> you have some interaction between textrules and backgrounds (and that can be 
>> a matter of very small differences in dimensions and rounding and such .. i 
>> just don't see a quick way out) ... esp these backgrounds are an old 
>> mechanism (maybe i should alias it to textbackgrounds in lmtx)
>> 
>> much better is to use this:
>> 
>> \definetextbackground
>>   [xx]
>>   [location=paragraph]
>> 
>> \starttextbackground[xx]
>> \stoptextbackground
>> 
>> can you try to use that instead? less page overflow too
>> 
>> (actually i should iontegrate some title line in that)
> A limitation of textbackgrounds is the limited control over the vertical 
> space at page breaks.
> 
> With the old background mechanism you get the normal topoffset and 
> bottomoffset values
> but with textbackgrounds you can just control the space at the end and end of 
> the environment.
> 
> \showframe[text][text]
> 
> \starttext
> 
> \dorecurse{3}{\samplefile{knuth}}
> 
> \startbackground[topoffset=1em,bottomoffset=1em]
> \dorecurse{2}{\samplefile{knuth}}
> \stopbackground
> 
> \dorecurse{2}{\samplefile{knuth}}
> 
> \page
> 
> \definetextbackground[xx][location=paragraph,frame=off,background=color,backgroundcolor=gray,topoffset=1em,bottomoffset=1em]
> 
> \dorecurse{3}{\samplefile{knuth}}
> 
> \starttextbackground[xx]
> \dorecurse{2}{\samplefile{knuth}}
> \stoptextbackground
> 
> \dorecurse{2}{\samplefile{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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

I’m so so sorry for yet another message in this thread. I’ve solved it, but 
still don’t quite understand why it works. I post the solution here so that 
nobody has to spend any time crafting the solution. But I still have 1 key 
question.

Key question: Why does \setwhitespace[line] prevent \blank[-0.5em] from working 
after a \framed?

(Ok. I better sleep before I pollute the mailing list further.)

Apparent Solution:

\usecolors[xwi]
\setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

{

\blank[line]

\setupwhitespace[none]

\startnarrower
  \dontleavehmode\framed[
width=local, corner=03, background=color, backgroundcolor=cyan,
frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
  {

  \setupwhitespace[line]

\input knuth

  }
  \stopsecondary
\stopnarrower

}

\input knuth
\stoptext


> On Aug 21, 2019, at 10:21 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Ok, last message in this topic, I promise. I’ve crafted a MWE.
> 
> If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I 
> need to revise my TeX notes. For now, can somebody give me a little 
> encouragement and tell me the answer? :-P
> 
> \usecolors[xwi]
> % \setupwhitespace[line]
> 
> \starttext
> \definetextbackground[secondary][
>   location=always,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
> 
> \input knuth
> 
> \startnarrower
>   \dontleavehmode\framed[
> width=local, corner=03, background=color, backgroundcolor=cyan,
> frame=off
>   ]{My header!}
> 
>   \blank[-0.5em]
> 
>   \startsecondary
> \input knuth
>   \stopsecondary
> \stopnarrower
> 
> \input knuth
> \stoptext
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:37 PM, Jon Wong > <mailto:jhannw...@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Ah, found the solution in TextBackground. At here: 
>> https://www.contextgarden.net/TextBackground 
>> <https://www.contextgarden.net/TextBackground>
>> 
>> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
>> TextBackgrounds, zero vspace between them)?
>> 
>> For the top segment, I want rounded corners only for top corners (corner=03 
>> with \framed).
>> 
>> Seems I really should dig into MetaFun and TextBackground. Looks really fun 
>> and useful.
>> 
>> Sorry for the noise. Am a little carried away exploring the Garden. :-P
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 9:25 PM, Jon Wong >> <mailto:jhannw...@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> Sorry, my solution didn’t work.
>>> 
>>> My purpose of using \startnarrower is to have some paragraphs of text 
>>> inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>>> 
>>> \startframedtext doesn’t have as many border options as \framed.
>>> 
>>> Should I use overlays? Or layers? It seems layers require absolutely 
>>> positioning, and can’t be logically contained inside a \startnarrower?
>>> 
>>> Regards
>>> Jon
>>> 
>>> 
>>>> On Aug 21, 2019, at 8:53 PM, Jon Wong >>> <mailto:jhannw...@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I got some progress!
>>>> 
>>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>>> \startnarrower
>>>> \dontleavehmode\framed[width=local]{testing}
>>>> 
>>>> Since this works for left offset: \framed[width=local]{testing}
>>>> \endnarrower
>>>> 
>>>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>>>> MetaPost and MetaFun some time. Is that where the solution is?
>>>> 
>>>> Regards
>>>> Jon
>>>> 
>>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong >>>> <mailto:jhannw...@gmail.com>> wrote:
>>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I want to have a \startnarrower effect. But I also want that segment to 
>>>>> have a border (hopefully a gradient background color too!).
>>>>> 
>>>>> I tried:
>>>>> 
>>>>> \startnarrower
>>>>> \framed{testing}
>>>>> 
>>>>> Seems framed doesn’t observe startnarrower commands.
>>>>> \endnarrower
>>>>> 
>>>>> How do I achieve that?
>>>>> 
>>>>> Regards
>>>>> Jon
>>>> 
>>> 
>> 
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

Ok, last message in this topic, I promise. I’ve crafted a MWE.

If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I need 
to revise my TeX notes. For now, can somebody give me a little encouragement 
and tell me the answer? :-P

\usecolors[xwi]
% \setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

\startnarrower
  \dontleavehmode\framed[
width=local, corner=03, background=color, backgroundcolor=cyan,
frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
\input knuth
  \stopsecondary
\stopnarrower

\input knuth
\stoptext

Regards
Jon


> On Aug 21, 2019, at 9:37 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Ah, found the solution in TextBackground. At here: 
> https://www.contextgarden.net/TextBackground 
> <https://www.contextgarden.net/TextBackground>
> 
> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
> TextBackgrounds, zero vspace between them)?
> 
> For the top segment, I want rounded corners only for top corners (corner=03 
> with \framed).
> 
> Seems I really should dig into MetaFun and TextBackground. Looks really fun 
> and useful.
> 
> Sorry for the noise. Am a little carried away exploring the Garden. :-P
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:25 PM, Jon Wong > <mailto:jhannw...@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Sorry, my solution didn’t work.
>> 
>> My purpose of using \startnarrower is to have some paragraphs of text inside 
>> the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>> 
>> \startframedtext doesn’t have as many border options as \framed.
>> 
>> Should I use overlays? Or layers? It seems layers require absolutely 
>> positioning, and can’t be logically contained inside a \startnarrower?
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 8:53 PM, Jon Wong >> <mailto:jhannw...@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I got some progress!
>>> 
>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>> \startnarrower
>>> \dontleavehmode\framed[width=local]{testing}
>>> 
>>> Since this works for left offset: \framed[width=local]{testing}
>>> \endnarrower
>>> 
>>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>>> MetaPost and MetaFun some time. Is that where the solution is?
>>> 
>>> Regards
>>> Jon
>>> 
>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong >>> <mailto:jhannw...@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I want to have a \startnarrower effect. But I also want that segment to 
>>>> have a border (hopefully a gradient background color too!).
>>>> 
>>>> I tried:
>>>> 
>>>> \startnarrower
>>>> \framed{testing}
>>>> 
>>>> Seems framed doesn’t observe startnarrower commands.
>>>> \endnarrower
>>>> 
>>>> How do I achieve that?
>>>> 
>>>> Regards
>>>> Jon
>>> 
>> 
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

Ah, found the solution in TextBackground. At here: 
https://www.contextgarden.net/TextBackground 
<https://www.contextgarden.net/TextBackground>

Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
TextBackgrounds, zero vspace between them)?

For the top segment, I want rounded corners only for top corners (corner=03 
with \framed).

Seems I really should dig into MetaFun and TextBackground. Looks really fun and 
useful.

Sorry for the noise. Am a little carried away exploring the Garden. :-P

Regards
Jon


> On Aug 21, 2019, at 9:25 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Sorry, my solution didn’t work.
> 
> My purpose of using \startnarrower is to have some paragraphs of text inside 
> the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
> 
> \startframedtext doesn’t have as many border options as \framed.
> 
> Should I use overlays? Or layers? It seems layers require absolutely 
> positioning, and can’t be logically contained inside a \startnarrower?
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 8:53 PM, Jon Wong  wrote:
>> 
>> Hi all,
>> 
>> I got some progress!
>> 
>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>> \startnarrower
>> \dontleavehmode\framed[width=local]{testing}
>> 
>> Since this works for left offset: \framed[width=local]{testing}
>> \endnarrower
>> 
>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>> MetaPost and MetaFun some time. Is that where the solution is?
>> 
>> Regards
>> Jon
>> 
>>> On Aug 21, 2019, at 8:14 PM, Jon Wong  wrote:
>>> 
>>> Hi all,
>>> 
>>> I want to have a \startnarrower effect. But I also want that segment to 
>>> have a border (hopefully a gradient background color too!).
>>> 
>>> I tried:
>>> 
>>> \startnarrower
>>> \framed{testing}
>>> 
>>> Seems framed doesn’t observe startnarrower commands.
>>> \endnarrower
>>> 
>>> How do I achieve that?
>>> 
>>> Regards
>>> Jon
>> 
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Captions with background

2019-08-04 Thread Hans Hagen

On 8/3/2019 5:22 PM, Henning Hraban Ramm wrote:

Hi,

in my books I typeset captions onto full page images, therefore I need a 
background; in the attached example it’s just a white box, usually I use a 
MetaPost shadow (some of you helped me with that a few years ago, current code 
see https://wiki.contextgarden.net/Drop_shadows).

Now, the background should just enclose the text, not more. Since I don’t know 
how long the caption will be (I use the whole setup in a macro), I need a \vbox 
within \setlayer, but that always uses the full \textwidth, regardless of width 
settings of \framed.

If the caption is short, the box should be minimal. Is this possible?


Even better would be a textbackground just behind the text lines.

Unfortunately my MP foo is not up to the task, the rectangular shadow was hard 
enough, but I’d try.
There’s an example in details.pdf, but I don’t understand how I could 
manipulate the path around the text (not: paragraph).


The example shows another problem: If you run it with --mode=arrange, the bleed 
is cut off.
Is this a matter of settings or a bug?


Greetlings, Hraban


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
\usemodule[visual]

\setuppapersize[A6][A6,oversized]

\setuplayout
   [location=middle,
marking=on,
grid=yes]

\setuppagenumbering
  [alternative=doublesided]

\starttext

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

\definelayer
  [footer]
  [width=\textwidth,
   height=\footerheight]

\setupbackgrounds
  [page]
  [background=page,
   state=start]

\setupbackgrounds
  [footer][text]
  [background=footer,
   state=start]

\setupfooter[strut=no]

\useMPlibrary[dum]

\showframe[frame=on]

\dorecurse{10} {

test

\page[left]

\setlayer
  [page]
  [x=-2mm,
   y=-2mm,
   preset=lefttop]
  {\externalfigure
 [bogus]
 [width=\dimexpr\paperwidth+2mm,
  height=\dimexpr\paperheight+4mm]
 [frame=on]}

\setlayerframed
  [footer]
  [preset=leftbottom]
  [frame=off,
   align=normal,
   background=color,
   backgroundcolor=white]
  {\fakewords{#1}{#1}}

\page[empty]

test

}

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Captions with background

2019-08-03 Thread Henning Hraban Ramm
Hi,

in my books I typeset captions onto full page images, therefore I need a 
background; in the attached example it’s just a white box, usually I use a 
MetaPost shadow (some of you helped me with that a few years ago, current code 
see https://wiki.contextgarden.net/Drop_shadows).

Now, the background should just enclose the text, not more. Since I don’t know 
how long the caption will be (I use the whole setup in a macro), I need a \vbox 
within \setlayer, but that always uses the full \textwidth, regardless of width 
settings of \framed.

If the caption is short, the box should be minimal. Is this possible?


Even better would be a textbackground just behind the text lines.

Unfortunately my MP foo is not up to the task, the rectangular shadow was hard 
enough, but I’d try.
There’s an example in details.pdf, but I don’t understand how I could 
manipulate the path around the text (not: paragraph).


The example shows another problem: If you run it with --mode=arrange, the bleed 
is cut off.
Is this a matter of settings or a bug?


Greetlings, Hraban


captiontest.tex
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Small pages and large framed texts

2019-03-21 Thread Willi Egger
Gosh Wolfgang! Thank you so much for your piece of code! — It starts to look 
nicer and nicer in my little project :-)

Kindest regards

Willi

> On 20 Mar 2019, at 22:31, Wolfgang Schuster 
>  wrote:
> 
> Willi Egger schrieb am 20.03.19 um 22:11:
>> It’s me again…
>> I appears that I was not clear enough, though I am happy about the 
>> possibility of using textbackground.
>> What I must do is to prepare a list of ConTeXt commands on a very small 
>> page. So the specific question is, how I can influence the 
>> \placelistofsorts[texcommand] in such a way, that the framed pieces break 
>> over the page.
> 
> \usemodule [setups]
> 
> \setuppapersize [A6] [A6]
> 
> \setupbodyfont [pagella,9pt]
> 
> \definetextbackground
>  [SetupsParameter]
>  [before=\blank,
>   after=\blank,
>   topoffset=10pt,
>   leftoffset=10pt,
>   location=paragraph,
>   frame=on]
> 
> \startsetups [xml:setups:start]
>  \starttextbackground [SetupsParameter]
> \stopsetups
> 
> \startsetups [xml:setups:stop]
>  \stoptextbackground
> \stopsetups
> 
> \starttext
> 
> \startsection[title={Short Version of the Command}]
> 
>  \cmdshortsetup [setupframed]
>  \cmdshortsetup [setupinteraction]
> 
> \stopsection
> 
> \startsection[title={\TEX-commands}]
> 
>  \placesetup
> 
> \stopsection
> 
> \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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Small pages and large framed texts

2019-03-20 Thread Wolfgang Schuster

Willi Egger schrieb am 20.03.19 um 22:11:

It’s me again…

I appears that I was not clear enough, though I am happy about the possibility 
of using textbackground.

What I must do is to prepare a list of ConTeXt commands on a very small page. 
So the specific question is, how I can influence the 
\placelistofsorts[texcommand] in such a way, that the framed pieces break over 
the page.


\usemodule [setups]

\setuppapersize [A6] [A6]

\setupbodyfont [pagella,9pt]

\definetextbackground
  [SetupsParameter]
  [before=\blank,
   after=\blank,
   topoffset=10pt,
   leftoffset=10pt,
   location=paragraph,
   frame=on]

\startsetups [xml:setups:start]
  \starttextbackground [SetupsParameter]
\stopsetups

\startsetups [xml:setups:stop]
  \stoptextbackground
\stopsetups

\starttext

\startsection[title={Short Version of the Command}]

  \cmdshortsetup [setupframed]
  \cmdshortsetup [setupinteraction]

\stopsection

\startsection[title={\TEX-commands}]

  \placesetup

\stopsection

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Small pages and large framed texts

2019-03-20 Thread Willi Egger
It’s me again…

I appears that I was not clear enough, though I am happy about the possibility 
of using textbackground.

What I must do is to prepare a list of ConTeXt commands on a very small page. 
So the specific question is, how I can influence the 
\placelistofsorts[texcommand] in such a way, that the framed pieces break over 
the page.

\usemodule[x][set-11]
\loadsetups[i-context]

\setuppapersize[A6][A6]

\setupbodyfont[pagella,rm,10pt]


\starttext

\startsection[title=hSort Version of the Command]

\shortsetup{setupframed}
\shortsetup{setupinteraction}

\stopsection

\startsection[title=\TEX -commands]

\placelistofsorts[texcommand]

\stopsection

\stoptext


Willi

> On 20 Mar 2019, at 20:48, Willi Egger  wrote:
> 
> Thank you Wolfgang, I will try this!
> 
> Willi
> 
>> On 20 Mar 2019, at 18:26, Willi Egger  wrote:
>> 
>> Hi,
>> 
>> I deal with a small project, in which I should be able to make a framed text 
>> break over the page. — Does anyone have an idea how to achieve this?
>> 
>> \setuppapersize[A6][A6]
>> 
>> \setupbodyfont[pagella,rm,10pt]
>> 
>> 
>> \starttext
>>  \framedtext
>>  {\dorecurse{3}{\input ward\blank}}
>> \stoptext
>> 
>> 
>> Any hints would be welcome
>> 
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Small pages and large framed texts

2019-03-20 Thread Wolfgang Schuster

Willi Egger schrieb am 20.03.19 um 18:26:

Hi,

I deal with a small project, in which I should be able to make a framed text 
break over the page. — Does anyone have an idea how to achieve this?

\setuppapersize[A6][A6]

\setupbodyfont[pagella,rm,10pt]


\starttext
\framedtext
{\dorecurse{3}{\input ward\blank}}
\stoptext


Any hints would be welcome


Use the textbackground environment.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Romain Diss
Le 18/03/2019, Aditya Mahajan a �crit
> On Mon, 18 Mar 2019, Romain Diss wrote:
> 
> > Le 13/03/2019, Aditya Mahajan a �crit
> > > > Is there a simple way to split a large \startframedtext environment over
> > > > multiple pages. It doesn't work out of the box and I didn't find any
> > > > option make it work in the wiki nor in the documentation I read.
> > > 
> > > Use backgrounds or textbackgrounds.
> > Thank you but I still can't achieve what I want to do whith this
> > command.
> > 
> > I try to make something similar to the frames in the
> > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > examples).
> > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > problems with 'textbackgrounds'.
> > 
> > In this minimal example, the frame doesn't appear (or if i set
> > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > right offsets are not took into account.
> 
> textbackground uses metapost for ALL backgrounds and the default metapost
> code to draw the background (draw_multi_pars, defined in mp-abck.mkiv)
> doesn't handle individual frames. So, you have to write your own metapost
> code to draw the side bar.
> 
> Another option for simple backgrounds is to use `\definebackground` instead
> of `definetextbackground`. The background mechanism doesn't have too many
> options, but does honor leftframe and rightframe by default.

It will take some time to understand everything in "mp-abck.mpiv" but it
will sure be very interesting.

Thank you.

-- 
Romain Diss
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Romain Diss
Le 18/03/2019, Alan Braslau a �crit
> On Mon, 18 Mar 2019 14:15:10 -0400 (EDT)
> Aditya Mahajan  wrote:
> 
> > On Mon, 18 Mar 2019, Romain Diss wrote:
> > 
> > > Le 13/03/2019, Aditya Mahajan a �crit  
> > >> > Is there a simple way to split a large \startframedtext environment 
> > >> > over
> > >> > multiple pages. It doesn't work out of the box and I didn't find any
> > >> > option make it work in the wiki nor in the documentation I read.  
> > >> 
> > >> Use backgrounds or textbackgrounds.  
> > > Thank you but I still can't achieve what I want to do whith this
> > > command.
> > >
> > > I try to make something similar to the frames in the
> > > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > > examples).
> > > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > > problems with 'textbackgrounds'.
> > >
> > > In this minimal example, the frame doesn't appear (or if i set
> > > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > > right offsets are not took into account.  
> > 
> > textbackground uses metapost for ALL backgrounds and the default metapost 
> > code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
> > doesn't handle individual frames. So, you have to write your own metapost 
> > code to draw the side bar.
> > 
> > Another option for simple backgrounds is to use `\definebackground` 
> > instead of `definetextbackground`. The background mechanism doesn't have 
> > too many options, but does honor leftframe and rightframe by default.
> > 
> > Aditya
> 
> You can look under
> doc/context/sources/general/manuals/publications/publications-style.tex
> to see how it is done.
All these source files where here, next to me, all this time and I didn't
know... Thank you very much!

-- 
Romain Diss
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Alan Braslau
On Mon, 18 Mar 2019 14:15:10 -0400 (EDT)
Aditya Mahajan  wrote:

> On Mon, 18 Mar 2019, Romain Diss wrote:
> 
> > Le 13/03/2019, Aditya Mahajan a �crit  
> >> > Is there a simple way to split a large \startframedtext environment over
> >> > multiple pages. It doesn't work out of the box and I didn't find any
> >> > option make it work in the wiki nor in the documentation I read.  
> >> 
> >> Use backgrounds or textbackgrounds.  
> > Thank you but I still can't achieve what I want to do whith this
> > command.
> >
> > I try to make something similar to the frames in the
> > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > examples).
> > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > problems with 'textbackgrounds'.
> >
> > In this minimal example, the frame doesn't appear (or if i set
> > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > right offsets are not took into account.  
> 
> textbackground uses metapost for ALL backgrounds and the default metapost 
> code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
> doesn't handle individual frames. So, you have to write your own metapost 
> code to draw the side bar.
> 
> Another option for simple backgrounds is to use `\definebackground` 
> instead of `definetextbackground`. The background mechanism doesn't have 
> too many options, but does honor leftframe and rightframe by default.
> 
> Aditya

You can look under
doc/context/sources/general/manuals/publications/publications-style.tex
to see how it is done.

Alan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Aditya Mahajan

On Mon, 18 Mar 2019, Romain Diss wrote:


Le 13/03/2019, Aditya Mahajan a �crit

> Is there a simple way to split a large \startframedtext environment over
> multiple pages. It doesn't work out of the box and I didn't find any
> option make it work in the wiki nor in the documentation I read.

Use backgrounds or textbackgrounds.

Thank you but I still can't achieve what I want to do whith this
command.

I try to make something similar to the frames in the
"mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
examples).
I suppose Hans Hagen made use of metafun to do it but I encounter some
problems with 'textbackgrounds'.

In this minimal example, the frame doesn't appear (or if i set
[frame=on,leftframe=off] all the frame is rendered) and the left and
right offsets are not took into account.


textbackground uses metapost for ALL backgrounds and the default metapost 
code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
doesn't handle individual frames. So, you have to write your own metapost 
code to draw the side bar.


Another option for simple backgrounds is to use `\definebackground` 
instead of `definetextbackground`. The background mechanism doesn't have 
too many options, but does honor leftframe and rightframe by default.


Aditya___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Textbackground offset with multi-col paragraphs

2017-11-23 Thread Thomas Floeren
> On 2. Nov 2017, at 15:17, Thomas Floeren <t...@mac.com> wrote:
> 
> Hi,
> 
> I noticed that with one of the recent betas the right offset of my 
> textbackgrounds doesn’t work properly anymore when the textbackground 
> contains a multi-column “paragraph”.
> 
> A minimal:
> 
> \defineparagraphs [TestPar][n=2, distance=7mm]
> \setupparagraphs [TestPar][1][width=2em]
> 
> \definetextbackground [CB][
> location=paragraph,
> backgroundcolor=gray,
> leftoffset=.3em,
> rightoffset=.3em,
> topoffset=.3em,
> bottomoffset=.3em,
> frame=off
> ]
> 
> \starttext
> 
> \starttextbackground [CB]
> \dorecurse {40} {a b c } 
> \stoptextbackground
> 
> text
> 
> \starttextbackground [CB]
> \startTestPar
> img
> \TestPar
> \dorecurse {40} {a b c } 
> \stopTestPar
> \stoptextbackground
> 
> \stoptext
> 
> 
> The first box is OK and as expected. But with the second one (containing a 
> “paragraph”) the right offset gets miscalculated, so that the text runs into 
> the edge of the background.
> 
> With a beta from July or so the behavior was still OK.
> 

Any news on this?

Just to know if I should wait for a fix, or rather adapt my existing documents.

Thanks,

-- 
Tom

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Textbackground offset with multi-col paragraphs

2017-11-02 Thread Thomas Floeren
> On 2. Nov 2017, at 18:55, Pablo Rodriguez <oi...@gmx.es> wrote:
> 
> On 11/02/2017 03:17 PM, Thomas Floeren wrote:
>> Hi,
>> 
>> I noticed that with one of the recent betas the right offset of my
>> textbackgrounds doesn’t work properly anymore when the textbackground
>> contains a multi-column “paragraph”.
>> 
>> The first box is OK and as expected. But with the second one
>> (containing a “paragraph”) the right offset gets miscalculated, so that
>> the text runs into the edge of the background.
>> 
>> With a beta from July or so the behavior was still OK.
> 
> Hi Thomas,
> 
> I can confirm the bug. It works fine with ConTeXt from TeX Live 2017,
> but not with latest beta (that I get to work) from 2017.10.29 15:44.
> 

Hi Pablo,

thanks for testing.

For me it’s still fine with 2017.07.30 19:30.
Not fine with 2017.10.29 15:44 and 2017.11.01 15:58.

-- 
Tom


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Textbackground offset with multi-col paragraphs

2017-11-02 Thread Pablo Rodriguez
On 11/02/2017 03:17 PM, Thomas Floeren wrote:
> Hi,
> 
> I noticed that with one of the recent betas the right offset of my
> textbackgrounds doesn’t work properly anymore when the textbackground
> contains a multi-column “paragraph”.
> 
> The first box is OK and as expected. But with the second one
> (containing a “paragraph”) the right offset gets miscalculated, so that
> the text runs into the edge of the background.
> 
> With a beta from July or so the behavior was still OK.

Hi Thomas,

I can confirm the bug. It works fine with ConTeXt from TeX Live 2017,
but not with latest beta (that I get to work) from 2017.10.29 15:44.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Textbackground offset with multi-col paragraphs

2017-11-02 Thread Thomas Floeren
Hi,

I noticed that with one of the recent betas the right offset of my 
textbackgrounds doesn’t work properly anymore when the textbackground contains 
a multi-column “paragraph”.

A minimal:

\defineparagraphs [TestPar][n=2, distance=7mm]
\setupparagraphs [TestPar][1][width=2em]

\definetextbackground [CB][
location=paragraph,
backgroundcolor=gray,
leftoffset=.3em,
rightoffset=.3em,
topoffset=.3em,
bottomoffset=.3em,
frame=off
]

\starttext

\starttextbackground [CB]
\dorecurse {40} {a b c } 
\stoptextbackground

text

\starttextbackground [CB]
\startTestPar
img
\TestPar
\dorecurse {40} {a b c } 
\stopTestPar
\stoptextbackground

\stoptext


The first box is OK and as expected. But with the second one (containing a 
“paragraph”) the right offset gets miscalculated, so that the text runs into 
the edge of the background.

With a beta from July or so the behavior was still OK.

Thanks for any advice,
best,

-- 
Tom

http://dflect.net/context-typeset-tool/

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Wed, 19 Jul 2017, Gerion Entrup wrote:


Am Mittwoch, 19. Juli 2017, 21:07:09 CEST schrieb Aditya Mahajan:

On Wed, 19 Jul 2017, Gerion Entrup wrote:

> Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
>> On Mon, 17 Jul 2017, Gerion Entrup wrote:
>>
>>> Hi,
>>>
>>> I have two questions with the vim module.
>>>
>>> 1. I want to use the math mode inside the code. I've seen the escape option,
>>> e.g. here [1], but this seems to work only with comments. Is there a
>>> possibility to use it directly in the code, too?
>>
>> Short answer. No.
>>
>> Long answer. t-vim relies on vim to syntax highlight the code. Since the
>> code is not valid python, the default python syntax highlighting will not
>> work. In principle, it is possible to write a vim syntax highlighting
>> script for a derivative of python where math terms are allowed, but that
>> requires a lot of work for each language. The whole point of t-vim module
>> was that I am lazy and don't want to write the parser for each language
>> :-)
>
> I've invested some time and rewrote parts of the vimscript file of t-vim.
> Now one or more escapechars can be defined, that helps vim to not interpret
> the text:

I'll look at this later

> Another point I saw is, that highlight together with TeX-code is not really 
usable:
> ```
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on]
>
> \starttext
> \startpython[highlight=1]
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> \stoppython
> \stoptext
> ```

By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:


\definetextbackground[texthighlight]
 [
   background=color,
   backgroundcolor=gray,
   frame=off,
 ]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
   print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
   print(x)
\stoppython
\stoptext

Thank you, this works much better (critic on high level: the sum symbol is
higher than the highlight box, relevant on fractions).


Another option (slightly better visually, but increases the interline 
distance)


\defineframed[texthighlight]
[
  background=color,
  backgroundcolor=gray,
  frame=off,
  location=middle,
]

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on,
highlightcommand=\dontleavehmode\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
  print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
  print(x)
\stoppython
\stoptext

Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Thu, 20 Jul 2017, Henri Menke wrote:


On Wed, 2017-07-19 at 15:07 -0400, Aditya Mahajan wrote:

On Wed, 19 Jul 2017, Gerion Entrup wrote:

> 
> Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> > 
> > On Mon, 17 Jul 2017, Gerion Entrup wrote:
> > 
> > > 
> > > Hi,
> > > 
> > > I have two questions with the vim module.
> > > 
> > > 1. I want to use the math mode inside the code. I've seen the escape option,

> > > e.g. here [1], but this seems to work only with comments. Is there a
> > > possibility to use it directly in the code, too?
> > Short answer. No.
> > 
> > Long answer. t-vim relies on vim to syntax highlight the code. Since the

> > code is not valid python, the default python syntax highlighting will not
> > work. In principle, it is possible to write a vim syntax highlighting
> > script for a derivative of python where math terms are allowed, but that
> > requires a lot of work for each language. The whole point of t-vim module
> > was that I am lazy and don't want to write the parser for each language
> > :-)
> I've invested some time and rewrote parts of the vimscript file of t-vim.
> Now one or more escapechars can be defined, that helps vim to not interpret
> the text:
I'll look at this later

> 
> Another point I saw is, that highlight together with TeX-code is not really usable:

> ```
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on]
> 
> \starttext

> \startpython[highlight=1]
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> \stoppython
> \stoptext
> ```
By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:

\definetextbackground[texthighlight]
 [
   background=color,
   backgroundcolor=gray,
   frame=off,
 ]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
   print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
   print(x)
\stoppython
\stoptext

The spacing in math mode is bad. What is happening is the following. To 
make sure that spaces are obeyed in the code listing, I set (a modified 
version of) \activatespacehandler{on}, so the output that you get is the 
following:

{\obeyspaces
  \def\obeyedspace{\hskip\interwordspace\relax}
\m{\sum_{i=1}^{n}i \in F \int_i f}}

The simplest way to fix this is to define a new command:

\define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}


Why not just this?

\def\obeyedspace{\ifmmode\else\hskip\interwordspace\relax\fi}


That's a good suggestion and will be easier to incorporate in t-vim.

Thanks,
Aditya___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Henri Menke
On Wed, 2017-07-19 at 15:07 -0400, Aditya Mahajan wrote:
> On Wed, 19 Jul 2017, Gerion Entrup wrote:
> 
> > 
> > Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> > > 
> > > On Mon, 17 Jul 2017, Gerion Entrup wrote:
> > > 
> > > > 
> > > > Hi,
> > > > 
> > > > I have two questions with the vim module.
> > > > 
> > > > 1. I want to use the math mode inside the code. I've seen the escape 
> > > > option,
> > > > e.g. here [1], but this seems to work only with comments. Is there a
> > > > possibility to use it directly in the code, too?
> > > Short answer. No.
> > > 
> > > Long answer. t-vim relies on vim to syntax highlight the code. Since the
> > > code is not valid python, the default python syntax highlighting will not
> > > work. In principle, it is possible to write a vim syntax highlighting
> > > script for a derivative of python where math terms are allowed, but that
> > > requires a lot of work for each language. The whole point of t-vim module
> > > was that I am lazy and don't want to write the parser for each language
> > > :-)
> > I've invested some time and rewrote parts of the vimscript file of t-vim.
> > Now one or more escapechars can be defined, that helps vim to not interpret
> > the text:
> I'll look at this later
> 
> > 
> > Another point I saw is, that highlight together with TeX-code is not really 
> > usable:
> > ```
> > \usemodule[vim]
> > \definevimtyping[python][syntax=python, escape=on]
> > 
> > \starttext
> > \startpython[highlight=1]
> > # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> > \stoppython
> > \stoptext
> > ```
> By default, the highlighting is done using the bars mechanism. It works 
> for simple cases but fails with math mode (the spaces are not covered). 
> One option is to highlight using the textbackground mechanism:
> 
> \definetextbackground[texthighlight]
>  [
>    background=color,
>    backgroundcolor=gray,
>    frame=off,
>  ]
> 
> \define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}
> 
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on, 
> highlightcommand=\texthighlight]
> 
> \starttext
> 
> \startpython[highlight=3]
> for x in 1:n
>    print(x)
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> for x in 1:n
>    print(x)
> \stoppython
> \stoptext
> 
> The spacing in math mode is bad. What is happening is the following. To 
> make sure that spaces are obeyed in the code listing, I set (a modified 
> version of) \activatespacehandler{on}, so the output that you get is the 
> following:
> 
> {\obeyspaces
>   \def\obeyedspace{\hskip\interwordspace\relax}
> \m{\sum_{i=1}^{n}i \in F \int_i f}}
> 
> The simplest way to fix this is to define a new command:
> 
> \define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}

Why not just this?

\def\obeyedspace{\ifmmode\else\hskip\interwordspace\relax\fi}

> 
> and use \MATH{} instead of \m{}.
> 
> I'll test this is a bit, and if the solution is robust, then I will map 
> \m{...} to something equivalent to the above in the t-vim environments.
> 
> 
> Aditya
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Gerion Entrup
Am Mittwoch, 19. Juli 2017, 21:07:09 CEST schrieb Aditya Mahajan:
> On Wed, 19 Jul 2017, Gerion Entrup wrote:
> 
> > Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:
> >> On Mon, 17 Jul 2017, Gerion Entrup wrote:
> >>
> >>> Hi,
> >>>
> >>> I have two questions with the vim module.
> >>>
> >>> 1. I want to use the math mode inside the code. I've seen the escape 
> >>> option,
> >>> e.g. here [1], but this seems to work only with comments. Is there a
> >>> possibility to use it directly in the code, too?
> >>
> >> Short answer. No.
> >>
> >> Long answer. t-vim relies on vim to syntax highlight the code. Since the
> >> code is not valid python, the default python syntax highlighting will not
> >> work. In principle, it is possible to write a vim syntax highlighting
> >> script for a derivative of python where math terms are allowed, but that
> >> requires a lot of work for each language. The whole point of t-vim module
> >> was that I am lazy and don't want to write the parser for each language
> >> :-)
> >
> > I've invested some time and rewrote parts of the vimscript file of t-vim.
> > Now one or more escapechars can be defined, that helps vim to not interpret
> > the text:
> 
> I'll look at this later
> 
> > Another point I saw is, that highlight together with TeX-code is not really 
> > usable:
> > ```
> > \usemodule[vim]
> > \definevimtyping[python][syntax=python, escape=on]
> >
> > \starttext
> > \startpython[highlight=1]
> > # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> > \stoppython
> > \stoptext
> > ```
> 
> By default, the highlighting is done using the bars mechanism. It works 
> for simple cases but fails with math mode (the spaces are not covered). 
> One option is to highlight using the textbackground mechanism:
> 
> \definetextbackground[texthighlight]
>  [
>background=color,
>backgroundcolor=gray,
>frame=off,
>  ]
> 
> \define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}
> 
> \usemodule[vim]
> \definevimtyping[python][syntax=python, escape=on, 
> highlightcommand=\texthighlight]
> 
> \starttext
> 
> \startpython[highlight=3]
> for x in 1:n
>print(x)
> # Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
> for x in 1:n
>print(x)
> \stoppython
> \stoptext
Thank you, this works much better (critic on high level: the sum symbol is
higher than the highlight box, relevant on fractions).

 
> The spacing in math mode is bad. What is happening is the following. To 
> make sure that spaces are obeyed in the code listing, I set (a modified 
> version of) \activatespacehandler{on}, so the output that you get is the 
> following:
> 
> {\obeyspaces
>   \def\obeyedspace{\hskip\interwordspace\relax}
> \m{\sum_{i=1}^{n}i \in F \int_i f}}
> 
> The simplest way to fix this is to define a new command:
> 
> \define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}
> 
> and use \MATH{} instead of \m{}.
> 
> I'll test this is a bit, and if the solution is robust, then I will map 
> \m{...} to something equivalent to the above in the t-vim environments.
I saw the strange spacing. Thank you very much to provide a solution.

Gerion

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] t-vim module: math in "normal" code and background color

2017-07-19 Thread Aditya Mahajan

On Wed, 19 Jul 2017, Gerion Entrup wrote:


Am Dienstag, 18. Juli 2017, 04:04:51 CEST schrieb Aditya Mahajan:

On Mon, 17 Jul 2017, Gerion Entrup wrote:


Hi,

I have two questions with the vim module.

1. I want to use the math mode inside the code. I've seen the escape option,
e.g. here [1], but this seems to work only with comments. Is there a
possibility to use it directly in the code, too?


Short answer. No.

Long answer. t-vim relies on vim to syntax highlight the code. Since the
code is not valid python, the default python syntax highlighting will not
work. In principle, it is possible to write a vim syntax highlighting
script for a derivative of python where math terms are allowed, but that
requires a lot of work for each language. The whole point of t-vim module
was that I am lazy and don't want to write the parser for each language
:-)


I've invested some time and rewrote parts of the vimscript file of t-vim.
Now one or more escapechars can be defined, that helps vim to not interpret
the text:


I'll look at this later


Another point I saw is, that highlight together with TeX-code is not really 
usable:
```
\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on]

\starttext
\startpython[highlight=1]
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
\stoppython
\stoptext
```


By default, the highlighting is done using the bars mechanism. It works 
for simple cases but fails with math mode (the spaces are not covered). 
One option is to highlight using the textbackground mechanism:


\definetextbackground[texthighlight]
[
  background=color,
  backgroundcolor=gray,
  frame=off,
]

\define[1]\texthighlight{\starttexthighlight#1\stoptexthighlight}

\usemodule[vim]
\definevimtyping[python][syntax=python, escape=on, 
highlightcommand=\texthighlight]

\starttext

\startpython[highlight=3]
for x in 1:n
  print(x)
# Returns \m{\sum_{i=1}^{n}i \in F \int_i f}
for x in 1:n
  print(x)
\stoppython
\stoptext

The spacing in math mode is bad. What is happening is the following. To 
make sure that spaces are obeyed in the code listing, I set (a modified 
version of) \activatespacehandler{on}, so the output that you get is the 
following:


{\obeyspaces
 \def\obeyedspace{\hskip\interwordspace\relax}
\m{\sum_{i=1}^{n}i \in F \int_i f}}

The simplest way to fix this is to define a new command:

\define[1]\MATH{\bgroup\activatespacehandler{off}\m{\rescan{#1}}\egroup}

and use \MATH{} instead of \m{}.

I'll test this is a bit, and if the solution is robust, then I will map 
\m{...} to something equivalent to the above in the t-vim environments.



Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-16 Thread Mathias Schickel

> Am 15.07.2017 um 21:55 schrieb Hans Hagen <pra...@wxs.nl>:
> 
> On 7/15/2017 9:11 PM, Alan Braslau wrote:
>> On Wed, 12 Jul 2017 19:05:26 +0200
>> Hans Hagen <pra...@wxs.nl> wrote:
>>> best play with textbackgrounds
>>> 
>>> \starttext
>>> 
>>> \starttextbackground
>>> \dorecurse{10}{test\footnote{tufte}: \input tufte\par}
>>> \stoptextbackground
>>> 
>>> \stoptext
>>> 
>> I have found the following to be necessary when using textbackground,
>> especially when backgrounds cross page boundaries:
>> \setnewconstant\kindofpagetextareas\plusone
>> % partial page. HH: low level, no high level switch (yet)
>> Maybe Hans can explain this?
> Because it's an option (with no parameter yet .. not sure where/how to 
> configure it; for floats one can do it per float)
> 

\setnewconstant\kindofpagetextareas\plusone

That indeed solves the problem of the textbackground extended over footnotes. 
Is that anywhere documented? I did not find that anywhere. And what exactly 
does that command do?

Would it not be a good idea to add this as an option in the definition of a 
textbackground?

Mathias

> Hans
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | 
> www.pragma-pod.nl <http://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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-15 Thread Hans Hagen

On 7/15/2017 9:11 PM, Alan Braslau wrote:

On Wed, 12 Jul 2017 19:05:26 +0200
Hans Hagen <pra...@wxs.nl> wrote:


best play with textbackgrounds

\starttext

\starttextbackground
\dorecurse{10}{test\footnote{tufte}: \input tufte\par}
\stoptextbackground

\stoptext



I have found the following to be necessary when using textbackground,
especially when backgrounds cross page boundaries:

\setnewconstant\kindofpagetextareas\plusone
% partial page. HH: low level, no high level switch (yet)

Maybe Hans can explain this?
Because it's an option (with no parameter yet .. not sure where/how to 
configure it; for floats one can do it per float)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-15 Thread Alan Braslau
On Wed, 12 Jul 2017 19:05:26 +0200
Hans Hagen <pra...@wxs.nl> wrote:

> best play with textbackgrounds
> 
> \starttext
> 
> \starttextbackground
> \dorecurse{10}{test\footnote{tufte}: \input tufte\par}
> \stoptextbackground
> 
> \stoptext
> 

I have found the following to be necessary when using textbackground,
especially when backgrounds cross page boundaries:

\setnewconstant\kindofpagetextareas\plusone
% partial page. HH: low level, no high level switch (yet)

Maybe Hans can explain this?

Alan


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-12 Thread Mathias Schickel
Am 10.07.2017 um 20:23 schrieb Mathias Schickel <m...@fa.uni-tuebingen.de>:Am 10.07.2017 um 12:50 schrieb Pablo Rodriguez <oi...@gmx.es>:On 07/08/2017 03:17 PM, Mathias Schickel wrote:Dear Andreas, Pablo and the list,I did read your question and answer with great interest, since Iencountered similar issues. Sadly your trick to get footnotes that aredefined in some environments like tables displayed at the bottom of thepage does not work if you try it using backgrounds. Here I provide aminimal example that shows the problem:Dear Mathias,I didn’t even know that backgrounds existed in ConTeXt.Framed texts does the trick with your sample:  \setupframedtext [width=\textwidth,  frame=on,  rulethickness=1pt,  corner=0,  offset=12pt]  \starttext  \startframedtext  If you typeset text with background,  the footnote workaround does not work.  \postponenotes\footnote{So what could  I do to get this footnote displayed?  Use framed texts.}  \stopframedtext  \flushnotes  \stoptextBut if you really need a background, I’m afraid it won’t work (or Idon’t know how to make it work).Just in case it might help,PabloDear Pablo,thank you very much for your suggestion! Sadly I have noticed that framed texts do not break across pages (at least if I simply copy and use your code). I remember that I switched to backgrounds (from \definetextbackground) because I did get problems at page breaks. Regarding that backgrounds showed the best behaviour but sadly it has the described problems using footnotes.Do you have any further suggestions how I can enable framed text to break across pages?And can anyone tell me how I can get rid of the problem of backgrounds and footnotes?Again, thank you very much for your kind help!BestMathiasDoes no-one know what I can do to settle the problem? I have created a minimal example that shows the problem using textbackground to work around the footnote problem. But sadly the framedtext environment does not seem to be able to break across pages. Besides I would prefer the background solution. So what can I do to get the footnotes in a background environment displayed?Help appreciated!BestMathiasThe minimal example follows:%%\setupbackground[	width=\textwidth,	frame=on,	framecolor=black,	rulethickness=1pt,	background="">	backgroundcolor=green,	corner=0,	before={\blank[4*small]},	after={\blank[5*small]},	topoffset=10pt,    bottomoffset=10pt,    leftoffset=10pt,   	rightoffset=10pt]\setupframedtext      [width=\textwidth,       frame=on,       framecolor=black,       rulethickness=1pt,       background="">	   backgroundcolor=red,       corner=0,       offset=12pt]     \starttext%\startbackground	%	If you typeset text with background, the footnote workaround does not work.\postponenotes\footnote{So what could I do to get this footnote displayed?}	%\stopbackground\flushnotes%\startbackground	%	One advantages of backgrounds is that they break across pages, as you can see here:	%	\dorecurse{5}{%		\input{knuth}%		}	%\stopbackground%Compare that to the output of framedtext (the gap on this page is not intended!):%\startframedtext	%	Here I am getting trouble with breaking across pages.	This was the first reason why I switched to backgrounds.	%	\dorecurse{5}{%		\input{knuth}%	}   	%\stopframedtext%\stoptext%%

FramedFootnote.pdf
Description: Adobe PDF document
-- 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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Textbackground issue with margin pictures

2017-04-03 Thread Hans Hagen

On 4/3/2017 2:58 PM, Tom wrote:

On 3. Apr 2017, at 10:16, Hans Hagen <pra...@wxs.nl> wrote:

On 4/3/2017 2:20 AM, Tom wrote:

Hi,

today I updated from ConTeXt 2015.11.19 to the recent Beta 2017.03.26 16:15.

I noticed that my textbackgrounds now interfere with margin pictures, that is,
if there is a margin picture at the side of a textbackground, then the
textbackground is suppressed for the entire height of the margin picture.


Here is a minimal:

\setuplayout [
leftmargin=0mm,
rightmargin=45mm,
height=fit,
width=fit,
]

\definetextbackground [test]

\starttext

\placefigure [margin]{}{}

\starttextbackground [test]
\dorecurse{3}{\readfile{ward}{}{}}
\stoptextbackground

\stoptext


With the ConTeXt Current from 2016.05.19 13:43 I don’t see the issue, 
everything’s fine there.

Here are two screenshots:

Desired behavior (Ctx Current): http://d.pr/i/Xgtc
Non-desired behavior (Ctx Beta): http://d.pr/i/1gyi

Is this a bug?


\definetextbackground [test] [location=paragraph]

\setupfloat[figure][freeregion=no]




Thank you, Hans, this works absolutely great!

Two little questions:

I have set it now globally for _all_ floats as \setupfloats[freeregion=no].
At a first glance it doesn’t seem to cause any issues.
Is there any pitfall when setting it globally, which I might not be aware?

Is 'freeregion=no' an option that is meant to stay, or is it a workaround for 
the recent betas?


it will stay (being a feature)

Hans


--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Textbackground issue with margin pictures

2017-04-03 Thread Tom
> On 3. Apr 2017, at 10:16, Hans Hagen <pra...@wxs.nl> wrote:
> 
> On 4/3/2017 2:20 AM, Tom wrote:
>> Hi,
>> 
>> today I updated from ConTeXt 2015.11.19 to the recent Beta 2017.03.26 16:15.
>> 
>> I noticed that my textbackgrounds now interfere with margin pictures, that 
>> is,
>> if there is a margin picture at the side of a textbackground, then the
>> textbackground is suppressed for the entire height of the margin picture.
>> 
>> 
>> Here is a minimal:
>> 
>> \setuplayout [
>> leftmargin=0mm,
>> rightmargin=45mm,
>> height=fit,
>> width=fit,
>> ]
>> 
>> \definetextbackground [test]
>> 
>> \starttext
>> 
>> \placefigure [margin]{}{}
>> 
>> \starttextbackground [test]
>> \dorecurse{3}{\readfile{ward}{}{}}
>> \stoptextbackground
>> 
>> \stoptext
>> 
>> 
>> With the ConTeXt Current from 2016.05.19 13:43 I don’t see the issue, 
>> everything’s fine there.
>> 
>> Here are two screenshots:
>> 
>> Desired behavior (Ctx Current): http://d.pr/i/Xgtc
>> Non-desired behavior (Ctx Beta): http://d.pr/i/1gyi
>> 
>> Is this a bug?
> 
> \definetextbackground [test] [location=paragraph]
> 
> \setupfloat[figure][freeregion=no]



Thank you, Hans, this works absolutely great!

Two little questions:

I have set it now globally for _all_ floats as \setupfloats[freeregion=no].
At a first glance it doesn’t seem to cause any issues. 
Is there any pitfall when setting it globally, which I might not be aware?

Is 'freeregion=no' an option that is meant to stay, or is it a workaround for 
the recent betas?

Thanks again,
Best,
-- 
Tom



> 
> \starttext
> 
> \placefigure [margin]{}{}
> 
> \starttextbackground [test]
>\dorecurse{3}{\readfile{ward}{}{}}
>\placefigure {}{}
>\dorecurse{3}{\readfile{ward}{}{}}
> \stoptextbackground
> 
> \stoptext
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Textbackground issue with margin pictures

2017-04-03 Thread Hans Hagen

On 4/3/2017 2:20 AM, Tom wrote:

Hi,

today I updated from ConTeXt 2015.11.19 to the recent Beta 2017.03.26 16:15.

I noticed that my textbackgrounds now interfere with margin pictures, that is,
if there is a margin picture at the side of a textbackground, then the
textbackground is suppressed for the entire height of the margin picture.


Here is a minimal:

\setuplayout [
leftmargin=0mm,
rightmargin=45mm,
height=fit,
width=fit,
]

\definetextbackground [test]

\starttext

\placefigure [margin]{}{}

\starttextbackground [test]
\dorecurse{3}{\readfile{ward}{}{}}
\stoptextbackground

\stoptext


With the ConTeXt Current from 2016.05.19 13:43 I don’t see the issue, 
everything’s fine there.

Here are two screenshots:

Desired behavior (Ctx Current): http://d.pr/i/Xgtc
Non-desired behavior (Ctx Beta): http://d.pr/i/1gyi

Is this a bug?


\definetextbackground [test] [location=paragraph]

\setupfloat[figure][freeregion=no]

\starttext

\placefigure [margin]{}{}

\starttextbackground [test]
\dorecurse{3}{\readfile{ward}{}{}}
\placefigure {}{}
\dorecurse{3}{\readfile{ward}{}{}}
\stoptextbackground

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Textbackground issue with margin pictures

2017-04-02 Thread Tom
Hi,

today I updated from ConTeXt 2015.11.19 to the recent Beta 2017.03.26 16:15.

I noticed that my textbackgrounds now interfere with margin pictures, that is,
if there is a margin picture at the side of a textbackground, then the 
textbackground is suppressed for the entire height of the margin picture.


Here is a minimal:

\setuplayout [
leftmargin=0mm,
rightmargin=45mm,
height=fit,
width=fit,
]

\definetextbackground [test] 

\starttext

\placefigure [margin]{}{}

\starttextbackground [test]
\dorecurse{3}{\readfile{ward}{}{}}
\stoptextbackground

\stoptext


With the ConTeXt Current from 2016.05.19 13:43 I don’t see the issue, 
everything’s fine there.

Here are two screenshots:

Desired behavior (Ctx Current): http://d.pr/i/Xgtc
Non-desired behavior (Ctx Beta): http://d.pr/i/1gyi

Is this a bug?

Thanks for any help.

-- 
Thomas Floeren


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] RTL bug in textbackground

2016-07-03 Thread Hans Hagen

On 7/3/2016 6:46 PM, Mohammad Hossein Bateni wrote:

Hello,

When using \definetextbackground in RTL setting, the boundaries are not
determined correctly (both for location=paragraph and location=text) and
colors gets messed up.

Here a sort-of-minimal example adapted from details.pdf.  Is there any
particular keys I should use in RTL to fix the issue?


\setupcolors[state=start]
\definecolor[infogray][s=0.5]
\definecolor[textgray][s=0.8]

\definetextbackground[intro]
 [backgroundcolor=infogray,
   backgroundoffset=.25cm,
   offset=.5cm,
   frame=on,framecolor=red,
   location=paragraph,
   color=white]

\definetextbackground[subintro]
 [backgroundcolor=textgray,
   backgroundoffset=0pt,
   offset=0pt,
   frame=off,
   location=text,
   color=blue]

\starttext

\starttextbackground[intro]
A rather common way to draw attention to a passage, is to add
a background. In this chapter we will therefore discuss how
to enhance your document with \starttextbackground [subintro]
colorful areas that either or not follow the shape of your
paragraph. \stoptextbackground\ Be warned: this chapter has
so many backgrounds that you should consider wearing sunglasses.
\stoptextbackground

\blank[3*big]

\righttoleft
\starttextbackground[intro]
A rather common way to draw attention to a passage, is to add
a background. In this chapter we will therefore discuss how
to enhance your document with \starttextbackground [subintro]
colorful areas that either or not follow the shape of your
paragraph. \stoptextbackground\ Be warned: this chapter has
so many backgrounds that you should consider wearing sunglasses.
\stoptextbackground
\stoptext


I think i fixed it (no upload yet) but this kind of tricky things 
probably need some time to get sorted out.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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] RTL bug in textbackground

2016-07-03 Thread Mohammad Hossein Bateni
Hello,

When using \definetextbackground in RTL setting, the boundaries are not
determined correctly (both for location=paragraph and location=text) and
colors gets messed up.

Here a sort-of-minimal example adapted from details.pdf.  Is there any
particular keys I should use in RTL to fix the issue?


\setupcolors[state=start]
\definecolor[infogray][s=0.5]
\definecolor[textgray][s=0.8]

\definetextbackground[intro]
 [backgroundcolor=infogray,
   backgroundoffset=.25cm,
   offset=.5cm,
   frame=on,framecolor=red,
   location=paragraph,
   color=white]

\definetextbackground[subintro]
 [backgroundcolor=textgray,
   backgroundoffset=0pt,
   offset=0pt,
   frame=off,
   location=text,
   color=blue]

\starttext

\starttextbackground[intro]
A rather common way to draw attention to a passage, is to add
a background. In this chapter we will therefore discuss how
to enhance your document with \starttextbackground [subintro]
colorful areas that either or not follow the shape of your
paragraph. \stoptextbackground\ Be warned: this chapter has
so many backgrounds that you should consider wearing sunglasses.
\stoptextbackground

\blank[3*big]

\righttoleft
\starttextbackground[intro]
A rather common way to draw attention to a passage, is to add
a background. In this chapter we will therefore discuss how
to enhance your document with \starttextbackground [subintro]
colorful areas that either or not follow the shape of your
paragraph. \stoptextbackground\ Be warned: this chapter has
so many backgrounds that you should consider wearing sunglasses.
\stoptextbackground
\stoptext


Thanks,
MHB
___
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] Overlays as background in textbackground

2016-05-18 Thread Alan BRASLAU
Here is a trick (due to Hans, of course) to produce a watermark image.
You can play with the idea in order to produce your own effect.

\definecolor [percent] [s=1,a=1,t=.9]
\externalfigure [cow] [background={foreground,color},backgroundcolor=percent]

Alan

On Wed, 18 May 2016 11:55:11 +
"Meer, Hans van der"  wrote:

> This code from three years back ia a reply to a question of placing
> an overlay background. Because the cow is very black I am curious if
> the \externalfigure can have a paramter to change the alpha of the
> cow, making it more transparent. By the way, it is not out of
> curiosity only. If possible it would forego the need to make separate
> pictures of different transparency beforehand.
> 
> > On 15 Jul 2013, at 11:22, Hans Hagen  wrote:
> > 
> > \definetextbackground [mybackgroundOverlay]
> > [mp=mpos:region:whatever]
> > 
> > \startuseMPgraphic{mpos:region:whatever}
> >for i=1 upto nofmultipars :
> >draw textext("\externalfigure[cow.pdf]") rotated 10 shifted
> > center multipars[i] ; endfor ;
> > \stopuseMPgraphic
> > 
> > \starttext
> > 
> >  \startmybackgroundOverlay
> >\dorecurse{10}{\input knuth \par}
> >  \stopmybackgroundOverlay
> > 
> > \stoptext
> 
> Hans van der Meer
___
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] Overlays as background in textbackground

2016-05-18 Thread Meer, Hans van der
This code from three years back ia a reply to a question of placing an overlay 
background. Because the cow is very black I am curious if the \externalfigure 
can have a paramter to change the alpha of the cow, making it more transparent. 
By the way, it is not out of curiosity only. If possible it would forego the 
need to make separate pictures of different transparency beforehand.

> On 15 Jul 2013, at 11:22, Hans Hagen  wrote:
> 
> \definetextbackground [mybackgroundOverlay] [mp=mpos:region:whatever]
> 
> \startuseMPgraphic{mpos:region:whatever}
>for i=1 upto nofmultipars :
>draw textext("\externalfigure[cow.pdf]") rotated 10 shifted center 
> multipars[i] ;
>endfor ;
> \stopuseMPgraphic
> 
> \starttext
> 
>  \startmybackgroundOverlay
>\dorecurse{10}{\input knuth \par}
>  \stopmybackgroundOverlay
> 
> \stoptext

Hans van der Meer




___
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] Is there “toffset” option for \setupbackgrounds in context

2016-02-26 Thread Wolfgang Schuster

Bou Salim <mailto:salimcol...@gmail.com>
26. Februar 2016 um 12:44
I'm trying to learn `context`, and I'm satisfied with their capacities.

I read in contextgarden 
<http://wiki.contextgarden.net/Command/setupbackgrounds> that options 
of `\setupbackgrounds` inherit from `\setupframed`, but if I setup 
`toffset=5mm` for 
 `\setupbackgrounds[text][text][frame=on,toffset=5mm]` I have no effect?


With `frameoffset` you can modify the four directions but how about a 
single direction?
The background mechanism for the text areas supports only a fraction of 
the normal framed options but you can do a lot when you use Metapost to 
draw the background.


\startuniqueMPgraphic{TextBackground}
path p ; p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
draw p topenlarged 5mm ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic

\defineoverlay[TextBackground][\uniqueMPgraphic{TextBackground}]

\setuppapersize[A4]
\setuppagenumbering[state=none]

\setupbackgrounds[text][text][background=TextBackground]

\starttext

\input knuth

\stoptext

BTW: It’s rude to crosspost without mentioning this 
(http://tex.stackexchange.com/questions/296037/is-there-toffset-option-for-setupbackgrounds-in-context)


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] textbackground

2015-02-26 Thread Alan BRASLAU
Hello,

For a multilingual document, alternating one language or another, not
necessarily a bilingual, translated text, I thought about using
textbackground to set-off paragraphs. This technique could also apply
to a single language text having multiple levels of information,
perhaps statements followed by discussion, etc.

A problem appears with respect to footnotes that I do not know how to
handle. If the backgrounded text goes across pages placing footnotes,
then the footnote also gets the background. This is incorrect, perhaps
a bug.

Second problem, if a footnote of a backgrounded text gets placed on a
following page, then it may not get a background. (It is not clear to me
whether it would be correct for footnotes to get the background or
not.) Of course, a solution to this secondary problem might be
before={\startlocalfootnotes},
after={\placelocalfootnotes\stoplocalfootnotes},
although such a solution would postpone backgrounded footnotes to the
end of the backgrounded text.

Alan



MWE: 

\definetextbackground
[spanish]
[location=paragraph,
 frame=off,
 before={\language[es]},
 background=color,
 backgroundcolor=lightgray]

\starttext

\input darwin%
\startfootnote
\input dawkins
\stopfootnote

\input tufte

\startspanish
\input quevedo-es%
\startfootnote
\input cervantes-es
\stopfootnote
\stopspanish

\input zapf

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

Re: [NTG-context] textbackground

2015-02-26 Thread Hans Hagen

On 2/26/2015 10:22 AM, Alan BRASLAU wrote:

Hello,

For a multilingual document, alternating one language or another, not
necessarily a bilingual, translated text, I thought about using
textbackground to set-off paragraphs. This technique could also apply
to a single language text having multiple levels of information,
perhaps statements followed by discussion, etc.

A problem appears with respect to footnotes that I do not know how to
handle. If the backgrounded text goes across pages placing footnotes,
then the footnote also gets the background. This is incorrect, perhaps
a bug.

Second problem, if a footnote of a backgrounded text gets placed on a
following page, then it may not get a background. (It is not clear to me
whether it would be correct for footnotes to get the background or
not.) Of course, a solution to this secondary problem might be
before={\startlocalfootnotes},
after={\placelocalfootnotes\stoplocalfootnotes},
although such a solution would postpone backgrounded footnotes to the
end of the backgrounded text.

Alan



MWE:

\definetextbackground
 [spanish]
 [location=paragraph,
  frame=off,
  before={\language[es]},
  background=color,
  backgroundcolor=lightgray]

\starttext

\input darwin%
\startfootnote
\input dawkins
\stopfootnote

\input tufte

\startspanish
\input quevedo-es%
\startfootnote
\input cervantes-es
\stopfootnote
\stopspanish

\input zapf

\stoptext


\definetextbackground[en]
\definetextbackground[nl]

\setnewconstant\kindofpagetextareas 1 % low level, no high level switch 
(yet)


\starttext

\starttextbackground[en]
\dorecurse{10}{\input tufte \footnote{tufte} \par}
\stoptextbackground

\starttextbackground[nl]
\dorecurse{10}{\input tufte \footnote{tufte} \par}
\stoptextbackground

\stoptext


-
  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] textbackground within framedtext

2015-02-18 Thread Christoph Reller
Hi,

How can I use textbackground within framedtext. In the following MWE, the
background extends beyond the frame of framedtext. Do I have to use a
different mechanism?

\definetextbackground[bg][
  background=color,
  backgroundcolor=yellow,
  frame=off]

\starttext

\startframedtext
  Before \par
  \starttextbackground[bg]
  \input knuth
  \stoptextbackground \par
  After
\stopframedtext

\input tufte \par
\starttextbackground[bg]
\dorecurse{2}{\input knuth \par}
\stoptextbackground
\input tufte

\stoptext

Any feedback is welcome,

Regards,
Christoph
___
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] TOC with Grey background for pages belonging to last section of every chapter

2015-02-02 Thread Wolfgang Schuster

 Am 02.02.2015 um 14:00 schrieb Keith J. Schultz keithjschu...@web.de:
 
 Hi Wolgang,
 
 I noticed that \startnamedsection does not add it to the TOC
 how would one go about having these „namedsections“ added to the TOC.
 
 regards
   Keith.
 
 Am 02.02.2015 um 12:51 schrieb Wolfgang Schuster 
 schuster.wolfg...@gmail.com mailto:schuster.wolfg...@gmail.com:
 
 You have to add „location=paragraph” to the textbackground setup.
 
 \definetextbackground
  [ChapterFrame]
  [frame=off,
   background=color,
   backgroundcolor=green,
   backgroundoffset=1ex,
   location=paragraph] % default: location=text
 
 \definehead [Framed][chapter]
 \definehead [Frameless] [chapter]
 
 \setuphead
  [Frameless]
  [before={\blank[2*line]}]
 
 \setuphead
  [Framed]
  [page=no,
   before=,
   beforesection={\page\blank[2*line]\starttextbackground[ChapterFrame]},
   aftersection=\stoptextbackground]
 
 \starttext
 
 \startnamedsection[Frameless][title=Chapter without frame]
 
 \input knuth
 
 \stopnamedsection
 
 \startnamedsection[Framed][title=Chapter with frame]
 
 \input knuth
 
 \stopnamedsection
 
 \stoptext

The command \startnamedsection[chapter] is the same as using \startchapter in 
your
document, the only difference is that you use the header-type as argument in 
the first
case while in the second case the head-type is part of the command name.

When you print your table of contents with the \placecontent or \completecontent
commands ConTeXt uses only headers which are in the list for the “content” list.
To print additional headers which are defined with \definehead in your document
you can either use \placelist[chapter,MYHEADER,section,…] instead of 
\placecontent
or you extend the list for “content” with 
\setupcombinedlist[content][list={chapter,MYHEADER,…}]
or \placecontent[list={chapter,MYHEADER,…}]

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] Grey background for pages belonging to last section of every chapter

2015-02-02 Thread Wolfgang Schuster

 Am 30.01.2015 um 21:43 schrieb Rob Heusdens robh...@xs4all.nl:
 
 Correction, I added offset=none,frameoffset=0pt, to the parameters for
 the textbackground frame.
 
 Code again with correction:
 
 % test background
 \setupwhitespace[none]
 \setupindenting[yes, small, next]
 \setuppagenumbering[alternative=doublesided]
 
 \definetextbackground
  [SummaryBackground]
  [frame=off,offset=none,frameoffset=0pt,
   background=color,
   backgroundcolor=gray,
   backgroundoffset=2ex]
 
 \definehead[summary][section]
 
 \setuphead
  [summary]
  [number=no,
   style=bold,
   before=,
   beforesection={\noindentation\page\starttextbackground[SummaryBackground]},
   aftersection={\stoptextbackground\blank}]
 
 \setuphead[section][number=no,style=bold]
 
 
 \definecombinedlist[content][section,summary]
 \setupcombinedlist[content][level=4, alternative=c]
 
 \starttext
 \completecontent
 \page
 \dorecurse{9}{
 \startsection[title={Knuth -- \recurselevel}]
 
 \input{knuth}
 
 \stopsection
 }
 
 \startsummary[title=Samenvatting]
 
 \input{zapf}
 
 \stopsummary
 
 \stoptext
 
 
 
 Still the summary title is a bit lower on the page then other text.


You have to add „location=paragraph” to the textbackground setup.

\definetextbackground
  [ChapterFrame]
  [frame=off,
   background=color,
   backgroundcolor=green,
   backgroundoffset=1ex,
   location=paragraph] % default: location=text

\definehead [Framed][chapter]
\definehead [Frameless] [chapter]

\setuphead
  [Frameless]
  [before={\blank[2*line]}]

\setuphead
  [Framed]
  [page=no,
   before=,
   beforesection={\page\blank[2*line]\starttextbackground[ChapterFrame]},
   aftersection=\stoptextbackground]

\starttext

\startnamedsection[Frameless][title=Chapter without frame]

\input knuth

\stopnamedsection

\startnamedsection[Framed][title=Chapter with frame]

\input knuth

\stopnamedsection

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

[NTG-context] TOC with Grey background for pages belonging to last section of every chapter

2015-02-02 Thread Keith J. Schultz
Hi Wolgang,

I noticed that \startnamedsection does not add it to the TOC
how would one go about having these „namedsections“ added to the TOC.

regards
Keith.

 Am 02.02.2015 um 12:51 schrieb Wolfgang Schuster 
 schuster.wolfg...@gmail.com:
 
 You have to add „location=paragraph” to the textbackground setup.
 
 \definetextbackground
  [ChapterFrame]
  [frame=off,
   background=color,
   backgroundcolor=green,
   backgroundoffset=1ex,
   location=paragraph] % default: location=text
 
 \definehead [Framed][chapter]
 \definehead [Frameless] [chapter]
 
 \setuphead
  [Frameless]
  [before={\blank[2*line]}]
 
 \setuphead
  [Framed]
  [page=no,
   before=,
   beforesection={\page\blank[2*line]\starttextbackground[ChapterFrame]},
   aftersection=\stoptextbackground]
 
 \starttext
 
 \startnamedsection[Frameless][title=Chapter without frame]
 
 \input knuth
 
 \stopnamedsection
 
 \startnamedsection[Framed][title=Chapter with frame]
 
 \input knuth
 
 \stopnamedsection
 
 \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
___

Re: [NTG-context] Grey background for pages belonging to last section of every chapter

2015-01-30 Thread Rob Heusdens
Correction, I added offset=none,frameoffset=0pt, to the parameters for
the textbackground frame.

Code again with correction:

% test background
\setupwhitespace[none]
\setupindenting[yes, small, next]
\setuppagenumbering[alternative=doublesided]

\definetextbackground
  [SummaryBackground]
  [frame=off,offset=none,frameoffset=0pt,
   background=color,
   backgroundcolor=gray,
   backgroundoffset=2ex]

\definehead[summary][section]

\setuphead
  [summary]
  [number=no,
   style=bold,
   before=,
   beforesection={\noindentation\page\starttextbackground[SummaryBackground]},
   aftersection={\stoptextbackground\blank}]

\setuphead[section][number=no,style=bold]


\definecombinedlist[content][section,summary]
\setupcombinedlist[content][level=4, alternative=c]

\starttext
\completecontent
\page
\dorecurse{9}{
\startsection[title={Knuth -- \recurselevel}]

\input{knuth}

\stopsection
}

\startsummary[title=Samenvatting]

\input{zapf}

\stopsummary

\stoptext



Still the summary title is a bit lower on the page then other text.


___
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] Framed text and page breaks

2014-09-02 Thread Aditya Mahajan
If you just want to reduce the width of paragraphs, use the narrower 
environment. If you also want frames or background colors that break 
across page, use the background environment. If you want floats and 
parshape to also work, use the textbackground environment.


Aditya

On Tue, 2 Sep 2014, Keith McKay wrote:


Colleagues

I've been struggling today with trying to change paragraph width of selected 
paragraphs within the body text of a novel I'm typesetting. I thought that 
the way to do this would be by framing the text that I would like to reduce 
the paragraph width off.  However the framed text doesn't seem to honour page 
breaks and just seems to disappear off the page bottom.  Also the framed text 
starts on a new page which I do not want to happen.


Any suggestions on how I may go about solving this problem?

Best Wishes
Keith McKay

Here is an example tex file which shows these effects:
\definepapersize[book][width=5.06in,height=7.81in]

\setuppapersize [book][]

\setuplayout 
[width=middle,backspace=12.5mm,cutspace=12.5mm,height=middle,topspace=12.7mm,bottomspace=12.7mm]


\starttext

\dorecurse{2}{\input ward \blank}

\midaligned

\framed[frame=off,width=5cm,align={width,nothyphenated,verytolerant,stretch},before=\blank]{\dorecurse{4}{\input 
ward \blank}}


\dorecurse{2}{\input ward \blank}

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


  1   2   3   >