Re: [NTG-context] How to scale math with text?

2018-06-05 Thread Alan Braslau
The "style=" use is, in general, preferable for tagging (and
exporting). For less than paragraph switching, the use of
\definehighlight for example could be used.

Quick and dirty font switching is almost always poor usage...

Alan

On Tue, 5 Jun 2018 12:57:59 -0400 (EDT)
Aditya Mahajan  wrote:

> On Mon, 4 Jun 2018, Alan Braslau wrote:
> 
> > On Tue, 5 Jun 2018 10:37:12 +1200
> > Henri Menke  wrote:
> >  
> >> Dear list,
> >> 
> >> probably I'm just missing something obvious.  How can I scale the
> >> math font size to match the text font size locally?  In the
> >> following MWE text is scaled to 10pt but math still appears at
> >> 12pt.
> >> 
> >> \starttext
> >> {\tfx ABC $DEF$ GHI\par}
> >> \stoptext  
> >
> > I believe that the "proper" way would be:
> >
> > \starttext
> >
> > \startparagraph [style=small]
> > ABC $DEF$ GHI
> > \stopparagraph
> >
> > \stoptext  
> 
> Or, \switchtobodyfotn[small] etc. This is what I had written in the 
> tugboat article on font switching (wikified at 
> http://wiki.contextgarden.net/Font_Switching)
> 
> "These quick font switches are meant for changing the font style, 
> alternative, or size of a few words: they do not change the bodyfont,
> so they don't affect interline spacing or math font sizes. So, if you
> want to change the font size of an entire paragraph, use
> \switchtobodyfont described below in Complete Font Change. However,
> it is fine to use them as style directives in setup commands, that
> is, using them as an option for style=... in any setup command that
> accepts style option. "
> 
> Please feel free to change the phrasing if it is not clear.
> 
> 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] How to scale math with text?

2018-06-05 Thread Aditya Mahajan

On Mon, 4 Jun 2018, Alan Braslau wrote:


On Tue, 5 Jun 2018 10:37:12 +1200
Henri Menke  wrote:


Dear list,

probably I'm just missing something obvious.  How can I scale the
math font size to match the text font size locally?  In the following
MWE text is scaled to 10pt but math still appears at 12pt.

\starttext
{\tfx ABC $DEF$ GHI\par}
\stoptext


I believe that the "proper" way would be:

\starttext

\startparagraph [style=small]
ABC $DEF$ GHI
\stopparagraph

\stoptext


Or, \switchtobodyfotn[small] etc. This is what I had written in the 
tugboat article on font switching (wikified at 
http://wiki.contextgarden.net/Font_Switching)


"These quick font switches are meant for changing the font style, 
alternative, or size of a few words: they do not change the bodyfont, so 
they don't affect interline spacing or math font sizes. So, if you want to 
change the font size of an entire paragraph, use \switchtobodyfont 
described below in Complete Font Change. However, it is fine to use them 
as style directives in setup commands, that is, using them as an option 
for style=... in any setup command that accepts style option. "


Please feel free to change the phrasing if it is not clear.

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] How to scale math with text?

2018-06-04 Thread Alan Braslau
On Tue, 5 Jun 2018 10:37:12 +1200
Henri Menke  wrote:

> Dear list,
> 
> probably I'm just missing something obvious.  How can I scale the
> math font size to match the text font size locally?  In the following
> MWE text is scaled to 10pt but math still appears at 12pt.
> 
> \starttext
> {\tfx ABC $DEF$ GHI\par}
> \stoptext

I believe that the "proper" way would be:

\starttext

\startparagraph [style=small]
ABC $DEF$ GHI
\stopparagraph

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

Re: [NTG-context] Firstline problem with smallcaps

2018-01-14 Thread Hans Hagen

On 1/12/2018 10:47 PM, Rik Kabel wrote:
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


\definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
or =\sc
\definefirstline[BD][alternative=line,style=bold]
\definefirstline[IT][alternative=line,style=italic]
\setupbodyfont[termes,11pt]% requires font with small caps
\starttext
   \setfirstline[SC]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[BD]
   \startparagraph
     \input montgomery
   \stopparagraph
   \setfirstline[IT]
   \startparagraph
     \input montgomery
   \stopparagraph
\stoptext


fixed in next beta


-
  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] Firstline problem with smallcaps

2018-01-12 Thread Rik Kabel
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


   \definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
   or =\sc
   \definefirstline[BD][alternative=line,style=bold]
   \definefirstline[IT][alternative=line,style=italic]
   \setupbodyfont[termes,11pt]% requires font with small caps
   \starttext
  \setfirstline[SC]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[BD]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[IT]
  \startparagraph
    \input montgomery
  \stopparagraph
   \stoptext

--
Rik

___
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] Two requests for new btx subsystem

2017-10-30 Thread Rik
The most recent update (ConTeXt  ver: 2017.10.29 15:44 MKIV beta  fmt: 
2017.10.30  int: english/english) has broken \cite processing. I now get 
the author name (poorly formatted) instead of the translator, and 
 instead of the title, with the example document.


If this is not the result of some misconfiguration or misuse of the 
macros on my part, can this part of the update be rolled back?


--
Rik


On 2017-10-21 19:00, Rik Kabel wrote:


Two improvement requests for the new bibliography subsystem:

 1. Tag titles (and subtitles) with the language explicitly provided
in the bib entry.
 2. Add editor and translator to fields supported in \cite[field][tag].

An example follows. It shows that the title generated by the 
\cite[title][tag] does not have an associated language, even though 
the bib entry specifies one and the publications manual indicates that 
this is intended for the rendering and hyphenation of the title. It is 
apparently used for that in the bibliography, but it is needed as well 
in the text. (And yes, /Formenwandlungen/ does have the same 
hyphenation points in both German and English; this was just a 
convenient example.)


It also shows that [translator] is not inserted into the text.

*NOTE* that when \cite[editor][tag] is attempted (and present in the 
bib entry) compilation halts with the Lua error no string to print, 
but continues to completion when allowed.


 \mainlanguage[en]

 \startbuffer[TestBib]
    @BOOK{Tschichold1953,
  author   = {Jan Tschichold},
  title    = {Formenwandlungen der \&-Zeichen},
  year = {1953},
  publisher    = {D. Stempelag},
  address  = {Frankfurt am Main},
  language = {german},
    }
    @BOOK{Plaat1957,
  author   = {Jan Tschichold},
  translator   = {Frederick Plaat},
  title    = {The Ampersand: Its origin and development},
  year = {1957},
  publisher    = {Woudhuysen},
  address  = {London},
  note = {Translation by F.\ Plaat of
\cite{Tschichold1953}.},
    }
 \stopbuffer

 \loadbtxdefinitionfile[apa]
 \usebtxdataset    [TestBib]
   [TestBib.buffer]
 \definebtxrendering   [TestBib]
   [apa]
   [dataset=TestBib]

 \setupspellchecking   [state=start,
    method=3]
 \definecolor  [word:de]
   [r=.85]

 \starttext
     \startparagraph
 \cite[title][TestBib::Plaat1957]
 is a translation by \cite[translator][TestBib::Plaat1957]
 of \cite[title][TestBib::Tschichold1953]
 by \cite[author][TestBib::Tschichold1953].
 \stopparagraph
     \startparagraph
 {\it The Ampersand: Its origin and development}
 is a translation by Frederick Plaat
 of {\it\de Formenwandlungen der \&-Zeichen}
 by Jan Tschichold.
 \stopparagraph
 \blank[big]

 \placebtxrendering[TestBib][method=dataset]
 \stoptext

--

Rik



___
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] Two requests for new btx subsystem

2017-10-21 Thread Rik Kabel

Two improvement requests for the new bibliography subsystem:

1. Tag titles (and subtitles) with the language explicitly provided in
   the bib entry.
2. Add editor and translator to fields supported in \cite[field][tag].

An example follows. It shows that the title generated by the 
\cite[title][tag] does not have an associated language, even though the 
bib entry specifies one and the publications manual indicates that this 
is intended for the rendering and hyphenation of the title. It is 
apparently used for that in the bibliography, but it is needed as well 
in the text. (And yes, /Formenwandlungen/ does have the same hyphenation 
points in both German and English; this was just a convenient example.)


It also shows that [translator] is not inserted into the text.

*NOTE* that when \cite[editor][tag] is attempted (and present in the bib 
entry) compilation halts with the Lua error no string to print, but 
continues to completion when allowed.


 \mainlanguage[en]

 \startbuffer[TestBib]
    @BOOK{Tschichold1953,
  author   = {Jan Tschichold},
  title    = {Formenwandlungen der \&-Zeichen},
  year = {1953},
  publisher    = {D. Stempelag},
  address  = {Frankfurt am Main},
  language = {german},
    }
    @BOOK{Plaat1957,
  author   = {Jan Tschichold},
  translator   = {Frederick Plaat},
  title    = {The Ampersand: Its origin and development},
  year = {1957},
  publisher    = {Woudhuysen},
  address  = {London},
  note = {Translation by F.\ Plaat of
   \cite{Tschichold1953}.},
    }
 \stopbuffer

 \loadbtxdefinitionfile[apa]
 \usebtxdataset    [TestBib]
   [TestBib.buffer]
 \definebtxrendering   [TestBib]
   [apa]
   [dataset=TestBib]

 \setupspellchecking   [state=start,
    method=3]
 \definecolor  [word:de]
   [r=.85]

 \starttext
     \startparagraph
 \cite[title][TestBib::Plaat1957]
 is a translation by \cite[translator][TestBib::Plaat1957]
 of \cite[title][TestBib::Tschichold1953]
 by \cite[author][TestBib::Tschichold1953].
 \stopparagraph
     \startparagraph
 {\it The Ampersand: Its origin and development}
 is a translation by Frederick Plaat
 of {\it\de Formenwandlungen der \&-Zeichen}
 by Jan Tschichold.
 \stopparagraph
 \blank[big]

 \placebtxrendering[TestBib][method=dataset]
 \stoptext

--

Rik

___
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] Problems with setfirstline

2017-10-18 Thread Rik Kabel
Setfirstline does not seem to be working well with most fonts, perhaps 
all. The example below shows the issue.


   \define \Fonts
    {libertinus,ebgaramond,termes,antykwa,
 cambria,minion,bonum,heros,pagella,iwona}
   \define[1]  \Setupbodyfont{\setupbodyfont[#1,11pt]}
   \define[1] \DisplayExample{\switchtobodyfont[#1]\getbuffer}

   \setupfirstline [alternative=line,
 style=\setfontfeature{smallcaps}]
   \setupinitial   [location=text,n=2,color=darkred]

   \setuphead  [chapter][
   after={\blank[big]\setfirstline\setinitial}]
   \setuphead  [section][continue=yes,
 after=\setfirstline]

   \startbuffer
    \startchapter[title=Initial and first line: \Word{\fontclass}]
    \startparagraph
    \input darwin
    \stopparagraph
 \startsection[title=First line only]
    \startparagraph
    \input montgomery
    \stopparagraph
    \startparagraph
    \input sapolsky
    \stopparagraph
    \stopsection
    \stopchapter
   \stopbuffer

   \expandafter\processcommalist\expandafter[\Fonts]\Setupbodyfont

   \starttext

   \expandafter\processcommalist\expandafter[\Fonts]\DisplayExample

   \stoptext

--
Rik

___
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] Is this a bug in header marking?

2017-10-17 Thread Rik

I have resolved the issue in a practical, but unsatisfactory, manner.

I have resorted to creating an interlude, a new heading derived from 
title, setting it for left pages with no displayed head:


   \definehead[ChapterEpigraph][title]
   \setuphead [ChapterEpigraph][
  page={yes,left},
  insidesection=\vfill,
  aftersection={\vfill\vfill},
  header=empty,
  placehead=no,
 ]

Thus, \startChapterEpigraph can safely be placed before each 
\startchapter (and between the last \stopchapter of a part and the start 
of the next part) when that last chapter ends on a recto). This clears 
the chapter marking in the headings of the new verso. When there is an 
epigraph to set, it is placed in the ChapterEpigraph section.


This is unsatisfactory because it implements an inaccurate semantic 
model of the document – the epigraphs belong to the following chapter, 
not the numberless, nameless interlude.


And there is almost certainly a bug lurking here. I had considered 
adding the marking of the next chapter to the interlude to better tie 
the interlude to the place it belongs. When I made ChapterEpigraph 
derivative of chapter:


   \definehead[ChapterEpigraph][chapter]
   \setuphead [ChapterEpigraph][
  page={yes,left},
  insidesection=\vfill,
  aftersection={\vfill\vfill},
  header=yes,
  number=no,
  placehead=no,
 ]

and provided a marking:

   \startChapterEpigraph[marking={Same as next chapter marking}]

The resulting page displayed the marking of the previous chapter, not 
the marking provided. This appears to be the same behavior as in the 
example below in my first note, although I can provide another working 
example using this apparatus if anyone wants it.


Can we please have a \setuphead or \setupheads option to clear markings 
at the end of the level, and not simply override them when the next 
equivalent level starts? (Although perhaps, based on the observed issue 
described just above, there is some other logic at work here.)


--
Rik

On 2017-10-15 23:54, Rik Kabel wrote:


As a followup to my query on suppressing header marking, I have 
prepared an example which clearly shows odd, if not buggy behavior.


The book places chapter openings on recto pages which follow a verso 
that may have an epigraph. When there is no epigraph, the blank verso 
is properly unmarked by a header, but when there is an epigraph, the 
header from the previous chapter appears on the page. How can I 
eliminate this orphan header?


\setuppagenumbering [alternative=doublesided,location=]
\setupheadertexts   [][{\it\getmarking[section]}]
    [{\it\getmarking[chapter]}][]

\starttexdefinition unexpanded startSectionEpigraph
    \dostartbuffer  [SectionEpigraph]
[startSectionEpigraph][stopSectionEpigraph]
\stoptexdefinition

\setuphead  [chapter][
beforesection=\setups{chapter:epigraph}]

\startsetups chapter:epigraph
    \page[yes,left]% same result with yes,header,footer,left
    \doifelsebuffer{SectionEpigraph}
    {\getbuffer[SectionEpigraph]
 \resetbuffer[SectionEpigraph]}
    {\donothing}
    \page[yes,header,footer,right]
\stopsetups

\starttext

    \completecontent

    \startfrontmatter
    \startchapter[title=Preface]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \stopfrontmatter
    \startbodymatter

    \startchapter[title=Chapter First]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startSectionEpigraph
    Why does this page have the heading
    from the previous chapter?
    \stopSectionEpigraph

    \startchapter[title=Chapter Second]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startSectionEpigraph
  Look up!
    \stopSectionEpigraph

    \startchapter[title=Chapter Third]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startchapter[title=Chapter Final]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \stopbodymatter

\stoptext

--
Rik


___
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

[NTG-context] Is this a bug in header marking?

2017-10-15 Thread Rik Kabel
As a followup to my query on suppressing header marking, I have prepared 
an example which clearly shows odd, if not buggy behavior.


The book places chapter openings on recto pages which follow a verso 
that may have an epigraph. When there is no epigraph, the blank verso is 
properly unmarked by a header, but when there is an epigraph, the header 
from the previous chapter appears on the page. How can I eliminate this 
orphan header?


   \setuppagenumbering [alternative=doublesided,location=]
   \setupheadertexts   [][{\it\getmarking[section]}]
    [{\it\getmarking[chapter]}][]

   \starttexdefinition unexpanded startSectionEpigraph
    \dostartbuffer  [SectionEpigraph]
   [startSectionEpigraph][stopSectionEpigraph]
   \stoptexdefinition

   \setuphead  [chapter][
 beforesection=\setups{chapter:epigraph}]

   \startsetups chapter:epigraph
    \page[yes,left]% same result with yes,header,footer,left
    \doifelsebuffer{SectionEpigraph}
    {\getbuffer[SectionEpigraph]
 \resetbuffer[SectionEpigraph]}
    {\donothing}
    \page[yes,header,footer,right]
   \stopsetups

   \starttext

    \completecontent

    \startfrontmatter
    \startchapter[title=Preface]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \stopfrontmatter
    \startbodymatter

    \startchapter[title=Chapter First]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startSectionEpigraph
    Why does this page have the heading
    from the previous chapter?
    \stopSectionEpigraph

    \startchapter[title=Chapter Second]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startSectionEpigraph
  Look up!
    \stopSectionEpigraph

    \startchapter[title=Chapter Third]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \startchapter[title=Chapter Final]
    \startparagraph
    \input ward
    \stopparagraph
    \stopchapter

    \stopbodymatter

   \stoptext

--
Rik
___
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] Suppress chapter title marking on blank page after chapter

2017-10-14 Thread Rik Kabel
In a doublesided document, how can I suppress the chapter title marking 
in the header of the blank page that follows a chapter in which the text 
ends on a recto page? I do not want to suppress the header.


The following example shows the problem on pages 4 and 6. I notice that 
the Contents chapter does not exhibit this problem (page 2). But 
checking the source for /completecontent/ provides no useful 
information. Indeed, when I use /title/ instead of /chapter/, as done in 
strc-lis.mkvi, page 2 gets the marking as well!


   \setuppagenumbering [alternative=doublesided,location=]
   \setupheadertexts   [][{\it\getmarking[section]}]
    [{\it\getmarking[chapter]}][]
   \setupheadertexts   [margin]
    []
   [{\inframed[frame=off,leftframe=on,loffset=1em]
    {\userpage}}]
   [{\inframed[frame=off,rightframe=on,roffset=1em]
    {\userpage}}]
    []
   \setuphead  [chapter]
    [header=nomarking]

   \startbuffer[testt]
    \startchapter[title=Chapter]
    \startparagraph
    \input ward
    \stopparagraph
    \dorecurse{\numexpr2*\recurselevel\relax}
    {\startsection[title=Section]
    \startparagraph
    \input ward
    \stopparagraph
    \stopsection}
    \stopchapter
   \stopbuffer

   \starttext
   \completecontent
   \dorecurse{3}{\getbuffer[testt]}
   \startchapter[title={Chapter Last}]
    \input knuth
   \stopchapter
   \stoptext


--
Rik

___
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] methods for numbered paragraphs (ii)

2017-08-06 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sun, 06 Aug 2017 13:39:50 -0600, Pablo Rodriguez <oi...@gmx.es> wrote:


On 08/06/2017 03:54 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

[...]
Something along the lines of the following would be a sufficient (and
easier) first step for the current project, although we may want to
revisit the above for the future:

3  % section
3.0.1   % subsubsection

4  % section
4.1% subsection
4.1.1   % subsubsection

How can we automate this?


Hi Idris,

if you only need a printed version, I think the following approach might
help:

\setupwhitespace[big]

\setuphead[section]
[alternative=margintext,
 color=white,
 style=\tfxx,
 before=,
 after=,
 commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[sectionnumber][current]
\hspace[big]}}]}]

\setuphead[subsection]
[commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[subsectionnumber][current]
\hspace[big]}}]}]

\setuphead[subsubsection]
[commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[subsubsectionnumber][current]
\hspace[big]}}]}]

\starttext

\dorecurse{3}{\section{}
\startpar\input ward\stoppar
\startpar\input ward\stoppar
\dorecurse{3}{\subsection{}
\startpar\input ward\stoppar
\startpar\input ward\stoppar
\dorecurse{3}{\subsubsection{}
\startpar\input ward\stoppar
\startpar\input ward\stoppar
\startpar\input ward\stoppar}
\startpar\input ward\stoppar}
\startpar\input ward\stoppar}

\stoptext


Thank you very much, Pablo. Here is a modified version:

\setupwhitespace[big]

\setuphead[section]
[alternative=margintext,
 color=white,
 style=\tfxx,
 before=,
 after=,
 commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[sectionnumber][current]
\hspace[big]}}]}]

\setuphead[subsection]
[commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[subsectionnumber][current]
\hspace[big]}}]}]

\setuphead[subsubsection]
[commandafter={\setupparagraphintro[first]
[{{\bf \getmarking[subsubsectionnumber][current]
\hspace[big]}}]}]

\starttext
\starttitle[title=Paper]
\dorecurse{2}{%
\startsection
\startpar\input ward\stoppar
\startparagraph\input ward\stopparagraph

\startsubsubsection{}
\startpar\input ward\stoppar
\stopsubsubsection

\dorecurse{2}{%
\startsubsection
\startpar\input ward\stoppar
\startparagraph\input ward\stopparagraph

\dorecurse{2}{%
\startsubsubsection{}
\startpar\input ward\stoppar
\startparagraph\input ward\stopparagraph
\stopsubsubsection
}

\startparagraph{\bf level 2} \input ward\stopparagraph
\stopsubsection
}

\startparagraph{\bf level 1} \input ward\stopparagraph
\stopsection
}

\stoptitle
\stoptext
Challenges:

1. How can we get automatic indentation for all heads *except* the first  
one that occurs after the \starttitle?


2. Look at the output of the adjusted version above - attached. Note that  
a subsubsection after a section gives


1.1
2.1

which are the same as those given by a subsection after a section. How can  
we get a subsubsection after a section to produce the following?


1.0.1
2.0.1

etc.

Thanks again, Pablo!
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

numbered-paragraphs-pablo.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] methods for numbered paragraphs (ii)

2017-08-06 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sat, 05 Aug 2017 21:28:30 -0600, Idris Samawi Hamid ادريس سماوي حامد
<idris.ha...@colostate.edu> wrote:


The parameter insidesection= helps:


\setupwhitespace[big]

\def\SPACE#1{#1\hskip2em\hbox{}}
\setuphead[section]
[style=\bf,
 after={\blank[big]},
 before={\blank[big,medium]},
 color=walayahgreen,
 alternative=text,
 insidesection=\hskip-1.2em]
 % textcommand=\SPACE]
\setuphead[subsection]
[style=\bf,
 after={\blank[big]},
 before={\blank[big,medium]},
 color=walayahgreen,
 alternative=text,
 insidesection=\hskip-1.2em]
\setuphead[subsubsection]
[style=\bf,
 after={\blank[big]},
 before={\blank[big,medium]},
 color=walayahgreen,
 alternative=text,
 insidesection=\hskip-1.2em]

\define[1]\PARHEAD {{\bf{#1}}}

\starttext
\starttitle[title=Section 1]
\startsection[title=Paragraph 1]
\input ward
\stopsection

\startsection
\PARHEAD{Paragraph 2.} \input ward

\startparagraph
\input ward
\stopparagraph

\startsubsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsubsection
\stopsection

\startsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsection
\stoptitle
\stoptext


Paragraph 1 shows that we cannot use the normal title= mechanism and  
maintain consistent spacing.


Paragraph 2 does not use the \start|stopparagraph mechanism, but the  
succeeding non-numbered paragraph does.


CHALLENGES:

1. See the following:

https://www.dropbox.com/s/wckt0zm0zfpx721/numbered-paragraphs-indent.pdf?dl=0

The first numbered paragraph is not indented, but the second onward is.  
How can we automate this?


2. See attached. Consider the following snippet:

\startsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsection

The paragraph number comes out as 3, but the subsubparagraph as 1. What  
we want is


3 
3.01 

The '0' indicates that there is no subsection. Here is an example:

https://www.dropbox.com/s/gy3e93x7jqt6ivx/numbered-paragraphs-indent-01.pdf?dl=0

How can we automate this?

Thanks in advance for any guidance and pointers.


In addition to the two dropbox links above, see the following:

https://people.umass.edu/klement/tlp/tlp.html#bodytext
https://people.umass.edu/klement/tlp/tlp.pdf

The dropbox links (from Introduction to Hegel by GRG Mure) illustrate a
combination of Wittgenstein numbering with paragraph indentation. So it is
something of a hybrid between sectioning and paragraph numbering.

NOTE: A full implementation of Wittgenstein numbering is not required, and
would probably not be wise except in the context of producing a ConTeXt
edition of the Tractatus (something of zero interest to this writer).
Indeed, Wittgenstein's numbering system is inconsistent or obscure in
places... What we are looking for is something actually sane-)

1. If we take the sectioning approach outlined above, then the challenges
are

i)  indent a section after a title; and
ii) implement something not identical to but in the spirit of wittgenstein
numbers, e.g., where a subsubsection follows a section:

3  % section
3.01   % subsubsection

4  % section
4.1% subsection
4.11   % subsubsection

But this may be difficult to automate except for simple cases.

Something along the lines of the following would be a sufficient (and
easier) first step for the current project, although we may want to
revisit the above for the future:

3  % section
3.0.1   % subsubsection

