Re: [NTG-context] TeXGyre Heros on Firefox
Am 10.03.22 um 15:57 schrieb Hans Hagen via ntg-context: mtxrun --script pdf --fonts hostsharing-vereinshandbuch.pdf the arial comes from an image Thanks! So many cool tools out there. :-) juh ___ 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] redefining xmlsetups inside a XML document
On 3/10/2022 4:59 PM, mf via ntg-context wrote: Hello, I'm trying to add new templates (xmlsetups) from the XML document itself. See the attached MWE. - the XML document is a simple XHTML file - in the "head" element there's a "script" element with the "type" attribute set to "text/vnd.context", whose contents are then passed to \xmlcontext - the "body" element has a "data-xmlsetups" attribute whose value should tell which xmlsetups is to be applied on the body contents (it's defined in the "script" element above) If it worked, the resulting PDF should show the body element, followed by a "Hello world!" paragraph written in red. But it does not work, because there's something I'm missing in the redefinition and application of xmlsetups. To try the MWE, type: context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml \startxmlsetups myHtml \xmlsetsetup{#1}{p}{myHtml:p} % you're missing this \xmlsetup{#1}{xml:process} % which is % \xmlregistereddocumentsetups{#1}{#1} % \xmlmain{#1} \stopxmlsetups \startxmlsetups myHtml:p \dontleavehmode\red\xmlflush{#1}\par \stopxmlsetups - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] redefining xmlsetups inside a XML document
Hello, I'm trying to add new templates (xmlsetups) from the XML document itself. See the attached MWE. - the XML document is a simple XHTML file - in the "head" element there's a "script" element with the "type" attribute set to "text/vnd.context", whose contents are then passed to \xmlcontext - the "body" element has a "data-xmlsetups" attribute whose value should tell which xmlsetups is to be applied on the body contents (it's defined in the "script" element above) If it worked, the resulting PDF should show the body element, followed by a "Hello world!" paragraph written in red. But it does not work, because there's something I'm missing in the redefinition and application of xmlsetups. To try the MWE, type: context --environment=nested-xmlsetup.tex --forcexml nested-xmlsetup.xhtml Massi\startxmlsetups html \xmlsetsetup{#1}{{html|head}}{html:flush} \xmlsetsetup{#1}{{html head script}}{html:script:context} \xmlsetsetup{#1}{{html body}}{html:body} \xmlsetsetup{#1}{p}{html:p} \stopxmlsetups \startxmlsetups html:flush \xmlflush{#1} \stopxmlsetups \startluacode function xml.functions.parseScript(s) local mimetype = s and s.at and s.at.type if mimetype and mimetype == "text/vnd.context" then lxml.context(s) end end function xml.functions.flushBody(b) local xmlsetups = b and b.at and b.at["data-xmlsetups"] if xmlsetups then lxml.tobuffer(b, ".", "body") context("\\typebuffer[body]") context.xmlprocessbuffer("body", "body", xmlsetups) else lxml.flush(b) end end \stopluacode \startxmlsetups html:script:context \xmlfunction{#1}{parseScript} \stopxmlsetups \startxmlsetups html:body \starttext \xmlfunction{#1}{flushBody} \stoptext \stopxmlsetups \startxmlsetups html:p \dontleavehmode\xmlflush{#1}\par \stopxmlsetups \xmlregistersetup{html} nested-xmlsetup.xhtml Description: application/xhtml ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] TeXGyre Heros on Firefox
On 3/10/2022 1:44 PM, juh via ntg-context wrote: Dear all, there were some discussions on pdf viewers on the list and I know that things are not always fine. I now have a problems with the Firefox pdf viewer and TeX Gyre Heros. The font looks uneven in FF, no problems elsewhere. so a ff problem then When I scroll into the pdf to set the display to 150% or more the font shows up just fine. So it seems to be a display problems with firefox. I tried several pdf versions no change. My configuration: \definefontfamily[mainfont][serif][texgyreheros] \definefontfamily[mainfont][sans] [textgyreheros] \definefontfamily[mainfont][mono] [texgyrecursor][features=none] \definefontfamily[mainfont][math] [texgyrepagellamath] \definefallbackfamily [mainfont] [rm] [Latin Modern Math] [scale=0.925, range=0x22C0] \definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes] \setupalign[hz,hanging] \setupitaliccorrection[global, always] Is there anything I can do? And the is another issue: To my big surprise ArialBold MT is included into the file. mtxrun --script pdf --fonts hostsharing-vereinshandbuch.pdf the arial comes from an image - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] TeXGyre Heros on Firefox
Dear all, there were some discussions on pdf viewers on the list and I know that things are not always fine. I now have a problems with the Firefox pdf viewer and TeX Gyre Heros. The font looks uneven in FF, no problems elsewhere. When I scroll into the pdf to set the display to 150% or more the font shows up just fine. So it seems to be a display problems with firefox. I tried several pdf versions no change. My configuration: \definefontfamily[mainfont][serif][texgyreheros] \definefontfamily[mainfont][sans] [textgyreheros] \definefontfamily[mainfont][mono] [texgyrecursor][features=none] \definefontfamily[mainfont][math] [texgyrepagellamath] \definefallbackfamily [mainfont] [rm] [Latin Modern Math] [scale=0.925, range=0x22C0] \definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes] \setupalign[hz,hanging] \setupitaliccorrection[global, always] Is there anything I can do? And the is another issue: To my big surprise ArialBold MT is included into the file. I am using the current lmtx. If you want to see the effect, download the pdf. https://www.hostsharing.net/publikationen/vereinshandbuch/ Just click on "Anonym herunterladen" no need to register. TIA juh -- Autoren-Homepage: . http://literatur.hasecke.com Satiren & Essays: . http://www.sudelbuch.de Privater Blog: http://www.hasecke.eu Netzliteratur-Projekt: http://www.generationenprojekt.de signature.asc Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] help with facing page image
Using your example, Sreeram, but adapting it to my own set of images (which are not cows or spiders!) I can now see clearly how to make use of all the essential information that had initially been provided by Wolfgang, and also the important hint, which I had clumsily and unsuccessfully been trying anyway before he offered it, from Aditya, about passing key value parameters along the lines of Wolfgang's 'name ='. It simply did not occur to me to do this using 'factor= '. But there was much more about the example I would not have worked out by myself as well! Thank you (all) for your patience. Julian On 10/3/22 17:51, śrīrāma wrote: On Thursday, March 10, 2022 3:32 AM jbf via ntg-context wrote: Am endeavouring to explore Wolfgang's very 'elegant' solution to this facing page challenge. The exploration has included a look at base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where I see immediately that the approach is experimental and where it says also that 'probably more alternatives will be added'. I wonder if that last phrase also includes the ability to manipulate the image(s) either generally or in individual cases? The following example is based on Wolfgang's solution using injections: I have modified the setup slightly to hook into \externalfigure's {width, height, orientation} using user-variables. With this I think you can place any kind of image (portrait or landscape) correctly by using width, height, and rotation. I picked up some images of cows, 'spider', 'hacker' and 'mill' and have them renamed as {chap-cover-1, ... chap-cover-6} for a total of 6 chapter images. %%% start example \definepageinjectionalternative [chapter:image] [renderingsetup=pageinjection:chapter:image] \startsetups [pageinjection:chapter:image] \clip [width=\framedwidth,height=\framedheight] {\centerbox{% \externalfigure [\dummyparameter{name}] [%factor=, width=\structureuservariable{width}, height=\structureuservariable{height}, orientation=\structureuservariable{rotation}]% }} \stopsetups \definepageinjection [chapter:start] [empty] [page=left] \definepageinjection [chapter:insert] [previouspage] [alternative=chapter:image, pagestate=stop] \setuphead [chapter] [beforesection={\pageinjection[chapter:start]}, insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}]}] \setuphead [chapter] [beforesection={\pageinjection[chapter:start]}, insidesection={\pageinjection[chapter:insert][name={chap-cover-\namedheadnumber{chapter}}]}] \setuppagenumbering [alternative=doublesided] \setupexternalfigures [location=default] \starttext \startchapter [title={Mill}] [rotation=90,width=\paperheight] \dorecurse{7}{\samplefile{lorem}} \stopchapter \startchapter [title={Mill}] [rotation=-90,width=\paperheight] \dorecurse{11}{\samplefile{lorem}} \stopchapter \startchapter [title={Mill}] [rotation=-90,width=\paperheight] \dorecurse{7}{\samplefile{lorem}} \stopchapter \startchapter [title={Mill}] [rotation=90,width=\paperheight] \dorecurse{7}{\samplefile{lorem}} \stopchapter \startchapter [title={Mill}] [rotation=-45,width=\paperwidth] \dorecurse{11}{\samplefile{lorem}} \stopchapter \startchapter [title={Mill}] [height=\paperheight] \dorecurse{7}{\samplefile{lorem}} \stopchapter \stoptext %%% end example Sreeram ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] interlinespacing in margin notes – solved
Hi all, esp. Hans and Massimiliano, yesterday in the online meeting we discussed (again) my margin notes problems. A quite minimal setup is shown below. My remaining problem was that the footnotes always used the interlinespacing (baseskip) of the main text. Finally I found the reason in my typescript file: \definefontfeature[default][dimensions=strut] (I guess I tried to solve the irregular line spacing with that setting.) Thank you for your patience! Now I need to adjust the linespacing and page breaking in all other parts of my current book... Hraban """ \usemodule[ipsum] \showframe \setuplayout[ width=100mm, rightmargin=50mm, rightmargindistance=6mm, ] \setupbodyfontenvironment[11pt][ em=italicface, text=11pt, small=8pt, interlinespace=14pt, ] \definebodyfontenvironment[8pt][interlinespace=8pt] \setupbodyfont[rm,11pt] \define\PlaceFootnote{% \inouter[ width=50mm, stack=yes, ]{% \placelocalnotes[footnote][before=,after=] }} \setupnote[footnote][ location=text, indenting=no, bodyfont={ss,8pt},% footnote text style next=\PlaceFootnote, align=flushleft, ] % footnote marker in text \setupnotation[footnote][ way=bytext, indenting=no, distance=0.25em, ] % footnote text \starttext \dorecurse{10}{ \ipsum[alternative=lines,n=random,language=la]\footnote{\ipsum[alternative=lines,n=random,language=la]} \ipsum[alternative=lines,n=random,language=la]\par } \stoptext """ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___