[NTG-context] Typesetting Markdown - Part 8

2020-04-27 Thread Thangalin
Hi folks!

Second last part in the series. The project, product, component, and
environment relations were a bit finicky. Those willing to point out
improvements that can be made---Hans, Taco, Wolfgang, Aditya, and
others---would be very much appreciated.

Specifically, it seems that some project environment settings can be
overruled inside products, but other project settings cannot. It's not
really clear to me whether this is due to dependency order or that
definitions cannot be redefined across environments. Thoughts?

https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/

Stay safe!
___
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] Typesetting Markdown - Part 8

2020-04-28 Thread Thangalin
Jan-Erik, after you have installed all the required software (and
fonts!) and unzipped the book.zip and themes.zip archives, you can
build a book using:

cd $HOME/dev/writing/book
./build -V -c -y -i jekyll-hyde -d standard-ebooks/jekyll-hyde \
-b robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde

This is noted at the bottom of the preamble section.

Enjoy!

On Tue, Apr 28, 2020 at 7:12 AM Jan-Erik Hägglöf
 wrote:
>
> Is there a running example ? I’m not sure how to fill in the commandline
>
>
>
> 28 apr. 2020 kl. 09:33 skrev Henning Hraban Ramm :
>
> Yes, the naming is completely up to you.
>
> I use:
>
> project_something.tex
> env_something.tex
> prd_oneissue.tex
> c_onechapter.tex
>
> That’s also what my script supports as default:
> https://github.com/fiee/tools/blob/master/contextproject.py
>
>
> ___
> 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] Typesetting Markdown - Part 8

2020-04-28 Thread Thangalin
Hi Jan,

> 1. Nameing and organizing the project, product and environments files. I
> am currently reorganising the files for my cooperative. I think that
> besides some nameing conventions it is more or less up to me how I
> organise our print work. Any recommendations welcome.

Download "themes.zip" from the blog post. It shows some naming
conventions and relationships between projects, products,
environments, and components.

> books. What I am looking for is a script to extract all XML tags/tokens
> from their files to have a complete list of things that should be
> handled in a ConTeXt style file. Five years ago I tried to create such a
> style file by hand, but I gave up.

XSL was designed specifically to parse XML. ConTeXt has facilities for
mapping XML tokens, as you've used. Depending on the complexity of
what you're trying to accomplish, take a look at "book.zip" from the
blog post. Inside you'll find "se2md.xsl"; a similar approach could
work for TEI: put the complexity of parsing TEI into XSL, then use
ConTeXt to typeset the resulting 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] image across 2 page spread

2020-04-29 Thread Thangalin
Would something like this work?

\setupbackgrounds[page][
  background={BookIllustrationLayer},
]

\definelayer[BookIllustrationLayer][
  width=\paperwidth,
  height=.5\paperheight,
  y=.5\paperheight,
  position=no,
  repeat=no,
]

  \setlayer[BookIllustrationLayer]{%
\clip[x=\doifelseoddpage{2}{1}]{%
  \externalfigure[filename][
width=2\paperwidth,
height=.5\paperheight]%
}%
  }%

On Wed, Apr 29, 2020 at 5:05 PM jbf  wrote:
>
> Hi list,
>
> With 99% of work complete on a book, including single page images, I now find 
> myself confronted with a final problem: how to run one image across facing 
> pages or in other words, one image (plus its caption) across a two-page 
> spread, such that there is no gap.
>
> I have tried a number of fairly crass attempts (obviously too simple) to see 
> if I could get somewhere near what I want, e.g.
>
> \externalfigure[plate12.jpg][width=\paperwidth, height=.7\paperheight, 
> frame=none] {\tfx \sc Plates 12, 13. \tfx Twenty trucks from the Netherlands 
> setting off}
>
> \externalfigure[plate13.jpg][width=\paperwidth, height=.7\paperheight, 
> frame=none] {\tfx for their first mission amongst the German diaspora.}
>
> My thinking here was that \paperwidth might help extend the image to the 
> inner edge on the left-hand page, but it doesn't work that way for the 
> right-hand page, since there it extends to the outer edge, not the inner 
> edge! The .7\paperheight was to provide room for the caption. But all in all, 
> this is no solution!
>
> If it is any help, the setup dimensions for the book are US Digest:
>
> \definepapersize
>   [ACN][width=5.5in,height=8.5in] %  w140mm x h216mm
>
> I then looked up how one might do it in LaTeX, and found the following link: 
> https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right
>
> How much of that would be transferable to ConTeXt? (I am thinking 
> particularly of the \newcommand*{\twopagepicture}[4] bit.
>
> There are explanations for how to do this in InDesign, and since it is 
> something someone might often want to do (e.g. in magazines), I also thought 
> it might be easier to find reference to it on Contextgarden, yet haven't 
> found anything there. But I am sure ConTeXt has a way to do this.
>
> Could someone point me in the right direction with this please?
>
> Julian
>
> ___
> 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] Blank page added after pagecolumns

2020-05-10 Thread Thangalin
Bump.

See also: https://tex.stackexchange.com/q/542993/2148

On Mon, May 4, 2020 at 11:46 AM Joey McCollum
 wrote:
>
> After continuing to look into this a bit, I noticed that a similar issue 
> involving the insertion of a blank page after a columnset environment has 
> been discussed on the mailing list in the thread "Blank page inserted when 
> text reaches column's end" (dated 08 Dec 2019). In that thread, a proposed 
> solution was to redefine the \page_grd_stop macro found in page-cst.mkiv as 
> follows:
>
> ```
> \unprotect
> \def\page_grd_stop{%
>   \endgraf % needed, else wrong vsize in one par case
>   \vfill % otherwise weird \placenotes[endnotes]
>   \page_grd_command_set_vsize % needed
>   \penalty\c_page_otr_eject_penalty
>   %\page_grd_command_flush_page
>   \page_otr_fill_and_eject_page
>   \page_grd_command_set_vsize % why here
>   \egroup
>   \page_otr_command_set_vsize
>   \page_otr_command_set_hsize
> }
> \protect
> ```
>
> Unfortunately, this approach was found to have potential issues in that 
> thread, and it does not fix the problem with pagecolumns in my MWE. Are 
> pagecolumns commands aliased to pagegrid commands like columnset commands 
> are, or are they defined somewhere else? I checked page-col.mkiv, but it 
> seems to be too short to be the file that defines pagecolumns behavior.
>
> Joey
>
> On Sat, May 2, 2020 at 11:46 AM Joey McCollum  
> wrote:
>>
>> I recently found the pagecolumns manual 
>> (http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in several 
>> of the examples (including those for side floats and footnotes), the 
>> addition of a blank page after the end of the pagecolumns environment also 
>> seems to occur. So when the manual says, "We always start at a new page and 
>> end on a new one," does it mean that this is a feature of pagecolumns? And 
>> if so, is there any way to disable it? I have no problem with a page break 
>> after the end of the pagecolumns environment, but an empty page added after 
>> the break seems unnecessary. I checked for a wiki page on the 
>> \definepagecolumns command to get more information on its accepted inputs, 
>> but there doesn't appear to be a page for this command.
>>
>> Joey
>>
>> On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum  
>> wrote:
>>>
>>> I am typesetting a document using pagecolumns to ensure that my footnotes 
>>> are set ragged-bottom in columns. I have observed some unexpected behavior 
>>> whenever the last column on a page is left incomplete: a blank page is 
>>> added at the end of the document. A minimal working example follows:
>>>
>>> ```
>>>
>>> \starttext
>>>
>>> \startpagecolumns[n=2]
>>>
>>> \dorecurse{3}{\par\input zapf}
>>>
>>> \stoppagecolumns
>>>
>>> \stoptext
>>>
>>> ```
>>>
>>> I typeset this using ConTeXt version 2020.03.10, as released with TeXLive 
>>> 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or 
>>> \dorecurse{6} (so that the text ends in the first column of a page), then 
>>> there is no problem. I have tried to fix this by specifying page=no in the 
>>> \startpagecolumns arguments, but it did not change anything. Is there 
>>> something else I am missing?
>>>
>>> Thank you,
>>>
>>> Joey
>
> ___
> 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
___


[NTG-context] Inkscape command line arguments have changed

2020-05-19 Thread Thangalin
$ inkscape --version
Inkscape 1.0 (4035a4fb49, 2020-05-01)
Pango version: 1.44.7

With the new release of Inkscape, --export-pdf no longer exists. The
new options appear to be:

  --export=type=pdf
  --export=pdf-version=1.5 (or 1.4)
  --export-filename=filename.pdf

Aditya has shown a work-around on TeX.SE. I've changed the code a little:

\startluacode
figures.programs.inkscape={
  command="inkscape",
  pdfargument=[[
"%oldname%"
--export-dpi=600
--export=type=pdf
--export-filename="%newname%"
  ]],
  pngargument=[[
"%oldname%"
--export-dpi=600
--export=type=png
--export-filename="%newname%"
  ]],
}
\stopluacode

Unfortunately, this does override outdated command line argument.
ConTeXt appears to pass in the old argument:

context --purgeall --trackers=graphics.conversion filename.tex

Shows:

Unknown option --export-pdf=images/m_k_i_v_genealogy.svg.pdf

How would you replace the export-pdf option for the new version of Inkscape?

(I'll send a bug to the Inkscape issue tracker; it strikes me that
--export-pdf could have remained an alias.)

Thank you!
___
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] Inkscape command line arguments have changed

2020-05-19 Thread Thangalin
Minor correction:

\startluacode
figures.programs.inkscape={
  command="inkscape",
  pdfargument=[[
"%oldname%"
--export-dpi=600
--export-type=pdf
--export-filename="%newname%"
  ]],
  pngargument=[[
"%oldname%"
--export-dpi=600
--export-type=png
--export-filename="%newname%"
  ]],
}
\stopluacode

Still doesn't work, though. ConTeXt persists with using --export-pdf=...
Cheers!
___
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] Inkscape command line arguments have changed

2020-05-19 Thread Thangalin
As a work around, rename /usr/bin/inkscape to new-inkscape, such as:

# mv /usr/bin/inkscape /usr/bin/new-inkscape

Then change /usr/bin/inkscape to intercept and replace the command
line argument:

#!/usr/bin/env bash
/usr/bin/new-inkscape \
  $(echo "$@" | sed 's/--export-pdf/--export-type=pdf --export-filename/')

Then make sure the shell script is executable:

chmod +x /usr/bin/inkscape

This produces the expected results:

graphics> inclusion > checking conversion of 'genealogy-sm',
fullname 'images/genealogy-sm.svg', old format 'svg', new format
'pdf', conversion 'default', resolution 'default', arguments ''
graphics> inclusion > converting 'genealogy-sm'
('images/genealogy-sm.svg') from 'svg' to 'pdf'
graphics> inclusion > new graphic, using hash
'images/m_k_i_v_genealogy-sm.svg.pdf->1->crop->->->default->default->default'

Stay safe everybody.
___
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] ConTeXt, KeenWrite, Markdown, and XHTML

2021-03-06 Thread Thangalin
How would you convert the first class attribute of XHTML div elements
to ConTeXt LMTX-specific start/stop environments?

For example:



Whose woods these are I think I know.


And miles to go before I sleep.



Becomes (the equivalent of?):

\startpoem
\startstanza
Whose woods these are I think I know.
\stopstanza
\startstanza
And miles to go before I sleep.
\stopstanza
\stoppoem

In case this is an XY problem, background details follow. In a
nutshell: convert a processed Markdown file that includes interpolated
variables, arbitrary classes, and output from R functions into a
format that ConTeXt can typeset.

Background Details

Pandoc's fenced div syntax is now supported by my text editor,
allowing users to write "paragraph classes" in Markdown, such as:

::: {.poem .dark}
::: stanza
Whose woods these are I think I know.
:::
:::

This gets converted to XHTML (as shown above), which is to be rendered
using ConTeXt LMTX. Rendering via ConTeXt needs the following tool
chain:

Editor (.md) -> run Pandoc (.tex) -> run ConTeXt (.pdf)

Generating XHTML means Pandoc can be removed, simplifying the chain:

Editor (.md -> magic -> .xhtml) -> run ConTeXt (.pdf)

The Lua code to generate start/stop environments with Pandoc is
described in Part 8 of my Typesetting Markdown series.

https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/#annotations

The XML-MKIV documentation shows how to map a specific setup to a
particular attribute:

\xmlsetsetup{demo}{resource[@type='figure']}{xml:demo:figure}

In Schmitz' XHTML-oriented My Way from 2010 there's a getmeas Lua
function defined on page 9 that parses a width attribute. That's great
for the opening div, but how would you close/stop the correct
environment for nested divs? Would ConTeXt automatically track these
on a stack, for example?

Additional Ideas

Given that the text editor converts Markdown to XHTML and has an XSLT
engine, the following is possible:

Editor (.md -> .xhtml) -> XSLT (.tex) -> run ConTeXt (.pdf)

Piping XHTML directly into ConTeXt would be ideal, though. Well,
piping CommonMark plus fenced div extensions to ConTeXt would be
optimal, but my understanding is that support isn't quite there yet.

Aditya wrote a Markdown filter that runs:

pandoc -t context -o \externalfilteroutputfile\space \externalfilterinputfile

This still needs Pandoc, though.

There's also a dependency-free Markdown module. A few problems though.
First, the module isn't ported to ConTeXt LMTX, yet? Second, it
doesn't support element attributes beyond enabling content slicing.
(Third, the module has LaTeX support tightly bundled within, which
bloats a pure ConTeXt solution.)

Related Links

https://dl.contextgarden.net/myway/tas/xhtml.pdf
https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf
https://github.com/DaveJarvis/keenwrite#screenshots
https://github.com/adityam/filter/blob/master/README.md
https://mirror.its.dal.ca/ctan/macros/generic/markdown/markdown.html#header-attributes
https://github.com/Witiko/markdown/
___
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] SVG images inside XML setups

2021-03-08 Thread Thangalin
Here's a fairly minimal example showing an issue, using ConTeXt LMTX.
Save the following as "main.tex":