4  % section
4.1% subsection
4.1.1   % subsubsection

How can we automate this?

2. There may be better approaches than the sectioning model outlined in
the previous message.

Thank you in advance for your help.

Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___
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] methods for numbered paragraphs

2017-08-06 Thread Wolfgang Schuster



Idris Samawi Hamid ادريس سماوي حامد <mailto:idris.ha...@colostate.edu>
4. August 2017 um 06:36
Dear syndicate,

Not sure if there is a canonical way to do numbered paragraphs. In the
following, I use subsections to mimic numbered paragraphs:

===section-intext.tex===
\setuphead[section][style=\bfa,after={\blank[big]},before={\blank[big,medium]},color=walayahblue] 

\setuphead[subsection][style=\bf,after={\blank[big]},before={\blank[big,medium]},color=walayahgreen,alternative=text,distance=0.28em] 

\setuphead[subsubsection][style=\tf,after={\blank[big]},before={\blank[big,medium]},color=walayahred,alternative=text,distance=0.28em] 



\starttext
\startsection[title=Section 1]
\startsubsection
\input ward
\stopsubsection

\startsubsection[title=Paragraph 2]
\input ward
\stopsubsection

\startsubsection
\startparagraph
\input ward
\stopparagraph
\stopsubsection
\stopsection
\stoptext
==

See attached output.

In paragraphs 1 and 2, there is too much distance between the subsection
number (subsection number + title in paragraph 2) and between the text.
The distance parameter is not appropriate here, it is the distance 
*after*

the section head that needs adjustment (even if the text portion of the
head (i.e., the section title) is empty).

Question 1: How do we fix the post-head distance?

Paragraph three shows that one apparently cannot mix this sectioning
approach with the \start-stopparagraph mechanism.

Question 2: Is there a way to mix \start-stopparagraph with the above
subsection approach to par numbering?

I suppose that as long as I maintain exactly one paragraph per 
subsection,

then structured output  (xml etc.) should look ok.

Question 3: Is there a wiser way to handle this kind of par numbering in
mkiv?


\setupwhitespace[big]

\definelabel[ParagraphNumber][text=Paragraph,closesymbol={\hspace[big]}]

\setupparagraphintro[each][\ParagraphNumber]

\starttext

\section{Section}

\input ward

\input ward

\input ward

\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] methods for numbered paragraphs (ii)

2017-08-05 Thread Idris Samawi Hamid ادريس سماوي حامد
On Sat, 05 Aug 2017 14:08:28 -0600, Idris Samawi Hamid ادريس سماوي حامد  
<idris.ha...@colostate.edu> wrote:



[Sent this a couple of days ago, maybe will get some takers this time -)]

Dear syndicate,

Not sure if there is a canonical way to do numbered paragraphs. In the
following, I use subsections to mimic numbered paragraphs:

===section-intext.tex===
\setuphead[section][style=\bfa,after={\blank[big]},before={\blank[big,medium]},color=walayahblue]
\setuphead[subsection][style=\bf,after={\blank[big]},before={\blank[big,medium]},color=walayahgreen,alternative=text,distance=0.28em]
\setuphead[subsubsection][style=\tf,after={\blank[big]},before={\blank[big,medium]},color=walayahred,alternative=text,distance=0.28em]

\starttext
\startsection[title=Section 1]
\startsubsection
\input ward
\stopsubsection

\startsubsection[title=Paragraph 2]
\input ward
\stopsubsection

\startsubsection
\startparagraph
\input ward
\stopparagraph
\stopsubsection
\stopsection
\stoptext
==

See attached output.

In paragraphs 1 and 2, there is too much distance between the subsection
number (subsection number + title in paragraph 2) and between the text.
The distance parameter is not appropriate here, it is the distance  
*after*

the section head that needs adjustment (even if the text portion of the
head (i.e., the section title) is empty).

Question 1: How do we fix the post-head distance?


The parameter insidesection= helps:


\setupwhitespace[big]

\def\SPACE#1{#1\hskip2em\hbox{}}
\setuphead[section]
   [style=\bf,
after={\blank[big]},
before={\blank[big,medium]},
color=walayahgreen,
alternative=text,
insidesection=\hskip-1.2em]
% textcommand=\SPACE]
\setuphead[subsection]
   [style=\bf,
after={\blank[big]},
before={\blank[big,medium]},
color=walayahgreen,
alternative=text,
insidesection=\hskip-1.2em]
\setuphead[subsubsection]
   [style=\bf,
after={\blank[big]},
before={\blank[big,medium]},
color=walayahgreen,
alternative=text,
insidesection=\hskip-1.2em]

\define[1]\PARHEAD {{\bf{#1}}}

\starttext
\starttitle[title=Section 1]
\startsection[title=Paragraph 1]
\input ward
\stopsection

\startsection
\PARHEAD{Paragraph 2.} \input ward

\startparagraph
\input ward
\stopparagraph

\startsubsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsubsection
\stopsection

\startsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsection
\stoptitle
\stoptext


Paragraph 1 shows that we cannot use the normal title= mechanism and  
maintain consistent spacing.


Paragraph 2 does not use the \start|stopparagraph mechanism, but the  
succeeding non-numbered paragraph does.


CHALLENGES:

1. See the following:

https://www.dropbox.com/s/wckt0zm0zfpx721/numbered-paragraphs-indent.pdf?dl=0

The first numbered paragraph is not indented, but the second onward is.  
How can we automate this?


2. See attached. Consider the following snippet:

\startsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsection

The paragraph number comes out as 3, but the subsubparagraph as 1. What we  
want is


3 
3.01 

The '0' indicates that there is no subsection. Here is an example:

https://www.dropbox.com/s/gy3e93x7jqt6ivx/numbered-paragraphs-indent-01.pdf?dl=0

How can we automate this?

Thanks in advance for any guidance and pointers.

Best wishes
Idris


Paragraph three shows that one apparently cannot mix this sectioning
approach with the \start-stopparagraph mechanism.

Question 2: Is there a way to mix \start-stopparagraph with the above
subsection approach to par numbering?

I suppose that as long as I maintain exactly one paragraph per  
subsection,

then structured output  (xml etc.) should look ok.

Question 3: Is there a wiser way to handle this kind of par numbering in
mkiv?

Thanks in advance!

Idris

--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

section-intext.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
___

[NTG-context] methods for numbered paragraphs (ii)

2017-08-05 Thread Idris Samawi Hamid ادريس سماوي حامد

[Sent this a couple of days ago, maybe will get some takers this time -)]

Dear syndicate,

Not sure if there is a canonical way to do numbered paragraphs. In the
following, I use subsections to mimic numbered paragraphs:

===section-intext.tex===
\setuphead[section][style=\bfa,after={\blank[big]},before={\blank[big,medium]},color=walayahblue]
\setuphead[subsection][style=\bf,after={\blank[big]},before={\blank[big,medium]},color=walayahgreen,alternative=text,distance=0.28em]
\setuphead[subsubsection][style=\tf,after={\blank[big]},before={\blank[big,medium]},color=walayahred,alternative=text,distance=0.28em]

\starttext
\startsection[title=Section 1]
\startsubsection
\input ward
\stopsubsection

\startsubsection[title=Paragraph 2]
\input ward
\stopsubsection

\startsubsection
\startparagraph
\input ward
\stopparagraph
\stopsubsection
\stopsection
\stoptext
==

See attached output.

In paragraphs 1 and 2, there is too much distance between the subsection
number (subsection number + title in paragraph 2) and between the text.
The distance parameter is not appropriate here, it is the distance *after*
the section head that needs adjustment (even if the text portion of the
head (i.e., the section title) is empty).

Question 1: How do we fix the post-head distance?

Paragraph three shows that one apparently cannot mix this sectioning
approach with the \start-stopparagraph mechanism.

Question 2: Is there a way to mix \start-stopparagraph with the above
subsection approach to par numbering?

I suppose that as long as I maintain exactly one paragraph per subsection,
then structured output  (xml etc.) should look ok.

Question 3: Is there a wiser way to handle this kind of par numbering in
mkiv?

Thanks in advance!

Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

section-intext.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
___

[NTG-context] methods for numbered paragraphs

2017-08-03 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear syndicate,

Not sure if there is a canonical way to do numbered paragraphs. In the
following, I use subsections to mimic numbered paragraphs:

===section-intext.tex===
\setuphead[section][style=\bfa,after={\blank[big]},before={\blank[big,medium]},color=walayahblue]
\setuphead[subsection][style=\bf,after={\blank[big]},before={\blank[big,medium]},color=walayahgreen,alternative=text,distance=0.28em]
\setuphead[subsubsection][style=\tf,after={\blank[big]},before={\blank[big,medium]},color=walayahred,alternative=text,distance=0.28em]

\starttext
\startsection[title=Section 1]
\startsubsection
\input ward
\stopsubsection

\startsubsection[title=Paragraph 2]
\input ward
\stopsubsection

\startsubsection
\startparagraph
\input ward
\stopparagraph
\stopsubsection
\stopsection
\stoptext
==

See attached output.

In paragraphs 1 and 2, there is too much distance between the subsection
number (subsection number + title in paragraph 2) and between the text.
The distance parameter is not appropriate here, it is the distance *after*
the section head that needs adjustment (even if the text portion of the
head (i.e., the section title) is empty).

Question 1: How do we fix the post-head distance?

Paragraph three shows that one apparently cannot mix this sectioning
approach with the \start-stopparagraph mechanism.

Question 2: Is there a way to mix \start-stopparagraph with the above
subsection approach to par numbering?

I suppose that as long as I maintain exactly one paragraph per subsection,
then structured output  (xml etc.) should look ok.

Question 3: Is there a wiser way to handle this kind of par numbering in
mkiv?

Thanks in advance!

Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

section-intext.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] Problems with heads using margintext alternative

2017-07-29 Thread Rik

Willi, Pablo, and list,

Willi,

I understand that the overprint of the margin can be managed by changing 
the default layout. The left margin box displayed by \showframe using 
the default layout clearly shows the margin extending past the edge of 
the page.


I would think that the default layout should be usable as is, which for 
this purpose means that the defined text areas are contained within the 
page boundary. If the default layout is not intended to be usable, it 
should be so documented. I will gladly update the wiki if this is the 
case, but first I would like authoritative confirmation that this is the 
case.


Indeed, the extra line before the text occurs only when inter-paragraph 
whitespace is set and start/stop is used. This does indeed appear to be 
something that can be repaired.


Pablo,

The \inmargin commands do suffer from the same problem; you need simply 
change marg  to marg marg marg to see it. The problem is not that text 
is set outside the margin. It is all set in the margin. The problem is 
that the left margin is laid out over the page edge, and text set in the 
part of the margin that is off the page is lost.


--
Rik

On 2017-07-29 13:10, Pablo Rodriguez wrote:

On 07/23/2017 09:48 PM, Rik Kabel wrote:

The following example demonstrates two problems with
alternative=margintext in \setuphead:

  1. When used with start/stop sectioning, text following the title may
 be set on the wrong line.

Hi Rik,

the issue comes with \startparagraph and sectioning commands (other
margindata are fine):

 \setuphead
 [chapter]
 [alternative=margintext]
 \starttext
 \chapter{Chapter}
 \startparagraph\input jojomayer\stopparagraph
 \blank
 \inleft{marg}\startparagraph\input jojomayer\stopparagraph
 \blank
 \inright{marg}\startparagraph\input jojomayer\stopparagraph
 \blank
 \inouter{marg}\startparagraph\input jojomayer\stopparagraph
 \ininner{marg}\startparagraph\input jojomayer\stopparagraph
 \blank
 \inmargin{marg}\startparagraph\input jojomayer\stopparagraph
 \blank
 \inother{marg}\startparagraph\input jojomayer\stopparagraph
 \stoptext

But \inmargin has no problem with margin

  2. Without regard to the type of sectioning, margintext titles may
 spill over the left edge of the margin and beyond the page frame.

I cannot align them either. I don’t know what we may be missing here.

Pablo



___
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] Problems with heads using margintext alternative

2017-07-29 Thread Pablo Rodriguez
On 07/23/2017 09:48 PM, Rik Kabel wrote:
> The following example demonstrates two problems with
> alternative=margintext in \setuphead:
> 
>  1. When used with start/stop sectioning, text following the title may
> be set on the wrong line.

Hi Rik,

the issue comes with \startparagraph and sectioning commands (other
margindata are fine):

\setuphead
[chapter]
[alternative=margintext]
\starttext
\chapter{Chapter}
\startparagraph\input jojomayer\stopparagraph
\blank
    \inleft{marg}\startparagraph\input jojomayer\stopparagraph
\blank
\inright{marg}\startparagraph\input jojomayer\stopparagraph
\blank
\inouter{marg}\startparagraph\input jojomayer\stopparagraph
\ininner{marg}\startparagraph\input jojomayer\stopparagraph
\blank
\inmargin{marg}\startparagraph\input jojomayer\stopparagraph
\blank
\inother{marg}\startparagraph\input jojomayer\stopparagraph
\stoptext

But \inmargin has no problem with margin
>  2. Without regard to the type of sectioning, margintext titles may
> spill over the left edge of the margin and beyond the page frame.

I cannot align them either. I don’t know what we may be missing here.

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
___

Re: [NTG-context] Problems with headers using margintext alternative

2017-07-29 Thread Willi Egger
Hi,

I am not a guru, but I think that you should setup your pagesize properly. For 
the calculation of the paper-width margin widths are not used. The elements for 
calculations are the backspace and makeupwidth and the rest to sum up to the 
paperwidth as given in the definition of the papersize. Margins are kind of 
virtual. If text spills out of the margin then the backspace and the margin 
have to be adjusted.

e.g. 
\setuplayout
[location=middle,
 topspace=1.5cm,
 backspace=2cm,
 margin=18mm,
 width=middle]

Location=middle tells only, that the lettersized paper should placed centered 
onto the lettersized paper, oversized.

When I comment the line with insidesection= I get a consistent result i.e. that 
the text of the sections with start\stop in the text body starts one line to 
low compared to the traditional way of coding. 
Otherwise with this insidesection={\blank[-line]}  it appears, that the text 
next uneven section numbers is typeset at the expected place, where text next 
to even section numbers is not. — This might indeed be something which Hans 
should look at.


Best

