Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Henning Hraban Ramm

Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:

 On Tue, 17 Feb 2015, Hans Hagen wrote:
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
 div/class tagging. The last one is supposed to work on all devices as it 
 doesn't demands anything beyond css.
 
 The XML generated by ConTeXt is very well structured. So, an option is to 
 simply provide XLST stylesheets that transform ConTeXT-XML to 
 XHTML/HTML5/whatever.
 
 Such XLST transformation will be better than have ConTeXt chase a moving 
 target.

See e.g. http://wiki.contextgarden.net/Epub_Sample

I’ll try to update the pages about ConTeXt’s current export soon, since I have 
a new book in the pipeline.

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
___

[NTG-context] Placing a box with left-aligned lines on the right border

2015-02-18 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

how to more easily achieve this?:


Some text on line   Text in box
Longer text in the box
Shorter text in box

|--|
  Width of the box is
  that of the longest
  text in it

 ||
  Some space between the preceeding
  text and the box
|--|
  Text width available (\textwidth)


The solution should have the following features:

- Text in the box to be written at once with a token (be \\ or \par or 
another) to go to the next line;
- The box (wrapping Text in box, Longer text in the box, Shorter text in 
box) should have no width specified -
it should get it from the longest member (line) in it (in our case: width of 
Longer text in the box);
- Text in the box should be alignleft;
- Base line of first text the box to be vertically aligned to the base of the 
preceding text, i.e.
Some text on line to have the same basement as Text in box;
- A horizontal filler may be placed between Some text on line and the box to fit 
text width available.

Two ways that don't go to the goal, just to demonstrate my trials and fails:


\starttext

% 1

Some text on line\hfill Text in box\par
 \hfill Longer text in the box\par
 \hfill Shorter text in box\par

% 2

Some text on line\hfill\framed[width=5cm,align=flushleft,frame=off]
  {Text in box\\
   Longer text in the box\\
   Shorter text in box}

\stoptext


Way 1 - problems:

- The text to be boxed is not written in a box environment;
- the text to be boxed is not left-aligned in the box (as it actually is not in 
a box).

Way 2 - problems:

- The text in the box (\framed) must have width specified;
- the text in the box goes over the line where it is placed, not with first 
line basement aligned.

So - how to achieve the layout desired?

(Hint:

The situation may be imagined as the top of a letter page:

write some text to the left, fill with the maximum space till you reach the box 
for an address on the right of the current line;
write address lines left-aligned inside the box.)

Thank you for ideas in advance.

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

t3.mkiv
Description: Binary data


t3.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] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/17/2015 10:01 PM, Keith Schultz wrote:



Am 17.02.2015 um 21:16 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:

On 2/17/2015 8:24 AM, Keith J. Schultz wrote:

Hi Axel, All,



[snip, snip]

IMHO : ConTeXt should not output XHMTL for epub, but HMTL5.
Yes, yes, I know XHMTL is part of HMTL5.


And html 5 is just html with some extras (and assuming javascript i
guess) ... marketing.

The html 5 standard is far more. For one is makes flash, java and more
obsolete. Far more than a marketing gag!


well, if javascript is used instead it's still fluent ... every time i 
played with e.g. jquery or libraries i had to make sure i used the 
latest and had to adapt code .. there will be something new (and maybe 
even different) every decade (if only because that generates money)



Another question for me is if ConTeXt should also output code for
the iBooks epub format, (Basicaly epub, but some extras).


Isn't a book supposed to be independent and kind of portable + long
term visible? So no way that a context epub will be specific for a
device. (I probably can't even get it on / test it on my outdated ipad
1 anyway.)

I was thinking more along the line of the spine.


ah, direct neural injection ...


There are thing you can do in/with ConTeXt that would work with iBooks
that do not in „ordinary“ epub books.

Then, there is the Kindle format one might want to consider!


Another lock-in device.


Another, question which needs investigation is if the ConTeXt output for
epub,
also, implementing the fallbacks for missing features which is required?


Context outputs three varants: regular xml, xhtml, and stupified xhtml
with div/class tagging. The last one is supposed to work on all
devices as it doesn't demands anything beyond css.

If that is the case it is not very useful for a decent workflow. There
would be to much to
tweak to make good looking output.


i'm not sure what you have in mind but context is a typesetting system 
and as such cannot produce an epub simply because epub is a blob of xml 
(html) with a css packages in a zip