% SOF
\startbuffer[document]

\stopbuffer

\startbuffer[csvg]
http://www.w3.org/2000/svg";>


\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{body|img}{xml:*}
\stopxmlsetups

\startxmlsetups xml:body
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:img
  \placefigure{}{\externalfigure[\xmlatt{#1}{src}][conversion=mp]}
  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\starttext
  \xmlprocessbuffer{xhtml}{document}{}

  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\externalfigure[diagram.svg][conversion=mp]}
\stoptext
% EOF

Save the contents of "\startbuffer[csvg]" to a file named
"circle.svg", to create a valid, external SVG file.

Copy "circle.svg" to a file named "diagram.svg" to create a second
valid, external SVG file.

Run: context main.tex

Expected

All the SVG images appear.

Actual

Figures 1, 2, and 4 show only the following text:

\includesvgfile[circle.svg]\resetbuffer[svg-circle-inclusion]

In contrast, consider the following document:

% SOF
\startbuffer[csvg]
http://www.w3.org/2000/svg";>


\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[csvg][conversion=mp]}
  \placefigure{}{\externalfigure[circle.svg][conversion=mp]}
  \placefigure{}{\externalfigure[diagram.svg][conversion=mp]}
\stoptext
% EOF

All the images appear as expected.

Any idea why using XML setups appears to affect the behaviour of
rendering SVG documents using MetaPost?

Thank you!
___
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] SVG images inside XML setups

2021-03-09 Thread Thangalin
Thanks, Hans.

The image is now rendered. Here's a picture of the output from ConTeXt
(left) and the expected output using Apache Batik:

https://i.ibb.co/zPqfhjK/metapost-svg.png

Would a copy of the SVG file be useful for unit testing?

Thanks again.

> I probably need to add that wrapper in a few spots but in general if you
> can use that in case of issues. It has to do with catcodes, chicken and
> eggs.
___
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] Build fails on fresh installs

2021-03-20 Thread Thangalin
VirtualBox 6.1.18 + ConTeXt
Perform OS installations using defaults and the following values:

   - Set regular username to: username
   - Set guest computer name to: computer

Use ConTeXt binaries appropriate for OS:

   - FreeBSD -
   http://lmtx.pragma-ade.nl/install-lmtx/context-freebsd-amd64.zip
   - Xubuntu/Debian -
   http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip

ConTeXt version 2021.03.20 01:07. See questions at the end.

Instructions
After an OS is installed, complete the following steps:

   1. Start VirtualBox
   2. Install ISO
   3. Log in as root
   4. Open a terminal
   5. Install wget
   6. Install gcc
   7. Install Guest Additions (to enable copy/paste between guest/host)
   8. Log in as username
   9. Open a terminal
   10. mkdir context
   11. cd context
   12. Download OS-specific ConTeXt binary
   13. unzip *zip
   14. sh install.sh
   15. Export PATH environment variable (OS-specific; see below)
   16. context --version
   17. mkdir -p ../tex
   18. cd ../tex
   19. Create "hello.tex": \starttext Hello \stoptext
   20. context hello.tex
   21. Stop VirtualBox

Expected
A hello.pdf file is created.

Actual
Build fails.

resolvers   > lua > loading file
'/home/username/context/tex/texmf-context/tex/context/base/mkxl/spac-hor.lmt'
succeeded
tex error   > tex error on line 25 in file spac-hor.mkxl: Undefined
control sequence
 \bitwiseflip \normalizelinemode \flattendiscretionariescode
The control sequence at the end of the top line of your error message was
never \def'ed. You can just continue as I'll forget about whatever was
undefined.
...
mtx-context | error, no format found with name: cont-en, aborting

Debian 10.8.0

   -
   
https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.8.0-amd64-xfce.iso

Additional instructions:

   - usermod -aG sudo username
   - apt install wget gcc
   - export PATH=/home/username/context/tex/texmf-linux-64/bin:$PATH

Xubuntu 20.04.2

   -
   
http://mirror.us.leaseweb.net/ubuntu-cdimage/xubuntu/releases/20.04/release/xubuntu-20.04.2.0-desktop-amd64.iso

Additional instructions:

   - usermod -aG sudo username
   - apt install wget gcc
   - export PATH=/home/username/context/tex/texmf-linux-64/bin:$PATH

FreeBSD 12.2

   -
   
https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.2/FreeBSD-12.2-RELEASE-amd64-dvd1.iso.xz

Additional instructions:

   - pkg install security/sudo
   - pkg install wget gcc xor slim xfce
   - pw group mod wheel -m username
   - visudo (add username to sudoers)
   - export PATH=/home/username/context/tex/texmf-freebsd-amd64/bin:$PATH

Are there additional requirements that must be installed? If so, what are
they and is there a way for ConTeXt itself to list them for the user?

Thank you!
___
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] Radial gradient stops in SVG images

2021-03-28 Thread Thangalin
In the latest release, SVG radial gradients appear to apply colour stops as
solid black. Removing the  elements produces a solid colour, but
without a radial gradient.

Hans may be aware of the issue. Meanwhile, here's an MWE.

Save as gradient.svg:


http://www.w3.org/2000/svg"; viewBox="0 0 215.9 279.4"
height="1056" width="816">


Save as gradient.tex:

% SOF
\starttext
  \placefigure{}{\externalfigure[gradient.svg][conversion=mp]}
\stoptext
% EOF

Expected: A light-brown, translucent, radial gradient region appears on the
page.

Actual: A solid, opaque, black region appears on the page.

Environment:

Xubuntu Linux 5.8.0-48 (clean install on VirtualBox)
ConTeXt version 2021.03.27 19:09

Cheers!
___
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] Output result to specified file path

2021-03-29 Thread Thangalin
How do you set the target output path and file name? Consider:

% SOF
\starttext
  Hello
\stoptext
% EOF

Save as $HOME/test.tex and then:

mkdir /tmp/subdir
context --result=/tmp/subdir/test.pdf $HOME/test.tex

Expected: PDF file is created in /tmp/subdir directory.

Actual: PDF file is created in $HOME directory.

Version: 2021.03.27 19:09

Thank you!
___
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] Output result to specified file path

2021-03-30 Thread Thangalin
>From https://wiki.contextgarden.net/Run_scripts

context --jit prd_${PRD} --result=_pdf/$RESULT --mode=$MOD

Does this mean the example is incorrect? Or did it once work and the
behaviour has since changed? Or is it that relative directories are fine
but absolute paths won't work?

Let me know and I'll update the wiki with the correct behaviour.
___
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] Combine purgeall and result options

2021-03-30 Thread Thangalin
Given test.tex:

% SOF
\starttext
Guten abend
\stoptext
% EOF

Run: context --puregeall --result=out.pdf test.tex

Expected: All .tuc and .log files are deleted.

Actual: out.log and out.tuc are not deleted.

Context version: 2021.03.27 19:09

Cheers!
___
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] Combine purgeall and result options

2021-03-30 Thread Thangalin
Typo, sorry list! Please ignore. Works as expected.

On Tue, Mar 30, 2021 at 7:02 PM Thangalin  wrote:

> Given test.tex:
>
> % SOF
> \starttext
> Guten abend
> \stoptext
> % EOF
>
> Run: context --puregeall --result=out.pdf test.tex
>
> Expected: All .tuc and .log files are deleted.
>
> Actual: out.log and out.tuc are not deleted.
>
> Context version: 2021.03.27 19:09
>
> Cheers!
>
___
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] KeenWrite + ConTeXt: a sneak peek

2021-03-31 Thread Thangalin
Hi all!

Here's a screenshot showing a PDF file created using ConTeXt, exported from
my text editor, KeenWrite:

https://ibb.co/SNg19Sn

Notice the areas highlighted with rounded red rectangles:

* Export PDF button (top-left)
* Exported file name and ConTeXt processing time (lower-left)
* Settings for the --path option (preferences dialog, top)
* Settings for the --environment option (preferences dialog, bottom)
* Document stats (lower-right)

The app has a preview tab that is updated in real-time, which can be
repositioned or closed and is shown to the left. Shown on the right is the
PDF document generated using ConTeXt by clicking the export PDF button.

App screenshots: https://github.com/DaveJarvis/keenwrite#screenshots

Thoughts? Ideas for ConTeXt integration features?

P.S.
Thank you for all the hard work that has gone into ConTeXt: it's truly a
splendid piece of software to use.
___
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] Ligature suppression word list

2021-04-03 Thread Thangalin
A starting list of English non-ligatures:

https://english.stackexchange.com/a/50957/22099

The entire SE thread has additional resources and is quite informative.
___
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] SVG comments, transparency, and extended font styles

2021-04-03 Thread Thangalin
Issues encountered with version 2021.03.31 18:04.

1. Comments in SVG

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg";>

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Black circle, no border, comment lines ignored.
Actual: Empty square.

2. Transparent stroke

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg"; version="1.1">


\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Light cyan rectangle, no border (it's transparent).
Actual: Light cyan rectangle with visible border.

3. Inkscape font specification

We discussed this previously: Inkscape extends the SVG specification with a
custom style class ("-inkscape-font-specification") that allows its users
to refine font styles.

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg"; viewBox="0 0 154.6 19.3"
width="155" height="19">Roboto
Ultra-Light
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: "Roboto Ultra-Light" appears in Roboto Ultra-Light font.
Actual: Empty square.

Supporting this via MetaPost would help maintain backwards compatibility
(with ConTeXt invoking Inkscape).

Thank you!
___
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] Ligature suppression word list

2021-04-03 Thread Thangalin
Untested. Lists are not subject to copyright, so public domain should be
legal, even though SE posts are CC-BY-SA. When a word has a single suffix
or prefix (e.g., safflower/s), the two words are listed together, rather
than using an explicit suffix/prefix section.

return {
name   = "english",
version= "1.00",
comment= "English ligature suppression",
author = "Mico Loretan, Dave Jarvis, & Hans Hagen",
copyright  = "Public domain",
options= {
{
actions = {
["|"] = "noligature"
},
words = [[
]],
},
{
patterns = {
fi  = "f|i",
fl  = "f|l",
},
words = [[
-- f|i
deafish
dwarfish
elfish
oafish
selfish
serfish
unselfish
wolfish

-- f|l
beefless
briefless
hoofless
leafless
roofless
selfless
turfless
]],
suffixes = [[
ness
ly
]],
},
{
patterns = {
fi  = "f|i",
},
words = [[
proofing
]],
prefixes = [[
air-
child-
fire-
flame-
moth-
rust-
sound-
water-
weather-
]],
},
{
patterns = {
ff  = "f|f",
fi  = "f|i",
fl  = "f|l",
ffi = "f|fi",
ffl = "f|fl",
},
words = [[
-- f|f
bookshelfful
mantelshelfful
shelfful

-- f|i
elfin

chafing
leafing
loafing
sheafing
strafing
vouchsafing
beefing
reefing
briefing
debriefing
coifing
fifing
jackknifing
knifing
midwifing
waifing
wifing

goofing
hoofing
roofing
reroofing
spoofing
whoofing
woofing

gulfing
begulfing
engulfing
ingulfing
golfing
gulfing
rolfing
selfing
wolfing
barfing
bedwarfing
dwarfing
enserfing
kerfing
scarfing
snarfing
surfing
windsurfing
turfing
wharfing

beefier
comfier
goofier
gulfier
leafier
surfier
turfier
beefiest
comfiest
goofiest
gulfiest
leafiest
surfiest
turfiest

beefily
goofily
goofiness

-- f|l
aloofly
briefly
chiefly
deafly
liefly

calflike
dwarflike
elflike
gulflike
hooflike
leaflike
rooflike
serflike
sheaflike
shelflike
surflike
turflike
waiflike
wolflike

halflife
shelflife
halfline
roofline

leaflet
leaflets
leafleted
leafleting
leafletting
leafletted
leafleteer

pdflatex

-- f|fi
chaffinch
wolffish

-- f|fl
safflower
safflowers
]],
},
{
patterns = {
ffi = "ff|i",
},
words = [[
-- ff|i
cuffing
]],
prefixes = [[
hand
un
]],
},
{
patterns = {
ffi = "ff|i",
},
words = [[
-- ff|i
feoffing
]],
  

Re: [NTG-context] SVG comments, transparency, and extended font styles

2021-04-03 Thread Thangalin
A bug report exists for the -inkscape-font-specification issue:

https://bugs.launchpad.net/inkscape/+bug/1324809

I've migrated it, so hopefully it'll get some traction:

https://gitlab.com/inkscape/inbox/-/issues/4704

It'd be nice to support that particular extension; however, the reason for
not supporting it is sound. It sucks because end users don't care about
such technical minutiae and can't readily unravel such font discrepancy
issues when encountered.
TX
___
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] Set luatex cache directory path

2021-04-05 Thread Thangalin
Peter Münster once asked:

> What should I do please, to prevent ConTeXt from creating
$HOME/luatex-cache?

I'd like to do the same:

$ cd $HOME
$ ls luatex-cache
ls: cannot access 'luatex-cache': No such file or directory
$ context test.tex
$ ls luatex-cache/
context
$ rm -rf luatex-cache
$ export TEXMFCACHE=/tmp
$ context test.tex
mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
$ export TEXMFCACHE=
$ context --version
...
mtx-context | current version: 2021.03.31 18:04

What environment variable must change to set the luatex-cache directory?

Thank you!
___
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] Set luatex cache directory path

2021-04-06 Thread Thangalin
Thanks Aditya.

What do you think of changing the default luatex-cache directory to the
system's temporary directory? Consider:

   - The $HOME directory is sacrosanct (4784 people agree:
   https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1575053)
   - The temp directory is cleared on Linux (Unix?) system reboots; purged
   during regular Windows upkeep
   - The temp directory is writable by default
   - Changing the location requires calling an additional program, which
   isn't obvious (principle of least astonishment)

My text editor invokes ConTeXt like:

if( TYPESETTER.canRun() ) {
  env.put( "TEXMFCACHE", System.getProperty( "java.io.tmpdir" ) );

  mArgs.add( TYPESETTER.getName() );
  mArgs.add( .. --path .. --purge .. --batch .. --result ..
--environment .. etc. );
  mArgs.add( inputFilename );
}

The first line ensures that "context" is an executable located in a PATH
directory. The second line attempts to change the luatex-cache directory.
The remaining lines configure the command-line arguments prior to running
ConTeXt.

Fearing flaming wrath from users, an additional mtxrun call is required,
which incurs overhead:

   - Check for mtxrun executable
   - Run mtxrun each time

This would work but feels like a leaky abstraction (i.e., the context
executable should honour TEXMFCACHE without needing to invoke mtxrun
because context creates the luatex-cache directory).

Thoughts?
___
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] Set luatex cache directory path