Will
> On 29 Jul 2017, at 16:52, Rik <r...@panix.com> wrote:
> 
> Bump.
> 
> The problem persists two updates later.
> 
> In the picture below, the green line represents the edge of the page.
> 
> 
> 
> Does anyone else get the same result? 
> -- 
> Rik
> 
> On 2017-07-23 15:48, Rik Kabel wrote:
>> The following example demonstrates two problems with alternative=margintext 
>> in \setuphead:
>>  • When used with start/stop sectioning, text following the title may be 
>> set on the wrong line.
>>  • Without regard to the type of sectioning, margintext titles may spill 
>> over the left edge of the margin and beyond the page frame.
>> \setuppapersize
>> [letter]
>> [letter,oversized]
>> \setuplayout
>> [location={middle,middle}]
>> \showframe
>> \setuphead
>> [chapter]
>> [number=no,
>>  alternative=inmargin]
>> \setuphead
>> [section]
>> [
>>  alternative=margintext,
>>  insidesection={\blank[-line]},
>> ]
>> \starttext
>>   \starttitle
>>   [title={Problem description}]
>>   \bgroup
>>   \setupwhitespace[medium]
>>   \startparagraph
>>   This demonstrates two problems with
>>   \type{alternative=margintext} in \tex{setuphead}:
>>   \startitemize[packed,n]
>>   \startitem
>> When used with start/stop sectioning, text following the
>> title may be set on the wrong line.
>>   \stopitem
>>   \startitem
>> Without regard to the type of sectioning, \type{margintext}
>> titles may spill over the left edge of the margin and beyond
>> the page frame. (Oddly, \tex{paperwidth} is less than the
>> sum of \tex{makeupwidth} and the margin widths and
>> distances for both letter and A4 paper.)
>>   \stopitem
>>   \stopitemize
>>   \stopparagraph
>>   \startparagraph
>>   With start/stop sectioning, the text following the section
>>   title may begin one line below the start of the title. That
>>   can be remedied if there is no whitespace between paragraphs
>>   with \type{insidesection={\blank[-line]}}, but the remedy
>>   fails when there is whitespace, and increasing the correction
>>   has no effect. With traditional sectioning, the text appears
>>   baseline|-|aligned with the heading, as expected. The
>>   the correction has no effect in any case with traditional
>>   sectioning.
>>   \stopparagraph
>>   \startparagraph
>>   It makes no difference in any test how the paragraphs are
>>   delimited—blank lines, \tex{bpar}/\tex{epar},
>>   \tex{startparagraph}/\tex{stopparagraph}, or \tex{par}.
>>   \stopparagraph
>>   \startparagraph
>>   Tested with standalone beta 2017.07.17 00:20.
>>   \stopparagraph
>>   \egroup
>>   \page
>>   \startchapter
>>   [title={Start/stop sectioning}]
>>   \startsection[title={Mis\-cel\-la\-neous quo\-ta\-tions}]
>>   \startparagraph
>>   \input jojomayer
>>   \stopparagraph
>>   \startparagraph
>>   \input carrol \wordright{No indent no whitespace.}
>>   \stopparagraph
>>   \stopsection
>>   \bgroup
>>   \setupwhitespace[medium]
>>   \startsection[title={Miscellaneous quotations}]
>>   \startparagraph
>>   \input jojomayer
>>   \stopparagraph
>>   \startparagraph
>>   \input carrol \wordright{No indent medium whitespac

Re: [NTG-context] Problems with headers using margintext alternative

2017-07-29 Thread Rik

Bump.

The problem persists two updates later.

In the picture below, the green line represents the edge of the page.



Does anyone else get the same result?
--
Rik

On 2017-07-23 15:48, Rik Kabel wrote:


The following example demonstrates two problems with 
alternative=margintext in \setuphead:


 1. When used with start/stop sectioning, text following the title may
be set on the wrong line.
 2. Without regard to the type of sectioning, margintext titles may
spill over the left edge of the margin and beyond the page frame.

\setuppapersize
[letter]
[letter,oversized]
\setuplayout
[location={middle,middle}]
\showframe
\setuphead
[chapter]
[number=no,
 alternative=inmargin]
\setuphead
[section]
[
 alternative=margintext,
 insidesection={\blank[-line]},
]
\starttext
  \starttitle
  [title={Problem description}]
  \bgroup
  \setupwhitespace[medium]
  \startparagraph
  This demonstrates two problems with
  \type{alternative=margintext} in \tex{setuphead}:
  \startitemize[packed,n]
  \startitem
When used with start/stop sectioning, text following the
title may be set on the wrong line.
  \stopitem
  \startitem
Without regard to the type of sectioning, \type{margintext}
titles may spill over the left edge of the margin and beyond
the page frame. (Oddly, \tex{paperwidth} is less than the
sum of \tex{makeupwidth} and the margin widths and
distances for both letter and A4 paper.)
  \stopitem
  \stopitemize
  \stopparagraph
  \startparagraph
  With start/stop sectioning, the text following the section
  title may begin one line below the start of the title. That
  can be remedied if there is no whitespace between paragraphs
  with \type{insidesection={\blank[-line]}}, but the remedy
  fails when there is whitespace, and increasing the correction
  has no effect. With traditional sectioning, the text appears
  baseline|-|aligned with the heading, as expected. The
  the correction has no effect in any case with traditional
  sectioning.
  \stopparagraph
  \startparagraph
  It makes no difference in any test how the paragraphs are
  delimited—blank lines, \tex{bpar}/\tex{epar},
  \tex{startparagraph}/\tex{stopparagraph}, or \tex{par}.
  \stopparagraph
  \startparagraph
  Tested with standalone beta 2017.07.17 00:20.
  \stopparagraph
  \egroup
  \page
  \startchapter
  [title={Start/stop sectioning}]
  \startsection[title={Mis\-cel\-la\-neous quo\-ta\-tions}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{No indent no whitespace.}
  \stopparagraph
  \stopsection
  \bgroup
  \setupwhitespace[medium]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{No indent medium whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \bgroup
  \setupindenting[yes,small]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{Small indent no whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \bgroup
  \setupwhitespace[medium]
  \setupindenting[yes,small]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{Small indent medium whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \stopchapter
  \chapter{Traditional sectioning}
  \section{Mis\-cel\-la\-neous quo\-ta\-tions}
  \input jojomayer \par
  \input carrol  \wordright{No indent no whitespace.} \par
  No indent no whitespace. \par
  \bgroup
  \setupwhitespace[medium]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{No indent medium whitespace.} \par
  \egroup
  \bgroup
  \setupindenting[yes,small]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{Small indent no whitespace.} \par
  \egroup
  \bgroup
  \setupwhitespace[medium]
  \setupindenting[yes,small]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{Small indent medium whitespace.} \par
  \egroup
\showlayout
\stoptext


--
Rik

[NTG-context] Problems with headers using margintext alternative

2017-07-23 Thread Rik Kabel
The following example demonstrates two problems with 
alternative=margintext in \setuphead:


1. When used with start/stop sectioning, text following the title may
   be set on the wrong line.
2. Without regard to the type of sectioning, margintext titles may
   spill over the left edge of the margin and beyond the page frame.

   \setuppapersize
[letter]
[letter,oversized]
   \setuplayout
[location={middle,middle}]
   \showframe
   \setuphead
[chapter]
[number=no,
 alternative=inmargin]
   \setuphead
[section]
[
 alternative=margintext,
 insidesection={\blank[-line]},
]
   \starttext
  \starttitle
  [title={Problem description}]
  \bgroup
  \setupwhitespace[medium]
  \startparagraph
  This demonstrates two problems with
  \type{alternative=margintext} in \tex{setuphead}:
  \startitemize[packed,n]
  \startitem
When used with start/stop sectioning, text following the
title may be set on the wrong line.
  \stopitem
  \startitem
Without regard to the type of sectioning, \type{margintext}
titles may spill over the left edge of the margin and beyond
the page frame. (Oddly, \tex{paperwidth} is less than the
sum of \tex{makeupwidth} and the margin widths and
distances for both letter and A4 paper.)
  \stopitem
  \stopitemize
  \stopparagraph
  \startparagraph
  With start/stop sectioning, the text following the section
  title may begin one line below the start of the title. That
  can be remedied if there is no whitespace between paragraphs
  with \type{insidesection={\blank[-line]}}, but the remedy
  fails when there is whitespace, and increasing the correction
  has no effect. With traditional sectioning, the text appears
  baseline|-|aligned with the heading, as expected. The
  the correction has no effect in any case with traditional
  sectioning.
  \stopparagraph
  \startparagraph
  It makes no difference in any test how the paragraphs are
  delimited—blank lines, \tex{bpar}/\tex{epar},
  \tex{startparagraph}/\tex{stopparagraph}, or \tex{par}.
  \stopparagraph
  \startparagraph
  Tested with standalone beta 2017.07.17 00:20.
  \stopparagraph
  \egroup
  \page
  \startchapter
  [title={Start/stop sectioning}]
  \startsection[title={Mis\-cel\-la\-neous quo\-ta\-tions}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{No indent no whitespace.}
  \stopparagraph
  \stopsection
  \bgroup
  \setupwhitespace[medium]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{No indent medium whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \bgroup
  \setupindenting[yes,small]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{Small indent no whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \bgroup
  \setupwhitespace[medium]
  \setupindenting[yes,small]
  \startsection[title={Miscellaneous quotations}]
  \startparagraph
  \input jojomayer
  \stopparagraph
  \startparagraph
  \input carrol \wordright{Small indent medium whitespace.}
  \stopparagraph
  \stopsection
  \egroup
  \stopchapter
  \chapter{Traditional sectioning}
  \section{Mis\-cel\-la\-neous quo\-ta\-tions}
  \input jojomayer \par
  \input carrol  \wordright{No indent no whitespace.} \par
  No indent no whitespace. \par
  \bgroup
  \setupwhitespace[medium]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{No indent medium whitespace.} \par
  \egroup
  \bgroup
  \setupindenting[yes,small]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{Small indent no whitespace.} \par
  \egroup
  \bgroup
  \setupwhitespace[medium]
  \setupindenting[yes,small]
  \section{Miscellaneous quotations}
  \input jojomayer \par
  \input carrol \wordright{Small indent medium whitespace.} \par
  \egroup
   \showlayout
   \stoptext


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

Re: [NTG-context] Aligning subsection head with following paragraph in tagged pdf output

2017-04-02 Thread Todd DeVries
Thank you for this information.

Wolfgang Schuster <schuster.wolfg...@gmail.com> writes:
> The inline heading in your example doesn’t work because \startparagraph
> forces the end of a paragraph for the preceding text.
>
> As you want only tags for the content of your paragraph you can enclose
> your text in \bpar … \epar instead of \startparagraph … \stopparagraph.

That seems to work.  I don't have the ability to directly examine the
pdf's tags table, but the document appears to read
correctly. Sections/subsections/paragraphs are identified. The subsection
is inline with the following paragraph.  I'm not sure what are the
differences between \bpar and \startparagraph, so have used the later
construction for the second paragraph in the subsection.

\setuppapersize[letter]
\setuptagging[state=start]
\setuphead[chapter][style=\bf, number=no, align=middle]
\setuphead[section][style=\bf, number=no]
\setuphead[subsection][style=\bf, number=no, commandafter={.~},
  textdistance=0cm, alternative=text]
\starttext
\startchapter[title=Chapter I]
  \startsection[title=Introduction]
\startparagraph
  Beginning with the passage of section 504 of the Rehabilitation
  Act of 1974, students with disabilities are participating in
  higher education in increasing numbers (Madaus, 2011). Students
  with psychiatric, learning, and cognitive impairment who once
  considered college out of reach are taking the plunge. …
\stopparagraph
\startsubsection[title=Demo Subsection]
  \bpar Numbers for all students moving from high school through a
  bachelors degree in Idaho are worse than in most of the
  nation. Go-on Idaho (2014), an organization dedicated to
  furthering our state's educational outcomes , relates …\epar
  \startparagraph
The U. S. Bureau of Labor Statistics (2016) report that a
person's level of education are linked to increased income
and levels of unemployment. The more education a person has,
the higher is the average wage and the lower the level of
unemployment. Educational attainment matters. …
  \stopparagraph
\stopsubsection
  \stopsection
  \stopchapter
\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
___

Re: [NTG-context] Aligning subsection head with following paragraph in tagged pdf output

2017-04-02 Thread Wolfgang Schuster



Todd DeVries <mailto:t...@equaltext.com>
2. April 2017 um 01:47via Postbox 
<https://www.postbox-inc.com/?utm_source=email_medium=sumlink_campaign=reach>

Hello everyone,

Thanks to all who helped me better understand the issues surrounding my
question. The document style I am following requires that the
first three headings are included in the table of contents. Headings
one and two are easy, as they stand on lines by themself. Heading three
must be aligned with the left margin in bold and followed by a period.
The rest of the paragraph or paragraphs folllow.

This style makes sense visually, bold text at the margin represents a
change in topic. less so when reading or editing with audio output (My
computer does not have a monitor attached.) Using good sectioning
allows one to fold the document for navigation and organization.
Consider how Org-mode in Emacs works as an analogue. I started thinking
that life would be easier if heading level 3 sections could be both
structural, for navigation, and visual, inline with their first
paragraph.

This idea holds true both in source text and in the pdf output.
Properly tagged pdf documents allow one to jump by structural elements
(heading to heading, paragraph to paragraph. In a perfect world one
could have it both ways: a structural element like a section, but placed
inline as though it were just another layout token. The audio using
tagged structure indicates a topic change, while those using their eyes
just see the bold text.

Hopefully this short explanation adequately describes my reason for
addressing the list.


The inline heading in your example doesn’t work because \startparagraph
forces the end of a paragraph for the preceding text.

As you want only tags for the content of your paragraph you can enclose
your text in \bpar … \epar instead of \startparagraph … \stopparagraph.

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] Aligning subsection head with following paragraph in tagged pdf output

2017-04-01 Thread Alan Braslau
Have you tried:

On Sat, 1 Apr 2017 20:20:02 +0200
Pablo Rodriguez <oi...@gmx.es> wrote:

> Tagging PDFs the way you seem to be trying might be impossible. Here
> is my sample:
> 
> \setuppapersize[letter]
> \setuptagging[state=start]
> \starttext
> \startsubsection[title=First Subsection]
  \startparagraph[before=] a\stopparagraph
> \startparagraph b\stopparagraph
> \startparagraph c\stopparagraph
> \stopsubsection
> \stoptext

(untested)

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] Aligning subsection head with following paragraph in tagged pdf output

2017-04-01 Thread Pablo Rodriguez
On 04/01/2017 05:32 PM, Rik Kabel wrote:
> On 2017-04-01 00:10, Todd DeVries wrote:
>> Thanks for your assistance.  Was unaware of using the setupheads
>> command incorrectly.  Good information to have.  I am still not
>> able to produce an automatic period (.) at the end of the section
>> title using the after keyword.  is this correct?
> 
> Seems to be. While before= is honored, after= is not. This looks like an 
> inconsistency that can be addressed.

Hi Todd,

this will give the output you like:

\setuppapersize[letter]
\setuptagging[state=start]
\setuphead[subsection][style=\bf, number=no, commandafter={.~},
 textdistance=0cm, alternative=text]
\starttext
\startsubsection[title=First Subsection]
\input knuth
\stopsubsection
\stoptext

>>> alternative=text is working, but \startparagraph is starting a
>>> new paragraph after the heading.  \start\stopparagraph is not
>>> happy with the text alternative.
>> I am wondering if this is just not going to work with the tagging
>> subsystem.  The subsection aligns if I remove the start/stop
>> paragraph following the heading.  But if I add a second paragraph
>> in that subsection it breaks again.
> 
> Example, please. I have no problem adding a start/stopparagraph after 
> your knuth. (Note that the knuth has to be terminated in a \par or a 
> blank line. That is because of the construction of that input file.)

Add a sample, otherwise we might speculate about what you’re aiming at.

Tagging PDFs the way you seem to be trying might be impossible. Here is
my sample:

\setuppapersize[letter]
\setuptagging[state=start]
    \starttext
    \startsubsection[title=First Subsection]
\startparagraph a\stopparagraph
\startparagraph b\stopparagraph
\startparagraph c\stopparagraph
\stopsubsection
\stoptext

Both paragraphs and headings are block elements (I have just checked it
at
https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=585).
Block elements cannot contain other block elements inside.

Displaying block elements as inline elements, if not contradictory,
might be misleading, at least.

>> I use tagged pdfs for output
>> because they are more accessible with my screen reader.  Without
>> tagging, all one gets is long blocks of undifferentiated text.
>> With the correct tags, paragraphs, headings, lists, and tables
>> get created that make more sense with auditory output.  To my
>> knowledge, ConTeXt is the only alternative for producing
>> accessible pdfs beyond working with Acrobat pro or MS.  Word.
>> After writing a 70-page academic project in Word, I'm seeking
>> alternatives!

This is an issue about text structure. We speak of block elements
because they have vertical space between them (even if set to none).

>> Perhaps one can just use in-paragraph bolding and mark that text
>> for the table of contents as an alternative.  This is required
>> for heading level 3 content in APA style.
> 
> For now that might be best as long as you do not need to reference them 
> in a table of contents (not required by APA, as I read the standard, 
> although perhaps an added requirement from your publisher).

It seems that H3 should be a block element, not an inline element inside
P (according to most XML implementations, I’d say).

Why do you need in-line titles?

But I may be missing something, correct me if I’m wrong.

Sorry for the bad news,

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
___

Re: [NTG-context] Aligning subsection head with following paragraph in tagged pdf output

2017-04-01 Thread Rik Kabel

On 2017-04-01 00:10, Todd DeVries wrote:

Thanks for your assistance.  Was unaware of using the setupheads
command incorrectly.  Good information to have.  I am still not
able to produce an automatic period (.) at the end of the section
title using the after keyword.  is this correct?


Seems to be. While before= is honored, after= is not. This looks like an 
inconsistency that can be addressed.




On Friday, March 31, 2017, 7:01:28 PM, Rik writes:


alternative=text is working, but \startparagraph is starting a
new paragraph after the heading.  \start\stopparagraph is not
happy with the text alternative.

I am wondering if this is just not going to work with the tagging
subsystem.  The subsection aligns if I remove the start/stop
paragraph following the heading.  But if I add a second paragraph
in that subsection it breaks again.


Example, please. I have no problem adding a start/stopparagraph after 
your knuth. (Note that the knuth has to be terminated in a \par or a 
blank line. That is because of the construction of that input file.)



I use tagged pdfs for output
because they are more accessible with my screen reader.  Without
tagging, all one gets is long blocks of undifferentiated text.
With the correct tags, paragraphs, headings, lists, and tables
get created that make more sense with auditory output.  To my
knowledge, ConTeXt is the only alternative for producing
accessible pdfs beyond working with Acrobat pro or MS.  Word.
After writing a 70-page academic project in Word, I'm seeking
alternatives!

Perhaps one can just use in-paragraph bolding and mark that text
for the table of contents as an alternative.  This is required
for heading level 3 content in APA style.


For now that might be best as long as you do not need to reference them 
in a table of contents (not required by APA, as I read the standard, 
although perhaps an added requirement from your publisher).



Thanks for your assistance.  I'm a newbie and appreciate the
help.

Todd


--
Rik
___
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] Aligning subsection head with following paragraph in tagged pdf output

2017-03-31 Thread Todd DeVries
Thanks for your assistance.  Was unaware of using the setupheads
command incorrectly.  Good information to have.  I am still not
able to produce an automatic period (.) at the end of the section
title using the after keyword.  is this correct?

On Friday, March 31, 2017, 7:01:28 PM, Rik writes:

> alternative=text is working, but \startparagraph is starting a
> new paragraph after the heading.  \start\stopparagraph is not
> happy with the text alternative.

I am wondering if this is just not going to work with the tagging
subsystem.  The subsection aligns if I remove the start/stop
paragraph following the heading.  But if I add a second paragraph
in that subsection it breaks again.  I use tagged pdfs for output
because they are more accessible with my screen reader.  Without
tagging, all one gets is long blocks of undifferentiated text.
With the correct tags, paragraphs, headings, lists, and tables
get created that make more sense with auditory output.  To my
knowledge, ConTeXt is the only alternative for producing
accessible pdfs beyond working with Acrobat pro or MS.  Word.
After writing a 70-page academic project in Word, I'm seeking
alternatives!

Perhaps one can just use in-paragraph bolding and mark that text
for the table of contents as an alternative.  This is required
for heading level 3 content in APA style.

Thanks for your assistance.  I'm a newbie and appreciate the
help.

Todd

___
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] Aligning subsection head with following paragraph in tagged pdf output

2017-03-31 Thread Rik Kabel

On 2017-03-31 19:05, Todd DeVries wrote:

Hello,

I would like to align a subsection heading with the following
paragraph. For example:

Subsectiontext. The data presented in this section will ...

What I get is:

Subsection Text

The data presented in this section will ...

What recipe should be used with the \setupheads command to produce this
output?  I've tried several variations including the snippit below.

\setuppapersize[letter][letter]
\setuptagging[state=start]
\setupheads[subsection][style=\bf, number=no, after={. }, alternative=text]
\starttext
\startsection[reference=sec:deep, title=Deep Thoughts
\startparagraph
Oh Hum, its too windy to play out side, so perhaps I'll write a while...
\startsubsection[reference=first, title=First Subsection]
   \startparagraph
 \input knuth
   \stopparagraph
\stopsubsection
\stopsection
\stoptext

First, add a closing ] to \startsubsection...

Then remove the \startparagraph following it, and the \stopparagraph 
after knuth. alternative=text is working, but \startparagraph is 
starting a new paragraph after the heading. \start\stopparagraph is not 
happy with the text alternative.


You should also add a \stopparagraph after the Oh Hum line.

 Then change \setupheads to \setuphead. \setupheads should have only 
one []. That [] contains key/value option pairs that apply to all 
heading levels. \setuphead[sectionlevel][] is used to provide key/value 
option pairs for sectionlevel headings (and for lower-level heads for 
inherited options).


--
Rik
___
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] Aligning subsection head with following paragraph in tagged pdf output

2017-03-31 Thread Todd DeVries
Hello,

I would like to align a subsection heading with the following
paragraph. For example:

Subsectiontext. The data presented in this section will ...

What I get is:

Subsection Text

The data presented in this section will ...

What recipe should be used with the \setupheads command to produce this
output?  I've tried several variations including the snippit below.

\setuppapersize[letter][letter]
\setuptagging[state=start]
\setupheads[subsection][style=\bf, number=no, after={. }, alternative=text]
\starttext
\startsection[reference=sec:deep, title=Deep Thoughts
\startparagraph
Oh Hum, its too windy to play out side, so perhaps I'll write a while...
\startsubsection[reference=first, title=First Subsection]
  \startparagraph
\input knuth
  \stopparagraph
\stopsubsection
\stopsection
\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] Luatex 0.95.0 error with bidi and Hebrew

2016-04-30 Thread Rik Kabel

Version information:

   ConTeXt  ver: 2016.04.30 18:59 MKIV beta  fmt: 2016.4.30  int:
   english/english
   luajittex, 0.95.0 and luatex, 0.95.0

   running on Windows 10 x64

Error message:

   error:
   ...eXt/tex/texmf-context/tex/context/base/mkiv/font-otj.lua:1205:
   attempt to index local 'i' (a nil value)
   tex error   > tex error on line 7 in file
   C://Users/rik/Desktop/comp_body.tex: ?

Code:

   \setupdirections [bidi=global]
   \definefont [hebrew] [default] [lang=heb,ccmp=yes,script=hebr]
   \definefont [Hebrew] [sileotsr*hebrew sa .9]
   \starttext
     \startparagraph
  Hebrew : {\Hebrew רִ}
 \stopparagraph
   \stoptext

When the first line is removed, or the value of bidi changed to on, no 
error is thrown.


A single-font version of the code, for fonts that have Hebrew glyphs, 
fails with some fonts (libertine shown below), but works with others, 
for example, dejavu sans.


Code:

   \setupdirections [bidi=global]
   \setupbodyfont[libertine]
   \starttext
     \startparagraph
  Hebrew : רִ
 \stopparagraph
   \stoptext

My installation, or is this a bug?

--
Rik Kabel

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

2016-01-12 Thread Alan BRASLAU
Hello,

Jean-Michel pointed out to me the following curiosity:

\starttext
\input tufte
\startalignment[middle]
\input ward
\stopalignment
\input tufte
\stoptext

The startalignment applies to the preceding text, too. Strange...

I never noticed this before as I have the habit of coding
\startalignment\stopalignment blocks set-off with leading and trailing
blank lines for better readability. But such practice could lead to
undesired results. Consider the following example:

\setupwhitespace [big]

\starttext
\input tufte

\startalignment[middle]
\input ward
\stopalignment
\input dawkins
\stoptext

So \stopalignment implicitly imposes a \par.
If I were to omit the blank line before \startalignment so that no big
whitespace be included before the centered block, the tufte text will
get middle aligned. Also, perhaps I might not wish for the dawkins text
to be separated by a big whitespace, logically as in:

\startparagraph
\input tufte
\startalignment [middle]
\input ward
\stopalignment
\input dawkins
\stopparagraph

Indeed, curious behavior.

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

Re: [NTG-context] meaning of error message?

2015-11-29 Thread Alan Bowen
Hi, Wolfgang—

at line 34, I have \Query
which is defined:
\definehighlight[Query][color=magenta,style=bold]

There also instances of \emph (\definehighlight[emph][style=italic]) at
lines 41 and 58.

Alan


On Sat, Nov 28, 2015 at 11:31 AM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

> Alan Bowen <bowenala...@gmail.com>
> 25. November 2015 um 17:33
> Hi, Wolfgang—
>
> The lines from the file are:
>
>
> \startextract   <— LINE 43
> \startparagraph
> \startlines
> .
> .
> \footnote[particles]{A look at the particles in this sentence suggests
> that something has gone wrong. The initial «{δέ}» is mildly adversative, as
> is the «{δέ}» at the beginning of the sentence opening the second
> paragraph. This is in line with the careful disposition of the {\emph cola}
> in the whole introduction: independent, principal clauses are always
> introduced by conjunctive «{δέ}», and inside them the subclauses in
> contraposition are regularly marked by the canonical «{μέν \dots δέ}».
> Moreover, every «{μέν}» is answered by a «{δέ}». The only exception is the
> «{μέν}» in this sentence [lines 23–24]: a clause such as «{οἱ δὲ ἐπιμερεῖϲ
> οὔ}» (\quote{whereas epimeric do not}) is surely missing due to scribal
> mistake. I regard the correction as certain, given the strictly analogous
> structure of the immediately following sentence. Nothing in the
> interpretation that I shall develop depends on this textual detail,
> however.}
> %
> Γινώϲκομεν δὲ καὶ τῶν φθόγγων τοὺϲ μὲν ϲυμφώ{-}
> νουϲ ὄνταϲ, τοὺϲ δὲ διαφώνουϲ, καὶ τοὺϲ μὲν ϲυμφώνουϲ
> μίαν κρᾶϲιν τὴν ἐξ ἀμφοῖν ποιοῦνταϲ, τοὺϲ δὲ διαφώ{-}
> <—LINE 62
> νουϲ οὔ. τούτων οὕτωϲ ἐχόντων εἰκὸϲ\note[03] τοὺϲ ϲυμφώνουϲ
> %
> \footnotetext[03]{εἰκόϲ: notice the determination of likelihood in a place
> where in the first paragraph one finds two occurrences of a determination
> of necessity. I would link this feature to a perceptibly less firm status
> of the assumed correspondence between notes and numbers. Compare the more
> precise statement occurring on the second line of the first paragraph:
> «{τοὺϲ φθόγγουϲ ἀναγκαῖον ἐν ἀριθμοῦ λόγῳ λέγεϲθαι πρὸϲ ἀλλήλουϲ}».}
> %
> \Lmt{M160.1}φθόγγουϲ, ἐπειδὴ μίαν τὴν ἐξ ἀμφοῖν ποιοῦνται κρᾶϲιν
> τῆϲ φωνῆϲ, εἶναι \underbar{τῶν ἐν ἑνὶ ὀνόματι πρὸϲ ἀλλήλουϲ
> λεγομένων ἀριθμῶν},\note[04]  ἤτοι πολλαπλαϲίουϲ ὄνταϲ ἢ ἐπι{-}
> %
> \footnotetext[04]{The {\emph variatio} «({ἐν}) {ἑνὶ ὀνόματι}» is very
> likely a scribal {\emph lapsus}, even if it is not clear whether the
> mistake is a haplography or a dittography.}
> %
> μορίουϲ.
> \stoplines
> \stopparagraph
> \stopextract  <— LINE 80
>
>
> ​Many thanks for any thoughts on this or advice.
>
> Did you create a command with \definehighlight which is used in this part
> of the document?
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] meaning of error message?

2015-11-28 Thread Wolfgang Schuster

Alan Bowen <mailto:bowenala...@gmail.com>
25. November 2015 um 17:33
Hi, Wolfgang—

The lines from the file are:


\startextract <— LINE 43
\startparagraph
\startlines
.
.
\footnote[particles]{A look at the particles in this sentence suggests 
that something has gone wrong. The initial «{δέ}» is mildly 
adversative, as is the «{δέ}» at the beginning of the sentence opening 
the second paragraph. This is in line with the careful disposition of 
the {\emph cola} in the whole introduction: independent, principal 
clauses are always introduced by conjunctive «{δέ}», and inside them 
the subclauses in contraposition are regularly marked by the canonical 
«{μέν \dots δέ}». Moreover, every «{μέν}» is answered by a «{δέ}». The 
only exception is the «{μέν}» in this sentence [lines 23–24]: a clause 
such as «{οἱ δὲ ἐπιμερεῖϲ οὔ}» (\quote{whereas epimeric do not}) is 
surely missing due to scribal mistake. I regard the correction as 
certain, given the strictly analogous structure of the immediately 
following sentence. Nothing in the interpretation that I shall develop 
depends on this textual detail, however.}

%
Γινώϲκομεν δὲ καὶ τῶν φθόγγων τοὺϲ μὲν ϲυμφώ{-}
νουϲ ὄνταϲ, τοὺϲ δὲ διαφώνουϲ, καὶ τοὺϲ μὲν ϲυμφώνουϲ
μίαν κρᾶϲιν τὴν ἐξ ἀμφοῖν ποιοῦνταϲ, τοὺϲ δὲ διαφώ{-} <—LINE 62
νουϲ οὔ. τούτων οὕτωϲ ἐχόντων εἰκὸϲ\note[03] τοὺϲ ϲυμφώνουϲ
%
\footnotetext[03]{εἰκόϲ: notice the determination of likelihood in a 
place where in the first paragraph one finds two occurrences of a 
determination of necessity. I would link this feature to a perceptibly 
less firm status of the assumed correspondence between notes and 
numbers. Compare the more precise statement occurring on the second 
line of the first paragraph: «{τοὺϲ φθόγγουϲ ἀναγκαῖον ἐν ἀριθμοῦ λόγῳ 
λέγεϲθαι πρὸϲ ἀλλήλουϲ}».}

%
\Lmt{M160.1}φθόγγουϲ, ἐπειδὴ μίαν τὴν ἐξ ἀμφοῖν ποιοῦνται κρᾶϲιν
τῆϲ φωνῆϲ, εἶναι \underbar{τῶν ἐν ἑνὶ ὀνόματι πρὸϲ ἀλλήλουϲ
λεγομένων ἀριθμῶν},\note[04]  ἤτοι πολλαπλαϲίουϲ ὄνταϲ ἢ ἐπι{-}
%
\footnotetext[04]{The {\emph variatio} «({ἐν}) {ἑνὶ ὀνόματι}» is very 
likely a scribal {\emph lapsus}, even if it is not clear whether the 
mistake is a haplography or a dittography.}

%
μορίουϲ.
\stoplines
\stopparagraph
\stopextract <— LINE 80


​Many thanks for any thoughts on this or advice.

Did you create a command with \definehighlight which is used in this 
part of the document?


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] meaning of error message?

2015-11-25 Thread Alan Bowen
Hi, Wolfgang—

The lines from the file are:


\startextract   <— LINE 43
\startparagraph
\startlines
.
.
\footnote[particles]{A look at the particles in this sentence suggests that
something has gone wrong. The initial «{δέ}» is mildly adversative, as is
the «{δέ}» at the beginning of the sentence opening the second paragraph.
This is in line with the careful disposition of the {\emph cola} in the
whole introduction: independent, principal clauses are always introduced by
conjunctive «{δέ}», and inside them the subclauses in contraposition are
regularly marked by the canonical «{μέν \dots δέ}». Moreover, every «{μέν}»
is answered by a «{δέ}». The only exception is the «{μέν}» in this sentence
[lines 23–24]: a clause such as «{οἱ δὲ ἐπιμερεῖϲ οὔ}» (\quote{whereas
epimeric do not}) is surely missing due to scribal mistake. I regard the
correction as certain, given the strictly analogous structure of the
immediately following sentence. Nothing in the interpretation that I shall
develop depends on this textual detail, however.}
%
Γινώϲκομεν δὲ καὶ τῶν φθόγγων τοὺϲ μὲν ϲυμφώ{-}
νουϲ ὄνταϲ, τοὺϲ δὲ διαφώνουϲ, καὶ τοὺϲ μὲν ϲυμφώνουϲ
μίαν κρᾶϲιν τὴν ἐξ ἀμφοῖν ποιοῦνταϲ, τοὺϲ δὲ διαφώ{-}   <—
   LINE 62
νουϲ οὔ. τούτων οὕτωϲ ἐχόντων εἰκὸϲ\note[03] τοὺϲ ϲυμφώνουϲ
%
\footnotetext[03]{εἰκόϲ: notice the determination of likelihood in a place
where in the first paragraph one finds two occurrences of a determination
of necessity. I would link this feature to a perceptibly less firm status
of the assumed correspondence between notes and numbers. Compare the more
precise statement occurring on the second line of the first paragraph:
«{τοὺϲ φθόγγουϲ ἀναγκαῖον ἐν ἀριθμοῦ λόγῳ λέγεϲθαι πρὸϲ ἀλλήλουϲ}».}
%
\Lmt{M160.1}φθόγγουϲ, ἐπειδὴ μίαν τὴν ἐξ ἀμφοῖν ποιοῦνται κρᾶϲιν
τῆϲ φωνῆϲ, εἶναι \underbar{τῶν ἐν ἑνὶ ὀνόματι πρὸϲ ἀλλήλουϲ
λεγομένων ἀριθμῶν},\note[04]  ἤτοι πολλαπλαϲίουϲ ὄνταϲ ἢ ἐπι{-}
%
\footnotetext[04]{The {\emph variatio} «({ἐν}) {ἑνὶ ὀνόματι}» is very
likely a scribal {\emph lapsus}, even if it is not clear whether the
mistake is a haplography or a dittography.}
%
μορίουϲ.
\stoplines
\stopparagraph
\stopextract  <— LINE 80


​Many thanks for any thoughts on this or advice.

Alan
​

On Tue, Nov 24, 2015 at 3:27 PM, Wolfgang Schuster <
schuster.wolfg...@gmail.com> wrote:

> Alan Bowen <bowenala...@gmail.com>
> 24. November 2015 um 20:47
> I have been experimenting with tagging. But my attempts with two files now
> have generated this sort of error message:
>
> lua error   > lua error on line 62 in file c_Int-A002_Acerbi.tex:
>
>
> .../ConTeXt/tex/texmf-context/tex/context/base/strc-tag.lua:407: bad
> argument #2 to 'lpegmatch' (string expected, got boolean)
>
> stack traceback:
>
> [C]: in function 'lpegmatch'
>
> .../ConTeXt/tex/texmf-context/tex/context/base/strc-tag.lua:407: in
> function 'strippedtag'
>
> .../ConTeXt/tex/texmf-context/tex/context/base/back-exp.lua:740: in
> function <.../ConTeXt/tex/texmf-context/tex/context/base/back-exp.lua:739>
>
> (...tail calls...)
>
> Could someone tell me what this means—is there are error in my encoding or
> a problem in lua?
>
> What’s the content of line 62 (plus a few lines before/after) in your file
> c_Int_A002_Acerbi.tex?
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] New btx code problem with quote protrusion, redux

2015-11-02 Thread Hans Hagen

On 10/23/2015 8:40 PM, Rik Kabel wrote:

At Wolfgang’s request, a new thread for this subject. I have cleaned up
the example from the July 5 posting, but the problems are the same as
shown there. In July Alan suggested that there might a bug here, but
nothing has been done to address it since then. Wolfgang suggested
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg35580.html) that
method=font is required for proper protrusion handling for quotations.

 1. When \setupdelimitedtext[quotation][method=font] is present /and