I have not investigated how it handles dimensions, widths, font sizes,
spacing, etc.


structure normally doesn't carry that information


These are important in order to create output that adjust proper to the
 devices capabilities.
One should avoid absolute values.


there are hardly any values output ... but one can of course extend the 
css with font and color directives, probably different from the ones 
used in the pdf



Of course if we want to emulate the printed output then we could simply
create a pdf or very page as pdf and put in an epub wrapper.


i've seen impressive examples of pdf turned html (huge html files btw)

(fyi: i see pdf and html as independent things)

(and i don't believe in reflow of pdf: it's either a design for made up 
pages or a flexible adaptive one as in html; and till now i never wished 
a paper book to reflow itself anyway but maybe if i really would use an 
epub device ... who knows ... i don't own ebooks currently as i cannot 
share docs freely then like i share books and i consider ebooks to be 
way too expensive for fun)


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
___

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/17/2015 11:37 PM, Aditya Mahajan wrote:

On Tue, 17 Feb 2015, Hans Hagen wrote:


Context outputs three varants: regular xml, xhtml, and stupified xhtml
with div/class tagging. The last one is supposed to work on all
devices as it doesn't demands anything beyond css.


The XML generated by ConTeXt is very well structured. So, an option is
to simply provide XLST stylesheets that transform ConTeXT-XML to
XHTML/HTML5/whatever.

Such XLST transformation will be better than have ConTeXt chase a moving
target.


indeed, and the context wiki can provide useful examples

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
___

Re: [NTG-context] on the t-ruby module

2015-02-18 Thread Wolfgang Schuster

 Am 18.02.2015 um 20:04 schrieb Pablo Rodriguez oi...@gmx.es:
 
 Hi Wolfgang,
 
 I have just discovered your t-ruby module.
 
 Many thanks for this module, which is extremely useful for interlinear
 translations.
 
 Here you have the sample:
 
 \usemodule[ruby]
 \defineruby[trans][textstyle=\it]
 
 \starttext
 \startTEXpage[offset=1em]
 \trans{The}{Der} \trans{sentence}{Satz}
 \trans{is}{ist} \trans{right}{richtig}.
 
 \blank[big]
 
 \trans{Der}{The} \trans{Satz}{sentence}
 \trans{ist}{is} \trans{richtig}{right}.
 \stopTEXpage
 \stoptext
 
 Is there no way that text above doen’t overlap?
 
 Sorry, I should be too sleepy, because the hang and overhang options
 don’t seem to work for me.

It’s a bug.

BTW: The following definition does what you want.

\define[2]\trans
  