2021-04-06 Thread Thangalin
Perfect, thank you.

Will be Wikified.
___
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] Set luatex cache directory path

2021-04-10 Thread Thangalin
Are two runs always required to generate a PDF when TEXMFCACHE is set?

$ sudo su -
$ mkdir -p /opt/context
$ cd /opt/context
$ wget http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip
$ unzip *zip
$ sh install.sh
$ exit
$ cat test.tex
\starttext
Test
\stoptext
$ export TEXMFCACHE=/tmp
$ rm -rf $TEXMFCACHE/luatex-cache
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
mtx-context --autopdf test.tex
...
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --script context --version
mtx-context | current version: 2021.04.10 17:09
$ mtxrun --autogenerate --script mtx-context --autopdf test.tex
...
mkiv lua stats  > runtime: 0.432 seconds, 1 processed pages, 1 shipped
pages, 2.315 pages/second
system  | total runtime: 3.318 seconds of 3.372 seconds

The first run fails; the second run succeeds.

If TEXMFCACHE is not set, then the first run succeeds. If TEXMFCACHE is set
to any non-empty value and $TEXMFCACHE/luatex-cache has not been created,
mtxrun always terminates with the same unknown script error.

What am I missing to ensure that ConTeXt will create luatex-cache in /tmp
when TEXMFCACHE is set and successfully build the PDF on first run?

Thank you!
___
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] Set luatex cache directory path

2021-04-11 Thread Thangalin
$ sudo su -
$ rm -rf /opt/context
$ mkdir -p /opt/context
$ cd /opt/context
$ wget http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip
$ unzip *zip
$ export TEXMFCACHE=/tmp
$ sh install.sh
$ exit
$ cat test.tex
\starttext
Test
\stoptext
$ export TEXMFCACHE=/tmp
$ sudo rm -rf /tmp/luatex-cache
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
mtx-context --autopdf test.tex
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'

If the cache directory isn't deleted, the PDF is generated. However, as
soon as the computer reboots, or the temporary directory is otherwise
erased, two runs are required.

I've addressed this in my code, but it's a little awkward and somewhat
brittle because the code cannot know what makes for a valid luatex-cache
directory:

private boolean reinitialize() {
  // variable assignments ... exists = check for luatex-cache directory

  mArgs.clear();
  mArgs.add( TYPESETTER.getName() );

  if( exists ) {
mArgs.add( "--autogenerate" );
mArgs.add( "--script" );
mArgs.add( "mtx-context" );
mArgs.add( ... remaining args ... );
  }
  else {
mArgs.add( "--generate" );
  }

  return exists;
}

private boolean typeset() throws Exception {
  return reinitialize() ? call() : call() && reinitialize() && call();
}

// Invoke ConTeXt to either typeset the document or generate the cache
directory
public Boolean call() throws Exception {
  final var builder = new ProcessBuilder( mArgs );
  builder.directory( mDirectory.toFile() );

  final var cacheDir = getCacheDir();
  final var env = builder.environment();
  env.put( "TEXMFCACHE", cacheDir.toString() );

  builder.redirectOutput( DISCARD );
  builder.redirectError( DISCARD );

  final var process = builder.start();
  process.waitFor();
  final var exit = process.exitValue();
  process.destroy();
  return exit == 0;
}

Also, unless my application installs ConTeXt, setting the TEXMFCACHE
directory before the installation begins will require asking users to do
this. Ideally, using the software would take the following steps:

1. Download text editor
2. Download and install ConTeXt (e.g., click link, extract archive, run
install.sh)
3. Run text editor
4. Export PDF (editor configures ConTeXt as required, reducing the number
of steps for end users)

At some point in the future, the editor may prompt the user for permission
to install ConTeXt on their behalf---to simplify step 2---but that's much
more effort.

Stay safe!
___
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] SVG stroked path colours

2021-04-14 Thread Thangalin
A regression?

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg"; width="179" height="126" viewBox="0
0 134 94">
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Green box, black outline.

Actual: Green box, no outline.

I believe the borders were drawn in the previous version.

Current version: 2021.04.14 22:58

Thank you!
___
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] SVG transparent stroke shown

2021-05-06 Thread Thangalin
Hi again!

% SOF\startbuffer[svg]

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: No border around the outer white box, border around the inner
green box.

Actual: Border around both boxes.

Version: 2021.05.06

Additional details: The SVG is generated using GraphViz, which adds a white
box as the background with a transparent border. The GraphViz is being
invoked over a rest API. Even if the binary has a setting to change the
border colour, that setting probably isn't accessible via HTTP POST.
___
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] Hyphen collapsing

2021-05-06 Thread Thangalin
Not sure if this is a regression:

% SOF
\nohyphencollapsing

\setuphead[chapter][align={nothyphenated}]

\starttext
  \chapter{Such --- Emdashery}
\stoptext
% EOF

Expected: No collapsed hyphens.

Actual: Hyphens are collapsed.

Workaround: Remove the nothyphenated option or insert \nohyphencollapsing
into the \chapter command.

Is there another way to prevent collapsing hyphens with a single setting
that applies to the entire document?

The hyphens did not collapse in the previous version.

Current version: 2021.05.06
___
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] Hyphen collapsing

2021-05-07 Thread Thangalin
 \setuphead[chapter][align={nothyphenated,notcollapsed}]
Would that mean there's no way to collapse the hyphenation throughout the
entire document from a single location? That is:

\nohyphencollapsing
\setuphead[section][align={nothyphenated,notcollapsed}]
\setuphead[subsection][align={nothyphenated,notcollapsed}]
\setuphead[subsubsection][align={nothyphenated,notcollapsed}]

Would "\nohyphencollapsing[head=yes]" allow the setting to apply once to
all areas?

Thank you!
___
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] Update setpath to set the path

2021-05-09 Thread Thangalin
Thoughts on updating the setpath.bat file to persist setting the path?

Here's an updated version that sets the system environment variable while
preserving the existing unexpanded PATH value:

rem SOF
echo off
set OWNPATH=%~dp0
set PLATFORM=mswin

if defined ProgramFiles(x86)set PLATFORM=win64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64"  set PLATFORM=win64
if exist "%OWNPATH%tex\texmf-mswin\bin\context.exe" set PLATFORM=mswin
if exist "%OWNPATH%tex\texmf-win64\bin\context.exe" set PLATFORM=win64

echo %PATH% | findstr "texmf-%PLATFORM%" > nul

rem Only update the PATH if not previously updated
if ERRORLEVEL 1 (
  set Key="HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment"
  set "CurrPath="
  for /F "USEBACKQ tokens=2*" %%A in (`reg query %%Key%% /v PATH`) do (
if not "%%~B" == "" (
  rem Preserve the existing PATH
  echo %%B > currpath.txt

  rem Update the current session
  set PATH=%PATH%;%OWNPATH%tex\texmf-%PLATFORM%\bin

  rem Change the PATH environment variable
  setx PATH "%%B;%OWNPATH%tex\texmf-%PLATFORM%\bin" /M
)
  )
)
rem EOF

Another possibility would be to define CONTEXT_HOME as an unexpanded value
added to both the system environment variables and  the PATH variable. For
example (haven't tried it):

setx CONTEXT_HOME "%OWNPATH%tex\texmf-%PLATFORM%\bin"
setx PATH "%%B;%%CONTEXT_HOME%%"

The advantage with this pattern is that subsequent updates need only check
for CONTEXT_HOME and change its value without having to worry about PATH
parsing, which can be hairy.

Yet another option to consider is changing the value for only the existing
user, rather than system-wide. Perhaps two different batch files?

The reason for this change is because the Windows installation instructions
(on the wiki) are incomplete: technically, the user must run setpath.bat
for each new session. This implies that any third-party program that wants
to make use of ConTeXt on Windows would have to communicate said fact to
the user, or let the user set the full path to ConTeXt within the
third-party program. Both of these can be avoided by persisting the PATH
setting across sessions.

Thank you!

P.S.
Pasted: https://pastebin.com/qpsqXZNB
___
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] Update setpath to set the path

2021-05-09 Thread Thangalin
Here's a version that persits the current user's PATH (i.e., not
system-wide):

rem SOF
@echo off
set "OWNPATH=%~dp0"
set "PLATFORM=mswin"

if defined ProgramFiles(x86)set "PLATFORM=win64"
if "%PROCESSOR_ARCHITECTURE%"=="AMD64"  set "PLATFORM=win64"
if exist "%OWNPATH%tex\texmf-mswin\bin\context.exe" set "PLATFORM=mswin"
if exist "%OWNPATH%tex\texmf-win64\bin\context.exe" set "PLATFORM=win64"

set "TeXPath=%OWNPATH%tex\texmf-%PLATFORM%\bin"

echo %PATH% | findstr "texmf-%PLATFORM%" > nul

rem Only update the PATH if not previously updated
if ERRORLEVEL 1 (
  setlocal enabledelayedexpansion
  set "Exists=false"
  set "Key=HKCU\Environment"

  for /F "USEBACKQ tokens=2*" %%A in (`reg query %%Key%% /v PATH 2^>nul`)
do (
if not "%%~B" == "" (
  set "Exists=true"

  rem Preserve the existing PATH
  echo %%B > currpath.txt

  rem Change the PATH environment variable
  setx PATH "%%B;%TeXPath%"
)
  )

  rem The user-defined PATH does not exist, create it
  if "!Exists!" == "false" (
rem Change the user PATH environment variable
setx PATH "%TeXPath%"
  )

  endlocal

  rem Update the current session
  set "PATH=%PATH%;%TeXPath%"
)
rem EOF
___
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] KeenWrite 2.0

2021-05-09 Thread Thangalin
Happy to announce that invoking ConTeXt from KeenWrite is now possible.

Here's a screenshot showing three different PDFs compiled from the same
plain text document:

https://github.com/DaveJarvis/keenwrite/blob/master/docs/screenshots.md#pdf-themes

Here are the installation instructions for ConTeXt (basically, make sure
that the "context" executable can be found in the system PATH):

https://github.com/DaveJarvis/keenwrite/blob/master/docs/typesetting.md

KeenWrite downloads:

https://github.com/DaveJarvis/keenwrite#download

Stay safe everyone!
___
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] Update setpath to set the path

2021-05-10 Thread Thangalin
> One of the benefits of context minimals is that you can install multiple
> versions in parallel, which allows the user to update frequently without
> the risk of breaking something for long-term projects. Specifically, you
> can keep a "frozen" version of context for long-term projects and install a
> newer version in parallel for newer projects.
>

For sure! My environment looks as follows:

export CONTEXT_HOME=/opt/context
export PATH="$PATH:...:$CONTEXT_HOME/tex/texmf-linux-64/bin:..."

The /opt/context directory is a symbolic link, which eases switching
between versions: I seldom have to change the environment variables
settings.

So, your suggestions should be included as a separate script and not as
> part of the default. Then there is the question of providing an uninstall
> script as well...
>

Using a ConTeXt-specific environment variable (e.g., LMTX_HOME) would make
uninstalling a matter of removing it from the PATH and registry (on
Windows, anyway). Here are the current instructions:

https://github.com/DaveJarvis/keenwrite/blob/master/docs/typesetting.md#windows

Is there a way we can eliminate steps 3 - 6 for Windows installs?
___
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] KeenWrite 2.0

2021-05-10 Thread Thangalin
Thanks Floris.

https://github.com/DaveJarvis/keenwrite#other

That's a known issue due to Java's transition to a modular architecture. It
means that a third-party library is using reflection to access behaviour in
a Java class that was designed to be off-limits. Starting from Java 9,
these types of reflection calls have been deprecated. In this particular
case, it's fine, but this third-party library needs to be updated soon.

Cheers!

On Mon, May 10, 2021 at 2:47 AM Floris van Manen  wrote:

>
>
> On 10/05/2021 07:40, Thangalin wrote:
> > https://github.com/DaveJarvis/keenwrite#download
> > <https://github.com/DaveJarvis/keenwrite#download>
> >
> > Stay safe everyone!
>
>
> When launching from
>
> Linux vmz 5.11.0-7614-generic #15~1618626693~20.10~ecb25cd-Ubuntu SMP
> Thu Apr 22 16:00:45 UTC  x86_64 x86_64 x86_64 GNU/Linux
>
> I get a warning:
>
> $ keenwrite.bin
> OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated
> and will be removed in a future release.
>
>
>
> ___
> 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] KeenWrite 2.0

2021-05-10 Thread Thangalin
Running from the command-line requires the full edition of Liberica JDK,
which includes JavaFX. See:

https://github.com/DaveJarvis/keenwrite#other
https://bell-sw.com/pages/downloads/?version=java-16