//there is //no citation//in a footnote within a startquotation
block and a bibliography is produced/, compilation proceeds normally.
 2. When \setupdelimitedtext[quotation][method=font] is present /and
//there is a citation//in a footnote within a startquotation block
and a bibliography is produced,/ the compilation complains of a
missing right curly. When allowed to continue to completion the
protrusion for the opening quotation marks does not match the
protrusion for similar marks not produced through \startquotation.
Citations in footnotes outside quotation blocks are not a problem.
Without a bibliography (\placelistofpublications)
 3. When \setupdelimitedtext[quotation][method=font] is present, the
[right] option of \startblockquotation is treated as text within the
quotation. This can be resolved by adding “leftmargin=” to the
\setupdelimitedtext[quotation] command (but that complicates matters
when you want other alignments). Similarly, the [left] and [middle]
options are ignored as options and appear as text.
 4. When “method=font” is not present, protrusion for block quotations
(\startblockquotation … \stopblockquotation) is greater than and not
aligned with other protrusion.
 5. When “method=font” is not present, protrusion for non-block
quotations (\quotation{…}) is not done at all.
 6. With the older bibliography system, footnotes in citations in
quotation blocks do not cause a halt in compilation.
 7. With the older bibliography system, item 3 is still a problem, that
is, method=font appears to be inimical to the left, right, and
middle options for \startblockquotation without regard to the
bibliography system in use.


\showframe

\definefontfeature [default][protrusion=quality]
\setupalign[hz,hanging]

% The next line should allow \startquotation to protrude quotes properly
\setupdelimitedtext[quotation][method=font]

%==
% For testing with old regime, enable next and disable following
%\setupbibtex[database=sample.bib] % requires sample.bib in current
directory
%--
% For testing with new regime, disable above and enable following
\definebtxdataset  [sample] % finds and uses distribution sample.bib
\usebtxdataset [sample.bib]
%==

\starttext
\startparagraph
   There is a citation in the footnote to this standard
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}
\stopparagraph

\startparagraph
\startquotation[right]
   There is a citation in the footnote to this block
quotation\footnote{This footnote has a citation \cite[hh2010a].}
\stopquotation
\stopparagraph

\startparagraph
\startquotation[right]
   There is no citation in the footnote to this block
quotation\footnote{This footnote has no citation.}
\stopquotation
\stopparagraph

\startparagraph
   \quotation{There is a citation in the footnote to this non-block
quotation paragraph\footnote{This footnote has a citation
\cite[Eijkhout1991].}}
\stopparagraph

\startparagraph
   \quotation{There is no citation in the footnote to this non-block
quotation paragraph\footnote{This footnote has no citation.}}
\stopparagraph

\startparagraph
   “There is a citation in the footnote to this standard
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}”
\stopparagraph

\startparagraph
   “There is no citation in the footnote to this standard
paragraph\footnote{This footnote has no citation.}”
\stopparagraph

\blank[big]

%==
% For testing with old regime, enable next and disable following
%\placepublications
%--
% For testing with new regime, disable above and enable following
\placelistofpublications
%==

\stoptext


first hang in par fixed in the luatex engine so you have to wait till we 
release


Hans


-
  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

[NTG-context] New btx code problem with quote protrusion, redux

2015-10-23 Thread Rik Kabel
At Wolfgang’s request, a new thread for this subject. I have cleaned up 
the example from the July 5 posting, but the problems are the same as 
shown there. In July Alan suggested that there might a bug here, but 
nothing has been done to address it since then. Wolfgang suggested 
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg35580.html) that 
method=font is required for proper protrusion handling for quotations.


1. When \setupdelimitedtext[quotation][method=font] is present /and
   //there is //no citation//in a footnote within a startquotation
   block and a bibliography is produced/, compilation proceeds normally.
2. When \setupdelimitedtext[quotation][method=font] is present /and
   //there is a citation//in a footnote within a startquotation block
   and a bibliography is produced,/ the compilation complains of a
   missing right curly. When allowed to continue to completion the
   protrusion for the opening quotation marks does not match the
   protrusion for similar marks not produced through \startquotation.
   Citations in footnotes outside quotation blocks are not a problem.
   Without a bibliography (\placelistofpublications)
3. When \setupdelimitedtext[quotation][method=font] is present, the
   [right] option of \startblockquotation is treated as text within the
   quotation. This can be resolved by adding “leftmargin=” to the
   \setupdelimitedtext[quotation] command (but that complicates matters
   when you want other alignments). Similarly, the [left] and [middle]
   options are ignored as options and appear as text.
4. When “method=font” is not present, protrusion for block quotations
   (\startblockquotation … \stopblockquotation) is greater than and not
   aligned with other protrusion.
5. When “method=font” is not present, protrusion for non-block
   quotations (\quotation{…}) is not done at all.
6. With the older bibliography system, footnotes in citations in
   quotation blocks do not cause a halt in compilation.
7. With the older bibliography system, item 3 is still a problem, that
   is, method=font appears to be inimical to the left, right, and
   middle options for \startblockquotation without regard to the
   bibliography system in use.


\showframe

\definefontfeature [default][protrusion=quality]
\setupalign[hz,hanging]

% The next line should allow \startquotation to protrude quotes properly
\setupdelimitedtext[quotation][method=font]

%==
% For testing with old regime, enable next and disable following
%\setupbibtex[database=sample.bib] % requires sample.bib in current 
directory

%--
% For testing with new regime, disable above and enable following
\definebtxdataset  [sample] % finds and uses distribution sample.bib
\usebtxdataset [sample.bib]
%==

\starttext
\startparagraph
  There is a citation in the footnote to this standard 
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}

\stopparagraph

\startparagraph
\startquotation[right]
  There is a citation in the footnote to this block 
quotation\footnote{This footnote has a citation \cite[hh2010a].}

\stopquotation
\stopparagraph

\startparagraph
\startquotation[right]
  There is no citation in the footnote to this block 
quotation\footnote{This footnote has no citation.}

\stopquotation
\stopparagraph

\startparagraph
  \quotation{There is a citation in the footnote to this non-block 
quotation paragraph\footnote{This footnote has a citation 
\cite[Eijkhout1991].}}

\stopparagraph

\startparagraph
  \quotation{There is no citation in the footnote to this non-block 
quotation paragraph\footnote{This footnote has no citation.}}

\stopparagraph

\startparagraph
  “There is a citation in the footnote to this standard 
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}”

\stopparagraph

\startparagraph
  “There is no citation in the footnote to this standard 
paragraph\footnote{This footnote has no citation.}”

\stopparagraph

\blank[big]

%==
% For testing with old regime, enable next and disable following
%\placepublications
%--
% For testing with new regime, disable above and enable following
\placelistofpublications
%==

\stoptext

--
Rik
___
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] Cover of ePub

2015-08-07 Thread Henning Hraban Ramm
Hi again,

I'm trying to define a cover image for my ePub using the documented „firstpage“ 
setting of \setupexport.

While it works in my minimal example below, it fails in my project structure; I 
tried to move \setupexport into project, product and component to no avail.

%
\setupbackend[export=yes]
\setupinteraction[
state=start,
color=,contrastcolor=,
title={ePub Test},
subtitle={ConTeXt},
author={Hraban},
]
\setupexport[
bodyfont=12pt,width=470pt,
hyphen=yes,
firstpage={koe}, % works here, but not in environment
]

\starttext

\startchapter[title={Knuth}]

\startparagraph
\input knuth
\stopparagraph

\stopchapter

\stoptext



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Cover of ePub

2015-08-07 Thread Henning Hraban Ramm
I overlooked one thing:
With the minimal example ConTeXt’s export doesn’t create a cover.xhtml, but in 
my project it does.

Am 2015-08-08 um 09:59 schrieb Henning Hraban Ramm te...@fiee.net:

 Hi again,
 
 I'm trying to define a cover image for my ePub using the documented 
 „firstpage“ setting of \setupexport.
 
 While it works in my minimal example below, it fails in my project structure; 
 I tried to move \setupexport into project, product and component to no avail.
 
 %
 \setupbackend[export=yes]
 \setupinteraction[
   state=start,
   color=,contrastcolor=,
   title={ePub Test},
   subtitle={ConTeXt},
   author={Hraban},
 ]
 \setupexport[
   bodyfont=12pt,width=470pt,
   hyphen=yes,
   firstpage={koe}, % works here, but not in environment
 ]
 
 \starttext
 
 \startchapter[title={Knuth}]
 
 \startparagraph
 \input knuth
 \stopparagraph
 
 \stopchapter
 
 \stoptext
 
 
 
 Greetlings, Hraban
 ---
 http://www.fiee.net
 http://wiki.contextgarden.net
 https://www.cacert.org (I'm an assurer)

___
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] ending every paragraph

2015-08-02 Thread Alan BRASLAU
On Sat, 1 Aug 2015 17:35:38 -0600
Idris Samawi Hamid ادريس سماوي حامد idris.ha...@colostate.edu wrote:

 Suppose I want to end the last line of every paragraph with a
 command, say, \thinrule, or a string of dots. Is there a
 straightforward way to do that? TeX has \everypar but I'm not aware
 of any, say, \endeverypar command.

Hello Idris,

I would think that your only hope in this case would be through the use
of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an explicit
\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]

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

Re: [NTG-context] ending every paragraph

2015-08-02 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Alan,

On Sun, 02 Aug 2015 01:11:38 -0600, Alan BRASLAU alan.bras...@cea.fr  
wrote:



On Sat, 1 Aug 2015 17:35:38 -0600
Idris Samawi Hamid ادريس سماوي حامد idris.ha...@colostate.edu wrote:


Suppose I want to end the last line of every paragraph with a
command, say, \thinrule, or a string of dots. Is there a
straightforward way to do that? TeX has \everypar but I'm not aware
of any, say, \endeverypar command.


Hello Idris,

I would think that your only hope in this case would be through the use
of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an explicit
\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]


I actually tried that before sending the note to the list. It doesn't  
work; if it is supposed to work then I guess it's a bug.


Of course, using \start-stopparagraph is much more verbose than simply  
adding a control sequence at the end of each par.


It's also curious that, for all its power, TeX has no straightforward way  
to recognize paragraph endings. But I'll bet Hans could figure out a way  
to do it in lua.


On the other hand, this is not a priority at this juncture; more  
experimental.


Thanks, Alan, and

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] ending every paragraph

2015-08-02 Thread Idris Samawi Hamid ادريس سماوي حامد
On Sun, 02 Aug 2015 11:40:59 -0600, Wolfgang Schuster  
schuster.wolfg...@gmail.com wrote:



Idris Samawi Hamid ادريس سماوي حامد mailto:idris.ha...@colostate.edu
2. August 2015 19:34
On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster
schuster.wolfg...@gmail.com wrote:


Alan BRASLAU mailto:alan.bras...@cea.fr
2. August 2015 09:11
On Sat, 1 Aug 2015 17:35:38 -0600

Hello Idris,

I would think that your only hope in this case would be through the  
use

of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an  
explicit

\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]


The paragraph environment has no before/after keys


Then the wiki is mistaken:

http://wiki.contextgarden.net/Command/setupparagraphs

The page describes the paragraph*s* environment which isn’t related to
\startparagraph.



Ah you are right as usual. The comment to the link under See also at the  
bottom of


http://wiki.contextgarden.net/Command/startparagraph

was misleading.

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] ending every paragraph

2015-08-02 Thread Wolfgang Schuster

Idris Samawi Hamid ادريس سماوي حامد mailto:idris.ha...@colostate.edu
2. August 2015 19:34
On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster 
schuster.wolfg...@gmail.com wrote:



Alan BRASLAU mailto:alan.bras...@cea.fr
2. August 2015 09:11
On Sat, 1 Aug 2015 17:35:38 -0600

Hello Idris,

I would think that your only hope in this case would be through the use
of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an explicit
\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]


The paragraph environment has no before/after keys


Then the wiki is mistaken:

http://wiki.contextgarden.net/Command/setupparagraphs
The page describes the paragraph*s* environment which isn’t related to 
\startparagraph.


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] ending every paragraph

2015-08-02 Thread Idris Samawi Hamid ادريس سماوي حامد
On Sun, 02 Aug 2015 11:25:01 -0600, Wolfgang Schuster  
schuster.wolfg...@gmail.com wrote:



Alan BRASLAU mailto:alan.bras...@cea.fr
2. August 2015 09:11
On Sat, 1 Aug 2015 17:35:38 -0600

Hello Idris,

I would think that your only hope in this case would be through the use
of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an explicit
\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]


The paragraph environment has no before/after keys


Then the wiki is mistaken:

http://wiki.contextgarden.net/Command/setupparagraphs


and even if it would
the after key would be normally applied after the paragraph has needed.


That was my guess as to why it didn't work.

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] ending every paragraph

2015-08-02 Thread Wolfgang Schuster

Alan BRASLAU mailto:alan.bras...@cea.fr
2. August 2015 09:11
On Sat, 1 Aug 2015 17:35:38 -0600

Hello Idris,

I would think that your only hope in this case would be through the use
of \startparagraph \stopparagraph, for otherwise TeX does not know
where a paragraph is to end (only where one begins, through an explicit
\par or through an implicit blank line).

My guess, untested, would be \setupparagraph[after=\thinrule]


The paragraph environment has no before/after keys and even if it would 
the after key would be normally applied after the paragraph has needed.


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] User-Defined Commands With Key-Value Options

2015-07-23 Thread Rik

On 2015-07-22 05:20, Joas Yannick wrote:

On 7/20/2105 11:28 AM Joas Yannick wrote:

  On 7/20/2105 0:50 AM Hans Hagen wrote:
  So how would you like to use lua? Is the data stored in lua?

 Yes, I imagine that the data (for instance, the value of
 the keys number, name, abbreviation, title, etc.)
 is stored somewhere when the compilation process reads, say,
 \startbiblebook, and that they are available to define the
 the formatting done by \startbiblebook.

 Thank you.

I have found this wiki:

http://wiki.contextgarden.net/Commands_with_KeyVal_arguments

But since I do not know Lua, I would appreciate that someone gets me
started with my example.


Joas,

Perhaps there some confusion here about how ConTeXt is used to create a 
document, and what role Lua plays in it. ConTeXt is a macro-based 
language that provides a level of abstraction over TeX, which is also a 
macro language. Documents can be completely specified with the use of 
ConTeXt. Lua is a traditional programming language that is used by some 
versions of ConTeXt to optimize and extend some of the internal 
capabilities of ConTeXt and TeX. There are very few situations, if any, 
in which a document writer /must/ resort to using Lua; ConTeXt almost 
always suffices.


Only the first example you found in the ConTeXt wiki uses Lua, and that 
example is not really useful for your problem. The other examples on 
that page are coded in the ConTeXt macro language.


You might also look at 
http://wiki.contextgarden.net/System_Macros/Handling_Arguments and 
http://wiki.contextgarden.net/Commands_with_optional_arguments for more 
examples, and on the mailing list. I would also recommend looking in the 
mailing list for discussions of the \getrawparameters and \getbufferdata 
and related commands (in particular 
http://www.mail-archive.com/ntg-context%40ntg.nl/msg78808.html).


Here is some code I use to format verse. It provides default values for 
the language, margin inset and continuation line indents that can be 
overridden when needed:


   \starttexdefinition unexpanded startPoem
  \begingroup
  \dosingleempty\dostartPoem
   \stoptexdefinition

   \starttexdefinition dostartPoem [#SETUPS]
   \getrawparameters[Poem][inset=2em,indent=0em,before=,font=,
  language=en,#SETUPS]
  \grabbufferdata[Poem][startPoem][stopPoem]
   \stoptexdefinition

   \starttexdefinition stopPoem
\obeylines
\language[\Poemlanguage]
\Poembefore
\Poemfont
   \setupnarrower[left={\dimexpr\Poemindent+\Poeminset\relax},
   right=\Poeminset,
   before=]
\startnarrower[left,right]
  \startparagraph
  \setupindenting[-\Poemindent,yes]
  \inlinebuffer[Poem]
  \stopparagraph
\stopnarrower
  \endgroup
  \blank[halfline]
   \stoptexdefinition

This type of code can easily be used to deal with the names, numbers, 
and abbreviations you describe in your requirements.


--
Rik Kabel
___
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] New btx code problem with quote protrusion

2015-07-05 Thread Rik Kabel

List folk:

In the MWE below, everything builds cleanly if the \setupdelimitedtext 
line is removed. With it removed, however, quote marks protrusion looks 
poor when nearby quote marks in non-quotation text is allowed to 
protrude. The happens when there is a citation in a footnote in the 
quoted text.


Is this a bug, or simply something not yet ready with the new regime, or 
am I doing something wrong?


   % The next line should allow \startquotation to protrude quotes
   \setupdelimitedtext[quotation][method=font]
   % However, it causes the new bib code to fail when there is a
   %   footnote containing a citation in the quote. See
   % http://www.mail-archive.com/ntg-context@ntg.nl/msg35580.html
   \definefontfeature [default][protrusion=quality]
   \setupalign[hz,hanging]
   \usebtxdataset [xx.bib]
   \starttext
   \startparagraph\noindent
  There is a citation in the footnote to this standard
   paragraph\footnote{This footnote has a citation \cite[One].}
   \stopparagraph
   \startquotation[right]
  There is a citation in the footnote to this block
   quotation\footnote{This footnote has a citation \cite[Two].}
   \stopquotation
   \startparagraph\noindent
   “There is a citation in the footnote to this standard
   paragraph\footnote{This footnote has a citation \cite[One].}”
   \stopparagraph
   \placelistofpublications
   \stoptext

And the corresponding xx.bib file:

   @BOOK{One,
  author   = {A. N. Author},
  title= {A Book Title},
  year = {2017},
  publisher= {Self},
  address  = {sine loco},
   }

   @ARTICLE{Two,
  author   = {N. O. Author},
  title= {A Pipe},
  journal  = {The Journal},
  year = {2018},
  volume   = {32},
  number   = {3},
  pages= {42--69},
   }

--
Rik Kabel


___
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] Problem with margin figures and whitespace in text

2015-04-26 Thread Rik Kabel

On 2015-04-26 14:01, Hans Hagen wrote:

On 4/26/2015 3:32 AM, Rik Kabel wrote:

I have two problems with figures placed into the left or right margin.
When the figure is in a group, extra whitespace is inserted between the
paragraphs that precede and follow the placefigure command. This happens
for figures placed by startplacefigure/stopplacefigure and tradiitonal
placefigure commands, and paragraphs placed by
startparagraph/stopparagraph or marked by par or newlines.

When the figure is not in a group, whitespace called for by
\setupwhitespace is lost, except when the paragraphs are marked by
traditional means. That is, whitespace is lost when
startparagraph/stopparagraph is used.

Interestingly, when that is changed to bpar/epar, the problem for
ungrouped figures disappears, but as I understand it, bpar/epar is not a
real substitute for startparagraph/stopparagraph.

There is probably a simple explanation, but it eludes me. I prefer to be
able to use startparagraph/stopparagraph, and it is sometimes desirable
to place a figure into a group in order to prevent unique settings from
leaking out.


you can test with this in cont-new.mkiv

\unprotect

\def\page_sides_inject_dummy_lines
  {\begingroup
   \scratchcounter\pageshrink
   \divide\scratchcounter \baselineskip
   \advance\scratchcounter \plusone
   \parskip\zeropoint
   \dorecurse\scratchcounter{\hbox to \hsize{}}%
   \kern-\scratchcounter\baselineskip
   \penalty\zerocount
   \endgroup}

\def\page_sides_prepare_space
  {\par
  %\whitespace
   \begingroup
   \forgetall
   \reseteverypar
   \verticalstrut
   \vskip-\struttotal
   \endgroup}

\protect

Thank you, Hans. That works well, both on the example and on a more 
complex real document.


--
Rik
___
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] Problem with margin figures and whitespace in text

2015-04-26 Thread Hans Hagen

On 4/26/2015 3:32 AM, Rik Kabel wrote:

I have two problems with figures placed into the left or right margin.
When the figure is in a group, extra whitespace is inserted between the
paragraphs that precede and follow the placefigure command. This happens
for figures placed by startplacefigure/stopplacefigure and tradiitonal
placefigure commands, and paragraphs placed by
startparagraph/stopparagraph or marked by par or newlines.

When the figure is not in a group, whitespace called for by
\setupwhitespace is lost, except when the paragraphs are marked by
traditional means. That is, whitespace is lost when
startparagraph/stopparagraph is used.

Interestingly, when that is changed to bpar/epar, the problem for
ungrouped figures disappears, but as I understand it, bpar/epar is not a
real substitute for startparagraph/stopparagraph.

There is probably a simple explanation, but it eludes me. I prefer to be
able to use startparagraph/stopparagraph, and it is sometimes desirable
to place a figure into a group in order to prevent unique settings from
leaking out.


you can test with this in cont-new.mkiv

\unprotect

\def\page_sides_inject_dummy_lines
  {\begingroup
   \scratchcounter\pageshrink
   \divide\scratchcounter \baselineskip
   \advance\scratchcounter \plusone
   \parskip\zeropoint
   \dorecurse\scratchcounter{\hbox to \hsize{}}%
   \kern-\scratchcounter\baselineskip
   \penalty\zerocount
   \endgroup}

\def\page_sides_prepare_space
  {\par
  %\whitespace
   \begingroup
   \forgetall
   \reseteverypar
   \verticalstrut
   \vskip-\struttotal
   \endgroup}

\protect



The following should demonstrate the problem. Turning on grid setting
makes it worse. I get the same result with current betas and older versions.

\useMPlibrary   [dum]
%\showgrid
\setuplayout[%grid=yes,
  backspace=151pt,leftmargin=117pt]