{\dontleavehmode\framed[frame=off,offset=0pt,location=bottom,align=middle]{{\it 
#1}\\#2}}

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] on the t-ruby module

2015-02-18 Thread Wolfgang Schuster

 Am 18.02.2015 um 20:25 schrieb Wolfgang Schuster 
 schuster.wolfg...@gmail.com:
 
 
 Am 18.02.2015 um 20:04 schrieb Pablo Rodriguez oi...@gmx.es:
 
 Hi Wolfgang,
 
 I have just discovered your t-ruby module.
 
 Many thanks for this module, which is extremely useful for interlinear
 translations.
 
 Here you have the sample:
 
 \usemodule[ruby]
 \defineruby[trans][textstyle=\it]
 
 \starttext
 \startTEXpage[offset=1em]
 \trans{The}{Der} \trans{sentence}{Satz}
 \trans{is}{ist} \trans{right}{richtig}.
 
 \blank[big]
 
 \trans{Der}{The} \trans{Satz}{sentence}
 \trans{ist}{is} \trans{richtig}{right}.
 \stopTEXpage
 \stoptext
 
 Is there no way that text above doen’t overlap?
 
 Sorry, I should be too sleepy, because the hang and overhang options
 don’t seem to work for me.
 
 It’s a bug.

I have to correct myself, you can use „hang=none“ to avoid the overlapping 
texts in your case.

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] on the t-ruby module

2015-02-18 Thread Pablo Rodriguez
On 02/18/2015 08:36 PM, Wolfgang Schuster wrote:
 Am 18.02.2015 um 20:25 schrieb Wolfgang Schuster:
 Am 18.02.2015 um 20:04 schrieb Pablo Rodriguez:

 I have just discovered your t-ruby module.

 Many thanks for this module, which is extremely useful for interlinear
 translations.
 [...]
 Is there no way that text above doen’t overlap?

 Sorry, I should be too sleepy, because the hang and overhang options
 don’t seem to work for me.

 It’s a bug.
 
 I have to correct myself, you can use „hang=none“ to avoid the
 overlapping texts in your case.

Many thanks for your help, Wolfgang.


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

[NTG-context] on the t-ruby module

2015-02-18 Thread Pablo Rodriguez
Hi Wolfgang,

I have just discovered your t-ruby module.

Many thanks for this module, which is extremely useful for interlinear
translations.

Here you have the sample:

\usemodule[ruby]
\defineruby[trans][textstyle=\it]

\starttext
\startTEXpage[offset=1em]
\trans{The}{Der} \trans{sentence}{Satz}
\trans{is}{ist} \trans{right}{richtig}.

\blank[big]

\trans{Der}{The} \trans{Satz}{sentence}
\trans{ist}{is} \trans{richtig}{right}.
\stopTEXpage
\stoptext

Is there no way that text above doen’t overlap?

Sorry, I should be too sleepy, because the hang and overhang options
don’t seem to work for me.

Many thanks for your help,


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

[NTG-context] removing layers in empty pages

2015-02-18 Thread Pablo Rodriguez
Dear list,

I come with a different approach to the issue I had yesterday.

I have a sample:

\setuppapersize[A6]
\setuppagenumbering[alternative=doublesided, location=]
\setupexternalfigures[location=default]
\starttext

\dorecurse{5}{
\definelayer[spider][state=start]
\setlayer[spider]{\externalfigure[spider][scale=1500]}
\definelayer[cow][x=.8\paperwidth, y=.85\paperheight, state=continue]
\setlayer[cow]{\externalfigure[cow][scale=600]}
\setupbackgrounds[page][background={spider, cow}]
\blank[force,10em]\dorecurse{8}{\input zapf\par}\page[right]}
\stoptext

I have an issue that I cannot solve:

How can I remove layers from empty pages?

I know there is a state=stop, but I don’t know how to link this to
empty pages.

Many thanks for your help,


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

Re: [NTG-context] setupcite in mkiv to cite two references

2015-02-18 Thread Yu Zhang
Thanks Hans. These settings fixed my issues.

best
Yu

On Tue, Feb 10, 2015 at 10:02 AM, Hans Hagen pra...@wxs.nl wrote:

 On 2/9/2015 10:15 PM, Yu Zhang wrote:

 Hi list,

 I need some help about formatting citations in mkiv.

 What I want is something like [3, 4] if I put \cite[ref3,ref4]. However,
 what I actually get is [3 and 4]. This only happens if I put two
 references in \cite[].

 So, does anyone know how to replace 'and' with ', ' in my situation.


 Look in the publ-imp-apa.mkvi file and overload the num setting:

 pubsep={,},
 lastpubsep={,},
 finalpubsep={,}

 Alan and I are currently working on the publication subsystem and there
 will be an update soon. The configuration of these things will change a bit
 (so that one can easier mix several renderings in one document).

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

2015-02-18 Thread Alan Bowen
The following:

\starttext
Fate\index{Fate}
and
Destiny\seeindex{Destiny}{Fate}
\blank[3*big]
\placeindex
\stoptext

produces an entry for “Destiny” that reads:

*d*
Destiny
 Fate*see Fate*

If one comments out “Fate\index{Fate}”, the entry reads as it should:

*d*
Destiny
  *see Fate*

Is there a way to cross-reference an indexed term X that has only
*see X*
and not
X *see X*?

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] removing layers in empty pages

2015-02-18 Thread Wolfgang Schuster

 Am 18.02.2015 um 22:32 schrieb Pablo Rodriguez oi...@gmx.es:
 
 Dear list,
 
 I come with a different approach to the issue I had yesterday.
 
 I have a sample:
 
 \setuppapersize[A6]
 \setuppagenumbering[alternative=doublesided, location=]
 \setupexternalfigures[location=default]
 \starttext
 
 \dorecurse{5}{
 \definelayer[spider][state=start]
 \setlayer[spider]{\externalfigure[spider][scale=1500]}
 \definelayer[cow][x=.8\paperwidth, y=.85\paperheight, state=continue]
 \setlayer[cow]{\externalfigure[cow][scale=600]}
 \setupbackgrounds[page][background={spider, cow}]
 \blank[force,10em]\dorecurse{8}{\input zapf\par}\page[right]}
 \stoptext
 
 I have an issue that I cannot solve:
 
 How can I remove layers from empty pages?
 
 I know there is a state=stop, but I don’t know how to link this to
 empty pages.