Other OpenJDK versions do not include JavaFX. (JavaFX can be installed
separately for other OpenJDK versions, but it's a bit of a pain.) The
decision to remove JavaFX from the default Java distribution kind of pulled
the rug out from under a number of projects.

https://dave.autonoma.ca/blog/2020/06/29/write-once-build-anywhere/

Cheers!

On Mon, May 10, 2021 at 5:34 AM Hans Hagen  wrote:

> On 5/10/2021 11:46 AM, Floris van Manen wrote:
> >
> >
> > On 10/05/2021 07:40, Thangalin wrote:
> >> https://github.com/DaveJarvis/keenwrite#download
> >> <https://github.com/DaveJarvis/keenwrite#download>
> >>
> >> Stay safe everyone!
> >
> >
> > When launching from
> >
> > Linux vmz 5.11.0-7614-generic #15~1618626693~20.10~ecb25cd-Ubuntu SMP
> > Thu Apr 22 16:00:45 UTC  x86_64 x86_64 x86_64 GNU/Linux
> >
> > I get a warning:
> >
> > $ keenwrite.bin
> > OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated
> > and will be removed in a future release.
> on windoes:
>
>  >java.exe --illegal-access=permit -jar keenwrite.jar
> OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated
> and will be removed in a future release.
> KeenWrite version 2.0.0
> Copyright 2016-2021 White Magic Software, Ltd.
> Portions copyright 2015-2020 Karl Tauber.
> Exception in thread "main" java.lang.NoClassDefFoundError:
> javafx/beans/property/ReadOnlyProperty
>  at com.keenwrite.Launcher.main(Launcher.java:27)
> Caused by: java.lang.ClassNotFoundException:
> javafx.beans.property.ReadOnlyProperty
>  at
>
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
>  at
>
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
>  at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
>  ... 1 more
>
>
>
___
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] Straight Quotes / Curly Quotes

2021-06-17 Thread Thangalin
I've written a Java-based lexer/parser that can convert straight quotes to
curly quotes for English prose. It's a one-pass algorithm (O(n)) that uses
neither look-behind nor regex. Here's a list of test cases it handles:

https://raw.githubusercontent.com/DaveJarvis/keenquotes/main/lib/src/test/resources/com/keenwrite/quotes/smartypants.txt

A test harness converted several Project Gutenberg texts quite well. The
folks at PG may be interested in using it themselves to help convert quotes
in older texts en masse. The source code is MIT-licensed:

https://github.com/DaveJarvis/keenquotes/

The code should port to Lua fairly easily, should anyone be interested in
adding a straight/curly quotation mark conversion module to ConTeXt.
(Similar to the LaTeX package, but without using regex.)

Cheers everyone!
___
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] Straight Quotes / Curly Quotes

2021-06-17 Thread Thangalin
Hraban,

> In what kind of workflows does your program make sense?

Have you looked around the web lately?

KeenWrite (https://github.com/DaveJarvis/keenwrite), my plain text editor,
can neither convert nor easily type curly quotes into the application.
Recently, I added ConTeXt integration for exporting to PDF files. ConTeXt
doesn't curl the quotes, which I found a little surprising (because LaTeX
has a quote curling package). Not seeing an obvious solution, I coded my
own library because all the other libraries I found were either not up to
the task or required a massive natural language parser dependency.

My workflow will be: Edit plain text in KeenWrite, export to XHTML, curl
the quotes, run ConTeXt to typeset XHTML.

Another workflow: Edit plain text in KeenWrite, export to XHTML, curl the
quotes, upload to CMS.

The problem is that when typewriters were invented, curly quotes didn't
make it onto the popular layouts. Then, after Unicode, curly closing single
quotes and curly apostrophes were not made unique. HTML entities get it
right, though, with l/rdquo, l/rsquo, and apos. C'est la vie.
___
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] Straight Quotes / Curly Quotes

2021-06-18 Thread Thangalin
The csquotes package can curl straight quotes:

https://ctan.org/pkg/csquotes

I don't know how smart its smart quote feature is, though, with respect to
apostrophes.
___
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] Straight Quotes / Curly Quotes

2021-06-18 Thread Thangalin
> In HTML you should be able to use  – I know that doesn’t work reliably
in browsers (some add straight quotes to my CSS-configured guillemets).

The Converter class maps token replacements:

https://github.com/DaveJarvis/keenquotes/blob/d6c9761f8fe1ae96391f25dc73be52050a148e37/src/main/java/com/whitemagicsoftware/keenquotes/Converter.java#L15

It'd be trivial to use  and , instead. For my purposes, HTML
entities work.

> Using \quotation / \quote I avoid typing quotation marks in most cases.

When writing plain text documents, adding TeX code or HTML code to
prescribe how the document should be presented is best avoided, so as to
keep the document decoupled from a particular tool chain. YMMV. A deeper
solution allows users to type the correctly curled quotes directly into the
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] Initial caps with short paragraph

2021-07-08 Thread Thangalin
This has come up before on the mailing list, but I was wondering if LMTX
has a more elegant solution than using a transparent/invisible capture of
the drop-cap.

Consider:

\setupinitial[n=2, style=\tfd,
location=text]\setuphead[chapter][after={\placeinitial}]
\starttext
  \chapter

  Hello world!

  \input ward\stoptext

The output shows that the second paragraph is not indented beyond the
bounding box of the drop-cap, resulting in an overlap. This isn't a problem
when the first paragraph spans two or more lines.

Any ideas for how to resolve this without changing the content?

Thank you!
___
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] Re: Why is the fonts database not updated?

2023-07-07 Thread Thangalin
I've used the following without any troubles for a few years now:

$ cat ~/bin/fontcache
#!/usr/bin/env bash

fc-cache -fv
mtxrun --generate
mtxrun --script fonts --reload
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Parallel columns using start/stop setups

2023-08-08 Thread Thangalin
Two concurrent situations can happen, which I'd like to typeset as two
parallel columns while keeping the overall page layout (i.e., headers,
footers, margins, and such).

current version: 2023.07.18 22:07

I'd like to find a way to set up start/stop environments, if possible, to
come up with a general-purpose solution (i.e., the prose itself is not
changed).

Here are a few examples. In the first, a "concurrent" environment is
created with two "timelines":

% SOT
\definestartstop[concurrent][
  before={\startcolumns[n=2, align={verytolerant,stretch}, separator=rule]},
  after=\stopcolumns,
]

\definestartstop[timelinea][
  after=\column,
]

\definestartstop[timelineb][]

\starttext
  \startconcurrent
\starttimelinea
  \dorecurse{5}{\input ward}
\stoptimelinea

\starttimelineb
  \dorecurse{5}{\input knuth}
\stoptimelineb
  \stopconcurrent
\stoptext
% EOT

The ward and knuth texts end up in the same column because one is shorter
than the other. Here's another attempt:

% SOT
\defineparagraphs[concurrent][n=2]

\definestartstop[timelinea][
  before=\concurrent,
  after=\concurrent,
]

\definestartstop[timelineb][
  before=\concurrent,
]

\starttext
  \startconcurrent
\starttimelinea
  \dorecurse{5}{\input ward}
\stoptimelinea

\starttimelineb
  \dorecurse{5}{\input knuth}
\stoptimelineb
  \stopconcurrent
\stoptext
% EOT

This loses much of the input text.

Can this be accomplished using LMTX and what would be the best approach?
Would this setupparagraphs, definecolumnset, synchronizestreams, or
possibly incomplete/experimental functionality?

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

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

[NTG-context] Map XML attributes to variables, dynamically

2023-08-10 Thread Thangalin
Hello!

A Markdown document resembles the following:

::: {.concurrent title="Berth 5" location="San Diego"}
Text Goes Here
:::

::: {.concurrent title="Road" location="Beale AFB"}
Different Text Goes Here
:::

The XHTML generated from that document resembles:


Text Goes Here


Different Text Goes Here


Environments for the DIV element gets translated using:

\startxmlsetups xml:div
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

This creates "\startconcurrent" and "\stopconcurrent", which are later
defined using "\definestartstop[concurrent]".

I'd like to dynamically define all the data- attributes to make key/value
pairs accessible from the document. For example, I have this:

\definestartstop[concurrent][
  before={%
\blank[big]%
\setMPtext{1}{Berth 5}%
\startTextConcurrentFrame},
  after={\stopTextConcurrentFrame\blank[big]},
]

I'd like to replace \setMPText calls with a reference to a dynamically
created variable reference. For example:

\setMPtext{1}{\usermap[concurrent.title]}
\setMPtext{2}{\usermap[concurrent.location]}

I can verify the attribute values exist by exporting them to the document:

\startxmlsetups xml:div
  title:\xmlatt{#1}{data-title} location:\xmlatt{#1}{data-location}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

How would you change the xml:div setup to create a map of its attributes as
key/value pairs?

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

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

[NTG-context] Re: Map XML attributes to variables, dynamically

2023-08-10 Thread Thangalin
Here's an MWE:

% SOT
\startbuffer[demo]



Text Goes Here


Different Text Goes Here



\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|body}{xml:*}
  \xmlsetsetup{\xmldocument}{div}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\startxmlsetups xml:html
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:body
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:div
  \setvariable{div}{\xmlatt{#1}{class}}{#1}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

\definestartstop[concurrent][
  before={TITLE: \xmlatt{\getvariable {div} {concurrent} {title}}},
]

\starttext
  \xmlprocessbuffer{main}{demo}{}
\stoptext
% EOT

It doesn't look like the variables are taking, regardless of whether
{title} or {data-title} are used.

On Thu, Aug 10, 2023 at 12:44 AM Hans Hagen  wrote:

> On 8/10/2023 9:10 AM, Thangalin wrote:
>
> > Environments for the DIV element gets translated using:
> >
> > \startxmlsetups xml:div
>
> \setvariable {div} {\xmlatt{#1}{class}} {#1}
>
> >\start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
> > \stopxmlsetups
> > \setMPtext{1}{\usermap[concurrent.title]}
> > \setMPtext{2}{\usermap[concurrent.location]}
>
> \setMPtext{1}{%
>\xmlatt {\getvariable {div} {concurrent} {title}%
> }
>
> > I can verify the attribute values exist by exporting them to the
> document:
> something like that .. untested as no mwe
>
> 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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: upload

2023-08-10 Thread Thangalin
Did arguments regress in 2023.08.10 02:59?

$ cat u.tex
\starttext
Feisty arguments
\stoptext
$ context u.tex
$  ls -la *.pdf
-rw-r--r-- 1 username username 6279 Aug 10 18:28 u.pdf
$ context --arguments=x=y u.tex | grep error
tex error   > tex error on line 13 in file : Use of \getrawparameters
doesn't match its definition
mtx-context | fatal error: return code: 1

This was working with the previous release.

On Wed, Aug 9, 2023 at 8:43 AM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new lmtx. There are some new features that wil be revealed
> in the future (likely after the meeting) but here is one:
>
> \starttext
>
>  \defineoverlay
>[test]
>[\color
>   [blue]
>   {TEST
>\inframed
>  [foregroundcolor=red]
>  {xxx}
>TEST}]
>
>  \framed
>[background=test,
> foregroundstyle=\switchtobodyfont[small]]
>{test}
>
> \stoptext
>
>  From now on many commands accept (properly) nested [] inside commands
> that use [] as fences (like the setup commands) where it makes sense. It
> is up to the user to decide to use {} (as before) or not but it is less
> error prone.
>
> It is now also possible to nest setups as in
>
> \starttext
>
> \startsetups one
>  \startsetups [three]
>  HERE
>  \stopsetups
> \stopsetups
>
> \startsetups two
>  \startsetups [three]
>  THERE
>  \stopsetups
> \stopsetups
>
> \setups[one] \setups[three]
>
> \setups[two] \setups[three]
>
> \stoptext
>
> As part of the ongoing improvements on math rendering we added some
> classic lm/cm kerns (between upperacse and periods / commas) in the
> goodie files.
>
> Some lowlevel manuals have been extended, explaining experimental 'named
> cross macro nesting parameter referencing' and 'constrained cq. retained
> assignments', but that is only relevant for those interested in
> overcoming some limitations in the traditional engines.
>
> 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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: upload

2023-08-11 Thread Thangalin
That works Hans, thank you.

line 802 in core-env should be:
>
> \permanent\tolerant\protected\def\setupenv
>{\syst_variables_set\getrawparameters[\s!environment]}
>
> (seems i forgot that one when doing some cleanup)
>
> 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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Why overbar is so big

2023-08-11 Thread Thangalin
Looks fine to me.

Current version: 2023.08.10 02:59

Running on Linux.

What fonts are you using?

On Fri, Aug 11, 2023 at 12:38 PM Xavier B.  wrote:

> If you run
>
> \starttext
>
> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
> veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
> commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
> cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
> est laborum.
> $\overbar{OA} = 4,2$
> \stoptext
>
> Then the overbar has the bar in a very long altitude.
> Can you please, see the output attached.
>
> Thanks in advance,
> Xavier
>
> PS: I use context version:mtx-context | ConTeXt Process Management 1.04
> mtx-context |
> mtx-context | main context file:
> /usr/share/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2023.03.10 12:15
> mtx-context | main context file:
> /usr/share/texmf-dist/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2023.03.10 12:15
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___


t.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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Pass string into text background graphic

2023-08-11 Thread Thangalin
Hi list,

I'm attempting to make a stylized border around paragraphs that can span
pages. The border runs along the side and the top. (Ideally the top border
wouldn't repeat, but that's a minor issue.) The issue I'm having is that
the title for the text doesn't always appear. Instead, there's a small gap
along the top border where the title should be.

Am I going about this the wrong way?

% SOT
\startbuffer[demo]



Text Goes Here


Different Text Goes Here


\stopbuffer
\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|body}{xml:*}
  \xmlsetsetup{\xmldocument}{div}{xml:*}\stopxmlsetups
\xmlregistersetup{xml:xhtml}
\startxmlsetups xml:html
  \xmlflush{#1}\stopxmlsetups
\startxmlsetups xml:body
  \xmlflush{#1}\stopxmlsetups
\startxmlsetups xml:div
  \setvariable{div}{\xmlatt{#1}{class}}{#1}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop\stopxmlsetups
\startusableMPgraphic{GraphicConcurrent}
  begingroup;
string legend;

picture title;
picture border;
picture bg;

numeric tw;
numeric th;

legend := \MPstring{concurrent};

title := nullpicture;
border := nullpicture;
bg := textext( "\strut " & legend );

tw := xpart lrcorner bg - xpart llcorner bg;
th := ypart ulcorner bg - ypart llcorner bg;

addto title also image(
  fill unitsquare
xysized (tw + 8, th)
shifted ulcorner multipars[1]
shifted 28 right
shifted 8 down
withcolor white;

  draw
textext.drt( legend )
shifted ulcorner multipars[1]
shifted 32 right
shifted 3 down;
);

addto border also image(
  for i = 1 upto nofmultipars:
draw
  llcorner multipars[i] --
  ulcorner multipars[i] shifted 8 down ..
  ulcorner multipars[i] shifted 8 right --
  urcorner multipars[i]
  withpen pencircle scaled 0.75 withcolor black;
  endfor;
);

draw image(
  draw border;
  draw title;
);
  endgroup;\stopusableMPgraphic
\definetextbackground[TextConcurrentFrame][
  mp=GraphicConcurrent,
  frame=off,
  topoffset=1em,
  leftoffset=1em,
  location=paragraph,
]
\definestartstop[concurrent][
  before={%
\blank[big]%
LEGEND: \xmlatt{\getvariable{div}{concurrent}}{data-title}%
\blank[big]%
\setMPtext{concurrent}{\xmlatt{\getvariable{div}{concurrent}}{data-title}}
\startTextConcurrentFrame},
  after={\stopTextConcurrentFrame\blank[big]},
]
\starttext
  \xmlprocessbuffer{main}{demo}{}\stoptext
% EOT

If I change the following line:

legend := \MPstring{concurrent};

to:

legend := "some string";

Then the title "some string" is repeated. It seems like the value for
\MPstring{concurrent} is being cached in some situations and ignored in
others.

Essentially, I'm trying to visually offset multiple paragraphs using a
left-hand vertical rule along with a top horizontal rule that has a title.
Each new "concurrent" section needs its own header that doesn't repeat.

Is there a ConTeXt-way to accomplish this feat?

Cheers!


t.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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Pass string into text background graphic

2023-08-12 Thread Thangalin
Thanks Hans.

The \newinteger approach would always increment the value, regardless of
conditionals within the MetaPost code (i.e., it was like legend :=
"\ConcurrentTextGet" would always invoke the macro just be referencing the
MPgraphic and nothing would prevent its execution). This meant that the Get
indexes would not correspond to the Set indexes. Switching to \definenumber
resolved the issue. There were a few other oddities, such as the "Get"
counter incrementing twice. Here's the code:

\definenumber[ConcurrentTextSetCounter][prefix=no]
\definenumber[ConcurrentTextGetCounter][prefix=no]

\setnumber[ConcurrentTextSetCounter][0]
\setnumber[ConcurrentTextGetCounter][0]

% Map each label as global key/value pairs.
\def\ConcurrentTextSet#1{%
  \incrementnumber[ConcurrentTextSetCounter]%
  \setxvariable
{concurrent}
{text:\rawcountervalue[ConcurrentTextSetCounter]}
{#1}}

% Account for the counter incrementing twice and the index being 1-based.
\def\ConcurrentTextGet{%
  \incrementnumber[ConcurrentTextGetCounter]%
  \getvariable
{concurrent}

{text:\number\numexpr1+\rawcountervalue[ConcurrentTextGetCounter]/2\relax}}

\startuseMPgraphic{GraphicConcurrent}
  numeric index;
  index := 1;

  % Differentiate between new text blocks and those crossing pages.
  if (multikind[ index ] = "single") or (multikind[ index ] = "first"):
string legend;
legend := "\ConcurrentTextGet";

% For new text blocks, write the title.
picture p;
p := textext.rt( legend )
  shifted ulcorner multipars[ index ]
  shifted (1cm, 0);

% Draw the horizontal rule only for the initial text block.
draw
  ulcorner multipars[ index ] shifted (1mm + xpart lrcorner p, 0) --
  urcorner multipars[ index ];

% Draw the vertical rule for the initial text block.
draw
  llcorner multipars[ index ] --
  ulcorner multipars[ index ] --
  ulcorner multipars[ index ] shifted (9mm, 0);

draw p;
  else:
% Draw only the vertical rule only when crossing page boundaries.
draw
  llcorner multipars[ index ] --
  ulcorner multipars[ index ];
  fi
\stopuseMPgraphic

\definetextbackground[TextConcurrentFrame][
  mp=GraphicConcurrent,
  frame=off,
  topoffset=1em,
  leftoffset=1em,
  before=\blank[2*big],
  after=\blank,
  location=paragraph,
]

\startsetups concurrent:before
  \ConcurrentTextSet{%
% Be sure to format "a.m." and other special phrases.
\expandafter\TextReplacement{%
  \xmlatt{\getvariable{div}{concurrent}}{data-title}%
}
  }
  \startTextConcurrentFrame
\stopsetups

\startsetups concurrent:after
  \stopTextConcurrentFrame
\stopsetups

\definestartstop[concurrent][
  before=\directsetup{concurrent:before},
  after=\directsetup{concurrent:after}
]

This allows for typesetting a wider range of pandoc-style Markdown
annotations, such as:

::: {.concurrent title="Terminal Berth 5, 3:17 a.m."}
text goes here
:::

With these changes, the titles now only appear at the start of the
demarcated text, in any combination of "concurrent" annotation instances
spanning any number of pages.

Much appreciated.

Cheers!
P.S.
The following line requires KeenWrite themes:

\expandafter\TextReplacement{ ... }

For details, see:

   -
   https://github.com/DaveJarvis/keenwrite-themes/blob/main/xhtml/xml-blocks.tex
   -
   https://github.com/DaveJarvis/keenwrite-themes/blob/main/boschet/replace.tex


concurrent.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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Pass string into text background graphic

2023-08-13 Thread Thangalin
Hi again,

you could remove the \localcontrolled around the advance
>

I thought I tried that, but the counter incremented to 6, instead of 4.
Using higher-level primitives seems more like the ConTeXt way.


> why twice ? you only have to typeset the text once, right?
> >
> {text:\number\numexpr1+\rawcountervalue[ConcurrentTextGetCounter]/2\relax}}
>

I don't know why the counter is incremented twice for each concurrent
environment; the document is typeset once, in three passes. Dividing by two
solves the issue, if there's a deeper issue, I'm at a loss to explain it.

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

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

[NTG-context] Markdown to HTML cross-references

2023-11-21 Thread Thangalin
Hi list,

I'm looking to implement a consistent syntax for cross-references in
KeenWrite  and am wondering what you think would
make the most sense for translating into ConTeXt commands.

First, some background (the first two give an overview, the others are
cross-reference references for various syntaxes):

   - https://talk.commonmark.org/t/cross-references-and-citations/4013/7
   - https://thesynack.com/posts/markdown-captions
   - https://quarto.org/docs/authoring/cross-references.html
   - https://mystmd.org/guide/cross-references
   - https://lierdakil.github.io/pandoc-crossref
   - https://github.com/tomduck/pandoc-eqnos

I'm leaning towards the following syntax:

Markdown Item (table, blockquote, TeX block, figure, code, R chunk, etc.)

: caption text {#type:label}

See [@type:label] for details.

There's a unit test that shows what's currently being generated with a
number of examples for images, tables, blockquotes, internationalization,
and so on:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/test/java/com/keenwrite/processors/markdown/extensions/references/CrossReferencesExtensionTest.java#L51

The code is a work-in-progress; so the tests may have changed depending on
if/when you view the Java source code. Presently, the captions produce
anchor references, mostly. The following seems easier to typeset using
ConTeXt:

Meschiya Lake - Lucky Devil 

This diverges from the HTML specification for tables (table/caption) and
figures (figure/figcaption). It would also mean having to write ConTeXt
macros that flip the spans and anchors to produce a caption such as:

*Lyrics 1.1.* Meschiya Lake - Lucky Devil

While there are plenty of ways of presenting captions (e.g., multi-column
images with sub-figure numbers) the majority of cross-references are to a
single "thing" with a single "caption".

What are your thoughts on this proposal? (Keeping in mind I'm the only
person working on KeenWrite and while I'm trying to keep the syntax
compatible with pandoc, implementing the full pandoc-crossref syntax is out
of scope for me.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Converting XHTML captions to ConTeXt captions

2023-11-26 Thread Thangalin
I'd like to capture a caption and apply it to the block-level element that
immediately follows. In the MWE, is there a more "ConTeXt way" to
accomplish the task of adding captions to tables, figures, blockquotes, etc?

% SOT
\startbuffer[demo]

Caption 1 
table 1 with caption
table 2 without caption
Caption 3 
table 3 with caption

\stopbuffer

\startxmlsetups xml:demo
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{a|p|body|table}{xml:*}
  \xmlsetsetup{\xmldocument}{span[@class='caption']}{xml:span}

  \define\CaptionText{}
  \define\AnchorXref{}
\stopxmlsetups

\startxmlsetups xml:span
  \define\CaptionText{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:a
  \define\AnchorXref{\xmlatt{#1}{data-type}-\xmlatt{#1}{name}}
\stopxmlsetups

\startxmlsetups xml:body \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups
\startxmlsetups xml:table
  \blank
  \doifelsetext{\CaptionText}{%
\startplacetable[
  title={\ignorespaces\CaptionText{}\removeunwantedspaces.},
  reference={\AnchorXref}
]

\define\CaptionText{}
\define\AnchorXref{}
  }{
\startplacetable
  }

\startembeddedxtable
  \startxtablebody[body]
\startxrow
  \startxcell
\xmlflush{#1}
  \stopxcell
\stopxrow
  \stopxtablebody
\stopembeddedxtable
  \stopplacetable
  \blank
\stopxmlsetups

\xmlregistersetup{xml:demo}

\starttext
  \xmlprocessbuffer{demo}{demo}{}
\stoptext
% EOT
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] externalfigure regression?

2023-12-03 Thread Thangalin
Hi,

>From the wiki :

"When the file extension is .auto or method=auto is used, ConTeXt reads the
first few bytes of the file to determine the filetype. Such an
auto-discovery is useful for remote images that do not have a file
extension."

current version: 2023.09.26 18:19

Code:

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=auto]
  \stopplacefigure
\stoptext
% EOT

Expected: Cute kitten photo.
Actual: Error.

Is this a regression? Or has the syntax changed (stale wiki)?

Specifying the type works (I'd've thought it not necessary to specify the
method at all, given both magic headers and HTTP content-type could
determine the type):

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=jpg]
  \stopplacefigure
\stoptext
% EOT

See also:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaTypeSniffer.java#L53

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaType.java#L218
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Problem with PNG images in the latest standalone version

2024-05-23 Thread Thangalin
Hajtmar, please provide a complete, self-contained, minimal working example.

See http://www.sscce.org/ for details.

On Thu, May 23, 2024 at 3:43 PM Hajtmar Jaroslav  wrote:

> Hello.
> After a long time of using ConText from TeXlive installation I tried the
> standalone version again.
> I found that my old documents that I normally compile exclusively with the
> old ConText ver: 2018.04.04 00:51 MKIV beta fmt: 2019.5.2
> latest version of standalone ConText compiles smoothly, seamlessly and
> most importantly very quickly and the results are the same at a glance.
> Unfortunately, the only problem I have not been able to solve is that the
> new standalone ConTeXt (ConTeXt ver: 2024.05.17 16:32 LMTX fmt: 2024.5.23)
> does not display PNG files in my PDF document for me. If I replace the PNG
> files with JPG files, the images are loaded and displayed in PDF file after
> compilation.
> I have also tried experimenting with the png method, see e.g.
> \setupexternalfigures[directory={../texlibrary/}, method=png], I have tried
> a few things, but it fails to work.
> I tried to search for something, but I couldn't find anything relevant.
> Can anyone advise me what the problem is or what I'm doing wrong? Is it
> caused by some version incompatibility or some setting?
> I apologize if something similar has already been addressed here, but I
> have not been able to follow the happenings in this mailing list for quite
> some time.
>
> Thanks a lot for any advice.
> Jaroslav
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Quotation mark in drop caps

2024-07-07 Thread Thangalin
Hi list!

I have a three-part question.

First, when using \placeinitial, how would you detect whether the first
character is a quotation mark, and, if so, override the setupinitial to use
m=2?

Second, when using m=2 to capture a quotation mark, how would you change
the font size of only the quotation mark, leaving the font size for the
remaining characters the same?

Third, can this be accomplished using setupinitial alone? Such as:

\setupinitial[
  quotefont=\SmallerFont,
  quotecolour=\QuoteColour,
]

A few typographic examples of what I'd like to accomplish:

Re: https://i.ibb.co/7rJYBS6/initial-Matching-Quotes.gif
Re: https://i.ibb.co/Hz8v5w4/atlantips-drop-caps-and-quotation-marks-10.png

My understanding of what exists in ConTeXt:

\starttext
\startchapter
  % This detaches the quotation mark from the paragraph, which looks
strange.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % This looks great.
  \placeinitial
  \input knuth
\stopchapter

\startchapter
  % I'd like to eliminate this next line.
  \setupinitial[m=2]

  % The quotation mark is a drop cap, albeit too big.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % I'd like to eliminate this next line.
  \setupinitial[m=1]

  % The setups are reinitialized, which in theory should not be needed.
  \placeinitial
  \input knuth
\stopchapter
\stoptext

Here's how I'd like to typeset the document (using setupinitial alone):

\setupinitial[
  % When a quotation mark is detected, the given font is applied to it.
  quotefont=\SmallerFont,
  % Not necessary, but could be useful to other people?
  quotecolour=\QuoteColour,
]

\starttext
\startchapter
  % The quotation mark gets attached and applies the smaller font size.
  \placeinitial
  "We held ConTeXt in high esteem."
\stopchapter

\startchapter
  % Only captures the first letter, because no quotation mark is present.
  \placeinitial
  \input knuth
\stopchapter
\stoptext

Is this possible? If so, how?

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Quotation mark in drop caps

2024-07-10 Thread Thangalin
>From TeX.SE, the following solution works; however, it doesn't feel like
the "ConTeXt way":

% SOT
\setuplocalboxes[leftmargin][
style=\bfd,
color=darkred,
distance=0pt,
]

\unprotect
\define\quoteinitial{%
\futureexpandisap“\quoteinitial_true\quoteinitial_false%
}

\define\quoteinitial_true{%
\localmargintext[leftmargin]{“}%
\expandafter\placeinitial%
\gobbleoneargument%
}

\let\quoteinitial_false\placeinitial
\protect

\starttext
\quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson}

\quoteinitial We held ConTeXt in high esteem.   \samplefile{bryson}
\stoptext
%EOT

Any suggestions for how to improve it?

See also: https://tex.stackexchange.com/q/722275/2148

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Quotation mark in drop caps

2024-07-10 Thread Thangalin
Thank you Hans.

That's pretty close. Is there a way to make the opening quotation mark
smaller? Ideally, control the font and colour?

Cheers!

On Wed, Jul 10, 2024 at 12:25 AM Hans Hagen via ntg-context <
ntg-context@ntg.nl> wrote:

> On 7/10/2024 9:10 AM, Thangalin wrote:
> >  From TeX.SE, the following solution works; however, it doesn't feel
> > like the "ConTeXt way":
> >
> > % SOT
> > \setuplocalboxes[leftmargin][
> >  style=\bfd,
> >  color=darkred,
> >  distance=0pt,
> > ]
> >
> > \unprotect
> > \define\quoteinitial{%
> >  \futureexpandisap“\quoteinitial_true\quoteinitial_false%
> > }
> >
> > \define\quoteinitial_true{%
> >  \localmargintext[leftmargin]{“}%
> >  \expandafter\placeinitial%
> >  \gobbleoneargument%
> > }
> >
> > \let\quoteinitial_false\placeinitial
> > \protect
> >
> > \starttext
> >  \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson}
> >
> >  \quoteinitial We held ConTeXt in high esteem.   \samplefile{bryson}
> > \stoptext
> > %EOT
> >
> > Any suggestions for how to improve it?
> >
> > See also: https://tex.stackexchange.com/q/722275/2148
> > <https://tex.stackexchange.com/q/722275/2148>
> \starttext
>
> \setupbodyfont[dejavu,9pt]
>
> \defineinitial[two][m=1,method=auto]
>
> \setinitial[two] Knuth   :\ignorespaces\input knuth \par
> \setinitial[two] \quotation {Knuth}  :\ignorespaces\input knuth \par
>
> \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 /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Quotation mark in drop caps

2024-07-10 Thread Thangalin
Hi again,

The output shows a closing red opening quotation mark, which is the
opposite of what I'd like to achieve. Using \quotation won't work in my
situation because the text mixes and matches numerous types of quotation
marks and the user is writing in Markdown. Matching against “ would work
for most cases; however, the quotation marks could include:

" -- straight quote
“ -- opening curly double quote
‘ -- opening curly single quote (or apostrophe)
« -- opening double quote (French, Spanish, etc.)
‹ -- opening single quote
「 -- opening Japanese quote

% SOT
\protected\def\typo_initial_handle_indeed#1#2%
   {\dontleavehmode
\begingroup
\cdef\currentinitial{#1}%
\setupcurrentinitial[#2]%
\resetfontfeature % might be needed in more places
\ifempty{\initialparameter\c!style}%
  \definedfont[\initialparameter\c!font]%
\else
  \useinitialstyleparameter\c!style
\fi
\ifempty{\initialparameter\c!color}%
  \c_attr_color   \attributeunsetvalue
  \c_attr_transparency\attributeunsetvalue
\else
  \useinitialcolorparameter\c!color
\fi}

\starttext
  \setupbodyfont[dejavu,9pt]
  \defineinitial[two][m=1,method=auto]

  \setupquotation[symcolor=red]

  \setinitial[two] Knuth   :\ignorespaces\input knuth \par
  \setinitial[two] \symbol[leftquotation]Knuth\symbol[rightquotation]
:\ignorespaces\input knuth \par
\stoptext
% EOT

This produces:

https://i.ibb.co/P5hDLH5/opening-quote.png

What I'm looking to produce is:

https://i.ibb.co/6PPGxxY/opening-quote-small.png

Using \quotation instead of \symbol[leftquotation] or “ produces a red
closing quote:

https://i.ibb.co/VY1wqZ1/closing-quote-red.png

Any other ideas?

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Quotation mark in drop caps

2024-07-11 Thread Thangalin
Thanks vm!

Sadly, I have no way of telling the 4,000+ people who have downloaded my
Markdown editor how they ought to compose and typeset their prose.

I'll let Robert Bringhurst know, though, and ask him to change Rule 4.1.5
of his Elements of Typographic Style from "include the initial quotation
mark" to "rewrite your prose." ;-)

https://i.imgur.com/ne991lZ.jpeg

TX

On Wed, Jul 10, 2024 at 11:35 PM vm via ntg-context 
wrote:

>
>
> On 11/07/2024 01:55, Thangalin wrote:
> >
> > Any other ideas?
>
> Yes, change/edit the text to avoid the quotation marks in the first place.
>
> e.g. There are always better/simpler ways to achieve the story to be
> told. Trace back to the underlying idea as why these drop capitals were
> invented in the first place. Most likely to visually separate blocs of
> mono colored bread text with the lead characters from the drawer below.
> These days there are (better) alternatives to solve the issue of
> separation text paragraphs.
>
>
> (avoiding a problem instead of trying to solve it afterwards)
>
> .F
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] WARNING: File path includes directory that doesn't exist

2016-07-30 Thread Thangalin
Hi,

Possible problem converting SVG to PDF.

$ context --version

mtx-context | ConTeXt Process Management 0.63
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2016.07.18 16:46

cd $HOME/test
$ cat test.tex
\setupexternalfigures[
  order={svg,pdf,png},
  location={local,default,global},
  directory={images},
  frameoffset=.5em,
  maxwidth=\makeupwidth,
  width=\makeupwidth,
]

\starttext
\placefigure{}{\externalfigure[images/drawing.svg]}
\stoptext

$ cat images/drawing.svg

http://purl.org/dc/elements/1.1/";
   xmlns:cc="http://creativecommons.org/ns#";
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
   xmlns:svg="http://www.w3.org/2000/svg";
   xmlns="http://www.w3.org/2000/svg";
   id="svg8"
   version="1.1"
   viewBox="0 0 210 297"
   height="297mm"
   width="210mm">
  
  

  
image/svg+xml
http://purl.org/dc/dcmitype/StillImage"; />

  

  
  

  


$ context test.tex
... logging ...
** (inkscape:19807): WARNING **: File path
"--export-pdf=/home/username/temp/images/m_k_i_v_drawing.svg.pdf"
includes directory that doesn't exist.
... more logging ...

Work Around

$ cd images
$ inkscape -z drawing.svg
--export-pdf=/home/username/temp/images/m_k_i_v_drawing.svg.pdf
$ cd ..
$ context test.tex

No errors.

Any ideas how to fix, without manually converting each file first?
___
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] WARNING: File path includes directory that doesn't exist

2016-07-30 Thread Thangalin
$ inkscape -V
Inkscape 0.92pre1 unknown (Jul 30 2016)

https://launchpad.net/~inkscape.dev/+archive/ubuntu/trunk

I'm not sure if this version of Inkscape is at fault. It'd be cool if
there was a way to specify the SVG to PDF converter program (e.g., to
use rsvg-converter instead) from the command line.
___
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] Blank page introduced by setmathfont?

2017-01-27 Thread Thangalin
Example:

\usemodule[simplefonts]
\setmathfont[modern]

\starttext
  \startfrontmatter
\input knuth
  \stopfrontmatter
\stoptext

Expected Results

The text is on the first page.

Actual Results

The text is on the second page, the first page is blank.

Work Around

Remove \setmathfont[modern].

Version

mtx-context | current version: 2017.01.17 17:37

$ uname -a
Linux server 4.8.4-040804-generic #201610220733 SMP Sat Oct 22
11:35:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
___
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] Missing Chapter Numbers

2017-05-19 Thread Thangalin
\setuphead[chapter][number=yes,]
\setuphead[section][number=no,]
\setuphead[subsection][placehead=hidden,]

\definehead[scenesubsection][subsection]

\starttext
  \dorecurse{5}{
\chapter{Chapter Name}
\section{Section Name}
\startscenesubsection
\input tufte
\stopscenesubsection
  }
\stoptext

The chapter headings should be enumerated 1 through 5, but some
chapter numbers are either hidden or enumerated incorrectly. Using
"placehead=no" causes the spacing to change when framing an entire
section.

Related: 
https://github.com/contextgarden/context-mirror/blob/b14f992ef5f4e868c9959b174278c86516d60dbc/tex/context/base/mkiv/strc-sec.mkiv#L930

Any ideas on how to work around this issue?

Thank you!
___
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] Missing Chapter Numbers

2017-10-22 Thread Thangalin
The following code does not hide the headings:

\setuphead[subsection][
  placehead=no,
  number=no,
]

% placehead=hidden breaks the counters?
\setuphead[subsubsection][
  placehead=no,
  number=no,
]

\starttext
  \chapter{chapter}
  chapter
  \section{section}
  section
  \section{subsection}
  subsection
  \section{subsubsection}
  subsubsection
\stoptext

The following code also does not hide the headings:

% placehead=hidden breaks the counters?
\setuphead[subsection, subsubsection][
  placehead=no,
  number=no,
]

\starttext
  \chapter{chapter}
  chapter
  \section{section}
  section
  \section{subsection}
  subsection
  \section{subsubsection}
  subsubsection
\stoptext

However, adding "section" makes the sub- and subsubsections hide as expected:

\setuphead[section, subsection, subsubsection][
  placehead=no,
  number=no,
]

\starttext
  \chapter{chapter}
  chapter
  \section{section}
  section
  \section{subsection}
  subsection
  \section{subsubsection}
  subsubsection
\stoptext

This behaviour appears to violate the principle of least astonishment.
___
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] Feature Request: define colour in relation to existing colour

2013-08-20 Thread Thangalin
Hi,

What would it take to extend \definecolor so that:

  \definecolor[ColourA][ColourB][t=0.5, a=1]

defines a new colour (ColourB) based on an existing colour (ColourA)?

I know that \definespotcolor[ColourA][ColourB][t=0.5, a=1] works, but
it seems like \definecolor would also be a natural fit.

Kind regards.
___
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] Feature Request: showframe debugging

2013-08-20 Thread Thangalin
Hi,

\showframe
[
  labels=on,
  measurements=on,
  color=red,
]

Would produce an image similar to the attached, but with the black
lines drawn in the specified colour.

Using labels=on would show the names of the items that can be changed
with \setuplayout.
Using measurements=on would show the values for each of the items.

I don't know if there is any value separating the measurements from the labels.

Thank you!
<>___
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] Feature Request: define colour in relation to existing colour

2013-08-21 Thread Thangalin
For context, here is the question on TeX.SE:

http://tex.stackexchange.com/questions/129297/define-colour-transparency-in-relation-to-existing-colour

I agree with Marco:

Are you sure it's a good idea to add another colour definition
> mechanism? Then we have
>
  \definecolor
  \defineglobalcolor
  \definenamedcolor
  \definespotcolor
  \definemultitonecolor
  \defineprocesscolor

That is a little confusing. I can understand a speed requirement, but
surely that can be taken into consideration beneath the definition?

\definecolor[A][r=1, g=0, b=0]
\definecolor[B][A][a=1, t=0.5]

That seems fairly reasonable. Also, why not embed colour spaces within the
command?

\definecolor[A][colorspace=spot]
\definecolor[A][colorspace=multitone]
\definecolor[A][colorspace=pantone]

One command to define a colour, rather than several commands for specific
variations of defining colours.

Kind regards.
___
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] ConTeXt Guru for Project

2013-08-25 Thread Thangalin
Hi, folks.

I'm looking for help migrating from LaTeX to ConTeXt. The following TeX.SE
question shows the LaTeX architecture I've put together:

http://tex.stackexchange.com/questions/127795/leveraging-a-dynamic-preamble-to-generate-multiple-output-formats

I'm moving away from LaTeX to ConTeXt to decrease system complexity, speed
up generating PDF documents, provide the ability to create beautiful EPUB
documents from the same auto-generated ConTeXt source file, leverage
MetaPost, plus all the other benefits that ConTeXt offers.

The project has some interesting design and layout challenges due to the
book content's dynamic nature. (For example, there are thematic concepts
applied across many different designs having optional content and stylistic
variations on the same data sets.)

If this intrigues you, send me a note and we can discuss the details (such
as availability, rates, requirements, technologies, project direction, and
so forth).

Thank you!
___
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] [***SPAM***] Continuous preview

