Re: [NTG-context] How to repeat the hyphen?

2019-03-25 Thread Alan Braslau
On Mon, 25 Mar 2019 22:24:34 -0700
Sam May  wrote:

> still using the ridiculously out-of-date 2016.05.17 because I haven't 
> gotten around to overriding the Gentoo package manager yet...

You can install the standalone Context distribution anywhere you want, in 
parallel with your OS package manager version. Both can very peacefully 
coexist. To select or use your standalone version, simply add its bin path 
(i.e. $CONTEXTROOT/tex/texmf-linux-64/bin) at the front of your PATH.

One strategy could be to keep a version of the standalone distribution in your 
project directory, even having multiple versions, one per project. This has the 
advantage that if one does not update the distribution it will always work with 
the project files, that is any future changes to Context will not affect the 
compiling of the project sources, for each project holds its own (frozen) 
version of Context.

In this case, your path can be:
export PATH=./context/tex/texmf-linux-64/bin:$PATH
so that it will select whatever is in the context subdirectory of the current 
directory.
(you can also use this PATH scheme adding a (soft)link in a project directory 
to whatever context distribution you like, or none, in which case it will 
fall-back on the system-installed texlive version.)

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] How to repeat the hyphen?

2019-03-25 Thread Sam May
Sounds like you've got it working, but just to provide an alternative 
that should* work, according to the sources:


 \setuplanguage[cz]
[compoundhyphen=-,%Or, to keep the \setuphyphenmark
 rightcompoundhyphen=-,%   configuration mentioned in Taco's link:
 leftcompoundhyphen=-]%`*compoundhyphen=\compoundhyphen`

That does require you to replace all the hyphens with `||`, which it 
understandably sounds like you want to avoid, but it can be good for 
someone like me who likes that explicit markup, or for someone who needs 
more control over which symbols go where (I'm using for Esperanto -- 
slightly non-standard -- a vertical tick mark for the inner-line and the 
left but the hyphen for the right).  The main benefit, though, is that 
you can do the same thing for line-breaking hyphenation if you need to 
change that, just drop the `compound` in the keys.


* I've been running into it working for the first break or two but than 
switching back to the default for the rest of the document, and haven't 
been able to track down why.  Though it might have something to do with 
me still using the ridiculously out-of-date 2016.05.17 because I haven't 
gotten around to overriding the Gentoo package manager yet...


Sam

On Fri, Mar 22, 2019 at 04:57:24PM +0100, Tomas Hala wrote:

Hi Taco,

this is exactly what I needed, thank you very much.

Fri, Mar 22, 2019 ve 04:16:20PM +0100 Taco Hoekwater napsal(a):
# Somewhat cleaner is to do it this way:
#   %%%
#   \definebreakpoints[czcompound]
#   \definebreakpoint[czcompound][-][nleft=3,nright=3,type=4]
#
#   \appendtoks
#\ifx\mylanguage\currentlanguage
#   \setbreakpoints[czcompound]
#\else
#   \resetbreakpoints
#\fi
#   \to\everylanguage
#
# It would be nice if that language= key would work, though (it is ignored, it 
seems)

I agree...

Best wishes,

Tomá??

