Re: [NTG-context] Marginrule levels after \placefigure[right]

2016-08-28 Thread Aditya Mahajan

On Sun, 28 Aug 2016, Aditya Mahajan wrote:


Hi,

This is based on a question on TeX.SE
https://tex.stackexchange.com/questions/326653/context-wrapfigure-interacts-with-marginrule

All marginrules except those of level 1 stop working after 
\placefigure[right]. Here is a minimal example:


\useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=4cm]
\starttext

\placefigure[here,none,right]{}{\externalfigure[ctanlion]}
\input knuth

\startmarginrule[2]
 \input ward
\stopmarginrule

\startmarginrule[1]
 \input ward
\stopmarginrule

\startmarginrule[3]
 \input ward
\stopmarginrule

\stoptext

The output is attached.


The attached patch seems to fix the bug.

Aditya*** /opt/context-minimals/tex/texmf-context/tex/context/base/mkiv/anch-bar.mkiv	2016-08-28 16:55:00.0 -0400
--- anch-bar.mkiv	2016-08-28 16:52:47.0 -0400
***
*** 111,118 
 \advance\d_anch_sidebars_distance\scratchdistance\relax
   \fi
 \else
   \ifnum\m_level=\plusone
-\scratchdimen\sidebarparameter\c!leftmargindistance\relax
 \ifdim\scratchdimen=\zeropoint
   \advance\d_anch_sidebars_distance\scratchdistance\relax
 \else
--- 111,118 
 \advance\d_anch_sidebars_distance\scratchdistance\relax
   \fi
 \else
+  \scratchdimen\sidebarparameter\c!leftmargindistance\relax
   \ifnum\m_level=\plusone
 \ifdim\scratchdimen=\zeropoint
   \advance\d_anch_sidebars_distance\scratchdistance\relax
 \else
___
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] Marginrule levels after \placefigure[right]

2016-08-28 Thread Aditya Mahajan

Hi,

This is based on a question on TeX.SE
https://tex.stackexchange.com/questions/326653/context-wrapfigure-interacts-with-marginrule

All marginrules except those of level 1 stop working after 
\placefigure[right]. Here is a minimal example:


\useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=4cm]
\starttext

\placefigure[here,none,right]{}{\externalfigure[ctanlion]}
\input knuth

\startmarginrule[2]
  \input ward
\stopmarginrule

\startmarginrule[1]
  \input ward
\stopmarginrule

\startmarginrule[3]
  \input ward
\stopmarginrule

\stoptext

The output is attached.

Aditya

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Using the margin for two purposes

2014-05-19 Thread Matthias Weber
Thanks again, Rik,

this works like a charm, with one exception: No matter what I try, the 
marginrule appears always in the left margin.
Is there a way to change this?