2013-08-27 Thread Thangalin
When using the "evince" PDF reader on Linux, reloading the PDF is as simple
as:

  context filename.tex -- Generate for the first time
  evince filename.pdf  & -- Open the reader in the background

  context filename.tex -- The evince process automatically refreshes with
new content

___
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] Documentation for EPUB conversion

2013-08-28 Thread Thangalin
Hi,

I ran the following simple document through ConTeXt:

\setupbackend[export=yes,xhtml=yes]

\enableregime[utf-8]
\mainlanguage[en]
\language[en]

\setupexport[
  title={A nice book},
  author={John Doe},
  firstpage={cover.jpg},
]

\starttext
  \startitemize
\item First
\item Second
\item Third
  \stopitemize

\stoptext

I then ran mtxrun:

mtxrun --script epub --make t.specification

This produced a document with the cover page correctly; however, the items
were listed on a single line in the EPUB, instead of on lines by themselves.

I have a couple of questions:

   - *Styling.* Is custom styling required to format bullet or numbered
   lists in the resulting EPUB XHTML document?
   - *Knowledge.* Would anyone be willing to share their experiences (and
   tips) for transforming ConTeXt documents to EPUB?
   - *Examples.* Where can I find examples of simple and complex ConTeXt
   documents being converted to EPUB documents having a similar layout?

Many thanks and kind regards.
___
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] Image width in a two-column layout

2013-09-02 Thread Thangalin
It seems that there is a bug with \textwidth and \linewidth inside mixed
columns. Minimum working example:

% interface=en output=pdftex
\definemixedcolumns[StyleColumns][
  n=2,
  separator=rule,
  align=tolerant,
  before={\blank[big]},]