# Taco
#
#
# > On 22 Mar 2019, at 15:38, Tomas Hala  wrote:
# >
# > Hi Taco,
# >
# > good idea, I tried it but the problem is that it does not switch itself off
# > automatically when the language is changed again.
# >
# > The following code works but I guess that must be some more sophisticated
# > ConTeXt way.
# >
# > Best wishes,
# >
# > Tomá??
# >
# >
# > %%
# > 
\def\myboxik#1#2{\start\setuphyphenation[cz][method=#1]\startframedtext[width=1dd]\hbox{{\bf#1}}\crlf#2\stopframedtext\stop\par}
# > 
\def\mybox#1{\myboxik{traditional}{#1}\myboxik{default}{#1}\myboxik{expanded}{#1}\myboxik{original}{#1}\myboxik{tex}{#1}\myboxik{hyphenate}{#1}\myboxik{none}{#1}\par\thinrule}
# >
# > \starttext
# > \definebreakpoints[czcompound]
# >
# > \let\oldlanguage=\language
# > \def\language[#1]{\oldlanguage[#1]
# >  \ifx\mylanguage\currentlanguage 
\definebreakpoint[czcompound][-][nleft=3,nright=3,type=4] 
\setbreakpoints[czcompound]
# >\else 
\definebreakpoint[czcompound][-][nleft=3,nright=3,type=1] 
\setbreakpoints[czcompound]
# >  \fi} and the same for \mainlanguage
# >
# > \def\mylanguage{cs}
# >
# > \language[en] \mybox{modro-zelený}
# > \language[cz] \mybox{modro-zelený}
# > \language[en] \mybox{modro-zelený}
# >
# > \stoptext
# > 
# >
# > Fri, Mar 22, 2019 ve 01:56:40PM +0100 Taco Hoekwater napsal(a):
# > # Hi Tomá??,
# > #
# > # Sorry but I do not know. I *do* know that you can do this:
# > #
# > #   \definebreakpoints [czcompound]
# > #   \definebreakpoint  [czcompound] [-] [nleft=3,nright=3,type=4]
# > #   \setbreakpoints[czcompound]
# > #
# > # And perhaps hook that into a language switch. Does that help?
# > #
# > #
# > #
# > # > On 22 Mar 2019, at 10:37, Tomas Hala  wrote:
# > # >
# > # > Hi,
# > # >
# > # > thanks, that's it. I did some tests and no side-effects appeared.
# > # > Moreover, it seems that it has no influence on \hyphentatedurl which is 
also ok.
# > # >
# > # > But only one point I do not understand -- when I used the key
# > # > language=cz, repeated hyphens disappeared. It would by fine if one
# > # > can set it only for the given language(s), eg. for cz+sk yes and for en 
no.
# > # > Is there any way for this?
# > # >
# > # > Best wishes,
# > # >
# > # > Tomá??
# > # >
# > # >
# > # > \definebreakpoint [compound] [-] [nleft=3,nright=3,type=4, language=cz]
# > # > \setbreakpoints[compound]
# > # >
# > # >
# > # > Thu, Mar 21, 2019 ve 04:45:49PM +0100 Taco Hoekwater napsal(a):
# > # > # Hi,
# > # > #
# > # > # \definebreakpoint [compound] [-] [nleft=3,nright=3,type=4]
# > # > # \setbreakpoints[compound]
# > # > #
# > # > # But also check the wiki, there can be side-effects to 
\setbreakpoints[compound]
# > # > #
# > # > #   https://wiki.contextgarden.net/Compound_words
# > # > #
# > # > #
# > # > # Best wishes,
# > # > # Taco
# > # > #
# > # > # > On 21 Mar 2019, at 16:23, Tomas Hala  wrote:
# > # > # >
# > # > # > Hi all,
# > # > # >
# > # > # > in composed words with hyphen inside (e.g. modro-zelený = 
blue-green), the
# > # > # > hyphen character must be repeated at the 

Re: [NTG-context] issue with symbol in attachments

2019-03-25 Thread Pablo Rodriguez
On 3/25/19 10:48 AM, Hans Hagen wrote:
> On 3/24/2019 6:47 PM, Pablo Rodriguez wrote:
>
>> Can anyone confirm that all attachment symbols are distorted, except the
>> first one?
> hard to say ... support for these symbols / icons in viewers has been an
> inconsistent mess right from the start and one has to keep adapting ...
> (scaling, positioning, decoupled representations, colors) ... a bit of a
> gamble

Many thanks for your reply, Hans.

I find suprising that /Rect entriess aren’t calculated the same way when
no dimension is specified. The following sample shows it:

\setupinteraction[state=start]
\setuppapersize[A9]
\starttext
\attachment[xml-mkiv.pdf]\\
\attachment[xml-mkiv.pdf]
[symbol=Pushpin]\\
\attachment[xml-mkiv.pdf]
[symbol=Default]\\
\stoptext

  /Rect [ 12.48609 117.54327 18.46039 123.51757 ]
  /Rect [ 12.48609 100.805667 54.306196 111.41602 ]
  /Rect [ 12.48609 88.58463 50.351209 97.11594 ]

Could it be possible that all /Rect entries for attachments are
calculated the same way (with a square of about 6×6), no matter which
symbol is used? At least, when no dimension is specified.

BTW, only one attachment is shown in each margin. It seems to be the
last one. I have just discovered it accidentally:

\setupinteraction[state=start]
\starttext
one\attachment[file=onandon, location=inmargin]

two (actually)\attachment[file=notnow, location=inmargin]%
\attachment[file=about, location=rightmargin]%
\attachment[file=onandon, location=leftmargin]%

three\attachment[file=notnow, location=rightmargin]%
\attachment[file=about, location=rightmargin]%
\attachment[file=onandon, location=rightmargin]%

four\attachment[file=about]\attachment[file=about]%
\attachment[file=about]\attachment[file=about]
\stoptext

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


Re: [NTG-context] optional hyphenation patterns in ancient Greek

2019-03-25 Thread Pablo Rodriguez
On 3/25/19 3:09 PM, Arthur Reutenauer wrote:
>   Dear Pablo,
>
>   Five months ago I sent you a private email with detailed explanations
> of how you can achieve that in ConTeXt.  I suggest you go through that
> first before we start talking about a new pattern set.  Here is the
> email, with a few updates (the paragraph quoted at the top is by
> myself).

