Re: [NTG-context] help with facing page image

2022-03-09 Thread śrīrāma via ntg-context
On Thursday, March 10, 2022 3:32 AM jbf via ntg-context wrote:
> Am endeavouring to explore Wolfgang's very 'elegant' solution to this 
> facing page challenge. The exploration has included a look at 
> base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where 
> I see immediately that the approach is experimental and where it says 
> also that 'probably more alternatives will be added'. I wonder if that 
> last phrase also includes the ability to manipulate the image(s) either 
> generally or in individual cases?
> 

The following example is based on Wolfgang's solution using injections: I have 
modified the setup slightly to hook into \externalfigure's {width, height, 
orientation} using user-variables. With this I think you can place any kind of 
image (portrait or landscape) correctly by using width, height, and rotation.

I picked up some images of cows, 'spider', 'hacker' and 'mill' and have them 
renamed as {chap-cover-1, ... chap-cover-6} for a total of 6 chapter images.

%%% start example
   \definepageinjectionalternative
   [chapter:image]
   [renderingsetup=pageinjection:chapter:image]

   \startsetups [pageinjection:chapter:image]
   \clip
  [width=\framedwidth,height=\framedheight]
  {\centerbox{%
 \externalfigure
[\dummyparameter{name}]
[%factor=,
 width=\structureuservariable{width},
 height=\structureuservariable{height},
 orientation=\structureuservariable{rotation}]%
  }}
   \stopsetups

   \definepageinjection
   [chapter:start]
   [empty]
   [page=left]

   \definepageinjection
   [chapter:insert]
   [previouspage]
   [alternative=chapter:image,
  pagestate=stop]

   \setuphead
   [chapter]
   [beforesection={\pageinjection[chapter:start]},
  
insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}]}]

   \setuphead
   [chapter]
   [beforesection={\pageinjection[chapter:start]},
  
insidesection={\pageinjection[chapter:insert][name={chap-cover-\namedheadnumber{chapter}}]}]


   \setuppagenumbering
   [alternative=doublesided]

   \setupexternalfigures
   [location=default]

   \starttext
  \startchapter [title={Mill}] [rotation=90,width=\paperheight]
  \dorecurse{7}{\samplefile{lorem}}
  \stopchapter

  \startchapter [title={Mill}] [rotation=-90,width=\paperheight]
  \dorecurse{11}{\samplefile{lorem}}
  \stopchapter

  \startchapter [title={Mill}] [rotation=-90,width=\paperheight]
  \dorecurse{7}{\samplefile{lorem}}
  \stopchapter

  \startchapter [title={Mill}] [rotation=90,width=\paperheight]
  \dorecurse{7}{\samplefile{lorem}}
  \stopchapter

  \startchapter [title={Mill}] [rotation=-45,width=\paperwidth]
  \dorecurse{11}{\samplefile{lorem}}
  \stopchapter

  \startchapter [title={Mill}] [height=\paperheight]
  \dorecurse{7}{\samplefile{lorem}}
  \stopchapter
   \stoptext
%%% end example

Sreeram


___
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] help with facing page image

2022-03-09 Thread jbf via ntg-context

If you mean

\setuphead

[chapter]

[beforesection={\pageinjection[chapter:start]},

insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}][name=\structureuservariable{scale}]}]

\starttext

\startchapter[title={My title}] [image=Chapter1.jpg][scale=500]

\setups[pageinjection:chapter:image]

\dorecurse{7}{\samplefile{lorem}}

\stopchapter

I tried that (and a few other combinations of the kind) but to no effect.

Julian

On 10/3/22 16:35, Aditya Mahajan via ntg-context wrote:

On Thu, 10 Mar 2022, jbf via ntg-context wrote:


Am endeavouring to explore Wolfgang's very 'elegant' solution to this
facing page challenge. The exploration has included a look at
base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where
I see immediately that the approach is experimental and where it says
also that 'probably more alternatives will be added'. I wonder if that
last phrase also includes the ability to manipulate the image(s) either
generally or in individual cases?

So, for example., say I need (and in fact I do!) to change some aspect
of individual images, e.g. I might want to scale=500, or fiddle with
width/height of a particular image. At the moment I cannot see a way of
doing this for each image. I wondered if the commented out setups in the
response to this question might be a clue, but so far haven't been able
to get that to have any effect.

Couldn't you just pass scale as a key-value parameter, similar to how `name` is 
passed in Wolfgang's solution?

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] help with facing page image

2022-03-09 Thread Aditya Mahajan via ntg-context
On Thu, 10 Mar 2022, jbf via ntg-context wrote:

> Am endeavouring to explore Wolfgang's very 'elegant' solution to this 
> facing page challenge. The exploration has included a look at 
> base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where 
> I see immediately that the approach is experimental and where it says 
> also that 'probably more alternatives will be added'. I wonder if that 
> last phrase also includes the ability to manipulate the image(s) either 
> generally or in individual cases?
> 
> So, for example., say I need (and in fact I do!) to change some aspect 
> of individual images, e.g. I might want to scale=500, or fiddle with 
> width/height of a particular image. At the moment I cannot see a way of 
> doing this for each image. I wondered if the commented out setups in the 
> response to this question might be a clue, but so far haven't been able 
> to get that to have any effect.