\setupexternalfigures[
  order={svg,pdf,png,jpg},
  location=global,
  %wfactor=fit,]
\setuphead[section][
  after={\startStyleColumns},
  aftersection={\stopStyleColumns},]
\starttext
\startbodymatter
  \setuppagenumbering[conversion=numbers]
  \setcounter[userpage][1]

  \startchapter[
title={Chapter},
reference=sec:chapter,
  ]

  \startsection[
title={Section},
reference=sec:chapter,
  ]

  \placefigure[]{}{%
\externalfigure[sheep.jpg][
width=\textwidth,
  ]
  }

  \startsubsection[
title={Equipment},
reference=sec:equipment,]
\input knuth
  \stopsubsection

  \stopsection
  \stopchapter\stopbodymatter
\stoptext

Actual results: the image appears as "undefined".
Expected results: the image appears, stretched to fill the column.
Work around 1: use wfactor.
Work around 2: \defineexternalfigure[fullwidth][factor=fit] and then use
\externalfigure[file.jpg][fullwidth]

Kind regards.
___
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] Unexpected EPUB Output

2013-09-03 Thread Thangalin
Hi,

I ran the following commands:

   - context t.tex
   - mtxrun --script epub --make t.specification

This produced the following code:

 http://www.w3.org/1998/Math/MathML"; date="Tue Sep  3
17:29:27 2013" xmlns:xhtml="http://www.w3.org/1999/xhtml"; file="t"
context="2013.08.17 00:58" version="0.30" language="en">
  
*Title pageCopyright
*   
  Contents

The "Title page" and "Copyright" page are inseparable text. I believe this
is due to how the front matter is coded:

\startfrontmatter
  \startstandardmakeup
Title page
  \stopstandardmakeup
  \startstandardmakeup
Copyright
  \stopstandardmakeup
  \completecontent
\stopfrontmatter

The front matter produces correct PDF output (with three separate pages for
the title page, copyright page, and ToC, respectively).

What must I do to wrap the *Title page* and *Copyright* page in separate
elements, yet still produce the same PDF?

Kind regards.


t.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] EPUB XHTML Format

2013-09-03 Thread Thangalin
Hi,

The attached t.tex file produces the attached t.xhtml file. I have looked
at the following documents:

   - http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1
   - http://en.wikipedia.org/wiki/DTBook
   - http://www.idpf.org/epub/20/spec/OPS_2.0.1_draft.htm
   - http://www.w3.org/TR/xhtml11/doctype.html
   - http://www.w3.org/TR/html5/sections.html

It seems that the macros in t.tex are being written out as XML elements,
verbatim. It is my understanding that these XML elements, however, do not
conform to the minimal content models associated with XHTML 1.1.

What needs to happen to take a minimal ConTeXt file (such as the attached)
to produce a minimum viable EPUB that:

   - Generates XHTML headers (including )
   - Produces images as img tags, rather than float tags.
   - Uses typical XHTML tags for  elements (e.g.,  for ordered
   lists).

Ideally, I would like to do something such as:

   - context t.tex
   - mtxrun --script epub --make t.specification

to generate an EPUB that passes validation of
epubcheck,
with an output XHTML file that more closely matches the XHTML specification.

How can I help?

Kind regards.


t.tex
Description: TeX document


t.xhtml
Description: application/xhtml


epub-errors.log
Description: Binary data
___
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 XHTML Format

2013-09-04 Thread Thangalin
Hi.

of course we could alternatively export all as 
> but i don't like that too much; html itself is not rich enough for our
> purpose
>

What about giving developers the ability to change the destination element?
For example:

\setuplist[chapter][
  xml={\starttag[h1]#1\stoptag}
]


Would produce, upon export:

Chapter


Or (using "export" instead of "xml"; I don't care what it is named):

\setuplist[chapter][

export={\starttag[div]\startattribute[class]{chapter}#1\stopattribute\stoptag}}
]


Similarly, this would produce:

Chapter


This would offer the flexibility of custom XML documents without affecting
the default behaviour.

  * Generates XHTML headers (including )
>
> not needed as we're 'standalone'
>

Having the ability to produce the  and  elements could
be as simple as:

\setupexport[
  standalone=no,
]



>   * Produces images as img tags, rather than float tags.
>>
> the css can deal with them (info is written to files for that)
>

Yes, but they aren't standard. There is an ecosystem of tools (e.g.,
Calibre, normalizing CSS templates, etc.), not to mention a widespread
knowledge-base, that groks the minimal XHTML specification. Plus, using XML
tags that are not in the minimal XHTML spec. means more testing on more
devices to make sure that their XHTML parsers render correctly.


> xhtml has no typical tags .. it's xml + css (or xslt) ... unfortunately
> browsers have


That is, a Strictly Conforming XHTML Document, as per:

http://www.w3.org/TR/2000/REC-xhtml1-2126/#docconf

the export of context is in fact just xml, and by tagging it as xhtml we
> can apply css to it; but if someone has a workflow for producing epub an
> option if to postprocess that xml file into whatever epub one wants
>

I could transform the ConTeXt-generated XML into strictly conforming XHTML,
but it was a step I was hoping to avoid. Right now my process is:

   1. Convert XML data to a ConTeXt .tex file.
   2. Convert ConTeXt to either PDF or EPUB.
   3. Stylize EPUB using CSS.

I want to use ConTeXt here (instead of going directly from XML data to
EPUB) because ConTeXt provides functionality such as multiple indexes,
table-of-contents, and bundling the .epub. Having an extra step to generate
strictly conforming XHTML is architecturally painful as it means
transforming the document three times (XML -> ConTeXt, ConTeXt -> XML, then
XML -> XHTML).


> Everytime we look into epub there's another issue ... it's not a standard
> but reversed engineered application mess (happen soften with xml: turn some
> application data structures into xml and call it a standard)
>

Some book vendors only accept validating EPUBs. ConTeXt is documented as
being able to generate EPUBs. The documentation should state the EPUBs do
not validate and do not generate strictly conforming XHTML.

I have spent the last three weeks converting documents from LaTeX to
ConTeXt because the documentation stated that ConTeXt can produce EPUBs.
While true, the documentation did not mention its shortcomings. Had I known
in advance, I probably would have gone straight to EPUB using Java or, with
a little revulsion, PHP classes. ;-) That said, I probably should have
tested this feature sooner. :-)

as i have no real use/demand for epub it's not something i look into on a
> daily basis
>

How can I help resolve these issues?

Merely "testing" (which I am happy to do) isn't going to produce a strictly
conforming XHTML document.

Kindest regards.
___
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 XHTML Format

2013-09-05 Thread Thangalin
Hi,


> 
> 
> 
>
> i.e. only divs and spans


I think that would be a more robust output format, technically, easier to
adapt, and more readily conform to the strict XHTML tag subset.

The other issue I encountered was this:

\startfrontmatter
  \startstandardmakeup
Title page
  \stopstandardmakeup

  \startstandardmakeup
Copyright
  \stopstandardmakeup

  \completecontent
\stopfrontmatter


This produced "*Title pageCopyright*" as text without any markup, which
makes the EPUB output a bit difficult to parse. I thought the software
should output something like:


  Title page
  Copyright
  



This way the title and copyright pages can be styled independently.

Kindest regards.
___
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 XHTML Format

2013-09-05 Thread Thangalin
Hi,

handle XML+CSS well. However, most (all?) EPUB readers don't. So, the
> question is asking if instead ConTeXt could generate a XHTML


Precisely.


>  If you need both EPUB and PDF, start with a semantically rich XML
>> vocabulary, e.g. DocBook. In this case you can relatively easy transfrom
>>
>
My database doesn't generate DocBook. It generates a custom XML document
from which I generate a web page, and a LaTeX document (though soon to be
ConTeXt!). There is no reason, technically, why I cannot convert the source
XML to either DocBook or directly to EPUB. There are, however, problems
doing that, which Aditya correctly surmises:


> - Automatic section numbering taking care of different conversions.
> - Automatic index generation and sorting
> - Inserting hyphenation points at the appropriate place in the generated
> output (so that the browser can effectively rely on TeX's hyphenation
> algorithm to do line-breaking).
> - Convert TeX math to MathML.
>
> The current ConTeXT XML source can translate a well formed ConTeXt
> document into a XML document with the above features.


Those are exactly the issues that I would love to resolve using ConTeXt for
generating an EPUB. (The MathML isn't as important to me, but I can see
other people wanting such a feature.)

What about accessibility? I expect that visually impaired people would
> depend on document structure rather than its visualisation.


That is a good point. The current XML structure produced by ConTeXt (Hans
correct me here if I'm mistaken) is not accessible, as it doesn't adhere to
strict XHTML. I suspect that  tags would not be accessible -- the only
way to provide true accessibility in EPUB format would be by using the
strict XHTML tags.

for instance, we have more levels than H1..H6, so how to do H7? if someone
> has to deal with that, he/she can as well transform all into H1 with some
> class which is a local solution then


I realize there is not going to be a one-to-one map of all possible ConTeXt
macros to XHTML. For someone who has 7 levels of nested sections they would
either have to rewrite some Lua or perform some post-processing (e.g., with
XSLT). I would posit that a document with 7 levels of nested sections is
not going to be a common occurrence.

When I talk about strict XHTML, I'm proposing that a _simple_ ConTeXt
document (up to 6 header levels, numbered and unnumbered lists, images,
text emphasis, etc.) should generate a simple, validating XHTML document.
Trying to attain 100% coverage of ConTeXt transmogrification to XHTML is
ridiculous when, I suspect, 80% coverage would meet most needs. :-)

It is definitely possible to translate the ConTeXt EPUB output to XHTML.
However, there are practical realities that hinder such an approach.
Architecturally, if anyone is going to translate an XML document to EPUB
format, it certainly won't be this way:

*XML + XSLT -> ConTeXT File -> ConTeXt EPUB XML + XSLT -> EPUB + CSS*

It'll be this way, which is less time-consuming, less complex, and less
susceptible to err:

*XML + XSLT (or API) -> EPUB + CSS*

However, it does not, as we all know, produce as feature rich output as
leveraging the ConTeXt abilities that Aditya mentioned, which was the point:

*XML + XSLT -> ConTeXT TeX -> EPUB + CSS*

Kindest regards.
___
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 XHTML Format

2013-09-06 Thread Thangalin
Hi,

The best reader imho is iBooks on the iPad, nothing else, from what I've
> seen, comes close. But that is one expensive eReader. :(
>

We'll just have everybody in the world who has a Kindle, Kobo, or other
reader exchange their existing hardware, and then purchase an iPad plus
iBook. Problem solved? ;-)

ConTeXT TeX reading xml -> export -> optional transform -> EPUB + CSS*
> you want 'direct epub html from context' (no xslt) but on the other hand
> use xslt to map onto context while context can do xml directly ... chicken
> egg


Well, given that ConTeXt doesn't actually produce validating EPUB
documents, I suspect not many people will actually use that feature. It's
great in theory, but if it produces books that don't actually work on the
Kindle or Kobo, then it's unusable in practice -- never mind not being able
to add the books to online marketplaces (such as Amazon) because, again,
the output does not validate.

Kind regards.
___
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 XHTML Format

2013-09-06 Thread Thangalin
Hi,

never mind not being able to add the books to online marketplaces (such as
> Amazon) because, again, the output does not validate.
>

I think the simplest thing to do would be to update the wiki and have a
note that informs readers that while ConTeXt can be used to generate an
EPUB, it is likely that that EPUB will be unusable for devices without
further transformation of the XML content. At least that way the knowledge
is out there and people are forewarned that not all EPUB documents are
equivalent.

Kindest regards.
___
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 XHTML Format

2013-09-07 Thread Thangalin
Hi,

so, i'd never claim that context produces epub but it can be used in a
> workflow that involves epub as it outputs xml which can be transformed
>

That's a distinction that either might not matter or sometimes is lost:

http://tex.stackexchange.com/a/17642/2148
http://wiki.contextgarden.net/epub
"ConTeXt has preliminary epub support..."

Does ConTeXt refer to a suite of tools, or only the "context" command?
Either way, it appears that the line between the command and the tool set
is blurred a bit. This is completely understandable, too, as you wouldn't
want to write, "the ConTeXt suite of tools includes a command, mtxrun, that
can produce EPUB files" all the time when talking about EPUBs.


> supporting all variants of epub in the backend would be the same as
> hardcoding all kind of xml dts in the frontend (docbook, tei, whatever);
> instead we provide a general xml handler and a general xml export


That paragraph would be an excellent addition to the wiki; not sure where
though.

Kind regards.
___
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] ConTeXt Manual Errata

2013-09-18 Thread Thangalin
Hi,

During a recent plane ride, I started to read the ConTeXt manual to get a
better understanding: http://www.ctex.org/documents/context/cont-enp.pdf

If anyone has plans to revise it, I have attached a file with corrections,
specific comments, and general comments. I did not have the ConTeXt manual
source code on hand, so I could not directly modify it.

Take the comments with a grain of salt: I have little ConTeXt experience. I
hope it proves useful.

Kindest regards.
ConTeXT Manual Errata & Suggestions
===

Section 1.3.

The word "something" needs to be defined before it is used.
For example, "\setupsomething" <- What does "something" mean?

The \defineenumeration[Question] creates a \Question command,
but \definehead[Procedure][section] does not create \Procedure command?
(Should the capital P not carry forward?)

The \startnarrower requires an explanation on how it affects the
resulting document. Likewise \startitemnize.

What does the "of" in "\beginofAnswer" mean? Is it required? Where
does it come from? Why is it not simply "\beginAnswer"?

"Figure 1.1 is typeset this way" should include the page number.

"The last example" -- does this refer to the previous example, or the
final example?

"The command \setupfootertexts, which we will discuss in detail in a later
chapter, has three arguments of which the first is optional. The first
argument defaults to [text]. Optional arguments are displayed as slanted
text." Can be: "The command \setupfootertexts, discussed in detail
chapter X, has three arguments. The first argument is optional as denoted
by slanted text, and has a default value of text."