Use \page[yes,blank,right] to move to a new right page, the blank keyword
disbles backgrounds and layers are placed as a background.

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 format Was: Re: Context to epub: itemize

2015-02-18 Thread Keith J. Schultz
Hi Hraban,

Good to know. I will investigate at another time and give feed back.
I am in the middle of moving, so I do not have much time.

We ought to think of making a export specific to epub in the long run!
 
regards
Keith.
 Am 18.02.2015 um 09:14 schrieb Henning Hraban Ramm te...@fiee.net:
 
 
 Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:
 
 On Tue, 17 Feb 2015, Hans Hagen wrote:
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
 div/class tagging. The last one is supposed to work on all devices as it 
 doesn't demands anything beyond css.
 
 The XML generated by ConTeXt is very well structured. So, an option is to 
 simply provide XLST stylesheets that transform ConTeXT-XML to 
 XHTML/HTML5/whatever.
 
 Such XLST transformation will be better than have ConTeXt chase a moving 
 target.
 
 See e.g. http://wiki.contextgarden.net/Epub_Sample
 
 I’ll try to update the pages about ConTeXt’s current export soon, since I 
 have a new book in the pipeline.
 
 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
 ___

___
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 format Was: Re: Context to epub: itemize

2015-02-18 Thread Henning Hraban Ramm

Am 2015-02-18 um 20:10 schrieb Keith J. Schultz keithjschu...@web.de:

 Hi Hraban,
 
 Good to know. I will investigate at another time and give feed back.
 I am in the middle of moving, so I do not have much time.
 
 We ought to think of making a export specific to epub in the long run!

For me, the regular export XML plus XSL conversion is the way to go; the „HTML“ 
is rather unusable.
The epub script is nice and all, it was important for me to get me running, but 
I guess I won’t use it in my final workflow.


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] Placing a box with left-aligned lines on the right border

2015-02-18 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

thank you - method 1 is exactly what I'm looking for.

Best regards,

Lukas

On Wed, 18 Feb 2015 14:58:49 +0100, Wolfgang Schuster 
schuster.wolfg...@gmail.com wrote:




Am 18.02.2015 um 11:45 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

Hello,

how to more easily achieve this?:


Some text on line   Text in box
   Longer text in the box
   Shorter text in box

   |--|
 Width of the box is
 that of the longest
 text in it

||
 Some space between the preceeding
 text and the box
|--|
 Text width available (\textwidth)


The solution should have the following features:

- Text in the box to be written at once with a token (be \\ or \par or 
another) to go to the next line;
- The box (wrapping Text in box, Longer text in the box, Shorter text in 
box) should have no width specified -
it should get it from the longest member (line) in it (in our case: width of 
Longer text in the box);
- Text in the box should be alignleft;
- Base line of first text the box to be vertically aligned to the base of the 
preceding text, i.e.
Some text on line to have the same basement as Text in box;
- A horizontal filler may be placed between Some text on line and the box to fit 
text width available.



Method 1 (frame based):

\starttext

Some text on line
\hfill
\startframed[width=fit,align=flushleft,frame=off,location=top]
Text in box\\
Longer text in the box\\
Shorter text in box
\stopframed

\stoptext


Method 2 (layer based):

\definelayer[letterhead][width=\textwidth]

\setupbackgrounds[text][background=letterhead]

\starttext

\setlayerframed
  [letterhead]
  [preset=lefttop]
  [offset=0pt,frame=off]
  {Some text on line}

\setlayerframed
  [letterhead]
  [preset=righttop]
  [offset=0pt,width=fit,align=flushleft,frame=off,location=top]
  {Text in box\\
   Longer text in the box\\
   Shorter text in box}

\blank[force,4*line]

\input knuth

\stoptext


Wolfgang



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

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

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

[NTG-context] textbackground within framedtext

2015-02-18 Thread Christoph Reller
Hi,

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

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

\starttext

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

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

\stoptext

Any feedback is welcome,

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

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

Re: [NTG-context] Placing a box with left-aligned lines on the right border