Couldn't you just pass scale as a key-value parameter, similar to how `name` is 
passed in Wolfgang's solution?

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] help with facing page image

2022-03-09 Thread jbf via ntg-context
Am endeavouring to explore Wolfgang's very 'elegant' solution to this 
facing page challenge. The exploration has included a look at 
base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where 
I see immediately that the approach is experimental and where it says 
also that 'probably more alternatives will be added'. I wonder if that 
last phrase also includes the ability to manipulate the image(s) either 
generally or in individual cases?


So, for example., say I need (and in fact I do!) to change some aspect 
of individual images, e.g. I might want to scale=500, or fiddle with 
width/height of a particular image. At the moment I cannot see a way of 
doing this for each image. I wondered if the commented out setups in the 
response to this question might be a clue, but so far haven't been able 
to get that to have any effect.


Julian

On 8/3/22 05:35, Wolfgang Schuster wrote:

jbf via ntg-context schrieb am 07.03.2022 um 09:27:
Appreciate your assistance. I'll do my best with what you offer here. 
Of course, I've always said these images are at the beginning, not 
"the end of their respective chapters" and I've already indicated how 
the images are named, simply as Chapter1.jpg  and so on, so I'll need 
to work around these differences in your example. But with trial and 
error, let's hope I get there!


The example below uses a different mechanism to add images at the 
start of a chapter. In the example you have to pass the name of image 
as userdata argument of \startchapter but in the commented \setuphead 
setting you can see how this can be automated.


 begin example
% \definepageinjectionalternative
%   [chapter:image]
%   [renderingsetup=pageinjection:chapter:image]
%
% \startsetups [pageinjection:chapter:image]
%   \clip
% [width=\framedwidth,height=\framedheight]
% {\centerbox{\externalfigure[\dummyparameter{name}][factor=min]}}
% \stopsetups

\definepageinjection
  [chapter:start]
  [empty]
  [page=left]

\definepageinjection
  [chapter:insert]
  [previouspage]
  [%alternative=chapter:image,
   pagestate=stop]

\setuphead
  [chapter]
  [beforesection={\pageinjection[chapter:start]},
insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}]}] 



% \setuphead
%   [chapter]
%   [beforesection={\pageinjection[chapter:start]},
% 
insidesection={\pageinjection[chapter:insert][name={chapter\namedheadnumber{chapter}}]}]


\setuppagenumbering
  [alternative=doublesided]

\setupexternalfigures
  [location=default]

\starttext

\startchapter [title={Mill}] [image=mill]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\startchapter [title={Mill}] [image=mill]
\dorecurse{11}{\samplefile{lorem}}
\stopchapter

\startchapter [title={Mill}] [image=mill]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\stoptext
 end example

Wolfgang


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

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


Re: [NTG-context] "Flushbottom" / \setupalign[line] in LMTX

2022-03-09 Thread Denis Maier via ntg-context
I forgot to include the link to my original question: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg98171.html

Von: Maier, Denis Christian (UB)
Gesendet: Mittwoch, 9. März 2022 17:51
An: 'mailing list for ConTeXt users' 
Betreff: "Flushbottom" / \setupalign[line] in LMTX

Hi everyone,

a quick follow-up to todays monthly meeting: A couple of months ago I ran into 
issues getting "flushbottom" typesetting right. See:

Today, some of these issues seem to have been fixed. But I still have the 
impression that vertical glue is still not working completely reliable. Below 
are a couple of examples.

While the second example seems to work ok with \setupalign[height] the last 
line differs if we have different font size, cf. e.g. page 3 and 4.

Best,
Denis

% From the Wiki : https://wiki.contextgarden.net/Flush_bottom %%
\setupalign[line]