\setupwhitespace[big]
\define\Paragraph{\startparagraph\input khatt-en\stopparagraph}
\starttext
{
   \subject{Start/stop paragraphs and figures}
   \subsubject{Group, extra whitespace}
   \Paragraph
   \Paragraph
   \begingroup
 \startplacefigure[location={leftmargin,none}]
   \externalfigure[A]
 \stopplacefigure
   \endgroup
   \Paragraph
   \Paragraph
   \subsubject{No group, no whitespace}
   \Paragraph
   \Paragraph
   \startplacefigure[location={leftmargin,none}]
 \externalfigure[A]
   \stopplacefigure
   \Paragraph
   \Paragraph
   \Paragraph
}
   \page
{
   \subject{Start/stop paragraphs, traditional figures}
   \subsubject{Group, extra whitespace}
   \Paragraph
   \Paragraph
   {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
   \Paragraph
   \Paragraph
   \subsubject{No group, no whitespace}
   \Paragraph
   \Paragraph
   \placefigure[leftmargin,none]{}{\externalfigure[A]}
   \Paragraph
   \Paragraph
   \Paragraph
}
   \page
{
   \subject{Traditional paragraphs, start/stop figures}
   \subsubject{Group, extra whitespace}
   \input khatt-en\par
   \input khatt-en\par
   \begingroup% or \bgroup or {
 \startplacefigure[location={leftmargin,none}]
   \externalfigure[A]
 \stopplacefigure
   \endgroup% or \egroup or }
   \input khatt-en\par
   \input khatt-en\par
   \subsubject{Okay}
   \input khatt-en\par
   \input khatt-en\par
   \startplacefigure[location={leftmargin,none}]
 \externalfigure[A]
   \stopplacefigure
   \input khatt-en\par
   \input khatt-en\par
   \input khatt-en\par
}
   \page
{
   \subject{Traditional paragraphs, traditional figures}
   \subsubject{Group, extra whitespace}
   \input khatt-en\par
   \input khatt-en\par
   {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
   \input khatt-en\par
   \input khatt-en\par
   \subsubject{Okay}
   \input khatt-en\par
   \input khatt-en\par
   \placefigure[leftmargin,none]{}{\externalfigure[A]}
   \input khatt-en\par
   \input khatt-en\par
   \input khatt-en\par
}
\stoptext

--
Rik


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




--

-
  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

[NTG-context] Problem with margin figures and whitespace in text

2015-04-25 Thread Rik Kabel
I have two problems with figures placed into the left or right margin. 
When the figure is in a group, extra whitespace is inserted between the 
paragraphs that precede and follow the placefigure command. This happens 
for figures placed by startplacefigure/stopplacefigure and tradiitonal 
placefigure commands, and paragraphs placed by 
startparagraph/stopparagraph or marked by par or newlines.


When the figure is not in a group, whitespace called for by 
\setupwhitespace is lost, except when the paragraphs are marked by 
traditional means. That is, whitespace is lost when 
startparagraph/stopparagraph is used.


Interestingly, when that is changed to bpar/epar, the problem for 
ungrouped figures disappears, but as I understand it, bpar/epar is not a 
real substitute for startparagraph/stopparagraph.


There is probably a simple explanation, but it eludes me. I prefer to be 
able to use startparagraph/stopparagraph, and it is sometimes desirable 
to place a figure into a group in order to prevent unique settings from 
leaking out.


The following should demonstrate the problem. Turning on grid setting 
makes it worse. I get the same result with current betas and older versions.


   \useMPlibrary   [dum]
   %\showgrid
   \setuplayout[%grid=yes,
 backspace=151pt,leftmargin=117pt]
   \setupwhitespace[big]
   \define\Paragraph{\startparagraph\input khatt-en\stopparagraph}
   \starttext
   {
  \subject{Start/stop paragraphs and figures}
  \subsubject{Group, extra whitespace}
  \Paragraph
  \Paragraph
  \begingroup
\startplacefigure[location={leftmargin,none}]
  \externalfigure[A]
\stopplacefigure
  \endgroup
  \Paragraph
  \Paragraph
  \subsubject{No group, no whitespace}
  \Paragraph
  \Paragraph
  \startplacefigure[location={leftmargin,none}]
\externalfigure[A]
  \stopplacefigure
  \Paragraph
  \Paragraph
  \Paragraph
   }
  \page
   {
  \subject{Start/stop paragraphs, traditional figures}
  \subsubject{Group, extra whitespace}
  \Paragraph
  \Paragraph
  {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
  \Paragraph
  \Paragraph
  \subsubject{No group, no whitespace}
  \Paragraph
  \Paragraph
  \placefigure[leftmargin,none]{}{\externalfigure[A]}
  \Paragraph
  \Paragraph
  \Paragraph
   }
  \page
   {
  \subject{Traditional paragraphs, start/stop figures}
  \subsubject{Group, extra whitespace}
  \input khatt-en\par
  \input khatt-en\par
  \begingroup% or \bgroup or {
\startplacefigure[location={leftmargin,none}]
  \externalfigure[A]
\stopplacefigure
  \endgroup% or \egroup or }
  \input khatt-en\par
  \input khatt-en\par
  \subsubject{Okay}
  \input khatt-en\par
  \input khatt-en\par
  \startplacefigure[location={leftmargin,none}]
\externalfigure[A]
  \stopplacefigure
  \input khatt-en\par
  \input khatt-en\par
  \input khatt-en\par
   }
  \page
   {
  \subject{Traditional paragraphs, traditional figures}
  \subsubject{Group, extra whitespace}
  \input khatt-en\par
  \input khatt-en\par
  {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
  \input khatt-en\par
  \input khatt-en\par
  \subsubject{Okay}
  \input khatt-en\par
  \input khatt-en\par
  \placefigure[leftmargin,none]{}{\externalfigure[A]}
  \input khatt-en\par
  \input khatt-en\par
  \input khatt-en\par
   }
   \stoptext

--
Rik
___
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] Export bugs

2015-04-24 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

 Here are two export bugs, full test suite attached:

 ==sh_ahmad-qajar-xml-test-highlight.tex===
 \setupexport[cssfile=sh_ahmad-qajar.css]
 \setupbackend[export=yes]
 \definehighlight[emphasis][style=\em]
 \definehighlight[important][style=bold]
 \starttext
 \startparagraph
 Some \emph{emphasis} and \important{important}.

 \emph{Emphasis} and \important{important}.
 \stopparagraph
 \stoptext
 ==sh_ahmad-qajar-xml-test-highlight-div.xhtml==
 div
div class=paragraphSome emphasis and div class=highlight
 importantimportant/div.  div class=break!--empty--/div
 Emphasis   div class=break!--empty--/div
 and div class=highlight importantimportant/div./div
 /div
 ==

 The exported formatting of \emph vanishes in each instance, as well as
 misbehaves in the second case; \important behaves just fine.

 It seems the export doesn't like \em. Can this be fixed? Thanks and

 Best wishes

 Idris

--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] Oddity with \definereferenceformat

2015-04-20 Thread Wolfgang Schuster

 Am 20.04.2015 um 05:10 schrieb Rik Kabel cont...@rik.users.panix.com:
 
 A reference to the text of a multi-line heading takes on the line breaks of 
 the heading when \definereferenceformat[about] is used.
 \definereferenceformat[about][type=title,left=,right=]
 \starttext
 \startsection[reference={sec:one},
   title={Three\\line\\title}]
 \startparagraph
 See \about[sec:one].
 \stopparagraph
 \stopsection
 \stoptext
 Can this be repaired? Or, am I doing it wrong?

To avoid the line breaks in the reference context has to redefined the meaning 
of \crlf and \\ when
the reference content is shown in the text which happens at the moment only for 
the \about command.

\setupreferencing[left=,right=]

\starttext
\startsection[reference={sec:one},
  title={Three\\line\\title}]
\startparagraph
See \about[sec:one].
\stopparagraph
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Oddity with \definereferenceformat

2015-04-19 Thread Rik Kabel
A reference to the text of a multi-line heading takes on the line breaks 
of the heading when \definereferenceformat[about] is used.


   \definereferenceformat[about][type=title,left=,right=]
   \starttext
   \startsection[reference={sec:one},
  title={Three\\line\\title}]
   \startparagraph
   See \about[sec:one].
   \stopparagraph
   \stopsection
   \stoptext

Can this be repaired? Or, am I doing it wrong?

--
Rik
___
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] \placefootnotes bug?

2015-04-05 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

In the attached files, watch the behavior of the second footnote: The  
footnote numeral and accompanying note are out of alignment. Toggle this  
line:


\setupnotation[footnote]  
[before={\setupwhitespace[none]},indenting={yes,big},after={\blank[small]}]


On, we get a misalignment. Off, no misalignment. Is this a bug or am I  
missing something? Thanks in advance for any advice and


Best wishes
Idris

===
\setupdelimitedtext[blockquote][indenting=no,spacebefore=medium,spaceafter=medium]

\setupnotation[footnote]  
[before={\setupwhitespace[none]},indenting={yes,big},after={\blank[small]}]


\setupfootnotes[location=text]

\starttext
\startsection[title=Section 1]
\startparagraph
\input ward
\startfootnote
\input ward 
\startparagraph
\input ward
\stopparagraph
\stopfootnote{}
\stopparagraph

\startparagraph
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopparagraph

\startparagraph
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopparagraph

\stopsection

\startsubject[title=Endnotes]
\placefootnotes
\stopsubject
\stoptext
===

--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

test-footnote-on.pdf
Description: Adobe PDF document


test-footnote-off.pdf
Description: Adobe PDF document


test-footnote.tex
Description: TeX 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
___

[NTG-context] indentnext=auto

2015-03-17 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

For export we have to tag paragraphs. After block quotes, itemizations,  
etc, the context determines whether the first line of the next paragraph  
should be indented, so we use the indentnext=auto mechanism. But with  
\start|stopparagraph it doesn't seem to work: See attached.



\setupindenting[big,yes]
% Do not indent the first line of a block quote
\setupdelimitedtext[blockquote][before={\blank[medium]  
\setupindenting[no]},after={\blank[medium]}]

% Do not indent the first line after a block quote
\setupdelimitedtext[blockquote][indentnext=auto]

\starttext
\startparagraph
\input ward
\stopparagraph

\startblockquote
\input ward
\stopblockquote

\startparagraph
\input ward
\stopparagraph

\startblockquote
\input ward
\stopblockquote
\startparagraph
\input ward
\stopparagraph
\stoptext


From what I understand, if [indentnext=auto] is activated then a blank  
line after the environment should activate indenting; no blank line after  
the environment should impede indenting.


In this example, we get no indentation either way. Am I missing something,  
or is it a bug?


By the way, something like

\setupdelimitedtext[blockquote][indentnext=yes]

\startparagraph[indenting=no]
\input ward
\stopparagraph

would be a nice feature. Any chance?

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

test-paragraph.tex
Description: TeX document


test-paragraph.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] indentnext=auto

2015-03-17 Thread Wolfgang Schuster

 Am 17.03.2015 um 21:30 schrieb Idris Samawi Hamid ادريس سماوي حامد 
 isha...@colostate.edu:
 
 Dear gang,
 
 For export we have to tag paragraphs. After block quotes, itemizations, etc, 
 the context determines whether the first line of the next paragraph should be 
 indented, so we use the indentnext=auto mechanism. But with 
 \start|stopparagraph it doesn't seem to work: See attached.
 
 
 \setupindenting[big,yes]
 % Do not indent the first line of a block quote
 \setupdelimitedtext[blockquote][before={\blank[medium] 
 \setupindenting[no]},after={\blank[medium]}]

\setupdelimitedtext
  [blockquote]
  [spacebefore=medium,
   spaceafter=medium,
   indenting=no]

 % Do not indent the first line after a block quote
 \setupdelimitedtext[blockquote][indentnext=auto]
 
 \starttext
 \startparagraph
 \input ward
 \stopparagraph
 
 \startblockquote
 \input ward
 \stopblockquote
 
 \startparagraph
 \input ward
 \stopparagraph
 
 \startblockquote
 \input ward
 \stopblockquote
 \startparagraph
 \input ward
 \stopparagraph
 \stoptext
 
 
 From what I understand, if [indentnext=auto] is activated then a blank line 
 after the environment should activate indenting; no blank line after the 
 environment should impede indenting.
 
 In this example, we get no indentation either way. Am I missing something, or 
 is it a bug?

It’s bug in the delimited text mechanism (typo-del.mkvi), a \aftergroup is 
missing before \dorechecknextindentation.

\def\typo_delimited_stop_par
  {\removeunwantedspaces
   \removelastskip
   \rightdelimitedtextmark
   \carryoverpar\endgroup % new per 2013-01-21 ... please left floats
   \popmacro\checkindentation
   \typo_delimited_stop_par_indeed
   \delimitedtextparameter\c!after
   \edef\p_delimited_spaceafter{\delimitedtextparameter\c!spaceafter}%
   \ifx\p_delimited_spaceafter\empty \else
 \blank[\p_delimited_spaceafter]%
   \fi
   \useindentnextparameter\delimitedtextparameter
-  \dorechecknextindentation}% AM: This was missing!
+  \aftergroup\dorechecknextindentation}% AM: This was missing!

 By the way, something like
 
 \setupdelimitedtext[blockquote][indentnext=yes]
 
 \startparagraph[indenting=no]
 \input ward
 \stopparagraph
 
 would be a nice feature. Any chance?

\startsetups[paragraph:noindent]
\setupindenting[no]
\stopsetups

\defineparagraph[noindent][setups=paragraph:noindent]

\setupindenting[yes,big]

\starttext

\startparagraph
\input ward
\stopparagraph

\startparagraph[noindent]
\input ward
\stopparagraph

\startparagraph
\input ward
\stopparagraph

\stoptext

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

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

Re: [NTG-context] indentnext=auto

2015-03-17 Thread Idris Samawi Hamid ادريس سماوي حامد
On Tue, 17 Mar 2015 15:04:32 -0600, Wolfgang Schuster  
schuster.wolfg...@gmail.com wrote:



Am 17.03.2015 um 21:30 schrieb Idris Samawi Hamid ادريس سماوي حامد




\setupindenting[big,yes]
% Do not indent the first line of a block quote
\setupdelimitedtext[blockquote][before={\blank[medium]  
\setupindenting[no]},after={\blank[medium]}]


\setupdelimitedtext
  [blockquote]
  [spacebefore=medium,
   spaceafter=medium,
   indenting=no]


Duly noted, thanks!

From what I understand, if [indentnext=auto] is activated then a blank  
line after the environment should activate indenting; no blank line  
after the environment should impede indenting.


In this example, we get no indentation either way. Am I missing  
something, or is it a bug?


It’s bug in the delimited text mechanism (typo-del.mkvi), a \aftergroup  
is missing before \dorechecknextindentation.


\def\typo_delimited_stop_par
  {\removeunwantedspaces
   \removelastskip
   \rightdelimitedtextmark
   \carryoverpar\endgroup % new per 2013-01-21 ... please left floats
   \popmacro\checkindentation
   \typo_delimited_stop_par_indeed
   \delimitedtextparameter\c!after
   \edef\p_delimited_spaceafter{\delimitedtextparameter\c!spaceafter}%
   \ifx\p_delimited_spaceafter\empty \else
 \blank[\p_delimited_spaceafter]%
   \fi
   \useindentnextparameter\delimitedtextparameter
-  \dorechecknextindentation}% AM: This was missing!
+  \aftergroup\dorechecknextindentation}% AM: This was missing!


Wow, so a bug indeed... I hope Hans is reading this -)


By the way, something like

\setupdelimitedtext[blockquote][indentnext=yes]

\startparagraph[indenting=no]
\input ward
\stopparagraph

would be a nice feature. Any chance?


\startsetups[paragraph:noindent]
\setupindenting[no]
\stopsetups

\defineparagraph[noindent][setups=paragraph:noindent]

\setupindenting[yes,big]

\starttext

\startparagraph
\input ward
\stopparagraph

\startparagraph[noindent]
\input ward
\stopparagraph

\startparagraph
\input ward
\stopparagraph

\stoptext


Wonderful, this is so much better than an explicit \noindentation. I  
really need to spend some time to learn the power of setups! Thanks a  
million, Wolfgang, and


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] indentnext=auto

2015-03-17 Thread Idris Samawi Hamid ادريس سماوي حامد
On Tue, 17 Mar 2015 15:04:32 -0600, Wolfgang Schuster  
schuster.wolfg...@gmail.com wrote:



\startsetups[paragraph:noindent]
\setupindenting[no]
\stopsetups
\defineparagraph[noindent][setups=paragraph:noindent]
\setupindenting[yes,big]
\starttext
\startparagraph
\input ward
\stopparagraph
\startparagraph[noindent]
\input ward
\stopparagraph
\startparagraph
\input ward
\stopparagraph
\stoptext


The opposite scenario doesn't work, viz.

==
% setup paragraph indents
\startsetups[paragraph:indent]
\setupindenting[big,yes]
\stopsetups
\defineparagraph[indent][setups=paragraph:indent]
==

But this appears to work:

==
% setup paragraph indents
\startsetups[paragraph:indent]
\indentation
\stopsetups
\defineparagraph[indent][setups=paragraph:indent]
==

So there is significant difference in the \setupindenting[yes] case. For  
consistency we may as well go with


=
\startsetups[paragraph:indent]
\indentation
\stopsetups
\defineparagraph[indent][setups=paragraph:indent]
\startsetups[paragraph:noindent]
\noindentation
\stopsetups
\defineparagraph[noindent][setups=paragraph:noindent]
=

This entire approach is better and wiser than indentnext=auto anyway.  
Thanks again, Wolfgang, and


Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] Exporting highlights

2015-03-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Ok, I've made some progress:

On Sun, 15 Mar 2015 17:01:16 -0600, Idris Samawi Hamid ادريس سماوي حامد  
isha...@colostate.edu wrote:



export-highlight.tex==
\setupbackend
   [export=yes,css=highlight.css]


\setupexport[cssfile=highlight.css]
\setupbackend[export=yes]


\definehighlight[emphasis] [style=italic]
\definehighlight[important][style=bold]
\definehighlight[regular][style=\tf]

\starttext

\startchapter[title=Highlights]
\startparagraph
This is \emphasis{emphasis}. This is \important{important}. This is
\regular{regular}.

This is \emphasis{some emphasized text, with \regular{regular} in  
between}.


This is \important{some important text, with \regular{regular} in  
between}.

\stopparagraph
\stopchapter
\stoptext
===

In highlight.css (copied from export-sample.css and modified) I added
these lines:

==
highlight [detail=emphasis]{
font-weight : italic ;
}

highlight [detail=important]{
font-weight : bold ;
}

highlight [detail=regular]{
font-weight : regular ;
}
==


Syntax correction (thanks Aditya!):

.highlight.emphasis {
  font-style: italic;
}

etc.


Challenge 1:
Neither export-highlight-tag.xhtml nor export-highlight-div.xhtml renders
the highlights. What do we need to do?


For italic, see above. For bold, we need

font-weight: bold;


Challenge 2:
export-highlight-div.xhtml breaks the line before a highlight as well as
after a highlight. What is missing here?


display: inline;

So here is exactly what we need:

.highlight.important {
   font-weight: bold;
  font-style: normal;
   display: inline;
}

.highlight.emphasis {
  font-weight: normal;
  font-style: italic;
  display: inline;
}

.highlight.regular {
  font-weight: normal;
  font-style: normal;
  display: inline;
}

Now export-highlight-div.xhtml renders in the browser exactly as in  
export-highlight.pdf.


This is progress: a first step!

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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] tlig in the export

2015-03-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

It appears that internal opentype feature tlig is not supported in the  
export. For current purposes this is not critical; but not sure if this is  
intentional or a bug, so reporting it here.


===
\setupbackend[export=yes]

\starttext

\startchapter[title=The tlig feature]
\startparagraph
In \TeX\ it is still common to use two keyboard dashes to obtain an  
en-dash. An en dash is used to indicate a number range, e.g., 1785--1906.


In \TeX\ it is still common to use three keyboard dashes to obtain an  
em-dash. An em-dash is used to indicate a prominent parenthesis---in  
modern usage the en-dash is becoming more popular for this task---as well  
as between the end of an epigraph and its author.


In \Context\ there is a dedicated control sequence for the en-dash. An  
en-dash is used to indicate a number range, e.g., 1785\endash{}1906.


In \Context\ there is a dedicated control sequence to obtain an em-dash.  
An em-dash is used to indicate a prominent parenthesis\emdash{}in modern  
usage the en-dash is becoming more popular for this task\emdash{}as well  
as between the end of an epigraph and its author.

\stopparagraph
\stopchapter
\stoptext
===

Thanks and best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

export-tlig.tex
Description: TeX document


export-tlig.pdf
Description: Adobe PDF document


export-tlig-div.xhtml
Description: application/xhtml
___
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] Exporting highlights

2015-03-15 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

Ok, I'm rolling up my sleeves and taking another stab at exporting to  
xhtml (maybe even epub). Major project, so taking this one small step at a  
time.


The immediate aim is to get correct output in a browser (I use Opera, and  
Chrome as a control). Test files attached.


Immediate problem is highlights.

export-highlight.tex==
\setupbackend
  [export=yes,css=highlight.css]

\definehighlight[emphasis] [style=italic]
\definehighlight[important][style=bold]
\definehighlight[regular][style=\tf]

\starttext

\startchapter[title=Highlights]
\startparagraph
This is \emphasis{emphasis}. This is \important{important}. This is  
\regular{regular}.


This is \emphasis{some emphasized text, with \regular{regular} in between}.

This is \important{some important text, with \regular{regular} in between}.
\stopparagraph
\stopchapter
\stoptext
===

In highlight.css (copied from export-sample.css and modified) I added  
these lines:


==
highlight [detail=emphasis]{
font-weight : italic ;
}

highlight [detail=important]{
font-weight : bold ;
}

highlight [detail=regular]{
font-weight : regular ;
}
==

Results:

===export-highlight-tag.xhtml
  sectioncontent
   paragraphThis is highlight detail=emphasisemphasis/highlight.  
This is highlight detail=importantimportant/highlight. This is  
highlight detail=regularregular/highlight.break/
This is highlight detail=emphasissome emphasized text, with highlight  
detail=regularregular/highlight in between/highlight.break/
This is highlight detail=importantsome important text, with highlight  
detail=regularregular/highlight in between/highlight./paragraph

  /sectioncontent
===export-highlight-div.xhtml
   div class=paragraphThis is div class=highlight  
emphasisemphasis/div. This is div class=highlight  
importantimportant/div. This is div class=highlight  
regularregular/div.div class=break!--empty--/div
This is div class=highlight emphasissome emphasized text, with div  
class=highlight regularregular/div in between/div.div  
class=break!--empty--/div
This is div class=highlight importantsome important text, with div  
class=highlight regularregular/div in between/div./div

=

Observation: Opera won't render *-raw.xml, so we ignore that file.

In a browser we have

Challenge 1:
Neither export-highlight-tag.xhtml nor export-highlight-div.xhtml renders  
the highlights. What do we need to do?


Challenge 2:
export-highlight-div.xhtml breaks the line before a highlight as well as  
after a highlight. What is missing here?


Aim: To turn my current project into an epub, or at least something that  
can be viewed in a browser (xhtml).


Caveat: I don't know much web development (css, xhtml, div, etc) but am  
willing to work with what I have... but only IF there is a finish line. If  
there is no finish line (i.e., things are too broken at the moment to get  
the mission accomplished via what ConTeXt and CSS provide) kindly let me  
know so I can stop now!


Henning Hraban Ramm and Aditya Mahajan mentioned XSLT stylesheets, but  
this is probably way above my paygrade, unless someone can give me very  
simple newbie pointers.


Thanks to all in advance and

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

export-highlight.tex
Description: TeX document


export-highlight.pdf
Description: Adobe PDF document
/*

	author: Hans Hagen, PRAGMA-ADE, Hasselt NL
	copyright : PRAGMA ADE / ConTeXt Development Team
	license   : see context related readme files
	comment   : companion to context.mkiv

*/

/* ignore  : mixed   */
/* metadata: display */

ignore {
	display : none ;
}

xmetadata {
	display : none ;
}

xmetavariable {
	display : none ;
}

/* document : display */

document:before {
	content   : attr(title) ;
	font-size : 44pt ;
	font-weight   : bold ;
	margin-bottom : 1em ;
}

document {
	font-family  : DejaVu Serif, Lucida Bright, serif ;
	font-size: 12pt ;
	max-width: 50em ;
	padding  : 1em ;
 /* text-align   : justify ;*/
 /*	hyphens  : manual ; */
 /* text-justify : inter-word ; */
}

documentmetadata {
	font-family   : Lucida Console, DejaVu Sans Mono, monospace ;
	margin-bottom : 2em ;
}

documentmetadatametavariable[name=title]:before {
	content : title\00A0\00A0\00A0:\00A0 ;
}

documentmetadatametavariable[name=author]:before {
		content : author\00A0\00A0:\00A0 ;
}

documentmetadatametavariable[name=version]:before {
	content : version\00A0:\00A0 ;
}

documentmetadatametavariable[name=title], documentmetadatametavariable[name=author], documentmetadatametavariable[name=version] {
	display : block ;
}