2015-02-18 Thread Wolfgang Schuster

 Am 18.02.2015 um 11:45 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
 l...@pontex.cz:
 
 Hello,
 
 how to more easily achieve this?:
 
 
 Some text on line   Text in box
Longer text in the box
Shorter text in box
 
|--|
  Width of the box is
  that of the longest
  text in it
 
 ||
  Some space between the preceeding
  text and the box
 |--|
  Text width available (\textwidth)
 
 
 The solution should have the following features:
 
 - Text in the box to be written at once with a token (be \\ or \par or 
 another) to go to the next line;
 - The box (wrapping Text in box, Longer text in the box, Shorter text in 
 box) should have no width specified -
   it should get it from the longest member (line) in it (in our case: 
 width of Longer text in the box);
 - Text in the box should be alignleft;
 - Base line of first text the box to be vertically aligned to the base of the 
 preceding text, i.e.
   Some text on line to have the same basement as Text in box;
 - A horizontal filler may be placed between Some text on line and the box 
 to fit text width available.
 
 Two ways that don't go to the goal, just to demonstrate my trials and fails:
 
 
 \starttext
 
 % 1
 
 Some text on line\hfill Text in box\par
 \hfill Longer text in the box\par
 \hfill Shorter text in box\par
 
 % 2
 
 Some text on line\hfill\framed[width=5cm,align=flushleft,frame=off]
  {Text in box\\
   Longer text in the box\\
   Shorter text in box}
 
 \stoptext
 
 
 Way 1 - problems:
 
 - The text to be boxed is not written in a box environment;
 - the text to be boxed is not left-aligned in the box (as it actually is not 
 in a box).
 
 Way 2 - problems:
 
 - The text in the box (\framed) must have width specified;
 - the text in the box goes over the line where it is placed, not with first 
 line basement aligned.
 
 So - how to achieve the layout desired?
 
 (Hint:
 
 The situation may be imagined as the top of a letter page:
 
 write some text to the left, fill with the maximum space till you reach 
 the box for an address on the right of the current line;
 write address lines left-aligned inside the box.)


Method 1 (frame based):

\starttext

Some text on line
\hfill
\startframed[width=fit,align=flushleft,frame=off,location=top]
Text in box\\
Longer text in the box\\
Shorter text in box
\stopframed

\stoptext


Method 2 (layer based):

\definelayer[letterhead][width=\textwidth]

\setupbackgrounds[text][background=letterhead]

\starttext

\setlayerframed
  [letterhead]
  [preset=lefttop]
  [offset=0pt,frame=off]
  {Some text on line}

\setlayerframed
  [letterhead]
  [preset=righttop]
  [offset=0pt,width=fit,align=flushleft,frame=off,location=top]
  {Text in box\\
   Longer text in the box\\
   Shorter text in box}

\blank[force,4*line]

\input knuth

\stoptext


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

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/18/2015 3:10 PM, Keith J. Schultz wrote:

Hi Hraban,

Good to know. I will investigate at another time and give feed back.
I am in the middle of moving, so I do not have much time.

We ought to think of making a export specific to epub in the long run!


The export is not really geared at that, as it's a representation of the 
rendering (although structured). The additional html output can be used 
for previewing and to what extend it's okay depends on the intended use.


Normally one starts from a neutral source (xml or tex) and then produces 
different output. So, for specific epub (or whatever) one can either 
start with the original code (xml) or manipulate what comes out of the 
export. The export is kind of standard so one can build all kind of 
scripts to convert it. There is no universal epub (rendering) solution, 
just as there is no universal pdf layout.


Of course the idea is that the default export is good enough for simple 
documents. What more gets provided depends on needs (and currently at 
least I have no need for epub other than a dedicated pdf suitable for 
displays).


Hans



regards
Keith.

Am 18.02.2015 um 09:14 schrieb Henning Hraban Ramm te...@fiee.net:


Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:


On Tue, 17 Feb 2015, Hans Hagen wrote:


Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
div/class tagging. The last one is supposed to work on all devices as it 
doesn't demands anything beyond css.


The XML generated by ConTeXt is very well structured. So, an option is to 
simply provide XLST stylesheets that transform ConTeXT-XML to 
XHTML/HTML5/whatever.

Such XLST transformation will be better than have ConTeXt chase a moving target.


See e.g. http://wiki.contextgarden.net/Epub_Sample

I’ll try to update the pages about ConTeXt’s current export soon, since I have 
a new book in the pipeline.

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
___


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