Dear Arthur,

many thanks for your reply.

I read your original message when you sent it, but the issue with that
kind of hyphenation exceptions is that they are document-based (I had
used them before, for Spanish [and German, I think]).

This is why I asked for the discussion of a new pattern set.

But I didn’t know that ConTeXt doesn’t allow them. So, this has to be
solved before a different pattern set could make sense in ConTeXt.

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


Re: [NTG-context] optional hyphenation patterns in ancient Greek

2019-03-25 Thread Arthur Reutenauer
Dear Pablo,

  Five months ago I sent you a private email with detailed explanations
of how you can achieve that in ConTeXt.  I suggest you go through that
first before we start talking about a new pattern set.  Here is the
email, with a few updates (the paragraph quoted at the top is by
myself).


Date: Thu, 25 Oct 2018 15:05:17 +0200
From: Arthur Reutenauer 

>   In LuaTeX it’s now possible to inject patterns on the fly, at
> typesetting time. I admit to not knowing if ConTeXt has a special way to
> take advantage of that; it’s a simple command in pure LuaTeX.  It would
> also be necessary to change a few patterns in the current set, because
> they would interact badly with 2γ1μ.  More on that tomorrow.

  OK, so here goes.

  It is not possible to just use \patterns in the middle of a Mark IV
run, because Hans deactivates it (in lang-ini.mkiv) -- clearly a remnant
from Mark II, as in pdfTeX and XeTeX it would have resulted in an error;
in ConTeXt it just becomes a no-op, which thus shadows LuaTeX’s
behaviour that could actually have been useful.

  The situation in Mark IV is documented in languages-mkiv.pdf which is
part of the distribution: Hans rewrote the whole hyphenation routine in
Lua in 2014, and users can switch to it with

\setuphyphenation[method=traditional]

  The idea behind the name is apparently that the Lua code mimics the
“traditional” way implemented in the TeX engine, and Hans envisages that
other methods can be written in the future (but this hasn’t happened
yet).  The non-Lua method is on by default and can be chosen explicitly
with \setuphyphenation[method=default] but it is not possible to inject
new patterns that way because of the above.

  With the Lua method activated, it becomes possible to add patterns on
the fly with

\registerhyphenationpattern[agr][2γ1μ]

  Some care should be taken when adding patterns to an existing set, since
they can -- and in this case do -- interact with other patterns in the set.
Here, I’ve found that this row of patterns (l. 516 of the master file,
https://github.com/hyphenation/tex-hyphen/blob/82e5651/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-grc.tex#L516):

4γμ' 4γμ’ 4γμʼ 4γμ᾽ 4γμ᾿

needs to be overridden with patterns such as

γ2μ' γ2μ’ γ2μʼ γ2μ᾽ γ2μ᾿

otherwise the new pattern would allow breaks before the mu.

  The attached file puts everything together.


Best,

Arthur
\mainlanguage[agr]
\definefont[linuxlibertine][name:linlibertineo]
\starttext

\hsize=1pt

\linuxlibertine
πρᾶγμα πράγματος

\setuphyphenation[method=traditional]
\registerhyphenationpattern[agr][2γ1μ γ2μ’]

πρᾶγμα πράγματος

πραγμ’ ἄτος % Without the second pattern above, we get the incorrect break πραγ-μ’

\stoptext


add-patterns-on-the-fly.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] Incorrect offset when textframe is used inside TEXpage

2019-03-25 Thread Hans Hagen

On 3/24/2019 5:46 PM, Aditya Mahajan wrote:

Hi,

With the latest beta, the following example:

\definetextbackground
   [test]
   [
     location=paragraph,
   ]

\starttext
\startTEXpage[offset=5cm]
   \starttest
   \input knuth
   \stoptest
\stopTEXpage
\stoptext

gives the attached output.

Note that in the output the left and right offsets are zero. Any ideas 
why this is happening and how to fix that.
such backgrounda are normally operating in a (vertical) text flow while 
a texpage is basically a framed


\definetextbackground
  [test]
  [topoffset=1cm,
   bottomoffset=1cm,
   leftoffset=1cm,
   rightoffset=3cm,
   location=paragraph]

\starttext
\startTEXpage[offset=overlay]
  \vskip-\strutdepth
  \starttest
\input knuth
  \stoptest
\stopTEXpage
\stoptext



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

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


Re: [NTG-context] issue with symbol in attachments

2019-03-25 Thread Hans Hagen

On 3/24/2019 6:47 PM, Pablo Rodriguez wrote:


Can anyone confirm that all attachment symbols are distorted, except the
first one?
hard to say ... support for these symbols / icons in viewers has been an 
inconsistent mess right from the start and one has to keep adapting ... 
(scaling, positioning, decoupled representations, colors) ... a bit of a 
gamble


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
___