/* paragraph : mixed */
/* p : mixed */

paragraph, p {
	display   : block ;
	margin-top: 0.5em ;
	margin-bottom : 0.5em ;
}

/* break : display

Re: [NTG-context] context - docx ??

2015-01-15 Thread Alan BRASLAU
On Wed, 14 Jan 2015 15:22:39 -0700
Idris Samawi Hamid ادريس سماوي حامد isha...@colostate.edu wrote:

  BTW, the quotation environment is not translated as blockquote and
  paragraphs lack their p tags.  
 
 Hmm, perhaps a showstopper.

Hans has often promoted the use of
\startparagraph
\stopparagraph
for the particular reason that rigorous structure can thus be correctly
exported.

I still have a hard time following this in practice, as I find that
paragraphs of text separated by blank lines to be more readable,
although I do try to use \startxxx\stopxxx forms as much as possible.
Example:
\startitemize
\startitem item one \stopitem
\startitem item two \stopitem
\stopitemize
(although can someone indicate how to replace \sym{} ?)


\startdigression
Curiously, I sometimes work with coauthors who only know Word as their
text editor. A work flow that we share is to edit ConTeXt source files
that are easily editable by them. This means paragraphs without any
line breaks, and the maximum use of UTF8 characters (no \alpha nor \int
for example). I have trained them to understand math versus text mode
and I place context commands on separate lines when possible.

Since they still have a hard time understanding the significance
(and the non-significance) of blank lines, I try to end all paragraphs
with \par. I imagine that \startparagraph ...\stopparagraph would be a
better practice in this workflow.
\stopdigression

The suggestion of using \definehighlight, etc. is good practice, too.

Alan

P.S. Mailers, certain text editors, and systems (MacOS for example)
often add hidden characters or change the encoding of files. Many text
editors hide these differences, so one must be careful. I understand,
though, that the problem was that of recursion with an problematic
choice of filename.
___
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] Loading modules

2014-12-23 Thread Wolfgang Schuster

 Am 23.12.2014 um 14:29 schrieb j. van den hoff veedeeh...@googlemail.com:
 
 uups. I was to quick with my answer: in the meantime I did reset my $PATH 
 variable in order to use
 the texlive-context version again. so adding the  
 \enabledirectives[modules.permitunprefixed] and recompiling
 the document did not proof anything (stupid error...). so I have now retried 
 with the current standalone
 `context' and -- alas! -- the `undefined control sequence' error does not go 
 away. do be specifc:
 
 -- document and module reside in the same directory
 
 -- the module is residing in file `t-title.tex' and defines (upon others) 
 `\doctitle'
 
 -- the document loads the module with `\usemodule[title]' (which is now 
 preceded by `\enabledirectives[modules.permitunprefixed]')
   and then uses `\doctitle' which triggers the error.
 
 -- right now, the standalone `context' binary is at the very top of $PATH.
 
 any ideas?

The ConTeXt suite includes a title module (when you install the  third party 
modules)
which is loaded instead of your own title module. The following example shows 
how
you can use the module in your document.


\usemodule[title]

\starttext

\placetitle
  [author=Ben Lee User,
title=How to write a \tex{placetitle} command,
 date=\currentdate\space\currenttime]

\dorecurse{6}
  {\startparagraph
   \input tufte\par
   \stopparagraph}

\stoptext


When you want to use your module instead of the third party module rename
it from t-title.tex to p-title.tex.

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] \startitem and \startparagraph

2014-10-18 Thread Wolfgang Schuster

 Am 17.10.2014 um 17:11 schrieb Rik Kabel cont...@rik.users.panix.com:
 
 On 2014-10-17 03:50, Hans Hagen wrote:
 On 10/17/2014 3:02 AM, Rik Kabel wrote:
 What is the proper way to delimit paragraphs within an itemized list
 using \start..\stop tagging (as for epub and such)? When I wrap
 paragraphs with \startparagraph..\stopparagraph within the
 \startitem..\stopitem, there is an unwanted newline inserted between the
 bullet and the item text.
 
 Or, is it not recommend to wrap paragraphs that are in enumerations?
 
 I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make
 sure to tag all your structural elements with \start...-\stop..., e.g.
 \startchapter, but even \startparagraph!” I also note the appearance of
 \startcontent..\stopcontent and \stopcaption..\startcaption and such,
 suggesting to me that semantic tagging may be a useful thing to add to
 new documents in order to support new output formats.
 
\starttext
\startitemize
   \startitem
 \startparagraph
   Item one paragraph one.
 \stopparagraph
 \startparagraph
   Item one paragraph two.
 \stopparagraph
 \startparagraph
   Item one paragraph three.
 \stopparagraph
   \stopitem
   \startitem
 \startparagraph
   Item two paragraph one.
 \stopparagraph
 \startparagraph
   Item two paragraph two.
 \stopparagraph
 \startparagraph
   Item two paragraph three.
 \stopparagraph
   \stopitem
\stopitemize
 
 \starttext
 \startitemize
  \startitem
\bpar
  Item one paragraph one.
\epar % \stopparagraph
\bpar
  Item one paragraph two.
\epar
\bpar
  Item one paragraph three.
\epar
  \stopitem
  \startitem
\bpar
  Item two paragraph one.
\epar
\bpar
  Item two paragraph two.
\epar
\bpar
  Item two paragraph three.
\epar
  \stopitem
 \stopitemize
 \stoptext
 
 Thank you, Hans, for that.
 
 Can you explain when \startparagraph..\stopparagraph should be preferred for 
 tagging, and when \bpar..\epar? There is clearly a difference between them.

\starttext

The \tex{bpar} and \tex{epar} commands only add tags for the begin and end
of the paragraph in the exported content:

\startitemize
  \startitem
\input ward
  \stopitem
  \startitem
\bpar \input ward \epar
  \stopitem
\stopitemize

When you use the \tex{startparagraph} and \tex{stopparagraph} commands \CONTEXT\
forces the end of the previous paragraph before it add the tags for the export:

\startitemize
  \startitem
\par \input ward \par
  \stopitem
  \startitem
\startparagraph \input ward \stopparagraph
  \stopitem
\stopitemize

\stoptext

 Is there any setup associated with \bpar..\epar as there is \defineparagraph 
 for \startparagraph..\stopparagraph?

No, the commands add only the tags when you use the export function.

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] \startitem and \startparagraph

2014-10-17 Thread Hans Hagen

On 10/17/2014 3:02 AM, Rik Kabel wrote:

What is the proper way to delimit paragraphs within an itemized list
using \start..\stop tagging (as for epub and such)? When I wrap
paragraphs with \startparagraph..\stopparagraph within the
\startitem..\stopitem, there is an unwanted newline inserted between the
bullet and the item text.

Or, is it not recommend to wrap paragraphs that are in enumerations?

I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make
sure to tag all your structural elements with \start...-\stop..., e.g.
\startchapter, but even \startparagraph!” I also note the appearance of
\startcontent..\stopcontent and \stopcaption..\startcaption and such,
suggesting to me that semantic tagging may be a useful thing to add to
new documents in order to support new output formats.

\starttext
\startitemize
   \startitem
 \startparagraph
   Item one paragraph one.
 \stopparagraph
 \startparagraph
   Item one paragraph two.
 \stopparagraph
 \startparagraph
   Item one paragraph three.
 \stopparagraph
   \stopitem
   \startitem
 \startparagraph
   Item two paragraph one.
 \stopparagraph
 \startparagraph
   Item two paragraph two.
 \stopparagraph
 \startparagraph
   Item two paragraph three.
 \stopparagraph
   \stopitem
\stopitemize


\starttext
\startitemize
  \startitem
\bpar
  Item one paragraph one.
\epar % \stopparagraph
\bpar
  Item one paragraph two.
\epar
\bpar
  Item one paragraph three.
\epar
  \stopitem
  \startitem
\bpar
  Item two paragraph one.
\epar
\bpar
  Item two paragraph two.
\epar
\bpar
  Item two paragraph three.
\epar
  \stopitem
\stopitemize
\stoptext



\startitemize
   \item
   Item three paragraph one.

   Item three paragraph two.

   Item three paragraph three.
   \item
   Item four paragraph one.

   Item four paragraph two.

   Item four paragraph three.
\stopitemize
\stoptext

--
Rik Kabel


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




--

-
  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] \startitem and \startparagraph

2014-10-17 Thread Rik Kabel

On 2014-10-17 03:50, Hans Hagen wrote:

On 10/17/2014 3:02 AM, Rik Kabel wrote:

What is the proper way to delimit paragraphs within an itemized list
using \start..\stop tagging (as for epub and such)? When I wrap
paragraphs with \startparagraph..\stopparagraph within the
\startitem..\stopitem, there is an unwanted newline inserted between the
bullet and the item text.

Or, is it not recommend to wrap paragraphs that are in enumerations?

I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make
sure to tag all your structural elements with \start...-\stop..., e.g.
\startchapter, but even \startparagraph!” I also note the appearance of
\startcontent..\stopcontent and \stopcaption..\startcaption and such,
suggesting to me that semantic tagging may be a useful thing to add to
new documents in order to support new output formats.

\starttext
\startitemize
   \startitem
 \startparagraph
   Item one paragraph one.
 \stopparagraph
 \startparagraph
   Item one paragraph two.
 \stopparagraph
 \startparagraph
   Item one paragraph three.
 \stopparagraph
   \stopitem
   \startitem
 \startparagraph
   Item two paragraph one.
 \stopparagraph
 \startparagraph
   Item two paragraph two.
 \stopparagraph
 \startparagraph
   Item two paragraph three.
 \stopparagraph
   \stopitem
\stopitemize


\starttext
\startitemize
  \startitem
\bpar
  Item one paragraph one.
\epar % \stopparagraph
\bpar
  Item one paragraph two.
\epar
\bpar
  Item one paragraph three.
\epar
  \stopitem
  \startitem
\bpar
  Item two paragraph one.
\epar
\bpar
  Item two paragraph two.
\epar
\bpar
  Item two paragraph three.
\epar
  \stopitem
\stopitemize
\stoptext


Thank you, Hans, for that.

Can you explain when \startparagraph..\stopparagraph should be preferred 
for tagging, and when \bpar..\epar? There is clearly a difference 
between them.


Is there any setup associated with \bpar..\epar as there is 
\defineparagraph for \startparagraph..\stopparagraph?


--
Rik Kabel
___
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] \startitem and \startparagraph

2014-10-17 Thread Hans Hagen

On 10/17/2014 5:11 PM, Rik Kabel wrote:


Thank you, Hans, for that.

Can you explain when \startparagraph..\stopparagraph should be preferred
for tagging, and when \bpar..\epar? There is clearly a difference
between them.

Is there any setup associated with \bpar..\epar as there is
\defineparagraph for \startparagraph..\stopparagraph?


no time now ... just grep the source ... they are just simple hooks and 
the short bpar one doesn't issue a \par ... not that much special ... 
the long ones are real elements and can also have additional attributes


Hans

-
  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] \startitem and \startparagraph

2014-10-16 Thread Rik Kabel
What is the proper way to delimit paragraphs within an itemized list 
using \start..\stop tagging (as for epub and such)? When I wrap 
paragraphs with \startparagraph..\stopparagraph within the 
\startitem..\stopitem, there is an unwanted newline inserted between the 
bullet and the item text.


Or, is it not recommend to wrap paragraphs that are in enumerations?

I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make 
sure to tag all your structural elements with \start...-\stop..., e.g. 
\startchapter, but even \startparagraph!” I also note the appearance of 
\startcontent..\stopcontent and \stopcaption..\startcaption and such, 
suggesting to me that semantic tagging may be a useful thing to add to 
new documents in order to support new output formats.


   \starttext
   \startitemize
  \startitem
\startparagraph
  Item one paragraph one.
\stopparagraph
\startparagraph
  Item one paragraph two.
\stopparagraph
\startparagraph
  Item one paragraph three.
\stopparagraph
  \stopitem
  \startitem
\startparagraph
  Item two paragraph one.
\stopparagraph
\startparagraph
  Item two paragraph two.
\stopparagraph
\startparagraph
  Item two paragraph three.
\stopparagraph
  \stopitem
   \stopitemize

   \startitemize
  \item
  Item three paragraph one.

  Item three paragraph two.

  Item three paragraph three.
  \item
  Item four paragraph one.

  Item four paragraph two.

  Item four paragraph three.
   \stopitemize
   \stoptext

--
Rik Kabel
___
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] Startparagraph oddities

2014-08-29 Thread Hans Hagen

On 8/29/2014 12:22 AM, Rik Kabel wrote:

There appears to be an inconsistency in the implementation of
\startparagraph. When it is used with one argument (or two by my reading
of the source) it defines \stopparagraph with a terminal \endgraf, yet
with no arguments this is not done. Strangely (to me) it also appears to
insert a line-break before \startparagraph[]. The example below
demonstrates these issues.

I would expect to have \endgraf inserted with each \stopparagraph
regardless of the argument count.

There is also a wiki issue with overloading of the command name
\startparagraph. The existing command entry points to the paragraphs
mechanism for setting up parallel paragraphs in columns. There is also a
\startParagraph command described for the t-pararef module. There is no
mention of \startparagraph in the \startsection page, which might be an
appropriate place. Perhaps some Wikipedia-style disambiguation mechanism
is needed.

\starttext
\startparagraph
One
\stopparagraph
\startparagraph
Twee
\stopparagraph
\startparagraph
Drie
\stopparagraph
\startparagraph[]
One
\stopparagraph
\startparagraph
Twee
\stopparagraph
\startparagraph
Drie
\stopparagraph
\stoptext


fixed in next beta

-
  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] XML, XHTML, and HTML export issue with in URL

2014-08-28 Thread Rik Kabel
With the following example, the output xml writer fails to properly 
transform  to the html entity amp; in some urls; \hyphenatedurl works 
fine.


The generated xhtml and html files have this problem as well as more 
issues with the transformation, including what appears to be mistaken 
transformation of  and  to html entities and unbalanced link tags.


When a URL without  is used, the problems do not appear.

I used the default export-example.css file, and I assume that the lack 
of interaction in the result reflects the lack of coding for links in 
that file.


This was tested with the 2014-08-27 standalone.

   \setupbackend[export=xmltest.xml,xhtml=xmltest.xhtml,css=export-example.css]
   \setupinteraction[state=start]
   \useURL[avecAmpersand]
   [http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub]
  [][klik hier]
   \starttext
   \startsubject[title=Fails in xml]
   \startparagraph
  \tex{from}: \from[avecAmpersand]
   \stopparagraph
   \startparagraph
  \tex{goto[url]}: \goto{klik
   hier}[url(http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub)]
   \stopparagraph
   \stopsubject
   \startsubject[title=Okay in xml]
   \startparagraph
  \tex{url}: \url[avecAmpersand]
   \stopparagraph
   \startparagraph
  \tex{hyphenatedurl}:
   
\hyphenatedurl{http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub}
   \stopparagraph
   \stopsubject
   \stoptext

--
Rik Kabel
___
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] XML, XHTML, and HTML export issue with in URL

2014-08-28 Thread Hans Hagen

On 8/28/2014 6:20 PM, Rik Kabel wrote:

With the following example, the output xml writer fails to properly
transform  to the html entity amp; in some urls; \hyphenatedurl works
fine.

The generated xhtml and html files have this problem as well as more
issues with the transformation, including what appears to be mistaken
transformation of  and  to html entities and unbalanced link tags.

When a URL without  is used, the problems do not appear.

I used the default export-example.css file, and I assume that the lack
of interaction in the result reflects the lack of coding for links in
that file.

This was tested with the 2014-08-27 standalone.

\setupbackend[export=xmltest.xml,xhtml=xmltest.xhtml,css=export-example.css]
\setupinteraction[state=start]
\useURL[avecAmpersand]
[http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub]
   [][klik hier]
\starttext
\startsubject[title=Fails in xml]
\startparagraph
   \tex{from}: \from[avecAmpersand]
\stopparagraph
\startparagraph
   \tex{goto[url]}: \goto{klik
hier}[url(http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub)]
\stopparagraph
\stopsubject
\startsubject[title=Okay in xml]
\startparagraph
   \tex{url}: \url[avecAmpersand]
\stopparagraph
\startparagraph
   \tex{hyphenatedurl}:

\hyphenatedurl{http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub}
\stopparagraph
\stopsubject
\stoptext


fixed in next beta

-
  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] Startparagraph oddities

2014-08-28 Thread Rik Kabel
There appears to be an inconsistency in the implementation of 
\startparagraph. When it is used with one argument (or two by my reading 
of the source) it defines \stopparagraph with a terminal \endgraf, yet 
with no arguments this is not done. Strangely (to me) it also appears to 
insert a line-break before \startparagraph[]. The example below 
demonstrates these issues.


I would expect to have \endgraf inserted with each \stopparagraph 
regardless of the argument count.


There is also a wiki issue with overloading of the command name 
\startparagraph. The existing command entry points to the paragraphs 
mechanism for setting up parallel paragraphs in columns. There is also a 
\startParagraph command described for the t-pararef module. There is no 
mention of \startparagraph in the \startsection page, which might be an 
appropriate place. Perhaps some Wikipedia-style disambiguation mechanism 
is needed.


   \starttext
   \startparagraph
   One
   \stopparagraph
   \startparagraph
   Twee
   \stopparagraph
   \startparagraph
   Drie
   \stopparagraph
   \startparagraph[]
   One
   \stopparagraph
   \startparagraph
   Twee
   \stopparagraph
   \startparagraph
   Drie
   \stopparagraph
   \stoptext

--
Rik Kabel
___
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] Bugs in XML export (for ePub)

2014-03-10 Thread Henning Hraban Ramm
Hi again.

I understand you don’t want to export some arbitrary (X)HTML. That’s fine, I 
can make my own XSLT.
And I’m glad that \setupexport doesn’t kill hyphenation any more.

But there are serious errors in export, that have nothing to do with „there’s 
no usable standard“.


[1] root node

First, the exported XML file lacks a root node!
Just call it export or context or whatever you like, but it MUST be there, 
otherwise it’s no wellformed XML.

If I enable xhtml mode like
\setupbackend[export=export.xml,xhtml=yes]
the exported file stops after a few lines.

If I set xhtml=somefile.xhtml, I get the broken export.xml and the complete 
somefile.xhtml, so I guess xhtml=yes causes overwriting the complete file with 
the incomplete one.

As far as I remember previous discussions, this incomplete content is caused by 
the project structure (using project, product, environment); from single file 
it seemed to work, at least at that time, I didn’t check.

Since xhtml mode doesn’t do anything useful anyway, I can just drop the setting.


[2] metadata

The metadata from \setupexport is completely ignored.
The metadata from \settaggedmetadata is exported just fine, but it ends up 
within the first block of the first page, if that’s not empty.
e.g. my text starts with \startlines Title etc. \stoplines, then 
metadatametavariable etc. is exported within lines.
If I add something like \startparagraph \stopparagraph to contain the metadata, 
it disappears. Of course I don’t want to add something visible (then it works 
again).


[3] cover picture

The firstpage key of setupexport is supposed to define a cover picture for the 
ePub, but it doesn’t do anything, as far as I can tell.
Or is something wrong in:
\setupexport[firstpage={img/cover.jpg}]
?


[4] delimited

If \quotation{} contains more than one paragraph (in my case it’s a quote), the 
delimited detail=quotation“ is ended after the first paragraph.


(As always, working with latest MkIV beta on OSX.)

Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] struggling with section headers

2014-03-07 Thread Henning Hraban Ramm
Hi again,

I got a few different problems related to my section headers.

I use \startsection[title={Something}] … \stopsection, but not \startparagraph, 
in case that matters. (Latest MkIV beta on OSX.)

I need grid typesetting and use the same line spacing for body text and section 
headers (body text is 9pt, section headers are 11pt, interlinespace is 12pt).
But as soon as I enable grid typesetting, there’s at least one line of space 
after the header - doesn’t hurt, but my setup says:

\setupheads[
align={right,nothyphenated}, 
tolerance=verytolerant,
grid=line, 
number=no]

\setuphead[section][
page=no,
style={\SectionFont}, 
before={\blank\vfil},
after={\relax},
interlinespace=12pt]

Headers should stick with their (following) paragraph,
but they tend to stick with the previous line.
I.e. there are several pages that end somewhere in the middle, 
but their last line is on the next page above the section title.
   
I don’t want page=yes, but the section should start on a new page
rather than with just the title at the foot.

If a page starts with a header, there should be no additional space above it.

Did I miss some obvious setup?


Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] EPUB woes

2013-11-20 Thread Keith J. Schultz
Hi Mica,

Am 19.11.2013 um 22:39 schrieb Mica Semrick paperdig...@gmail.com:

 Keith,
 
 Maybe you should explore an XML format that can be transformed directly to 
 epub. You'd also be able to write a style sheet with ConTeXt that would out 
 put a PDF as well. I think TEI-Lite is a good starting point.
While XML is one approach and using XML-Styles and DocBook I could even 
do without ConTeXt completely. Yet, from a general
user standpoint this way of marking up ebooks is tedious. XML has 
become the standard for storing all kinds of data. A a storage
format it is great and allows for conversion to other formats for ages 
to come. YET, one has to know what XML is how to use it
how to make tools to process it. That is something that I would not 
like to enforce on the average author. 
 
 Since you can make your own commands in ConTeXt, it will never be able to 
 intelligently map all commands on to simple HTML.
How true. That is the problem with any system that is and can handle 
more complex structures than a simpler system.
That is why any module geared to creating ebooks has to only allow what 
is needed and can be done in any EREADER, 
(notice I wrote reader not / Book or EPub!)

My Idea is to use the Lua capabilities of ConTeXt to get the job done.
I will try to exemplify.

suggest MWE:
\usemodule[ebook]

\setupcss[…]{…}% see comment #1

\setupmapping[…]{…} % used for when author has his/her own ideas #2

%normal ConTeXt sets see comment #3

% possibly set a mode or set externally

\starttext
\startebook
\chapter… %see comment #4
\startparagraph{leftmargin=20%, …] % see 
comment #5
% text
\stopparagraph
\starttable…
\stoptable
…
\stopebook
\stoptext

OK, this pretty much looks like standard ConTeXt
Comments:
1) Here is where the author can define the CSS he wants
It will integrated into the CSS used for the ebook

2) The author can setup how the ebook commands are mapped to
 ConTeXt commands

3) Here are setups for the  NORMAL ConTeXt commands for producing PDFs

4)  if mode is PDF command is mapped to normal ConTeXt injected into 
stream
 if mode ebook, gather information for spine, etc, start a new file 
for the chapter
 start writing to this file as HTML 

5)  if in mode PDF map to ConTeXt command, whereby the leftmargin is 
used as the
 basis for the calculation .2\textwidth or if you wish

This approach is ebook centric. Allows for rapid prototyping and proofing of 
the ebook using a PDF
This approach alleviates the need to attempt to dumb down ConTeXt markup. 
Through the use mappings te author has the possibility of producing a higher 
quality PDF if wanted.
The system could be designed to produce a file with the ConTeXt commands that 
can be edited for even
higher quality PDFs of printed versions. 

There could be even XML or whatever mode in the ebook module.

Another advantage would be is that we are a module that will produce HTML out 
of a ConTeXt styled syntax
that can be directly converted to a PDF directly, without worrying about lose 
of formatting or using tools over
which features are supported or not. This is a straight forward approach.

True, enough, ConTeXt is not designed to be a  HTML editor. 

It is a matter of design policy! The philosophy of going from TeX/ConTeXt 
centric to HTML is IMHO far inferior than
going from HTML/ebook centric to ConTeXt. One can always make things more 
intricate/complicated and taking something
complicated and morphing onto a less sophisticated system.

What one has to keep in mind is that ConTeXt renders to PDF and that is what 
is not needed when producing a ebook.
The rendering is done by the ereader. ConTeXt does have any information about 
screen size or  orientation. ConTeXt is built upon 
a page morphology. ebooks are not! So any decent approach has to keep this in 
mind.

regards
Keith.

 
 
 On Mon, Nov 18, 2013 at 10:12 AM, Keith J. Schultz schul...@uni-trier.de 
 wrote:
 
 Am 18.11.2013 um 16:33 schrieb Hans Hagen pra...@wxs.nl:
 
 On 11/18/2013 4:11 PM, Keith J. Schultz wrote:
 Hi Hans,
 
 
 Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:
 
 On 11/18/2013 10:00 AM, Keith J. Schultz wrote:
 
   2) Now, what a EPub-READER must implement to handle is very
little. There are HARDLY ANY provisions that a certified 
 EPuB-READER has
  to implement any particular engine or features therein to 
 display/render
the information contain in the EPub-file/wrapper.
 
 right, and I'm not going to waste time

Re: [NTG-context] EPUB woes

2013-11-20 Thread Aditya Mahajan

On Wed, 20 Nov 2013, Keith J. Schultz wrote:


\usemodule[ebook]

\setupcss[…]{…}% see comment #1

\setupmapping[…]{…} % used for when author has his/her own ideas #2

%normal ConTeXt sets see comment #3

% possibly set a mode or set externally

\starttext
\startebook
\chapter… %see comment #4
\startparagraph{leftmargin=20%, …] % see 
comment #5
% text
\stopparagraph
\starttable…
\stoptable
…
   \stopebook
\stoptext


To me, the biggest advantage of a TeX based system is the ease of 
extensibility. If you want to restrict to a specific subset, then might as 
well use XML:


document
book
chapter
paragraph leftmargin=20%
 text
/paragraph
/book
/document

or using one of the existing XML schemas rather than inventing your own 
(perhaps even HTML5).


As far as ConTeXt is concerned, you can process the above XML quite 
easily. Come to think of it, it may be a useful to provide a module that

maps HTML5 to PDF.

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

Re: [NTG-context] EPUB woes

2013-11-16 Thread Wolfgang Schuster

Am 16.11.2013 um 16:16 schrieb Bill Meahan subscribed_li...@meahan.net:

 I have been trying for a very long time to generate an epub document via 
 context without success.
 
 I have followed the steps on the wiki to the letter, using the export-example 
 file provided with the standalone distribution. A PDF generated from the file 
 is exactly what I would expect from an example. The generated epub, however, 
 is useless - all the text is jammed together into one continuous block with 
 no formatting whatsoever.
 
 Adobe Digital Editions 2.0 crashes trying to open it. Sumatra and Sigil get 
 it open but the results are as described above. Obviously I am missing a step 
 or doing something wrong but I cannot see what.
 
 Context Standalone from a couple of days ago. Windows 7-64 (Home Premium) but 
 I got the same results several months ago on a Linux system so I do not think 
 it is OS-related.

When you use the export option context creates a xml file from your document. 
When you call not the epub script context creates epub file which contains this 
xml file which uses a custom format and not xhtml as you would expect. 

To get a epub file which can be used with most reader (a few programs on 
windows/mac/linux can read contexts output) you have to convert context xml 
file into valid xhtml.

What you have to do as well in your document to get proper tagged paragraphs is 
to add \startparagraph and \stopparagraph at the begin and end of each 
paragraph, otherwise context adds AFAIR br/ between them.

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] EPUB woes

2013-11-16 Thread Aditya Mahajan

On Sat, 16 Nov 2013, Bill Meahan wrote:


I would /expect/ to get a valid EPUB file, or so I'm lead to believe.

At the moment, I'm simply trying it out using Hans' export-example.tex file 
that comes as part of the standard ConTeXt distribution, either Standalone or 
part of one of the other distributions. I haven't even opened the 
export-example.tex file in an editor (yet) in this round of trials and I've 
even run the script against it right in the /base/ directory where it is 
found in the distribution so I don't understand why it is not producing a 
valid EPUB. Once I've got that sorted out, I can try applying the lessons 
learned to my own documents.


ConTeXt provides two types of exports. The first is an XML export. 
Consider a sample file:


~~~ {test.tex}
\setupbackend[export=yes]

\starttext
\startsection[title={This is a test}]
  \startparagraph
Some random text
\startitemize
  \item First
  \item Second
\stopitemize
  \stopparagraph
\stopsection

\stoptext
~~~

Running `context test.tex` generates a `test.export` file that looks as 
follows:


~~~ {test.export}
?xml version='1.0' encoding='UTF-8' standalone='yes' ?

!-- input filename   : test  --
!-- processing date  : Sat Nov 16 12:19:59 2013 --
!-- context version  : 2013.11.01 15:02  --
!-- exporter version : 0.30  --


 document language=en file=test date=Sat Nov 16 12:19:59 2013 
context=2013.11.01 15:02 version=0.30 
xmlns:m=http://www.w3.org/1998/Math/MathML;

  section detail=section location='aut:1'
sectionnumber1/sectionnumber
   sectiontitleThis is a test/sectiontitle
   sectioncontent
  paragraphSome random text itemgroup detail=itemize 
symbol=1itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentFirst/itemcontent/item 
itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentSecond/itemcontent/item/itemgroup/paragraph

   /sectioncontent
  /section
 /document
~~~

which is simply an XML representation of the document.

In prinicple, if one adds an appropriate CSS file with that XML, any 
recent browser will be able to display it. So, if you change the first 
line of `test.tex` to


~~~
\setupbackend[export=yes, xhtml=yes, css=yes]
~~~

and run `context test.tex`, you will get four additional files: 
`test.xhtml`, `test-styles.css`, `test-images.css`, and 
`test.specification`.


The `test.xhtml` file look as follows:

~~~{test.xhtml}
?xml version='1.0' encoding='UTF-8' standalone='yes' ?

!-- input filename   : test  --
!-- processing date  : Sat Nov 16 12:22:58 2013 --
!-- context version  : 2013.11.01 15:02  --
!-- exporter version : 0.30  --

?xml-stylesheet type=text/css href=test-styles.css?
?xml-stylesheet type=text/css href=test-images.css?
?xml-stylesheet type=text/css href=export-example.css?

 document language=en version=0.30 file=test 
xmlns:xhtml=http://www.w3.org/1999/xhtml; 
xmlns:m=http://www.w3.org/1998/Math/MathML; date=Sat Nov 16 12:22:58 
2013 context=2013.11.01 15:02

  xhtml:a name=aut_1section location=aut:1 detail=section
sectionnumber1/sectionnumber
   sectiontitleThis is a test/sectiontitle
   sectioncontent
  paragraphSome random text itemgroup symbol=1 
detail=itemizeitemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentFirst/itemcontent/item 
itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentSecond/itemcontent/item/itemgroup/paragraph

   /sectioncontent
  /section/xhtml:a
 /document
~~~

Notice that apart from the three lines specifying the CSS files, the rest 
of the document is the same as in XML export. The two css files, 
`test-styles.css` and `test-images.css` include the relevant code for the 
style modifications and images in the document. The css file 
`export-example.css` comes with the ConTeXt distribution and has the 
default values for most ConTeXt elements.


If you open the `test.xhtml` file in any browser, it will work correctly 
(because an XHTML markup is extensible and can use any XML tags as long as 
the behavior of the tag is specified in a CSS file). This is, however, not 
a XHTML file that includes the default XHTML markup (h1, p, ul, 
etc.)


Now, lets come back to the last file generated by the export: 
`test.specification`. This is a lua file that contains:


~~~{test.specification}
return {
 [files]={ test-styles.css, test-images.css, export-example.css, 
test.xhtml },

 [identifier]=e6a91a13-4e08-9494-3817-bfffe872be2c,
 [images]={},
 [language]=en,
 [name]=test,
 [root]=test.xhtml,
}


When you run `mtxrun --script epub --make test`, it just takes the files 
specificied in the files field, and zips them in as a epub file.


Now, in principle, any epub reader should support the any XHTML file; in 
practice, they only support the default XHTML tags. The XML+CSS file

Re: [NTG-context] EPUB woes

2013-11-16 Thread Bill Meahan

On 11/16/2013 12:37 PM, Aditya Mahajan wrote:

On Sat, 16 Nov 2013, Bill Meahan wrote:


I would /expect/ to get a valid EPUB file, or so I'm lead to believe.



1. Wait until the EPUB readers catch up. It took almost 10-15 years 
for the browsers to catch up with the HTML standards, and I don't have 
much hope for EPUB readers here. Last I checked, none of them 
supported even MATHML-2.


2. Write a script (either using xmlproc, or using you favorite XML 
parser in your favorite language) that converts the XML generated by 
ConTeXt into a standard XHTML file. This is the easiest and the 
least time consuming alternative.


3. Modify the way in which ConTeXt generates the XML files. Ideally, I 
should be able to write something like


~~~
\setupparagraph[tag=p, class=default]
~~~

to tell context that \startparagraph ... \stopparagraph should 
translate to `p class=default ... /p. Last I checked the code 
that generates the XML file, there was no easy way to change the tags 
and classes.


I hope that the above description clarifies the situation.

Aditya


Thanks for the clarification.

--
Bill Meahan, Westland, Michigan

 
  “Writing is like getting married. One should never

   commit oneself until one is amazed at one's luck.”

   —Iris Murdoch

This message is digitally signed with an X.509 certificate
to prove it is from me and has not been altered since it was sent.

___
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] reStructuredText module

2013-03-12 Thread Philipp Gesang
···date: 2013-03-12, Tuesday···from: Bill Meahan···

 Philipp Gesang wrote:
 ···date: 2013-03-11, Monday···from: Bill Meahan···
 Am I correct in thinking the rst module does not process the class
 and container directives?
 When I wrote the module I was working with the reST spec [0] and
 the syntax reference [1]. It’s been a while, but afair I
 implemented the spec completely (with the limitations described
 in the manual). It does not, to my knowledge, define the
 directives you mention and I don’t know what they’re supposed to
 do.
 
 (Btw. like much of the spec, “container” and “class” sound
 suspiciously HTML-specific. If that is true, they address one
 output markup which happens to be -- not Context! I might find
 the time to add a simple wrapper for the container thingy (to
 boxes or framed?). However, I doubt that it’s possible to
 replicate the behavior of HTML divs + CSS without a larger effort
 [2]. In this case it might be preferable to have docutils
 generate some XML and directly typeset the result with Context.)
 
 Best regards
 Philipp
 
 The .class and .container direectives are certainly there with *ML in mind 
 but I think there might be analog situatins in ConTeXt.
 
 .. class::  classname
 
   blah, blah, blah
 
 exists to stick a class name on the following element for styling with an 
 external stylesheet of some sort. CSS/CSS3 are probably the primary examles 
 but other XML-bases markus apply just as well
 
 .. class::classname
 
   blab, blab, blab
 
 could yield
 
   p class=classnameblab, blab, blab/p
   h2 class=classnameblab. blab, blab/h2
 
 or anything else that can take a class name attribute.

From its description [0], the “class” directive appears to be
next to meaningless outside an HTML context. It’s supposed to set
“classes”. The doctree spec [1] explicitly states that “The
classes attribute's contents should be ignorable.”

To my knowledge, the closest thing in Context to CSS classes is
the “setups=” parameter. All macros don’t accept it, though, so
I can’t think of a general way of handling it. The list of macros
where it applies would have to be hardcoded ...

Docutils’ latex2 writer -- the reference implementation, mind
you -- btw. doesn’t take the “class” directive seriously at all:
it handles paragraphs but ignores it e.g. for section heads.

 .. container:: containername
 
   Foo, bar, baz
 
   bunch of stuff
 
 yields
 
   div class=containername
 
   foo, bar, baz
 
   bunch of stuff
 
   /div
 
 .. container:: probably maps to something like
 \frame[containername]

 although frames as such cannot cross page boundaries. Perhaps
 there is (or could be) a more suitable construct. I'm trying to
 be exemplary not directive. :)

Fyi [2]: “container” is docutils for “div”. How’s a “div”
supposed to look? That depends on your browser (not the spec!),
and the HTML version being used (XHTML 1.1 for python2-docutils).
What does that mean for non-HTML targets? Apparently nothing:
again, docutils ignore the directive when writing LaTeX (and man
pages, for that matter).

Nevertheless, I added some code to handle container directives:
at the moment they simply map to macros of the same name.
Existence of the macro is tested for at runtime, so you can place
the definitions in your preamble. Example:

·

This is a paragraph.

.. container:: xyzzy

whatever

foo **bar** baz

This is another paragraph.

·

This will generate the output:

·

\startparagraph
This is a paragraph.
\stopparagraph

\ifcsname xyzzy\endcsname%
  \csname xyzzy\endcsname%
  {whatever foo {\sc bar} baz}%
\else
  {whatever foo {\sc bar} baz}%
\fi


\startparagraph
This is another paragraph.
\stopparagraph

·

So if there’s no \xyzzy, the contents are treated as a simple
group. Unnamed containers default to \framed. Let me know what
you think. The code is at:

  https://bitbucket.org/phg/context-rst/get/0df50df9c8fb.zip

 ConTeXt environment files are certainly analogus to CSS files and are used 
 with the same end goals in mind.
 
 styling markup elements through class= or equivalent is
 rapidly becoming the order of the day for a wide variety of
 documents. Certainly (X)HTML, epub2, epub3, ODT, DOCX and an
 increasing horde of others are either there or heading there very
 soon.

Sure. I have no problem with that as long as it stays
implementation-agnostic.

Thanks for the feedback.
Philipp



[0] http://docutils.sourceforge.net/docs/ref/rst/directives.html#class
[1] http://docutils.sourceforge.net/docs/ref/doctree.html#classes
[2] http://docutils.sourceforge.net/docs/ref/rst/directives.html#container


 
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Re: [NTG-context] reStructuredText module

2013-03-12 Thread Aditya Mahajan

On Tue, 12 Mar 2013, Philipp Gesang wrote:


Nevertheless, I added some code to handle container directives:
at the moment they simply map to macros of the same name.
Existence of the macro is tested for at runtime, so you can place
the definitions in your preamble. Example:

·

This is a paragraph.

.. container:: xyzzy

   whatever

   foo **bar** baz

This is another paragraph.

·

This will generate the output:

·

\startparagraph
This is a paragraph.
\stopparagraph

\ifcsname xyzzy\endcsname%
 \csname xyzzy\endcsname%
 {whatever foo {\sc bar} baz}%
\else
 {whatever foo {\sc bar} baz}%
\fi


\startparagraph
This is another paragraph.
\stopparagraph

·


A better way to handle this is to provide macros \startRSTcontainer ... 
\stopRSTcontainer and translate the above to


\startRSTcontainer[xyzzy][...settings ]

\stopRSTcontainer

It should be responsiblility of the document author to make sure that the 
containers work correctly.


Depending on what containers are supposed to do (I have not read the links 
posted in this thread), providing such a container might be as simple as


\let\startRSTcontainer=\startframedtext
\let\stopRSTcontainer=\stopframedtext

or

\let\startRSTcontainer=\startparagraph
\let\stopRSTcontainer=\stopparagraph


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

Re: [NTG-context] reStructuredText module

2013-03-12 Thread Philipp Gesang
···date: 2013-03-12, Tuesday···from: Aditya Mahajan···

 On Tue, 12 Mar 2013, Philipp Gesang wrote:
 
 A better way to handle this is to provide macros \startRSTcontainer
 ... \stopRSTcontainer and translate the above to

I considered adding a generator \defineRSTcontainer with the
usual interface (e.g. [command=\framed,frame=on]). This won’t
work because the output is supposed to be a self-contained
document. The goal is for the output to consist of ordinary
Context macros only so it can be imported without loading further
code. (I’m undecided regarding the requirement of the “\RST...”
prefix, though.)

 \startRSTcontainer[xyzzy][...settings ]
 
 \stopRSTcontainer
 
 It should be responsiblility of the document author to make sure
 that the containers work correctly.
 
 Depending on what containers are supposed to do (I have not read the
 links posted in this thread),

They are defined as HTML div’s.

   providing such a container might be as
 simple as
 
 \let\startRSTcontainer=\startframedtext
 \let\stopRSTcontainer=\stopframedtext
 
 or
 
 \let\startRSTcontainer=\startparagraph
 \let\stopRSTcontainer=\stopparagraph

Honestly, I have no idea. Depending on the style sheet a div can
be a float or aligned or have a shaded background. The current
approach leaves the implementation to the user.

Philipp

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgp0UMQM9mQ0z.pgp
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] block with different formatting per line?

2013-02-06 Thread Bill Meahan

On 02/01/2013 06:16 PM, Ingo Hohmann wrote:

Hi,

is it possible to define a block, where lines are automatically 
formatted differently?

For example:
first line in caps,
second in bold,
others normal.

Is this possible? And how?


My #1 Wish List item for ConTeXt is /allowing/ stylesheets at the 
paragraph level. That would allow closer correspondence with what 
CSS/CSS3, Scribus, ODT, EPUB3 al do and make it much easier to write 
transformation scripts whether XSLT, lua code, Perl code or whatever 
favorite tool one wishes to use.


I envision something like (psuedo code):

\setupstylesheet[myparagraphstyle]
  [font=AccanthisADF,
  fontsize=12pt,
  fontstyle=italic,
  alignment=justified,
  frame=no,
  color=blue,
  width=\textwidth,
  c 
  ]

\starttext

  \startparagraph[style=mystylesheet]
\input tufte
  \stopparagraph

  \input knuth

\stoptext

The output would have the tufte quote formatted according to my 
stylesheet and knuth in whatever the global style is.


The style parameter in the start/stop paragraph would, of course, be 
/optional/ so existing documents would be unchanged from current 
behavior but allow the introduction of paragraph styles.


--
Bill Meahan
Westland, Michigan USA

___
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] Paragraph formatting (was: block with different formatting per line?)

2013-02-06 Thread Wolfgang Schuster

Am 06.02.2013 um 20:21 schrieb Bill Meahan subscribed_li...@meahan.net:

 My #1 Wish List item for ConTeXt is /allowing/ stylesheets at the 
 paragraph level. That would allow closer correspondence with what CSS/CSS3, 
 Scribus, ODT, EPUB3 al do and make it much easier to write transformation 
 scripts whether XSLT, lua code, Perl code or whatever favorite tool one 
 wishes to use.
 
 I envision something like (psuedo code):
 
 \setupstylesheet[myparagraphstyle]
  [font=AccanthisADF,
  fontsize=12pt,
  fontstyle=italic,
  alignment=justified,
  frame=no,
  color=blue,
  width=\textwidth,
  c 
  ]
 
 \starttext
 
  \startparagraph[style=mystylesheet]
\input tufte
  \stopparagraph
 
  \input knuth
 
 \stoptext
 
 The output would have the tufte quote formatted according to my stylesheet 
 and knuth in whatever the global style is.
 
 The style parameter in the start/stop paragraph would, of course, be 
 /optional/ so existing documents would be unchanged from current behavior but 
 allow the introduction of paragraph styles.

A few of these values can be set for certain paragraphs with the new 
\defineparagraph command.

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] block with different formatting per line?

2013-02-06 Thread Aditya Mahajan

On Wed, 6 Feb 2013, Bill Meahan wrote:


On 02/01/2013 06:16 PM, Ingo Hohmann wrote:

Hi,

is it possible to define a block, where lines are automatically formatted 
differently?

For example:
first line in caps,
second in bold,
others normal.

Is this possible? And how?


My #1 Wish List item for ConTeXt is /allowing/ stylesheets at the 
paragraph level. That would allow closer correspondence with what CSS/CSS3, 
Scribus, ODT, EPUB3 al do and make it much easier to write transformation 
scripts whether XSLT, lua code, Perl code or whatever favorite tool one 
wishes to use.


I envision something like (psuedo code):

\setupstylesheet[myparagraphstyle]
 [font=AccanthisADF,
 fontsize=12pt,
 fontstyle=italic,
 alignment=justified,
 frame=no,
 color=blue,
 width=\textwidth,
 c 
 ]

\starttext

 \startparagraph[style=mystylesheet]
   \input tufte
 \stopparagraph

 \input knuth

\stoptext


framedtext already does most of this (except that it makes the paragraphs 
unbreakable across pages). I don't remember if backgrounds has all the 
relevant keys.


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


Re: [NTG-context] Possible inconsistency in the use of paragraphs in ConTeXt

2013-02-01 Thread Alain Delmotte

Hi again,

OK I just updated context, asking for all modules, and now I 
don't have any more error.


Thanks,

Alain

Le 1/02/2013 04:58, Wolfgang Schuster a écrit :


Am 31.01.2013 um 23:02 schrieb Keith J. Schultz
keithjschu...@web.de mailto:keithjschu...@web.de:


Hi Wolfgang,

You do seem to understand what I am getting at!

I purposely put paragraph in quotes. because the
environment that I have suggest was
one that had setups for bodyfont, color, indenting etc.
and one can just like the headers
have control over them.


\startsetups[paragraph:german]
   \language[german]
\stopsetups

\startsetups[paragraph:double]
   \setupinterlinespace[big]
\stopsetups

\startsetups[paragraph:indenting]
   \setupindenting[yes,medium]
\stopsetups

\defineparagraph[german][setups=paragraph:german]
\defineparagraph[big]   [setups=paragraph:double]
\defineparagraph[indent][setups=paragraph:indenting]
\defineparagraph[red]   [color=red]
\defineparagraph[italic][style=italic]

\setupwhitespace[line]

\starttext

\startparagraph
\input reich
\stopparagraph

\startparagraph[german]
\input reich
\stopparagraph

\startparagraph[big]
\input reich
\stopparagraph

\startparagraph[indent]
\input reich
\stopparagraph

\startparagraph[red]
\input reich
\stopparagraph

\startparagraph[italic]
\input reich
\stopparagraph

\stoptext


Furthermore, you have stated on the on the 30th:


ConTeXt provides also a paragraph environment but this
add only tags when you export the document
as XML or create a tagged PDF.

The paragraphs (note the s) environment has a Hans
already mentioned nothing to do with paragraphs,
it just puts the content on columns where each column can
con tai multiple paragraphs. The name
for the environment is misleading because columns is
already taken as name.


Thank you anyway. I will look into creating what I need on
my own. I already have an idea.
Just need to figure out the implementation.


You can use \definestartsetup or \definebuffer to create
your own environments.

Wolfgang



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

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



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

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


Re: [NTG-context] Possible inconsistency in the use of paragraphs in ConTeXt

2013-02-01 Thread Keith J. Schultz
Hi Wolfgang,

I do apologize.

ConTeXt, does have the functionality that I was suggesting.
I must say though that it seems just 2-3 weeks young and
searching for the command defineparagraph brings up
Nil on ConTeXt Garden. Thank, you for the example.

Yet, is not quite what I had in mind. But, that does not matter for right now.
Hans already said it is non trivial to get the functionality of what 
I has suggest. Which was to introduce the concept of a paragraph into
ConTeXt that TeX does not have and not have to use startparagraph and
stopparagraph all the time for a standard paragraph.

Yes, Yes, I know how to use setupbodyfont, setupdenting, and the likes
for that!

I was aware that I could develop my own environments for paragraphs

The paragraph environment does pretty much close the gap and it will be very 
beneficial 
to the beginners and converts.

Thanx to whoever did the work and to you, too.

regards
Keith.

Am 01.02.2013 um 04:58 schrieb Wolfgang Schuster wolfgang.schus...@gmail.com:

 
 Am 31.01.2013 um 23:02 schrieb Keith J. Schultz keithjschu...@web.de:
 
 Hi Wolfgang,
 
 You do seem to understand what I am getting at!
 
 I purposely put paragraph in quotes. because the environment that I have 
 suggest was
 one that had setups for bodyfont, color, indenting etc. and one can just 
 like the headers
 have control over them.

[deleted example for brevities sake]

 Furthermore, you have stated on the on the 30th:
 
 ConTeXt provides also a paragraph environment but this add only tags when 
 you export the document
 as XML or create a tagged PDF.
 
 The paragraphs (note the s) environment has a Hans already mentioned 
 nothing to do with paragraphs,
 it just puts the content on columns where each column can con tai multiple 
 paragraphs. The name
 for the environment is misleading because columns is already taken as name.
 
 Thank you anyway. I will look into creating what I need on my own. I already 
 have an idea.
 Just need to figure out the implementation.
 
 You can use \definestartsetup or \definebuffer to create your own 
 environments.

___
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] Possible inconsistency in the use of paragraphs in ConTeXt

2013-01-31 Thread Wolfgang Schuster

Am 31.01.2013 um 09:40 schrieb Keith J. Schultz keithjschu...@web.de:

   It would have been nice, if ConTeXt had such an environment. I do not 
 know how ConTeXt processes
   things internally, but since it is a front end, ConTeXt could have the 
 syntactic sugar of a paragraph-environment.
   That is that, while parsing the source it injects groups into the code 
 it outputs for the paragraphs.
   This would give us then paragraph-layout. Naturally, this is not a 
 TeX way, but could be a ConTeXt way. 

ConTeXt *has* a paragraph environment!

\starttext

\startparagraph
This is the first paragraph.
\stopparagraph

\startparagraph
This is another paragraph.
\stopparagraph

\stoptext

Wolfgang

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

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


Re: [NTG-context] Possible inconsistency in the use of paragraphs in ConTeXt

2013-01-31 Thread Keith J. Schultz
Hi Wolfgang,

You do seem to understand what I am getting at!

I purposely put paragraph in quotes. because the environment that I have 
suggest was
one that had setups for bodyfont, color, indenting etc. and one can just like 
the headers
have control over them.

Furthermore, you have stated on the on the 30th:

 ConTeXt provides also a paragraph environment but this add only tags when you 
 export the document
 as XML or create a tagged PDF.
 
 The paragraphs (note the s) environment has a Hans already mentioned 
 nothing to do with paragraphs,
 it just puts the content on columns where each column can con tai multiple 
 paragraphs. The name
 for the environment is misleading because columns is already taken as name.

Thank you anyway. I will look into creating what I need on my own. I already 
have an idea.
Just need to figure out the implementation.

regards
Keith


Am 31.01.2013 um 17:24 schrieb Wolfgang Schuster wolfgang.schus...@gmail.com:

 
 Am 31.01.2013 um 09:40 schrieb Keith J. Schultz keithjschu...@web.de:
 
  It would have been nice, if ConTeXt had such an environment. I do not 
 know how ConTeXt processes
  things internally, but since it is a front end, ConTeXt could have the 
 syntactic sugar of a paragraph-environment.
  That is that, while parsing the source it injects groups into the code 
 it outputs for the paragraphs.
  This would give us then paragraph-layout. Naturally, this is not a 
 TeX way, but could be a ConTeXt way. 
 
 ConTeXt *has* a paragraph environment!
 
 \starttext
 
 \startparagraph
 This is the first paragraph.
 \stopparagraph
 
 \startparagraph
 This is another paragraph.
 \stopparagraph
 
 \stoptext
 
 Wolfgang

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

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

Re: [NTG-context] Possible inconsistency in the use of paragraphs in ConTeXt

2013-01-31 Thread Wolfgang Schuster

Am 31.01.2013 um 23:02 schrieb Keith J. Schultz keithjschu...@web.de:

 Hi Wolfgang,
 
 You do seem to understand what I am getting at!
 
 I purposely put paragraph in quotes. because the environment that I have 
 suggest was
 one that had setups for bodyfont, color, indenting etc. and one can just like 
 the headers
 have control over them.

\startsetups[paragraph:german]
  \language[german]
\stopsetups

\startsetups[paragraph:double]
  \setupinterlinespace[big]
\stopsetups

\startsetups[paragraph:indenting]
  \setupindenting[yes,medium]
\stopsetups

\defineparagraph[german][setups=paragraph:german]
\defineparagraph[big]   [setups=paragraph:double]
\defineparagraph[indent][setups=paragraph:indenting]
\defineparagraph[red]   [color=red]
\defineparagraph[italic][style=italic]

\setupwhitespace[line]

\starttext

\startparagraph
\input reich
\stopparagraph

\startparagraph[german]
\input reich
\stopparagraph

\startparagraph[big]
\input reich
\stopparagraph

\startparagraph[indent]
\input reich
\stopparagraph

\startparagraph[red]
\input reich
\stopparagraph

\startparagraph[italic]
\input reich
\stopparagraph

\stoptext

 Furthermore, you have stated on the on the 30th:
 
 ConTeXt provides also a paragraph environment but this add only tags when 
 you export the document
 as XML or create a tagged PDF.
 
 The paragraphs (note the s) environment has a Hans already mentioned 
 nothing to do with paragraphs,
 it just puts the content on columns where each column can con tai multiple 
 paragraphs. The name
 for the environment is misleading because columns is already taken as name.
 
 Thank you anyway. I will look into creating what I need on my own. I already 
 have an idea.
 Just need to figure out the implementation.

You can use \definestartsetup or \definebuffer to create your own environments.

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] Possible inconsistency in the use of paragraphs in ConTeXt

2013-01-31 Thread Alain Delmotte

Hi Wolfgang,

Using MkIV, version 2013.01.24 i get an error about 
\defineparagraph:


! Undefined control sequence.

system   tex  error on line 25 in file first.tex: 
Undefined control sequence ...


[...]
24
25   \defineparagraph[german][setups=paragraph:german]
26 \defineparagraph[big]   [setups=paragraph:double]
[...]
l.25 \defineparagraph
 [german][setups=paragraph:german]
?
! Emergency stop.

Thanks for all the answers you, patiently, give to newbies.

Regards,

Alain


Le 1/02/2013 04:58, Wolfgang Schuster a écrit :


Am 31.01.2013 um 23:02 schrieb Keith J. Schultz
keithjschu...@web.de mailto:keithjschu...@web.de:


Hi Wolfgang,

You do seem to understand what I am getting at!

I purposely put paragraph in quotes. because the
environment that I have suggest was
one that had setups for bodyfont, color, indenting etc.
and one can just like the headers
have control over them.


\startsetups[paragraph:german]
   \language[german]
\stopsetups

\startsetups[paragraph:double]
   \setupinterlinespace[big]
\stopsetups

\startsetups[paragraph:indenting]
   \setupindenting[yes,medium]
\stopsetups

\defineparagraph[german][setups=paragraph:german]
\defineparagraph[big]   [setups=paragraph:double]
\defineparagraph[indent][setups=paragraph:indenting]
\defineparagraph[red]   [color=red]
\defineparagraph[italic][style=italic]

\setupwhitespace[line]

\starttext

\startparagraph
\input reich
\stopparagraph

\startparagraph[german]
\input reich
\stopparagraph

\startparagraph[big]
\input reich
\stopparagraph

\startparagraph[indent]
\input reich
\stopparagraph

\startparagraph[red]
\input reich
\stopparagraph

\startparagraph[italic]
\input reich
\stopparagraph

\stoptext


Furthermore, you have stated on the on the 30th:


ConTeXt provides also a paragraph environment but this
add only tags when you export the document
as XML or create a tagged PDF.

The paragraphs (note the s) environment has a Hans
already mentioned nothing to do with paragraphs,
it just puts the content on columns where each column can
con tai multiple paragraphs. The name
for the environment is misleading because columns is
already taken as name.


Thank you anyway. I will look into creating what I need on
my own. I already have an idea.
Just need to figure out the implementation.


You can use \definestartsetup or \definebuffer to create
your own environments.

Wolfgang



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

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



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

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


Re: [NTG-context] Possible inconsistency in the use of paragraphs in ConTeXt

2013-01-31 Thread Devendra Ghate


On 02/01/2013 01:16 PM, Alain Delmotte wrote:

Hi Wolfgang,

Using MkIV, version 2013.01.24 i get an error about \defineparagraph:

! Undefined control sequence.

system   tex  error on line 25 in file first.tex: Undefined 
control sequence ...


[...]
24
25   \defineparagraph[german][setups=paragraph:german]
26 \defineparagraph[big]   [setups=paragraph:double]
[...]
l.25 \defineparagraph
 [german][setups=paragraph:german]
?
! Emergency stop.

Thanks for all the answers you, patiently, give to newbies.

Regards,

Alain



Alain,

Update MKIV. I had the same problem earlier. It works.

Devendra


Le 1/02/2013 04:58, Wolfgang Schuster a écrit :


Am 31.01.2013 um 23:02 schrieb Keith J. Schultz
keithjschu...@web.de mailto:keithjschu...@web.de:


Hi Wolfgang,

You do seem to understand what I am getting at!

I purposely put paragraph in quotes. because the
environment that I have suggest was
one that had setups for bodyfont, color, indenting etc.
and one can just like the headers
have control over them.


\startsetups[paragraph:german]
   \language[german]
\stopsetups

\startsetups[paragraph:double]
   \setupinterlinespace[big]
\stopsetups

\startsetups[paragraph:indenting]
   \setupindenting[yes,medium]
\stopsetups

\defineparagraph[german][setups=paragraph:german]
\defineparagraph[big]   [setups=paragraph:double]
\defineparagraph[indent][setups=paragraph:indenting]
\defineparagraph[red]   [color=red]
\defineparagraph[italic][style=italic]

\setupwhitespace[line]

\starttext

\startparagraph
\input reich
\stopparagraph

\startparagraph[german]
\input reich
\stopparagraph

\startparagraph[big]
\input reich
\stopparagraph

\startparagraph[indent]
\input reich
\stopparagraph

\startparagraph[red]
\input reich
\stopparagraph

\startparagraph[italic]
\input reich
\stopparagraph

\stoptext


Furthermore, you have stated on the on the 30th:


ConTeXt provides also a paragraph environment but this
add only tags when you export the document
as XML or create a tagged PDF.

The paragraphs (note the s) environment has a Hans
already mentioned nothing to do with paragraphs,
it just puts the content on columns where each column can
con tai multiple paragraphs. The name
for the environment is misleading because columns is
already taken as name.


Thank you anyway. I will look into creating what I need on
my own. I already have an idea.
Just need to figure out the implementation.


You can use \definestartsetup or \definebuffer to create
your own environments.

Wolfgang



___ 

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


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___ 





___ 

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


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___ 



___
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] Epub woes

2012-11-15 Thread Wolfgang Schuster

Am 15.11.2012 um 19:58 schrieb Bill Meahan subscribed_li...@meahan.net:

 I tried to generate an epub document using ConTeXt following the recipe on 
 the wiki. Didn't work. So, I tried running the export-example.tex file that 
 comes with the distribution, unmodified. Same bad results.
 
Cover is not generated
TOC is not generated (though it is noted this might be the state of the 
 export)
Sectioning doesn't happen.
Paragraphing doesn't happen.
The resultant epub file cannot even be opened with FBReader.
 
 Importing the epub into Sigil shows one big blob of text, with only the 
 between word spacing that's present in the source file. The \quotation{} 
 markup did get turned into quotation marks, chapter numbers were generated 
 and the rest of the markup was stripped out.
 
 Same behavior with both the TeXLive 2012 version of ConTeXt and a quite 
 recent beta.
 
 Up-to-date Ubuntu 12.04
 
 Linux Escherton 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012 
 i686 i686 i386 GNU/Linux
 
 What am I doing wrong?

You have to tag paragraphs with

\startparagraph
…
\stopparagraph

which are converted to p and /p otherwise you get br/ between paragraphs.

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] Epub woes

2012-11-15 Thread Bill Meahan

On 11/15/2012 02:24 PM, Wolfgang Schuster wrote:

You have to tag paragraphs with

\startparagraph
…
\stopparagraph

which are converted to p and /p otherwise you get br/ between paragraphs.

Wolfgang



Oh, my! I'll have to go back and change hundreds of paragraphs! :(

What about the chapter headings, mucked up metadata c? I am using 
\startchapter..\stopchapter already.


--
Bill Meahan
Westland, Michigan USA

___
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] Did usage of \expanded changed?

2012-05-11 Thread Peter Schorsch
Hi,

I reactivated some code that was working a year ago. But now it seems
that \expanded has no effect in my case (see below). I also tried it
with \normalexpanded and \expandedafter but both had also no effect. My
problem seems to be this line of the full example below:


\doifsomething\Paragraphmark{\expanded{\textreference[\Paragraphmark]{\fullheadnumber/\rawnumber[ParagraphNumber]}}}%

The error shows itself in the line:

Should be 1/1: \in[test] 

As \in[test] gives me 1/3 instead of 1/1. (1 was the number assigned to
the first paragraph - 3 is the acutal number).

Can someone tell me what I need to change?

Thanks in advanced
P.

-8---full example---

\unprotect

\definenumber[ParagraphNumber][way=bysection,prefixsegments=100]
 
\unexpanded\def\startParagraph
{\dosingleempty\dostartParagraph}
 
\def\dostartParagraph[#1]%
   {\getrawparameters[Paragraph][heading=,mark=,#1]%
\incrementnumber[ParagraphNumber]%
\ininner{\tfx\getnumber[ParagraphNumber]}%
\doifsomething\Paragraphheading{\inouter{\Paragraphheading}}%

\doifsomething\Paragraphmark{\expanded{\textreference[\Paragraphmark]{\fullheadnumber/\rawnumber[ParagraphNumber]}}}%
\ignorespaces}

\unexpanded\def\stopParagraph
{\blank[medium]}
\protect

\starttext

\chapter{Alter novom}

\startParagraph[heading={lorem ipsum},mark=test]
\input tufte
\stopParagraph

\startParagraph
\input tufte
\stopParagraph

\startParagraph
Should be 1/1: \in[test] 
\stopParagraph

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

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


[NTG-context] xml export with footnote

2012-04-03 Thread Matthew Claus
Greetings all,

The document element exported by this small example appears to be prematurely 
closed.

Removing either the footnote or the second chapter will hide the problem.

Do I have something wrong here?

Thanks,
Matt


\setupbackend[export=yes]

\starttext
\startchapter
  \startsection
\startparagraph
  \footnote{a footnote}
\stopparagraph
  \stopsection
\stopchapter

\startchapter
\stopchapter

\stoptext

mtx-context | current version: 2012.04.02 12:51

document language=en file=problem date=04/03/12 11:42:51 context=2012.04
.02 12:51 version=0.30 xmlns:m=http://www.w3.org/1998/Math/MathML;
  section detail=chapter location='aut:1'
sectionnumber1/sectionnumber
sectioncontent
  section detail=section location='aut:2'
sectionnumber1.1/sectionnumber
sectioncontent
  paragraphdescriptionsymbol detail=footnotesup1/sup/descript
ionsymbol/paragraph
  description detail=footnote
descriptiontagsup1/sup /descriptiontag
descriptioncontenta footnote/descriptioncontent
  /description
/sectioncontent
  /section
/sectioncontent
  /section
/document
section detail=chapter location='aut:4'
  sectionnumber2/sectionnumber
/section


___
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] epub

2012-02-16 Thread Wolfgang Schuster

Am 16.02.2012 um 16:19 schrieb Jörg Hagmann:

 This discussion was continued privately (my mistake). A summary:
 
 Thanks for the file, Luigi -- getting closer. Two problems left:
 
 1. I was using Calibre. Maybe I simply don't know how to use that programme. 
 Whereas a free epub book downloaded from the net opens as it should, the 
 files generated by myself and by you just show the unformatted text. With 
 Firefox it works.
 
 2. In Firefox: My version lacks the images; in fact, the figures showing up 
 in the OPS directory after the mtxrun have zero KB. But it is ok for me to 
 copy them there manually.

Isn’t the problem with context pub’s the format of the xhtml file, when I 
compile this example:

\setupbackend[export=yes,xhtml=yes]

\starttext

\startparagraph
The Earth, as a habitat for animal life, is in old age and
has a fatal illness. Several, in fact. It would be happening
whether humans had ever evolved or not. But our presence is
like the effect of an old|-|age patient who smokes many packs
of cigarettes per day – and we humans are the cigarettes.
\stopparagraph

\stoptext

I get a xhtml file with the following content (I removed the comments):

?xml version='1.0' encoding='UTF-8' standalone='yes' ?

document xmlns:m=http://www.w3.org/1998/Math/MathML; version=0.30 
language=en date=Thu Feb 16 20:00:31 2012 file=test context=2012.02.16 
17:54 xmlns:xhtml=http://www.w3.org/1999/xhtml;
  paragraphThe Earth, as a habitat for animal life, is in old age and has a 
fatal illness. Several, in fact. It would be happening whether humans had ever 
evolved or not. But our presence is like the effect of an old-age patient who 
smokes many packs of cigarettes per day – and we humans are the 
cigarettes./paragraph
/document

but the produced epub file doesn’t work on my ereader. After I changed the tags 
of the file to this:

?xml version='1.0' encoding='UTF-8' standalone='yes' ?

html xmlns=http://www.w3.org/1999/xhtml;
  body
pThe Earth, as a habitat for animal life, is in old age and has a fatal 
illness. Several, in fact. It would be happening whether humans had ever 
evolved or not. But our presence is like the effect of an old-age patient who 
smokes many packs of cigarettes per day – and we humans are the cigarettes./p
  /body
/html

I got now a epub file which renders on my ereader without problems.

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

2012-02-16 Thread Aditya Mahajan

On Thu, 16 Feb 2012, Wolfgang Schuster wrote:



Am 16.02.2012 um 16:19 schrieb Jörg Hagmann:


This discussion was continued privately (my mistake). A summary:

Thanks for the file, Luigi -- getting closer. Two problems left:

1. I was using Calibre. Maybe I simply don't know how to use that programme. 
Whereas a free epub book downloaded from the net opens as it should, the files 
generated by myself and by you just show the unformatted text. With Firefox it 
works.

2. In Firefox: My version lacks the images; in fact, the figures showing up in 
the OPS directory after the mtxrun have zero KB. But it is ok for me to copy 
them there manually.


Isn’t the problem with context pub’s the format of the xhtml file, when I 
compile this example:

\setupbackend[export=yes,xhtml=yes]

\starttext

\startparagraph
The Earth, as a habitat for animal life, is in old age and
has a fatal illness. Several, in fact. It would be happening
whether humans had ever evolved or not. But our presence is
like the effect of an old|-|age patient who smokes many packs
of cigarettes per day – and we humans are the cigarettes.
\stopparagraph

\stoptext

I get a xhtml file with the following content (I removed the comments):

?xml version='1.0' encoding='UTF-8' standalone='yes' ?

document xmlns:m=http://www.w3.org/1998/Math/MathML; version=0.30 language=en date=Thu Feb 16 20:00:31 
2012 file=test context=2012.02.16 17:54 xmlns:xhtml=http://www.w3.org/1999/xhtml;
 paragraphThe Earth, as a habitat for animal life, is in old age and has a fatal 
illness. Several, in fact. It would be happening whether humans had ever evolved or not. 
But our presence is like the effect of an old-age patient who smokes many packs of 
cigarettes per day – and we humans are the cigarettes./paragraph
/document

but the produced epub file doesn’t work on my ereader. After I changed the tags 
of the file to this:


You also need to add the appropriate css file (there is an example css 
file in $TEXMF/tex/context/base IIRC). Any epub reader that understands 
xml+css will be able to read the file.



?xml version='1.0' encoding='UTF-8' standalone='yes' ?

html xmlns=http://www.w3.org/1999/xhtml;
 body
   pThe Earth, as a habitat for animal life, is in old age and has a fatal illness. 
Several, in fact. It would be happening whether humans had ever evolved or not. But our 
presence is like the effect of an old-age patient who smokes many packs of cigarettes per 
day – and we humans are the cigarettes./p
 /body
/html

I got now a epub file which renders on my ereader without problems.


I do agree if the export tags were configurable. Something similar to 
multi-lingual interface, but for output rather than input.


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

Re: [NTG-context] epub

2012-02-16 Thread Wolfgang Schuster

Am 16.02.2012 um 20:38 schrieb Aditya Mahajan:

 On Thu, 16 Feb 2012, Wolfgang Schuster wrote:
 
 
 Am 16.02.2012 um 16:19 schrieb Jörg Hagmann:
 
 This discussion was continued privately (my mistake). A summary:
 
 Thanks for the file, Luigi -- getting closer. Two problems left:
 
 1. I was using Calibre. Maybe I simply don't know how to use that 
 programme. Whereas a free epub book downloaded from the net opens as it 
 should, the files generated by myself and by you just show the unformatted 
 text. With Firefox it works.
 
 2. In Firefox: My version lacks the images; in fact, the figures showing up 
 in the OPS directory after the mtxrun have zero KB. But it is ok for me to 
 copy them there manually.
 
 Isn’t the problem with context pub’s the format of the xhtml file, when I 
 compile this example:
 
 \setupbackend[export=yes,xhtml=yes]
 
 \starttext
 
 \startparagraph
 The Earth, as a habitat for animal life, is in old age and
 has a fatal illness. Several, in fact. It would be happening
 whether humans had ever evolved or not. But our presence is
 like the effect of an old|-|age patient who smokes many packs
 of cigarettes per day – and we humans are the cigarettes.
 \stopparagraph
 
 \stoptext
 
 I get a xhtml file with the following content (I removed the comments):
 
 ?xml version='1.0' encoding='UTF-8' standalone='yes' ?
 
 document xmlns:m=http://www.w3.org/1998/Math/MathML; version=0.30 
 language=en date=Thu Feb 16 20:00:31 2012 file=test 
 context=2012.02.16 17:54 xmlns:xhtml=http://www.w3.org/1999/xhtml;
 paragraphThe Earth, as a habitat for animal life, is in old age and has a 
 fatal illness. Several, in fact. It would be happening whether humans had 
 ever evolved or not. But our presence is like the effect of an old-age 
 patient who smokes many packs of cigarettes per day – and we humans are the 
 cigarettes./paragraph
 /document
 
 but the produced epub file doesn’t work on my ereader. After I changed the 
 tags of the file to this:
 
 You also need to add the appropriate css file (there is an example css file 
 in $TEXMF/tex/context/base IIRC). Any epub reader that understands xml+css 
 will be able to read the file.

I know the example file but I forgot to add it.

 ?xml version='1.0' encoding='UTF-8' standalone='yes' ?
 
 html xmlns=http://www.w3.org/1999/xhtml;
 body
   pThe Earth, as a habitat for animal life, is in old age and has a fatal 
 illness. Several, in fact. It would be happening whether humans had ever 
 evolved or not. But our presence is like the effect of an old-age patient 
 who smokes many packs of cigarettes per day – and we humans are the 
 cigarettes./p
 /body
 /html
 
 I got now a epub file which renders on my ereader without problems.
 
 I do agree if the export tags were configurable. Something similar to 
 multi-lingual interface, but for output rather than input.

You mean like labeltexts :)

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] export hanging

2012-01-26 Thread Matthew Claus
Hi everyone,

This minimal example causes my luatex process to spin consuming 100
percent cpu (latest minimals, freebsd 9):

\setupbackend[export=yes]

\starttext
hello world
\stoptext

To rule out any issue with FreeBSD 9, which is fairly recent, I
compiled my own luatex binary from the svn trunk but still experienced
the problem.

Adding \startparagraph and \stopparagraph also produced the same result,
but with slightly different output after interrupting the compilation
process. 

I've read this list for years but rarely post and would like to thank
everyone who contributes to this amazing project.

Thanks for any suggestions,
Matt


mtx-context | current version: 2012.01.25 14:16


[/usr/home/mclaus/wk/git/personal/tex] context hello.tex

mtx-context | run 1: luatex 
--fmt=/usr/home/mclaus/context/tex/texmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606/formats/cont-en
 
--lua=/usr/home/mclaus/context/tex/texmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606/formats/cont-en.lui
 --backend=pdf ./hello.tex \stoptext
This is LuaTeX, Version beta-0.70.1-2011051912 (rev 4277) 
 \write18 enabled.
(hello.tex

ConTeXt  ver: 2012.01.25 14:16 MKIV  fmt: 2012.1.26  int: english/english

system   cont-new.mkiv loaded
(/usr/home/mclaus/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system   beware: some patches loaded from cont-new.mkiv
)
system   hello.top loaded
(hello.top)
fontslatin modern fonts are not preloaded
languageslanguage en is active
backend  export  enabling export to xml
{/usr/home/mclaus/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown: library 'loc'
{/usr/home/mclaus/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/home/mclaus/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fontsfallback modern rm 12pt is loaded
backend  xmp  using file 
'/usr/home/mclaus/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pagesflushing realpage 1, userpage 1, subpage 1
^C! Interruption.

system   tex  error on line 1 in file hello.tex: Interruption ...

1   
2 \setu
pba[/usr/home/mclaus/wk/git/personal/tex] ckend[export=yes]
3 
4 \starttext
5 hello world
6 \stoptext
7 
8 

inserted text \dostoptagged 
  \finalizeautostructurelevels \global \everytop...
\dostoptext ...youtpage \page \the \everystoptext 
  \global \everystoptext \em...
l.1 \dostoptext
   
\ctxcommand ...\directlua \zerocount {commands.#1}
  
l.6 \stoptext
 
? 
! Emergency stop.

system   tex  error on line 1 in file hello.tex: Emergency stop ...

1   
2 \setupbackend[export=yes]
3 
4 \starttext
5 hello world
6 \stoptext
7 
8 

inserted text \dostoptagged 
  \finalizeautostructurelevels \global \everytop...
\dostoptext ...youtpage \page \the \everystoptext 
  \global \everystoptext \em...
l.1 \dostoptext
   
\ctxcommand ...\directlua \zerocount {commands.#1}
  
l.6 \stoptext
 
!  == Fatal error occurred, no output PDF file produced!




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