Matthias

 
On May 18, 2014, at 11:42 PM, Rik r...@panix.com wrote:

 
 I have been playing with this a bit. I think that the following does what you 
 want as far as setting up the margin text and description. I am no help on 
 the mp stuff that you will need for curly or other-dotted rules.
 
 As you probably saw, neither \setupmargindata nor \setupmarginframed are in 
 the wiki. The list archive has some hints, but the source code, if you ignore 
 a couple of misleading comments, suggested what I got to work.
 
 The problem you will run into with the description as you want to use it 
 comes when you have multiple paragraphs. Without a start/stop mechanism, 
 there is no way to mark the paragraphs to include within the scope of the 
 line. As long as you are willing to enclose multiple paragraphs in braces 
 (and provide a null description as I do here) you will be fine, but at that 
 point you may as well use the start/stop.
 
 There is still a problem with the margin rule extending through the blank 
 line that results from the implied \par at the end of the description block 
 (and any explicit \par). It looks ugly and isn't matched by the behavior of 
 the rule in the start/stop text. Perhaps someone else can find a way around 
 it.
 
 Some of this is probably unnecessary for what you want; for example, instead 
 of using optional arguments you may prefer to hardcode the choice of rule # 
 and color. If you want to always use the same color with the same rule #, you 
 can simplify in other ways.
 
 I did use MKVI syntax, simply because I have been trying to use it 
 consistently in all my current work. It should be easily translated back to 
 earlier syntax.
 
 % macros=mkvi
 \setupmarginrules[rulethickness=2pt,alternative=1]
 
 \setupmargindata  [left]
   [location=left,
style=\bfxx]
 \setupmarginframed[left]
   [frame=on,
framecolor=darkgray,
corner=round,
offset=3pt,
width=2cm,
align=middle]
 
 \starttexdefinition startMtext
   \bgroup
   \dotripleempty\dostartMtext
 \stoptexdefinition
 \starttexdefinition dostartMtext [#RULE][#COLOR][#ORDER]
   \doifemptyelse{#RULE}
 {\def\Rule{2}}%  default rule
 {\def\Rule{#RULE}}
   \doifemptyelse{#COLOR}
  {\def\Color{green}}%default color
  {\def\Color{#COLOR}}
   \ifthirdargument
 \inleft{Read\\this\\#ORDER}
   \fi
   \setupmarginrule[\Rule][rulecolor=\Color]
   \startmarginrule[\Rule]
 \stoptexdefinition
 \starttexdefinition stopMtext
   \stopmarginrule
   \egroup
 \stoptexdefinition
 
 \definedescription[greenline]
   [before={\setupmarginrules[rulecolor=green,
  alternative=0,
  rulethickness=0.5pt]
\indenting[no]
\startmarginrule[2]},
after={\stopmarginrule}]
 
 \starttext
 
 \startMtext [1][][first]
 \input knuth
 \stopMtext
 
 \startMtext [2][green][second]
 \input tufte
 \stopMtext
 
 \blank
 
 \startMtext [3][blue][third]
 \input tufte
 \stopMtext
 
 \startMtext [4][black][fourth]
 \input knuth
 \stopMtext
 
 \input knuth
 Just a few lines of text before the marked text.
 \startMtext[][red]
 \input tufte
 \stopMtext
 And a few lines of text after the marked text.
 \input knuth
 
 \blank
 
 \greenline \input knuth
 
 \blank
 
 \greenline{} {Some text and tufte: \input tufte
 
 Some more text.}
 
 \input tufte
 
 \startMtext [][magenta][last]
 \input tufte
 \stopMtext
 
 \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
 ___

___
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] Using the margin for two purposes

2014-05-19 Thread Hans Hagen

On 5/19/2014 9:59 PM, Rik Kabel wrote:

On 2014-05-19 12:41, Matthias Weber wrote:

Thanks again, Rik,

this works like a charm, with one exception: No matter what I try, the
marginrule appears always in the left margin.
Is there a way to change this?

Matthias

Looking through the code in anch-bar.mkiv, there is nothing that I can
see that supports placing marginrules, or the sidebars on which they are
built, into the right margin. It looks like a job for Hans.


Hm, so you didn't experiment ...

\starttext

\definesidebar[whow][rulecolor=green,distance=0pt]
\definesidebar[oeps][rulecolor=blue,distance=-\dimexpr\textwidth+2mm]

\input tufte \par
\startsidebar
  \input tufte \par
  \input tufte \par
  \startsidebar[whow]
\input tufte \par
\input tufte \par
\input tufte
  \stopsidebar \par
  \input tufte \par
  \input tufte
\stopsidebar \par
\input tufte \par
\input tufte \par
\startsidebar[oeps]
  \input tufte \par
  \input tufte \par
  \input tufte \par
  \input tufte \par
  \input tufte
\stopsidebar \par
\input tufte \par
\input tufte \par
\startsidebar
  \input tufte
  \input tufte
  \input tufte
  \input tufte
  \input tufte
\stopsidebar

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


Re: [NTG-context] Using the margin for two purposes

2014-05-19 Thread Matthias Weber
Thanks Hans,

while I did experiment I had no chance at divining the correct dimension 
distance=-\dimexpr\textwidth+2mm below.

So, with that, my bare bones marginbar in the right margin could look like the 
one in the file below. Where do I squeeze in the alternative=1
option to get dotted lines? When I put it into \definesidebar, the sidebar 
disappears, and when I  write \startsidebar[oeps,alternative=1]
it reverts to the default left sidebar (albeit dotted).

Matthias



\setupmargindata  [left]
  [location=right,
   style=\bfxx]
\setupmarginframed[left]
  [frame=on,
   framecolor=darkgray,
   corner=round,
   offset=3pt,
   width=2cm,
   align=middle]
   
\definesidebar[oeps][rulecolor=blue,distance=-\dimexpr\textwidth+2mm,rulethickness=.1pt]


\starttexdefinition startRightbar
  \bgroup
\startsidebar[oeps]
\stoptexdefinition

\starttexdefinition stopRightbar
  \stopsidebar
  \egroup
\stoptexdefinition

\starttext



\input knuth
Just a few lines of text before the marked text.

\inmargin{Don’t\\read\\me\\again}
\startRightbar
\input tufte
\stopRightbar

And a few lines of text after the marked text.

\stoptext


On May 19, 2014, at 5:36 PM, Hans Hagen pra...@wxs.nl wrote:

 On 5/19/2014 9:59 PM, Rik Kabel wrote:
 On 2014-05-19 12:41, Matthias Weber wrote:
 Thanks again, Rik,
 
 this works like a charm, with one exception: No matter what I try, the
 marginrule appears always in the left margin.
 Is there a way to change this?
 
 Matthias
 Looking through the code in anch-bar.mkiv, there is nothing that I can
 see that supports placing marginrules, or the sidebars on which they are
 built, into the right margin. It looks like a job for Hans.
 
 Hm, so you didn't experiment ...
 
 \starttext
 
 \definesidebar[whow][rulecolor=green,distance=0pt]
 \definesidebar[oeps][rulecolor=blue,distance=-\dimexpr\textwidth+2mm]
 
 \input tufte \par
 \startsidebar
  \input tufte \par
  \input tufte \par
  \startsidebar[whow]
\input tufte \par
\input tufte \par
\input tufte
  \stopsidebar \par
  \input tufte \par
  \input tufte
 \stopsidebar \par
 \input tufte \par
 \input tufte \par
 \startsidebar[oeps]
  \input tufte \par
  \input tufte \par
  \input tufte \par
  \input tufte \par
  \input tufte
 \stopsidebar \par
 \input tufte \par
 \input tufte \par
 \startsidebar
  \input tufte
  \input tufte
  \input tufte
  \input tufte
  \input tufte
 \stopsidebar
 
 \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
 ___



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] nested itemize in margin

2013-10-23 Thread John Kitzmiller

To enumerate answer blanks in the right margin to match the question, thanks to 
Marco:

\define\ansblank{\inright{\getnumber[itemgroup:itemize]. \thinrules[n=1]}}
\setupitemgroup [itemize] [n,style=bold,right=\ansblank]

I am trying to augment this to handle nested itemizations so that the 
\getnumber in the right margin is from the parent itemize but the \getletter 
is from the child:

\starttext
\startitemize[n]
\item First
\item Second   
  \startitemize[a]
\item Related problem   % Would like this to show 2 a. before the marginrule
\item Related question  % Would like this to show 2 b. before the marginrule
  \stopitemize
\item Third
\stopitemize
\stoptext

Desired output:

1. First  1. _

2. Second
a. Related problem2a. 
b. Related question   2b. 

3. Third  3. _


My attempts have been to define a new blank and use [conversion=Character] 
along with stabs from cont-eni.pdf, but I am flailing and failing.

Thanks for any help,
John
___
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] marginrule does not work properly in wiki

2010-04-11 Thread Vyatcheslav Yatskovsky

Hello,

The following example does not work properly in wiki (the rule is 
missed), while in mkIV it's OK.


\starttext
\startmarginrule
The sound of a duck is a good demonstration of how different people
listen to a sound. Everywhere in Europe the sound is equal. But in
every country it is described differently: kwaak||kwaak (Netherlands),
couin||couin (French), gick||gack (German), rap||rap (Danish) and
mech||mech (Spanish). If you speak these words aloud you will notice
that in spite of the consonants the sound is really very
well described. And what about a cow, does it say boe, mboe or mm?
\stopmarginrule
\stoptext

http://wiki.contextgarden.net/Reference/en/startmarginrule

Regards,
Vyatcheslav
___
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] marginrule does not work properly in wiki

2010-04-11 Thread Vyatcheslav Yatskovsky
Looks like I understood the reason. It's not visible because it's inside 
the margin, and wiki does margins. :) Am I right?



Hello,

The following example does not work properly in wiki (the rule is
missed), while in mkIV it's OK.

\starttext
\startmarginrule
The sound of a duck is a good demonstration of how different people
listen to a sound. Everywhere in Europe the sound is equal. But in
every country it is described differently: kwaak||kwaak (Netherlands),
couin||couin (French), gick||gack (German), rap||rap (Danish) and
mech||mech (Spanish). If you speak these words aloud you will notice
that in spite of the consonants the sound is really very
well described. And what about a cow, does it say boe, mboe or mm?
\stopmarginrule
\stoptext

http://wiki.contextgarden.net/Reference/en/startmarginrule

Regards,
Vyatcheslav



--
Best Regards,
Vyatcheslav Yatskovsky
___
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] ConTeXt-ifying Kile

2008-01-02 Thread Matija Šuklje
]
\definetabulate[name][name][text]
\definetext[name][position][text][text][text]
# \definetextbackground
\definetextposition[name][settings]
# \definetextvariable[settings][???][???]
\definetype[name][settings]
# \definetypeface
\definetyping[file|typing|name][settings]
\defineversion[name][numbers]
# \defineXMLargument
# \defineXMLcommand
# \defineXMLenvironment
# \defineXMLenvironmentsave
# \defineXMLgrouped
# \defineXMLgsave
# \defineXMLgstore
# \defineXMLignore
# \defineXMLnested
# \defineXMLpickup
# \defineXMLprocess
# \defineXMLsave
# \defineXMLsavecontent
# \defineXMLsingular
# \defineXMLstore
# \defXMLstring
\description{text}text
\determineheadnumber[section]
\determinelistcharacteristics[names][settings]
# \digits
\disableinteractionmenu[position|name][references]
# \disablemode
# \doglobal
# \dogotopar
# \doif
# \doifcommon
# \doifcommonelse
# \doifdefined
# \doifdefinedelse
# \doifelse
# \doifelsenothing
# \doifelsevalue
# \doiffieldelse
# \doifflagged
# \doifinset
# \doifinsetelse
# \doifmode
# \doifmodeelse
# \doifnextcharelse
# \doifnot
# \doifnotcommon
# \doifnotflagged
# \doifnothing
# \doifnotinsetelse
# \doifnotmode
# \doifnotvalue
# \doifsomething
# \doiftext
# \doiftextelse
# \doifundefined
# \doifundefinedelse
# \doifvalue
# \doifXMLdata
# \doifXMLdataelse
# \doifXMLop
# \doifXMLparelse
# \doloop
# \donothing
# \dontleavehmode
\donttest
# \dorecurse
# \dostepwiserecurse
# \dowithnextbox
# \dowithnextboxcontent
# \empty
\emptylines[number]
# \emptytoks
# \enablemode
# \endstrut
\enumeration
# \environment
# \EQ
# \eTABLE
# \eTABLEbody
# \eTABLEfoot
# \eTABLEhead
# \eTABLEnext
# \eTD
# \eTH
# \eTR
# \exitloop
# \expanded
\externalfigure[file][settings]
\field[name]
\fieldstack[name][names][settings]
\fillinfield[text]{text}
\fillinline[settings]
\fillinrules[settings]{text}{text}
\fillintext[settings]{text}{text}
\fitfield[name]
\fixedspaces
# \FLOWchart
# \flushcollector
# \flushlayer
# \flushXMLelement
\followprofile{text}[text]
\followprofileversion{text}[text][text]
\followversion{text}[text]
\footnote[reference]{text}
\footnotetext[reference]{text}
\forceblocks[names][names]
# \forgetall
# \FR
\fraction{text}{text}
\framed[settings]{text}
\framedtext[settings]
\from[reference]
\getbuffer[name]
# \getfiguredimensionsonly
# \getmarking[name][options]
# \getvalue
# \getvariable
# \globalletvalue
\godown[dimension]
\goto{text}{text}[references]
\gotobox{text}[references]
\graycolor[text]
\grid[options]
# \gsaveXMLasdata
\hairline
\head[references]
\headnumber[section]
\headtext{text}
# \hfilll
\hideblocks[names][names]
\high{text}
# \HL
\hl[number]
# \hpos
# \hspace
# \ifconditional
# \ifdefined
# \iftrialtypesetting
# \ifundefined
\in{text}{text}[reference]
# \includeFLOWchart
# \includemenu
# \increment
\indentation
\indenting[options]
\inframed[settings]{text}
\ininner[+|-|low][reference]{text}
\inleft[+|-|low][reference]{text}
\inline[reference]
\inmargin[+|-|low][reference]{text}
\inothermargin[+|-|low][reference]{text}
\inouter[+|-|low][reference]{text}
\inright[+|-|low][reference]{text}
\installlanguage[name][options]
\interactionbar[settings]
\interactionbuttons[settings][names]
\item[references]
\items[settings]{text}
\its[references]
\keepblocks[names][all|names]
\labeling[reference]
\labels[name]
\labeltext{text}
\language[language code]
\leftaligned{text}
# \letgvalue
# \letvalue
\listsymbol[name]{text}
# \loadmapfile
\loadsorts
\loadsynonyms
# \localhsize
\logfields
\lohi[low]{text}{text}
\low{text}
# \LR
\mainlanguage[language code]
\mar[references]{text}
\marginrule[number]{text}
\margintext[+|-|low][reference]{text}
\marking[name]{text}
\markversion
\mathematics{text}
\mediaeval{text}
\midaligned{text}
\mirror{text}
\MONTH{text}
\month{text}
\moveongrid[options]
# \MR
\name{text}
# \NC
# \newcounter
# \nextbox
\nextsection
\nocap{text}
\noheaderandfooterlines
\noindenting
\nolist{text}
\nomarking{text}
\nomoreblocks
\nomorefiles
\nop
\nospace
\note[reference]
\notopandbottomlines
\nowhitespace
# \NR
\numbers{text}
\overbar{text}
\overbars{text text}
# \overlaybutton
# \overlayfigure
\overstrike{text}
\overstrikes{text text}
\packed
\page[options]
\pagereference[reference]
\pagetype[name]
\paragraph
\part[references]{text}
\periods[number]
\placebookmarks[names][names|all]
\placecombinedlist[name][settings]
\placecombinedlist[name][settings]
# \placefigure
\placefloat[options][references]{text}{text}
\placefootnotes[settings]
\placeformula[references]{text}$$ $$
# \placelayer
\placelegend{text}{text}
\placelist[names][settings]
\placelistoffloats
\placelistofsorts
\placelistofsynonyms
\placelocalfootnotes[settings]
\placelogos[names]
\placeongrid[settings{text}
\placeontopofeachother{text}{text}
\placereferencelist[names]
\placeregister[name][settings]
\placeregister[settings]
\placerule[name]
\placesidebyside{text}{text}
\placesubformula[references]{text}$$ $$
\placetextvariable[name]
# \plusone
# \plustwo
\position(numbers){text}
\positiontext[name]{text}
# \prependtoks