\def\Par{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}
\def\Fig{\placefigure{A figure.}{\framed{\vbox to 5cm{bla
\def\Tab{\placetable{A table.}{\framed{\vbox to 5cm{bla
\starttext
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\stoptext
%%%

% Another Example %%%
\setuppapersize[A5][A5]
\showframe
\setupalign[line]
% \setupalign[height]
\setupdelimitedtext[blockquote]
   [
   before={\setupindenting[yes]\tfx\setupinterlinespace},
   spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]

\starttext

\subject{asdf}

\dorecurse{5}{

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

\input ward

\subject{asdf}

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

}

\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] "Flushbottom" / \setupalign[line] in LMTX

2022-03-09 Thread Denis Maier via ntg-context
Hi everyone,

a quick follow-up to todays monthly meeting: A couple of months ago I ran into 
issues getting "flushbottom" typesetting right. See:

Today, some of these issues seem to have been fixed. But I still have the 
impression that vertical glue is still not working completely reliable. Below 
are a couple of examples.

While the second example seems to work ok with \setupalign[height] the last 
line differs if we have different font size, cf. e.g. page 3 and 4.

Best,
Denis

% From the Wiki : https://wiki.contextgarden.net/Flush_bottom %%
\setupalign[line]

\def\Par{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}
\def\Fig{\placefigure{A figure.}{\framed{\vbox to 5cm{bla
\def\Tab{\placetable{A table.}{\framed{\vbox to 5cm{bla
\starttext
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\section{Section}\Par\Par\Par\Fig\Par\Par\par\Par\par\Tab
\Par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\par\Par\Par\Par\Par\Par
\stoptext
%%%

% Another Example %%%
\setuppapersize[A5][A5]
\showframe
\setupalign[line]
% \setupalign[height]
\setupdelimitedtext[blockquote]
   [
   before={\setupindenting[yes]\tfx\setupinterlinespace},
   spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]

\starttext

\subject{asdf}

\dorecurse{5}{

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

\input ward

\subject{asdf}

\input knuth

\startblockquote
\input ward
\stopblockquote

\input knuth

}

\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] Few quick questions

2022-03-09 Thread Hans Hagen via ntg-context

On 3/9/2022 5:26 PM, Christoph Hintermüller via ntg-context wrote:

Ok replaced everything i could find with \start* \stop* pairs which got
me far down the document just the last about 4 pages.

The only thing when comparing with examples for using exporter which
still differs is that i use blank line in my sources. Does this
implicit definition of paragraphs cause any hickups in exporter and
would it be adviseable to enclose each paragraph in \startparagraph and
\stopparagraph? Or should that be no issue for xmlexporter and would
ensuring clean recent install be more efficient in this case.

normally there is no need to mark paragraphs

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Few quick questions

2022-03-09 Thread Christoph Hintermüller via ntg-context
Ok replaced everything i could find with \start* \stop* pairs which got
me far down the document just the last about 4 pages.

The only thing when comparing with examples for using exporter which
still differs is that i use blank line in my sources. Does this
implicit definition of paragraphs cause any hickups in exporter and
would it be adviseable to enclose each paragraph in \startparagraph and
\stopparagraph? Or should that be no issue for xmlexporter and would
ensuring clean recent install be more efficient in this case.

Best
Xristoph



___
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] Regular online meet-up

2022-03-09 Thread Henning Hraban Ramm via ntg-context

That’s NOW, BTW. ;)

Am 06.03.22 um 13:28 schrieb Henning Hraban Ramm via ntg-context:

You’re invited to join next *Wednesday*, March 9th, 15:00 CET (UTC+1)
(Beware, we changed the weekday!)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans will probably give a Q session again – please announce subjects 
you’d like to discuss ASAP, so that he can prepare.



(Same blurb as every time:)

[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the 
audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button. Beware 
there is only one presenter, so don’t kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), 
call +49-6151-86275-22 (German landline); then you must enter a PIN that 
changes every time – if you need it, ask me for it via email. 
Mute/unmute your microphone with "0".


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

See you, Hraban

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

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


Re: [NTG-context] Few quick questions

2022-03-09 Thread Christoph Hintermüller via ntg-context

Sorry for multi posting. Had yesterday a problem with my mail system
and was not sure if mail was sent at all.


On Tue, 2022-03-08 at 21:26 +0100, Marco Patzer via ntg-context wrote:
> On Tue, 08 Mar 2022 20:45:17 +0100
> Christoph Hintermüller via ntg-context  wrote:
> 
> > Hans indicated a tool, a program, which allows to verify that that
> > all start* stop* tag pairs are symmetric and placed in correct
> > order. I just cant remember how it is called. Can anybody help
> > here?
> 
>   mtxrun --autogenerate --script check 
> 


Thank you very much. If there is not any other tool it seems that there
are no errors.


> The following will not report missing tags but will find other
> common issues and report them on the console:
> 
>   context --errors='*' 


I guess this is equal to

\enabledirectives[logs.errors]

With which only the following error on plain pdf is remaining after
fixing any other indicated

error logging   > start possible issues

fonts   > start missing characters:
/usr/local/texlive/2021/texmf-dist/fonts/opentype/public/lm/lmroman12-
regular.otf
fonts   >2  U+1START OF HEADING
fonts   > stop missing characters

error logging   > stop possible issues



OK, I guess I figured the cause of why xml export aborts in the middle
of the document. It came to me while writing the above lines and
wanting to report that i see some warnings about fuzzy paragraphs
(forget about them).

To make it short it triggered a memory about a rather old thread, where
Hans mentioned that the exporter is not so fond of and keen about LaTeX
style \chapter, \section commands and that he advises to use
\startchapter \stopchapter, \startsection \stopsection, etc. pairs
instead. So i gave it a try and exchanged all occurrences of \chapter,
\section, \subsection, \subsection by their \start* \stop* equivalents
and now the xml document and the html document are a lot largen. They
now conatin nearly the whole document. 

There are sill plenty of LaTeX style commands around in the document
for which exporter friendly \start* \stop* replacements exist. I will
continue this route and 'am comfident that in the end  will get get a
full xhtml and true e-book for my lecture notes.
:-)

Thank you very much for triggering memories.

Christoph


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

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