"ConTeXt is able to keep track of the status of information on the
page, ..." is tersely written, "ConTeXt tracks status information per page,
such as the current chapter name."

Provide an immediate example of  arrow marks in a frame.

Section 1.4.

"TeX does a lot" is "TeX performs many".

Document processing is best done by TeXexec -- is this still true? I thought
the "context" program supercedes TeXexec?

Describe the relationship between TeX and ConTeXt. For example, why do the
subsequent sections discuss TeX examples?

Section 1.5.

TeX uses ASCII, but ConTeXt can use UTF-8. Is the information about ASCII a
bit misleading?

"ConTeXt fully supports PDFTeX, which means that you can generate PDF output
directly" can be written, "ConTeXt can produce PDF documents, because it fully
supports PDFTeX."

Section 1.6.1.
--
Still relevant with UTF-8?

Section 1.6.2.
--
Does \par hold true for ConTeXt? How would you use it? Show an example.

Section 1.6.3.
--
Avoid demonstrations that significantly reduce legibility.

Section 1.6.3.
--
"TeX is one of the few typesetting systems that does math typesetting right."
Can be: "TeX typesets mathmatical expressions correctly and beautifully."

"It does not hurt to know a bit about the basics of TeX, because that way one
can far more easilly write his or her own alternatives to, for instance,
chapter headers." Can be: "Knowing TeX basics allows developers and authors
to provide alternatives to default commands, such as chapter headers."

Section 1.6.4.
--
"Complete fontfamilies are" should be "Complete fontfamilies include".

Section 1.6.5.
--
"Characters have dimensions. Spacing between words and lines have dimensions.
These dimensions are related to one of the units of table 1.1. For example
the linespacing in this document is 14.83998pt." Can be: "Characters, spacing
between words (known as kerning), and spacing between lines have dimensions.
The line spacing in this document, for example, is 14.83998pt. Table 1.1
lists how dimensions relate."

Table 1.1 should split the "equivalent" column into two columns: "base" and
"equivalent", or be renamed to "equivalency". The millimeter might not be
necessary information (it is metric).

"Next to the mentioned dimension TeX also uses em and ex. Both are font
dependant." Better as: "In addition to the measures in Table 1.1, TeX uses
the font-dependent units of em and ex." (Note spelling mistake: dependant.)

Section 1.9.

Relatively empty page.

Unknown list of commands -- why are they there? What do they do? Should
they be moved elsewhere?

Section 2.2.

"It is advisable to type the document setups before the \start--command," --
What start command? \starttext, perhaps?

Section 2.3.

The \environment command should be introduced before it is used.

The bullet list should start with the word and then define it. For example,
"A *project* is a group of texts that belong together..."

The term "component" should be italicized like the other defined terms.

"Before a \start--\stop--pair commands can be added." Can be: "Commands
can be defined before a \start command."

The resolution process of searching for files in parent directories
is not clear. Use the 

[NTG-context] deeptextcommand and firstcharacter

2013-09-20 Thread Thangalin
Hi,

The attached file does not compile in ConTeXt.

However, if the \placeindex is substituted for \completeindex, then the
document compiles.

Any idea how to use a deeptextcommand and firstcharacter as shown in the
attachment while also using the firstcharacter macro?

Thank you.

Kindest regards.


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

Re: [NTG-context] deeptextcommand and firstcharacter

2013-09-21 Thread Thangalin
Hi,

Most programming languages allow extraction of a character or substring
from a string. For example, if I wanted to stylize the word Index:

*I...* Index *...X*

It would be handy to do something like:

\bold{\getcharacter[1]{#!}}... #1
...\bold{\getcharacter[\stringlength{#!}]}

That is a much more flexible solution than only providing a mechanism to
get the first character.

Is this possible?

Kind regards.
___
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] deeptextcommand and firstcharacter

2013-09-21 Thread Thangalin
Sorry, I missed a {#1}:

\bold{\getcharacter[1]{#1}}... #1 ...\bold{\getcharacter[\
stringlength{#1}{#1}]}

Best regards.
___
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] deeptextcommand and firstcharacter

2013-09-21 Thread Thangalin
Hi, Wolfgang.

I tried dropping in the Lua code, but it does not extract the text:

\define[1]\StyleChapter{%
  \StyleChapterFramed{%
\framed[align=right, frame=off]{%
  \startoverlay
\color[ColourSecondaryLightest]{%
  \cldcontext{string.sub(#1,0,1)}
}
\vskip-1.9em\hskip1.2em#1
  \stopoverlay
}
  }
}


! LuaTeX error [string "\directlua "]:1: bad argument #1 to 'sub' (string
expected, got nil)

I've tried a few variations:

  \directlua{string.sub(tex.sprint("\luatexluaescapestring{#1}") }
  \directlua{string.sub("\luatexluaescapestring{#1}",0,1)}
  \directlua{string.sub(tex.sprint("#1"),0,1)}
  \cldcontext{string.sub(tex.sprint("#1"),0,1)}

Any ideas?
___
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] deeptextcommand and firstcharacter

2013-09-21 Thread Thangalin
Ah, I think this does it:

  \cldcontext{string.sub("#1",0,1)}%

Automatically expands the macro. Nice.
___
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] Confounding colour conundrums

2013-09-22 Thread Thangalin
Hi,

In the attached example, I thought the word *Website* should be *orange*,
but it is *blue*.

If *color=blue* is removed (from \setupinteraction[state=start]), then the
word *Website* is *dark green*, which is also unexpected, because the only
place *dark green* occurs is in the setuplist for the chapter's page number
(i.e., pagecolor=darkgreen). It appears that the default colour for links
embedded with \useurl bucks trendy traditional *blue* hyperlinks, favouring
*dark green*. (*Black* would also make sense as a default.)

I am confounded because the code explicitly contains the line:

\setupurl[color=orange]

I thought that that would set the external hyperlink colour to *orange*.

In the same document, how do I set:

   - hyperlink colours to *orange*;
   - index page number colours to *red*;
   - table of contents text to *dark cyan*; and
   - table of contents page numbers to *dark green*.

Many thanks.

Kindest regards.


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

Re: [NTG-context] Confounding colour conundrums

2013-09-22 Thread Thangalin
>From http://www.mail-archive.com/ntg-context@ntg.nl/msg44867.html it
appears that \setupinteraction affects the \setupurl command when no url is
given. This was not  obvious from the
documentation
.

It seems that assigning different colours for internal (e.g.,
cross-references, table of contents, and indexes) vs. external links (e.g.,
web sites) is not possible without creating new macros that use the \colormacro?

Kind regards.
___
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] Confounding colour conundrums

2013-09-22 Thread Thangalin
Hi,

The trick does seem to be that a new macro is required.

% External link colours
\definecolor[steelblue][h=4682B4]
\define[2]\href{%
  \begingroup
\setupinteraction[
  style=normal,
  color=steelblue,
]%
\goto{#1}[url(#2)]%
  \endgroup%
}

See attached.

Kindest regards.


ex.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] Mixedcolumns maximum height for vertical rule: bug?

2013-09-23 Thread Thangalin
Hi,

The horizontal rule for the first page extends to the bottom of the page,
but does not do so on the second page. How do you prevent the vertical rule
from extending to the bottom of the page?

\usemodule[ipsum]
\setuplayout[
  topspace=\zeropoint,
  height=fit,
  width=fit, % Allow text to be flush with the bottom.
  %footerdistance=2cm,]
\definemixedcolumns[StyleColumns][
  frame=off,
  separator=rule,
  rulecolor=black,
  alternative=global,
  %maxheight=\textheight,]
% Set up two-column mode for the ingredients, instructions,
etc.\setuphead[section][
  after={\startStyleColumns},
  aftersection={\stopStyleColumns},]
\def\StylePageNumber#1{%
  {\inframed[
frame=off,
background=color,
backgroundcolor=red,
width=2em,
height=2em,
  ]{#1}}}
\setuppagenumbering[location=inright,command=\StylePageNumber,]
\starttext\startchapter[title=Chapter]
  \startsection[title=Section]
\input knuth \input zapf \ipsum \input knuth \input knuth \input zapf
  \stopsection\stopchapter\stoptext


For further details, see: http://tex.stackexchange.com/q/134750/2148

Kindest regards.
___
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] Repeat second-level registers within index

2013-09-24 Thread Thangalin
Hi,

How do you prevent ConTeXt from hiding (collapsing?) duplicate level 2
index items?

For example:

  \startitem
5 array \index{hedgehog+SECTION A}hedgehog
  \stopitem
  \startitem
7 army \index{herring+SECTION A}herring
  \stopitem
  \startitem
100 bloat \index{hippopotamuses+SECTION A}hippopotamuses
  \stopitem

The text "SECTION A" will only appear once in the index, right after
hedgehog. I would like it to appear once per index term, always. Such as:

*H*
hedgehog
SECTION A 2
herring
SECTION A 2
hippopotamuses
SECTION A 2

For more details, see:
http://tex.stackexchange.com/questions/134952/force-second-level-index-to-be-displayed-in-context

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

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

Re: [NTG-context] ConTeXt Manual Errata

2013-09-26 Thread Thangalin
Hi,

I registered an account, but have not seen any confirmation.

Kindest regards.


On Thu, Sep 26, 2013 at 10:44 AM, Marco Patzer  wrote:

> On 2013–09–21 Marco Patzer wrote:
>
> > > I did not have the ConTeXt manual source code on hand, so I could
> > > not directly modify it.
> >
> >   http://wiki.contextgarden.net/Improving_the_manuals
> >
> > Do not count on someone else to fix it. Create an account and fix
> > what you think could be improved, especially the grammar and
> > spelling mistakes. If you're unsure about something, write a mail to
> > the manual mailing list¹ for questions about the manual (style,
> > layout, etc.) or this list for everything else.
> >
> > Note: The manual has not been updated since a while and it's broken
> > at the moment. I'll prepare a fix soon, so it will compile with a
> > recent MkIV.
>
> I committed a fix today and now it should compile again. I did not
> fix any of your suggestions. You are invited to fix the source or
> send in a patch. I or someone else can review and merge them.
>
> The dedicated mailing list for the manual seems to be broken at the
> moment. Using this list for manual discussions is also fine, I guess.
>
> Marco
>
>
> ___
> 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] ConTeXt Manual Errata

2013-09-26 Thread Thangalin
+π from me.

My preference would be BitBucket (slightly simpler than github and allows
for free private repositories), but, either way, the result is the same:
fewer steps to updating the manual. Moving away from svn to git is also a
step in the right direction, IMO.

One aspect of wikis that I thoroughly enjoy is the ability to fix something
(contribute) immediately. Moving to a web-based repository for the manual
removes barriers (such as waiting upon moderated approvals whilst the
moderator vacations) to letting people contribute to projects. Throw in a
nightly build (with blaming) to ensure that the manual compile is never
broken (for long).

Regards.
___
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] git or svn (was: ConTeXt Manual Errata)

2013-09-26 Thread Thangalin
That is an excellent summation, Mica.


On Thu, Sep 26, 2013 at 2:56 PM, Mica Semrick  wrote:

> > Where is the pain?
> > What would be the benefit when moving to github?
>
> On the thread someone wanted to add something to the manual, but didn't
> have SVN access. The admin wasn't getting email, and thus couldn't grant
> the new account. The material was not added the to manual.
>
> If the manual was on github, it could have been forked, branched, content
> added, pull request made. End of story. So we do want the features of
> github.
>
>
> On Thu, Sep 26, 2013 at 2:50 PM, Peter Münster  wrote:
>
>> On Thu, Sep 26 2013, Mica Semrick wrote:
>>
>> > @Peter github makes collaboration quite painless. Users can manage
>> their own
>> > accounts.
>>
>> I like git because of its features. And when I don't need those
>> features, I prefer svn because of its simplicity. Where is the pain?
>> What would be the benefit when moving to github?
>>
>> -1 (not worth the trouble for me)
>>
>> (On the other hand, if you sent me some bitcoins, I would be glad to
>> copy contextman to github. ;)
>>
>> --
>>Peter
>>
>> ___
>> 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] Repeat second-level registers within index

2013-09-27 Thread Thangalin
Hi,

I changed lines 695 in
bin/context/tex/texmf-context/tex/context/base/strc-reg.lua to the above. I
re-ran context against my test case and Philipp's example.

Actual results:

a
foo 2
*aa 2
aaa 2

*bar 2
a
foo 2
aa 2

Expected results:

a
foo 2
aa
*foo 2
*aaa
*foo 2
*
bar 2
a
foo 2
aa 2

Kindest regards.

___
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] Repeat second-level registers within index

2013-09-27 Thread Thangalin
Thank you, Hans.

The error still seems to be present.

Out of curiosity, what does "max 4" mean? Does it limit the index nesting
levels?

For my project, I require 5 nesting levels -- is that possible?

Kind regards.


strc-reg.lua
Description: Binary data
___
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] Repeat second-level registers within index

2013-09-27 Thread Thangalin
Hi,

I did not. I have since run *context --make* and the second-level registers
are working.

Thank you.
___
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] mtx-context - extraordinarily quiet mode

2013-09-28 Thread Thangalin
Hi,

I ran the following:

context --noconsole --batchmode --nonstopmode filename.tex

This wrote information to the console:

This is LuaTeX, Version beta-0.76.0-2013040516 (rev 4627)
 \write18 enabled.
Underfull \hbox (badness 2401) in paragraph at lines 464--464
... lots more output ...
system  | total runtime: 1.962

How do you prevent ConTeXt from writing anything whatsoever to the console?

Kind regards.
___
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] mtx-context - extraordinarily quiet mode

2013-09-28 Thread Thangalin
Thank you, Aditya.

I should have mentioned that I was thinking about it in terms of
optimization. Sometimes when a program's debug/logging mode is
disabled, the program executes faster. (In the old days just writing
to standard out was enough to make a program grind to a crawl.)

I could not find a wiki page on optimizing the compiler -- are there
any other tricks to making compiles faster?

Kindest regards.
___
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   4   >