[NTG-context] Strange behavior in somewhat complex layout (again)
Hi List, it seems my message went unnoticed, if you can help me out, please do. I'm an struggling with this layout. I'm trying to make something using bits and examples found here and elsewhere, but I'm hitting a wall. I know there's a flawed logic in my approach, but I can't figure it out. Any help is appreciated. Expected behavior of the following MWE: When starting a new chapter, check if the page is even (left page), if so, fill it with color, and start the chapter in the next odd page (right page), removing the header but leaving the footer in that start-chapter page; and if this is a start-chapter page, use a specific graphic overlay for the page, but if if not (if its a regular page), use another graphic. Result: The header still appears in the start-chapter page, if it comes after the color filled page. But, if the start-chapter page comes after a regular (even) page, everything works as expected (no color-filled page, no header in the start-chapter page). MWE: %% START MWE \definecolor[rojo][h=ED553B] \definehighlight[rojo][color=rojo] \startMPinclusions numeric u ; u := 1.125pt ; numeric i ; i := 0.125in ; string prevChapterTitle, currentChapterTitle; prevChapterTitle := ""; currentChapterTitle := ""; \stopMPinclusions \startuseMPgraphic{page:background} StartPage; currentChapterTitle := "\namedstructurevariable{chapter}{title}"; if currentChapterTitle <> prevChapterTitle : fill (topboundary Page -- cycle) enlarged(0,8i) shifted (0,-4i) withcolor transparent(4, 0.2, \MPcolor{rojo}) ; fill (bottomboundary Page -- cycle) enlarged(0,1u) shifted (0,6i) withcolor \MPcolor{rojo} ; prevChapterTitle := currentChapterTitle ; else: fill (topboundary Page -- cycle) enlarged(0,0.25u) shifted (0,-7i+3u) withcolor \MPcolor{rojo} ; fill (bottomboundary Page -- cycle) enlarged(0,0.25u) shifted (0,6i) withcolor \MPcolor{rojo} ; fi; StopPage; \stopuseMPgraphic \defineoverlay [chapter:background] [\useMPgraphic{page:background}] \setupbackgrounds[page][background=chapter:background] \definepagebreak[firstpagebreak][yes,header] \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=rojo] \page[yes,right] \popbackground} \stopsetups \setuphead[chapter] [width=20em, before=\directsetup{chapter:before}, align={flushleft,nothyphenated,verytolerant}, style={\tfd\sansbold}, header=empty, page=yes, commandbefore={\blank[1.75in]}, after={\blackrule[color=rojo,height=4pt,width=6em]\blank[1.25in]}] \setuppagenumbering[alternative=doublesided,location=] \setupheadertexts [] [{{\small\sans\getmarking[chapter]}}] [{{\small\sans\getmarking[chapter]}}] [] \setupfootertexts [] [{\rojo{\small\sansbold\pagenumber}}] [{\rojo{\small\sansbold\pagenumber}}] [] \starttext \dorecurse{4}{% \startchapter[title={A chapter with a really long, long title}] \dorecurse{9}{\input{tufte}} \stopchapter \startchapter[title={A different chapter with a really long, long title}] \dorecurse{6}{\input{tufte}} \stopchapter} \stoptext %% STOP MWE Thank you for your time. Andrés Conrado Montoya ___ 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] is it useful to use the option "--fonts=all" when running first-setup-sh?
Tank you very much Pablo. I'll try that. They are proper latex fonts, tho, so I'm no sure that will do. I also have a background i humanities and book design, but I'm now making math books, go figure. It's very interesting from a typographic point of view. Now I'm more interested in seeing what happens with the last code I sent here, in another message... "Strange behavior in somewhat complex layout" Maybe nobody noticed it. I hope I can figure that out. ___ 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] Strange behavior in somewhat complex layout
Hello list, I'm trying to make something using bits and examples found here and elsewhere, but I'm hitting a wall. I know there's a flawed logic in my approach, but I can't figure it out. Any help is appreciated. Expected behavior of the following MWE: When starting a new chapter, check if the page is even (left page), if so, fill it with color, and start the chapter in the next odd page (right page), removing the header but leaving the footer in that start-chapter page; and if this is a start-chapter page, use a specific graphic overlay for the page, but if if not (if its a regular page), use another graphic. Result: The header still appears in the start-chapter page, if it comes after the color filled page. But, if the start-chapter page comes after a regular (even) page, everything works as expected (no color-filled page, no header in the start-chapter page). MWE: %% START MWE \definecolor[rojo][h=ED553B] \definehighlight[rojo][color=rojo] \startMPinclusions numeric u ; u := 1.125pt ; numeric i ; i := 0.125in ; string prevChapterTitle, currentChapterTitle; prevChapterTitle := ""; currentChapterTitle := ""; \stopMPinclusions \startuseMPgraphic{page:background} StartPage; currentChapterTitle := "\namedstructurevariable{chapter}{title}"; if currentChapterTitle <> prevChapterTitle : fill (topboundary Page -- cycle) enlarged(0,8i) shifted (0,-4i) withcolor transparent(4, 0.2, \MPcolor{rojo}) ; fill (bottomboundary Page -- cycle) enlarged(0,1u) shifted (0,6i) withcolor \MPcolor{rojo} ; prevChapterTitle := currentChapterTitle ; else: fill (topboundary Page -- cycle) enlarged(0,0.25u) shifted (0,-7i+3u) withcolor \MPcolor{rojo} ; fill (bottomboundary Page -- cycle) enlarged(0,0.25u) shifted (0,6i) withcolor \MPcolor{rojo} ; fi; StopPage; \stopuseMPgraphic \defineoverlay [chapter:background] [\useMPgraphic{page:background}] \setupbackgrounds[page][background=chapter:background] \definepagebreak[firstpagebreak][yes,header] \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=rojo] \page[yes,right] \popbackground} \stopsetups \setuphead[chapter] [width=20em, before=\directsetup{chapter:before}, align={flushleft,nothyphenated,verytolerant}, style={\tfd\sansbold}, header=empty, page=yes, commandbefore={\blank[1.75in]}, after={\blackrule[color=rojo,height=4pt,width=6em]\blank[1.25in]}] \setuppagenumbering[alternative=doublesided,location=] \setupheadertexts [] [{{\small\sans\getmarking[chapter]}}] [{{\small\sans\getmarking[chapter]}}] [] \setupfootertexts [] [{\rojo{\small\sansbold\pagenumber}}] [{\rojo{\small\sansbold\pagenumber}}] [] \starttext \dorecurse{4}{% \startchapter[title={A chapter with a really long, long title}] \dorecurse{9}{\input{tufte}} \stopchapter \startchapter[title={A different chapter with a really long, long title}] \dorecurse{6}{\input{tufte}} \stopchapter} \stoptext %% STOP MWE Thank you for your time. Andrés Conrado Montoya ___ 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] background color, was: CMYK Color profile
Hi Jan, yes, I've read these texts once and they played a role in thinking about getting into ConTEXt. Thank you for your answer, now I have something to investigate. Another follow up question on background colors: I try to setup the background color by \setupbackgrounds[page][backgroundcolor=blue] This works for the actual flyer, but the bleed remains white. I also tried replacing 'page' with 'paper', but then the whole document has white background... I saw your Hostsharing flyers do also have colors/graphics reaching the edge of the flyer, so I figure you ran into the same problem once. Thanks a lot De Benny Am 31. Mai 2019 07:56:02 MESZ schrieb "Jan U. Hasecke" : >Am 30.05.19 um 23:34 schrieb Benjamin Koppe: >> Hello everyone, >> >> I'm about creating a DIN Lang Folder brochure with ConTEXt. I got >> everything set up the way I'd like it to. Now that I'm done with the >> work, I've been told the output pdf should have a CMYK Color profile >> embedded for the on demand printing service to be able to deal with >the >> file... >> >> I am unsure what steps I have to take to make my output pdf compliant >> with CMYK. I don't even know how I could verify it does indeed have >> CMYK. Evince doesn't seem to show that info... >> >> So if anybdy of you could give me some hints, that's be wonderful. >> >> Cheers >> De Benny > >Hi Benny, > >if you can read German you might find some hints in my articles about >creating din lang folders >https://www.hasecke.eu/post/werbemittel-mit-context-gestalten/ > >On colors read the second part: >https://www.hasecke.eu/post/wie-wir-bei-hostsharing-mit-context-arbeiten/ > >Search the mailing list for color profile questions because I had to >ask >often to make my things work. ;-) > >The wiki contains some hints, too. > > >What you can do is to create a mode like this: > >\startmode[fogra39] > >\doiffileelse{CoatedFOGRA39.icc}{}{\farbprofilnichtgefunden} >% This will be printed in log if context does not find the profile for >% some reason > >\definecolor [hs-logoblau] [c=1.000, m=0.735, y=0.279, k=0.160] > >\definecolor [hs-dunkelblau] [c=0.844, m=0.544, y=0.070, k=0.000] > >\definecolor [hs-hellblau] [c=0.468, m=0.220, y=0.086, k=0.002] > >\definecolor [hs-orange] [c=0.127, m=0.832, y=1.000, k=0.042] > >\setupcolors[cmyk=yes,rgb=no,] > >\setupbackend[ > format=PDF/X-3:2003, > intent={Coated FOGRA39 (ISO 12647-2:2004)}, > ] > >\stopmode > >If you call context with --mode=fogra39 you will get these color >definitions and the defined pdf format with the right profile (intent). > >If you download additional icc profiles (eg. the fogra one is missing >in >the context distribution) put them here: >context/tex/texmf-local/colors/icc > >In this folder they won't be overwritten by an update. > >There are some limitations in ConTeXt concerning colors as embedded >images are not converted, so RGB images are converted only by the print >shop during printing, which can lead to strange results. I think the >only way to control the output is to convert all images to CMYK by >hand. >By doing this you can modify them to get the best results. > >I hope that helps >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 >___ -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___ 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] chapter-number prefixes on figure, etc, numbers, even in unnumbered section appearing in TOC
Dear List, The following, it seems, is a recurring question, which I had hoped to solve by digging in the test suite <https://wiki.contextgarden.net/Test_suite> -- but no luck. The problem is to have figures, list items, problems, etc. numbered with a chapter prefix (e.g. Figure 7.18) even in unnumbered sections that appear in the TOC. 1. Using \subject as the section command, the figure number is correctly prefixed, but the section itself doesn't appear in the TOC. 2. Using \section, the figure number is also correctly prefixed, and the section appears in the TOC, but the section gets numbered (e.g. Section 2.7). In one of the earlier threads, which are "Prefix for figure number lost in unnumbered subsection" <https://ntg.nl/pipermail/ntg-context/2015/082094.html>, "Unnumbered subject in TOC, numbered exercises in text" <https://ntg.nl/pipermail/ntg-context/2015/083710.html>, and "incrementnumber vs. prefixsegments" <https://ntg.nl/pipermail/ntg-context/2012/069765.html>, Hans suggested looking in the test suite for fine control of the prefix segments. I have done that, and the best MNWE that I can come up with is a modification of doc/context/tests/mkiv/sections/figures-001.tex in the test suite (see code below), but it also fails: * When incrementnumber=list (as in the code), the TOC lists that section, but the figure 5 doesn't get a chapter-number prefix. * When incrementnumber=no (recreating \subject), the TOC is not correct, but figure 5 gets its prefix. * And wWhen incrementnumber-yes (recreating \section), the TOC lists that section, but the section gets a number. Is there a modification to what I tried that gets all the aspects right (TOC entry, unnumbered, chapter prefix on figures, etc. within)? -Sanjoy The code: \setupcaption[figure][way=bytext,prefixset=1:2] \definehead[unnumberedsection][section] \setuphead [unnumberedsection][incrementnumber=list] \starttext \placelist[chapter,section,unnumberedsection] \chapter{One} \placefigure{one}{1} \section{Two} \placefigure{two}{2} \chapter{Three} \placefigure{three}{3} \placefigure{four}{4} \unnumberedsection{Four} \placefigure{five}{5} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Extend figure to margin, or extend figure from margin to text
Dear Wolfgang, I've made an MWE. It seems that once I changed the layout, the output would be a little strange: * The edgefigure (default=outer) on the odd pages can't be moved to the margin. Those on the even pages are fine as long as I use "leftmargindistance=-\innercombitotal" * the marginfigure (default={outermargin, hanging}) on the odd pages are fine, but those on the even pages have a weird offset. * by the way, the offset of the marginfigure on the even pages are the same as the edgefigure on the even pages if I set "leftmargindistance=-\outercombitotal" I managed to make the marginfigure work by adding (just in this case) leftmargindistance=\dimexpr\outercombitotal-\innercombitotal\relax, rightmargindistance=0pt But I could never make edgefigure work. Its different behavior on odd and even pages really bothers me. Although the output is acceptable now, I'm still concerned that the settings are not logical (to a human being). I'm afraid that one day it won't work out like that. Here's the MWE: === \showframe \setuppagenumbering [alternative=doublesided] \definepapersize [911] [width=9in, height=11in] \setuppapersize [911] \setuplayout [backspace=1in% ,leftmargin=.5in% ,leftmargindistance=0.25in% ,width=5.5in% ,rightmargindistance=0.25in% ,rightmargin=2in% ] \definefloat [edgefigure] [figure] \setupfloat [edgefigure] [rightmargindistance=-\outercombitotal ,leftmargindistance=-\innercombitotal ,default={outer,low,high,none}] \definefloat [marginfigure] [figure] \setupfloat [marginfigure] [default={outermargin,hanging,none}] \startbuffer[fitframe] \framed[width=\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkgreen]{\tt width=rightmarginwidth} \stopbuffer \startbuffer[wideframe] \framed[width=2\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkred]{\tt width=2*rightmarginwidth} \stopbuffer \starttext \chapter{edge} \dorecurse{10}{ \startplaceedgefigure \getbuffer[fitframe] \stopplaceedgefigure \input knuth } \chapter{margin} \dorecurse{10}{ \startplacemarginfigure \getbuffer[fitframe] \stopplacemarginfigure \input knuth } \dorecurse{10}{ \startplacemarginfigure \getbuffer[wideframe] \stopplacemarginfigure \input knuth } \stoptext === -- From:Wolfgang Schuster Sent At:2019 May 29 (Wed.) 17:55 To:陈之初 ; mailing list for ConTeXt users Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin to text Zhichu schrieb am Mi., 29. Mai 2019, 10:30: Hi everyone, I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body? Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Extend figure to margin, or extend figure from margin to text
Dear Wolfgang, That's quick. Thank you so much. Best regards, Zhichu -- From:Wolfgang Schuster Sent At:2019 May 29 (Wed.) 17:55 To:陈之初 ; mailing list for ConTeXt users Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin to text Zhichu schrieb am Mi., 29. Mai 2019, 10:30: Hi everyone, I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body? Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Extend figure to margin, or extend figure from margin to text
Zhichu schrieb am Mi., 29. Mai 2019, 10:30: > > Hi everyone, > > I am writing a book, in which all figures are placed in the margin. But > some graphics are too big to fit in the margin. I was wondering whether > there's an elegant way to use some room of the text body? > Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Extend figure to margin, or extend figure from margin to text
Hi everyone, I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body? The output is close to the following, but the caption should be as wide as the figure and the part in the margin should not affect other marginal notes: \showframe \starttext Hello\inright{Very very very long test notes.}, world! \startplacefigure [reference=fig:whatever, title={Test figure.}, location=outer] \hbox{% \framed [frame=on% ,offset=0pt% ,width=\dimexpr\rightmarginwidth+\rightmargindistance\relax ,height=\rightmarginwidth ]{Extended Part}% \framed [frame=on% ,offset=0pt% ,width=\rightmarginwidth ,height=\rightmarginwidth ]{My Figure Here}% \kern-\rightmargindistance \kern-\rightmarginwidth } \stopplacefigure \input knuth \stoptext Lua codes are also welcomed. Best Regards, Zhichu Chen ___ 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] Bug or not?
There is an interaction in the placement of float captions when their width is set and background coloring switched.Minimal example included here, the jpeg is arbitrary of course. Output shown.Setting the width of the caption effectively shifts the caption to the left.See the change between the last two floats where [background=] changes the game.I wonder, is this intended behaviour? Or should one expect something different?\starttextTesting figure captions with \tex{setupframed[background="">\setupframed[background="">\placefigure[][]{\tex{setupframed[background="">Add \tex{setupcaption[align=middle,width=\makeupwidth]} as setting here:\par\setupcaption[align=middle,width=\makeupwidth]\setupframed[background="">\placefigure[][]{\type{\setupcaption[align=middle,width=\makeupwidth]}}{\externalfigure[test.jpg]}\setupframed[background="">\placefigure[][]{\tex{setupframed[background="">\stoptext dr. Hans van der Meer captionshift.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] inserting figure labels
On Sun, 12 May 2019 19:25:26 +0200 Hans van der Meer wrote: > Can I be absolutely sure that \placefigure[here,force] will not > invoke the float mechanism, but instead always effects an in-place > insertion? It will trigger a page break if there is not enough space "here". In fact, "force" is enough, no need for "here": \startplacefigure [location=force,title={My title}] ... \stopplacefigure -- Alan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] inserting figure labels
Can I be absolutely sure that \placefigure[here,force] will not invoke the float mechanism, but instead always effects an in-place insertion? dr. Hans van der Meer > On 12 May 2019, at 14:32, Henning Hraban Ramm wrote: > > Am 2019-05-11 um 21:39 schrieb Hans van der Meer <mailto:havdm...@ziggo.nl>>: > >> Placing a float figure with >> \placefigure[][]{labeltext}{\externalfigure[]} >> delivers a figure with a label like "Figure V.3 labeltext" (depending on the >> setup) >> >> Now I want to intersperse this with an \externalfigure[] not within a >> placefigure but still accompanied by a label in the current running series. >> For example an uninterrupted series of figure numbers with: >> \placefigure[][]{labeltext-1}{\externalfigure[figure1]} % -> Figure 1 >> labeltext-1 >> \externalfigure[figure-2] \macrocall{labeltext-2} % -> Figure 2 >> labeltext-2 >> \placefigure[][]{labeltext-3}{\externalfigure[figure3]} % -> Figure 3 >> labeltext-3 >> >> I could not find what macro to call as the instance for \macrocall. > > Can’t you just use \placefigure with {here,force}? > > Greetlings, Hraban > --- > https://www.fiee.net <https://www.fiee.net/> > http://wiki.contextgarden.net <http://wiki.contextgarden.net/> > https://www.dreiviertelhaus.de <https://www.dreiviertelhaus.de/> > GPG Key ID 1C9B22FD > > ___ > 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] inserting figure labels
Am 2019-05-11 um 21:39 schrieb Hans van der Meer : > Placing a float figure with > \placefigure[][]{labeltext}{\externalfigure[]} > delivers a figure with a label like "Figure V.3 labeltext" (depending on the > setup) > > Now I want to intersperse this with an \externalfigure[] not within a > placefigure but still accompanied by a label in the current running series. > For example an uninterrupted series of figure numbers with: > \placefigure[][]{labeltext-1}{\externalfigure[figure1]} % -> Figure 1 > labeltext-1 > \externalfigure[figure-2] \macrocall{labeltext-2} % -> Figure 2 > labeltext-2 > \placefigure[][]{labeltext-3}{\externalfigure[figure3]} % -> Figure 3 > labeltext-3 > > I could not find what macro to call as the instance for \macrocall. Can’t you just use \placefigure with {here,force}? Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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] inserting figure labels
Placing a float figure with \placefigure[][]{labeltext}{\externalfigure[]} delivers a figure with a label like "Figure V.3 labeltext" (depending on the setup) Now I want to intersperse this with an \externalfigure[] not within a placefigure but still accompanied by a label in the current running series. For example an uninterrupted series of figure numbers with: \placefigure[][]{labeltext-1}{\externalfigure[figure1]} % -> Figure 1 labeltext-1 \externalfigure[figure-2] \macrocall{labeltext-2} % -> Figure 2 labeltext-2 \placefigure[][]{labeltext-3}{\externalfigure[figure3]} % -> Figure 3 labeltext-3 I could not find what macro to call as the instance for \macrocall. dr. Hans van der Meer ___ 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] PDF output routine in lmtx
> On 29. Apr 2019, at 11:46, Christian Prim wrote: > > Hi > > in lmtx the pdf output routine has changed afaik. I just wanted to report, > that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) doesn't print > any character. A standard document as the MWE prints well under mkiv. Under > lmtx, there is no output (blank sheet). In a document with a tikz-figure, the > tikz-figure (without labels, as they are text) is printed. Something with > text output must have changed, that makes it incompatible with the copier at > our school. I tried to print with different drivers and also used the > printers interface (direct print via usb-stick). No success. Are they some > flags I can play with (like other pdf-version or so) to find a solution to > this problem? This "bug" prevents me to use lmtx at out school. > > MWE: > > \starttext > That is a test. > \stoptext > > Of course there is no problem with the preview and the output works on a > HP-Printer. I have no solution, unfortunately, but I can add that I see similar problems. In my case, the printer is a HP LaserJet 1320. The page looks perfectly fine on screen; when I print it out, several Greek letters are replaced by questions marks in a small rectangular box. When I compile the same file with regular context mkiv, everything is printed as intended. So I’m at a loss… Thomas ___ 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] PDF output routine in lmtx
Thanks for your answer, Hans. I checked standard (modern) and gyre-palatino font. Both give no output. Did pdf-Version change between mkiv and lmtx? I will try to find the problem in the pdf-file, if I can. Thanks Christian Am Mo., 29. Apr. 2019 um 13:21 Uhr schrieb Hans Hagen : > On 4/29/2019 11:46 AM, Christian Prim wrote: > > Hi > > > > in lmtx the pdf output routine has changed afaik. I just wanted to > > report, that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) > > doesn't print any character. A standard document as the MWE prints well > > under mkiv. Under lmtx, there is no output (blank sheet). In a document > > with a tikz-figure, the tikz-figure (without labels, as they are text) > > is printed. Something with text output must have changed, that makes it > > incompatible with the copier at our school. I tried to print with > > different drivers and also used the printers interface (direct print via > > usb-stick). No success. Are they some flags I can play with (like other > > pdf-version or so) to find a solution to this problem? This "bug" > > prevents me to use lmtx at out school. > > > > MWE: > > > > \starttext > > That is a test. > > \stoptext > > Any font? > > > Of course there is no problem with the preview and the output works on a > > HP-Printer. > hard to say ... we output rather straightforward pdf 1.7 > > Hans > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ 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] PDF output routine in lmtx
On 4/29/2019 11:46 AM, Christian Prim wrote: Hi in lmtx the pdf output routine has changed afaik. I just wanted to report, that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) doesn't print any character. A standard document as the MWE prints well under mkiv. Under lmtx, there is no output (blank sheet). In a document with a tikz-figure, the tikz-figure (without labels, as they are text) is printed. Something with text output must have changed, that makes it incompatible with the copier at our school. I tried to print with different drivers and also used the printers interface (direct print via usb-stick). No success. Are they some flags I can play with (like other pdf-version or so) to find a solution to this problem? This "bug" prevents me to use lmtx at out school. MWE: \starttext That is a test. \stoptext Any font? Of course there is no problem with the preview and the output works on a HP-Printer. hard to say ... we output rather straightforward pdf 1.7 Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] PDF output routine in lmtx
Hi in lmtx the pdf output routine has changed afaik. I just wanted to report, that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) doesn't print any character. A standard document as the MWE prints well under mkiv. Under lmtx, there is no output (blank sheet). In a document with a tikz-figure, the tikz-figure (without labels, as they are text) is printed. Something with text output must have changed, that makes it incompatible with the copier at our school. I tried to print with different drivers and also used the printers interface (direct print via usb-stick). No success. Are they some flags I can play with (like other pdf-version or so) to find a solution to this problem? This "bug" prevents me to use lmtx at out school. MWE: \starttext That is a test. \stoptext Of course there is no problem with the preview and the output works on a HP-Printer. Many thanks for all suggestions! Christian ___ 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] PDF output routine in lmtx
Hi converting the document to ps and back to pdf works (pdf2ps and ps2pdf). But I think there must be a simpler solution... Christian Am Mo., 29. Apr. 2019 um 11:46 Uhr schrieb Christian Prim < christian.p...@gmx.ch>: > Hi > > in lmtx the pdf output routine has changed afaik. I just wanted to report, > that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) doesn't print > any character. A standard document as the MWE prints well under mkiv. Under > lmtx, there is no output (blank sheet). In a document with a tikz-figure, > the tikz-figure (without labels, as they are text) is printed. Something > with text output must have changed, that makes it incompatible with the > copier at our school. I tried to print with different drivers and also used > the printers interface (direct print via usb-stick). No success. Are they > some flags I can play with (like other pdf-version or so) to find a > solution to this problem? This "bug" prevents me to use lmtx at out school. > > MWE: > > \starttext > That is a test. > \stoptext > > Of course there is no problem with the preview and the output works on a > HP-Printer. > > Many thanks for all suggestions! > > Christian > ___ 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] Strange behavior concerning pdf-output of externalfigures
On Mon, Apr 29, 2019 at 10:52:59AM +0200, Bahr Rudolf wrote: > On Sun, Apr 28, 2019 at 11:12:43PM +0200, Hans Hagen wrote: > > On 4/28/2019 8:10 PM, Rudolf Bahr wrote: > > > > > > Dear list, > > > > > > I'm getting unexplainable artefacts in the pdf-output. > > > > > > My MWE is: > > > > > > -- > > > \starttext > > > > > > \externalfigure > > > [input.png] > > > [width=100mm] > > > > > > \stoptext > > > -- > > > > > > I append the output "MWE.pdf" and the input-figure "input.png" for > > > comparison. > > > > > > I'm experiencing the artefacts with some figures which are all several > > > years old. > > > Until now it never happened in conTeXt programs. Because I installed a > > > new OS > > > (LinuxMint) on my workstation at the same time I tried 3 pdfviewers > > > (okular, > > > evince, xpdf) all with the same result. > > > > different inclusion code > > > > > I'm using LuaMetaTeX, Version 2.00.0, > > > ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 > > > > > > Please, do you have any idea what could be the reason? > > no problems here .. can you update? > > > > Hans > > > Sorry, but even after updating to > ConTeXt ver: 2019.04.29 09:02 MKIV beta fmt: 2019.4.29 > I'm experiencing the same artefacts as before. > > Please, what means "different inclusion code"? > Interesting news! After having changed the png-Format of the external figure to ".tiff"-Format by gimp2.10 the artefacts have gone! Rudolf ___ 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] Strange behavior concerning pdf-output of externalfigures
On Sun, Apr 28, 2019 at 11:12:43PM +0200, Hans Hagen wrote: > On 4/28/2019 8:10 PM, Rudolf Bahr wrote: > > > > Dear list, > > > > I'm getting unexplainable artefacts in the pdf-output. > > > > My MWE is: > > > > -- > > \starttext > > > > \externalfigure > > [input.png] > > [width=100mm] > > > > \stoptext > > -- > > > > I append the output "MWE.pdf" and the input-figure "input.png" for > > comparison. > > > > I'm experiencing the artefacts with some figures which are all several > > years old. > > Until now it never happened in conTeXt programs. Because I installed a new > > OS > > (LinuxMint) on my workstation at the same time I tried 3 pdfviewers (okular, > > evince, xpdf) all with the same result. > > different inclusion code > > > I'm using LuaMetaTeX, Version 2.00.0, > > ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 > > > > Please, do you have any idea what could be the reason? > no problems here .. can you update? > > Hans Sorry, but even after updating to ConTeXt ver: 2019.04.29 09:02 MKIV beta fmt: 2019.4.29 I'm experiencing the same artefacts as before. Please, what means "different inclusion code"? Rudolf ___ 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] Strange behavior concerning pdf-output of externalfigures
On 4/28/2019 8:10 PM, Rudolf Bahr wrote: Dear list, I'm getting unexplainable artefacts in the pdf-output. My MWE is: -- \starttext \externalfigure [input.png] [width=100mm] \stoptext -- I append the output "MWE.pdf" and the input-figure "input.png" for comparison. I'm experiencing the artefacts with some figures which are all several years old. Until now it never happened in conTeXt programs. Because I installed a new OS (LinuxMint) on my workstation at the same time I tried 3 pdfviewers (okular, evince, xpdf) all with the same result. different inclusion code I'm using LuaMetaTeX, Version 2.00.0, ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 Please, do you have any idea what could be the reason? no problems here .. can you update? Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Strange behavior concerning pdf-output of externalfigures
Dear list, I'm getting unexplainable artefacts in the pdf-output. My MWE is: -- \starttext \externalfigure [input.png] [width=100mm] \stoptext -- I append the output "MWE.pdf" and the input-figure "input.png" for comparison. I'm experiencing the artefacts with some figures which are all several years old. Until now it never happened in conTeXt programs. Because I installed a new OS (LinuxMint) on my workstation at the same time I tried 3 pdfviewers (okular, evince, xpdf) all with the same result. I'm using LuaMetaTeX, Version 2.00.0, ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 Please, do you have any idea what could be the reason? Best wishes, Rudolf MWE.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] suggestion for LMTX
On 4/27/19 1:15 PM, Hans Hagen wrote: > On 4/27/2019 12:22 PM, Pablo Rodriguez wrote: >> Hi Hans, >> >> compiling the following sample with LMTX >> [...] >> \contextmark >> [...] >> outputs MKIV. >> >> Wouldn’t LMTX be a better option than LMTX? > > Why? Although there are some fundamental differences deep down, the LMTX > version has the MKIV functionality. There might be a point where we bind > a frozen version of MKIV to LuaTeX, but only when the code base becomes > too hybrid to my taste. Of course there will be functionality only > available when you use LMTX, but that is something Wolfgang and I need > to figure out wrr the interface specification. Also, Alan and I need to > deal with in the MetaFun code and documentation. At some point Taco and > Mojca might want granularity in the Wiki. We'll see. I have no clue when > users will have switched to lmtx for production anyway, as it's not > something we want to enforce. (fwfw: I run lmtx by default.) Well, it was only an idea... which seems to be wrong. Many thanks for your help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] suggestion for LMTX
On 4/27/2019 12:22 PM, Pablo Rodriguez wrote: Hi Hans, compiling the following sample with LMTX \starttext \contextmark \contextbanner \stoptext outputs MKIV. Wouldn’t LMTX be a better option than LMTX? Why? Although there are some fundamental differences deep down, the LMTX version has the MKIV functionality. There might be a point where we bind a frozen version of MKIV to LuaTeX, but only when the code base becomes too hybrid to my taste. Of course there will be functionality only available when you use LMTX, but that is something Wolfgang and I need to figure out wrr the interface specification. Also, Alan and I need to deal with in the MetaFun code and documentation. At some point Taco and Mojca might want granularity in the Wiki. We'll see. I have no clue when users will have switched to lmtx for production anyway, as it's not something we want to enforce. (fwfw: I run lmtx by default.) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text around a figure
Fabrice Couvreur schrieb am 24.04.2019 um 19:51: Hi Wolfgang, Thank you t works but why should you add this command ? ConTeXt has to update the number of remaining lines for side floats at the begin each each paragraph but when you start a paragraph in a group, e.g. {\bf ...} to information is lost after the closing brace. When you add now \dontleavehmode before the group starts you flushed to information because the paragraph already started. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Text around a figure
Fabrice Couvreur schrieb am 24.04.2019 um 19:44: Hi, Why does bold text touch the figure ? Thank you. Fabrice \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \starttext \placerecipe{}{ \setupbodyfont[8pt,pagella] \startMPcode path p, q ; p:= unitsquare xyscaled (1.5cm,1.5cm) ; q:= unitsquare xyscaled (2.5cm,2.5cm) shifted (1.5cm,0); draw p withpen pencircle scaled 1pt ; draw q withpen pencircle scaled 1pt ; label.llft("$A$", p) ; label.lrt("$M$", p) ; label.ulft("$P$", p) ; label.urt("$N$", p) ; label.lrt("$B$", q) ; label.urt("$Q$", q) ; label.ulft("$R$", q) ; \stopMPcode } Sur la figure ci-contre, \m{[AB]} est un segment de longueur 4. \m{M} est un point mobile sur le segment \m{[AB]} . \m{AMNP} et \m{MBQR} sont deux carrés. On note \m{x} la distance \m{AM}. \blank {\bf On cherche les positions de \m{M} telles que la surface constituée par les deux carrés soit supérieure à 10.} I guess this should work (untested). \dontleavehmode{\bf ...} Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Text around a figure
Hi, Why does bold text touch the figure ? Thank you. Fabrice \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \starttext \placerecipe{}{ \setupbodyfont[8pt,pagella] \startMPcode path p, q ; p:= unitsquare xyscaled (1.5cm,1.5cm) ; q:= unitsquare xyscaled (2.5cm,2.5cm) shifted (1.5cm,0); draw p withpen pencircle scaled 1pt ; draw q withpen pencircle scaled 1pt ; label.llft("$A$", p) ; label.lrt("$M$", p) ; label.ulft("$P$", p) ; label.urt("$N$", p) ; label.lrt("$B$", q) ; label.urt("$Q$", q) ; label.ulft("$R$", q) ; \stopMPcode } Sur la figure ci-contre, \m{[AB]} est un segment de longueur 4. \m{M} est un point mobile sur le segment \m{[AB]} . \m{AMNP} et \m{MBQR} sont deux carrés. On note \m{x} la distance \m{AM}. \blank {\bf On cherche les positions de \m{M} telles que la surface constituée par les deux carrés soit supérieure à 10.} \blank \startitemize[n] \item À quel intervalle appartient \m{x} ? \item Montrer que le problème revient à résoudre l'inéquation : \startformula 2x²-8x+6\geqslant 0. \stopformula \item Développer le produit \m{(2x-6)(x-1)}. \item En déduire les solutions de l'inéquation \m{2x²-8x+6\geqslant 0} et conclure concernant le problème. \stopitemize \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Hyphenation questions
1. is there an analog to \hyp{} command from the 'hyphenat' package? Double words with a dash happen all too often. 2. how to switch language for just three words for correct hyphenation? 3. if the citation in APS format falls out of the right margin, what needs to be changed to adjust it? 4. In APS, I cannot figure out how to make a space appear between the numbers for cited sources. [1, p. 1,2, p. 2]. But [1, p. 1, 2, p. 2] is what is desired. In one case it did appear automatically, but all others don't work. \cite[righttext={{{, p.~1}},{{, p.~2}}}][book1,book2] ___ 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] mathalign: specifying distance with glue
Hi, amsmath provides an environment `flalign` that flushes the "block" for display math. See page 6 (pdf page 27) of my article on display math in context (https://www.ntg.nl/maps/34/06.pdf) for an example. As shown in that article, I could achieve the same behavior in context mathalign by using distance=2em plus 1fil. However, on a recent context, the glue gets ignored. \starttext \startformula \startmathalignment[m=2,distance=2em plus 1 filll]%Notice distance=... \NC \nabla\cdot \bf E \NC= \frac{\rho}{\varepsilon_0}, \NC \nabla\times \bf E \NC= -\frac{\partial \bf B}{\partial t}, \NR \NC \nabla\cdot \bf B \NC= 0, \NC \nabla\times \bf B \NC= \mu_0{\bf j}+\varepsilon_0\mu_0 \frac{\partial \bf E}{\partial t}. \NR \stopmathalignment \stopformula \stoptext Looking at math-ali, I cannot figure out why that is happening. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Error concerning "pdfmapline"
On Tue, Apr 16, 2019 at 01:54:21PM +0200, Hans Hagen wrote: > On 4/16/2019 12:04 PM, Rudolf Bahr wrote: > > Hello All! > > > > Using: > > LuaMetaTeX, Version 2.00.0 > > ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 > > > > with following MWE: > > > > -- > > \pdfmapline {yfrak > \definefont [ToggenburgFont][yfrak at 10pt] [.75] > > > > \starttext > > > > %\ToggenburgFont Hallo! > > Maar had ik dit kunnen weten? > > > > \stoptext > > -- > > > > I'm getting now following errors: > > > > fatal error > unsupported cs \pdfmapline > > mtx-context | fatal error: return code: 256 > > > > I'm using the above "\pdfmapline" command since years. > > Now it gives an error even when it isn't used in the text. > > "yfrak.pfb" is in the same directory. > > Are there any hints, please? > because it is not needed in mkiv (never really was as it was ignored) .. > most \pdf* commands are no-ops and most will go (i need to figure out what > the bare minimum is that tikz needs) .. they are not user commands in > context > > actually, there is (as part of the typescript interface): > > \loadmapline > \loadmapfile > > not that they are needed either > > Hans Thank you for the information. Now, for going another way in order to print Fraktur texts I downloaded various "yfonts" from ctan [1] again and stored them in "~/context-lmtx/tex/texmf-local": yfrak.tfm, yfrak.mf for instance. "mtxrun --script fonts --reload" and "mtxrun --script fonts --list --all --pattern=yfrak" are in vain. The downloaded fonts aren't recognized. This is strange, because fonts with extensions ".mf" and ".tmf" are fonts how Knuth developed them. There are no files with other Fraktur file extensions in CTAN. Please, how to continue with ConTeXt? I'd like to continue to use exactly the same fonts because of a standard nature with my older Fraktur texts. Happy Easter! Rudolf [1] https://www.ctan.org/tex-archive/fonts/gothic/yfrak ___ 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] Error concerning "pdfmapline"
On 4/16/2019 12:04 PM, Rudolf Bahr wrote: Hello All! Using: LuaMetaTeX, Version 2.00.0 ConTeXt ver: 2019.04.13 17:25 MKIV beta fmt: 2019.4.15 with following MWE: -- \pdfmapline {yfrak unsupported cs \pdfmapline mtx-context | fatal error: return code: 256 I'm using the above "\pdfmapline" command since years. Now it gives an error even when it isn't used in the text. "yfrak.pfb" is in the same directory. Are there any hints, please? because it is not needed in mkiv (never really was as it was ignored) .. most \pdf* commands are no-ops and most will go (i need to figure out what the bare minimum is that tikz needs) .. they are not user commands in context actually, there is (as part of the typescript interface): \loadmapline \loadmapfile not that they are needed either Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] gnuplot-module broken under lmtx
ontrol sequence \GNUPLOTfile -ctx.tex \fourthoffivearguments #1#2#3#4#5->#4 set output "\@@GNUPLOTresult " }\endwrite \shipoutscratchbox \page_shipout_box #1->\clf_shipoutpage #1 \relax \global \setbox #1\emptybox ... ...l.8 \stoptext 1 >> % Written by ConTeXt terminal for GNUPLOT on: 2019-04-10 16:12 CEST 2 % GNUPLOT version: 5.0.5, terminal version: 1.0.0 (2011-11-05) 3 % See also http://wiki.contextgarden.net/Gnuplot 4 % 5 \startGNUPLOTgraphic[1] 6 string gnuplotversion; gnuplotversion := "5.0"; 7 string termversion; termversion := "1.0"; 8 % scaling factor, width and height of the figure 9 a := 1cm; w := 12.700a; h := 7.620a; % (5in, 3in) 10 % temporary variable for storing the path and images 11 save p, img, ima; path p; string img, ima; The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 Sorry, can't help more, as I don't know where the problem is. Thanks for fixing it in time, when the modules get installed with lmtx. Christian ___ 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 ___ -- - 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] gnuplot-module broken under lmtx
#1 \relax \global \setbox #1\emptybox ... ...l.8 \stoptext 1 >> % Written by ConTeXt terminal for GNUPLOT on: 2019-04-10 16:12 CEST 2 % GNUPLOT version: 5.0.5, terminal version: 1.0.0 (2011-11-05) 3 % See also http://wiki.contextgarden.net/Gnuplot 4 % 5 \startGNUPLOTgraphic[1] 6 string gnuplotversion; gnuplotversion := "5.0"; 7 string termversion;termversion:= "1.0"; 8 % scaling factor, width and height of the figure 9 a := 1cm; w := 12.700a; h := 7.620a; % (5in, 3in) 10 % temporary variable for storing the path and images 11 save p, img, ima; path p; string img, ima; The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. mtx-context | fatal error: return code: 256 Sorry, can't help more, as I don't know where the problem is. Thanks for fixing it in time, when the modules get installed with lmtx. Christian ___ 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] Write your own module?
Hi Gerard, the easiest is probably to put such a module into the texmf-tree i.e in ../texmf-project/tec/context/third/yourmodulename Do not to forget to regenerate the filedatabase. Willi > On 26 Mar 2019, at 12:20, Geert Verhaag wrote: > > Hi, > > I'd like to start writing a module, and test it using ConTeXt MkIV standalone > installation. > > Dived into wiki.contextgarden.net but was unable to find a basic tutorial on > how to tackle this. > > Yes, I did find a module template, but can't figure out where the module > should go such that ConTeXt can find and load it. > > Any hint would be very helpful. > > Thanks in advance! > > Regards, > Gerard > ___ > 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] Write your own module?
Hi, I'd like to start writing a module, and test it using ConTeXt MkIV standalone installation. Dived into wiki.contextgarden.net but was unable to find a basic tutorial on how to tackle this. Yes, I did find a module template, but can't figure out where the module should go such that ConTeXt can find and load it. Any hint would be very helpful. Thanks in advance! Regards, Gerard ___ 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] Question to floating figure and grid
Hi all, the following code worked in TL2017 but in TL2018 the unwanted vertical space appears before the 2nd knuth.tex. I do not know how to supress it. I also do not know how to deal with the distance between the text and the figure, I guessed that is controled by leftmargindistance but it makes nothing. What am I doing wrong? Best wishes, Tomáš %%% \setuplayout[grid=yes] \starttext \def\myfig#1#2#3#4{ \startplacefigure[location={right,none}] \setupfloat[roffset=0cc] % leftmargindistance=2cm \startfloatcombination[1*1] \setupfloatcaption[align=middle] \placefigure[][#1]{#2}{\externalfigure[#3][#4]} \stopfloatcombination \stopplacefigure} \input knuth \myfig{fig1}{This is FIG1}{any.jpg}{scale=250} \input knuth \input knuth \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] How to define a new language?
I'm trying to define a new language for use in a bilingual document, but my hyphenation patterns are being ignored and I'm sure I must be doing something wrong. I've devised a minimal example that should hyphenate between vowels but doesn't. Here's the hyphenation patterns file: - lang-foo.pat - % Hyphenation patterns for Foo. \begingroup \patterns{ a1a a1e a1i a1o a1u e1a e1e e1i e1o e1u i1a i1e i1i i1o i1u o1a o1e o1i o1o o1u u1a u1e u1i u1o u1u } \endgroup I tried to convert this to Lua code but couldn't figure out the right invocation of _mtxrun --script pattern --convert_. Then I wrote a minimal Context file and hoped it would pick up lang-foo.pat anyhow: - test-foo.tex - \installlanguage[foo][ spacing=broad, leftsentence=---, rightsentence=---, leftsubsentence=---, rightsubsentence=---, leftquote=\upperleftsinglesixquote, rightquote=\upperrightsingleninequote, leftquotation=\upperleftdoublesixquote, rightquotation=\upperrightdoubleninequote, date={month,\ ,day,{,\ },year}, state=stop, ] \mainlanguage[foo] \setuppapersize[A6] \setupalign[hyphenated,morehyphenation,flushleft] \starttext umleoeoikaoukkoiiaaiewuewniimoaralkokolwwuiuirmlkipetnoaeteuntoilamm uuuauemepokawpoieoomtkeaipeailloaukoiwaeuaewurawiueanwtaoaoemmuuonwleaue mrtmuweokmikariurtlluiraapnkowuaueolmrneraiiioeauemmaamauiiolluwrltounte aaaunnoitwueemwlniowotuauwomaupaapwtawiikiuolnrolouletouunwptoioououoael kiitinouoeolopewourtuineuaermnmmioaiuienkewuiaaklinipprurainouioiomuwokr koriiaieulkppwwieoemlipiakinppprnpaiaaekapnpatritotoeormaetualeonemlppau earoeauoiimekoilliiuomirnrwarpupieiilaaueeoaekwriummikpatakeairolwpiaoaa tniweuiineeetuiektpalukluanetoiklwnemutlonnuaalpnelpniiuiutmaoakmkoiomia ineioporrieopatakomonipiuwuiwiiaueiueoluoeaaiootwuekinkwawrrwwppilewoioo itroreraeonkeuiaawalunnueoreiaaeewknailaeomomilkruruekuonkaonwwiieunonow \stoptext It does seem to see lang-foo.pat: $ context --pdf test-foo.tex | fgrep patterns mkiv lua stats > loaded patterns: en::2 foo::67, load time: 0.000 But in the resulting PDF, nothing is hyphenated. (I'll post the PDF if anyone really wants to see it.) Here's my _context --version_ output: mtx-context | ConTeXt Process Management 1.02 mtx-context | mtx-context | main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2018.01.19 13:42 Can someone point me to my mistake? Thanks in advance, Paul. -- Paul Hoffman ___ 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] When newsizing an external figure by [width=], what will be its height in pt and viceversa?
On Wed, Feb 27, 2019 at 09:55:07AM +0100, Henning Hraban Ramm wrote: > Am 2019-02-24 um 09:11 schrieb Rudolf Bahr : > > > Yes, "~" was the reason for my failure. Its use seems to be linux specific > > only. > > No, it’s not Linux specific, but ConTeXt doesn’t expand shell variables. > > Greetlings, Hraban Aha! Thank you. Cheers, Rudolf ___ 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] When newsizing an external figure by [width=], what will be its height in pt and viceversa?
Am 2019-02-24 um 09:11 schrieb Rudolf Bahr : > Yes, "~" was the reason for my failure. Its use seems to be linux specific > only. No, it’s not Linux specific, but ConTeXt doesn’t expand shell variables. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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] When newsizing an external figure by [width=], what will be its height in pt and viceversa?
Dear Rudolf, > 2019. 2. 24. 오후 7:17, ntg-context-requ...@ntg.nl 작성: > > If you convert your sp-sizes into pt-sizes (1pt = 65536sp) you will get: > (45126287sp,31048991sp) = (688.5725pt,473.7700pt) > > What do you think, are these pt-values ok to you? In my opinion they seem to > be too > small. How are they calculated? I know 72pt per 1 incn, but don’t know well about sp and sp to pt conversion. I think that someone in this list will answer to you soon. Best regards, Dalyoung___ 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] When newsizing an external figure by [width=], what will be its height in pt and viceversa?
On Sun, Feb 24, 2019 at 07:38:42AM +0900, Jeong Dal wrote: > Dear Rudolf, > > It is working for me. > Using my figure, I got > (45126287sp,31048991sp) > > (1372,944) > > > As Hans said, either change ~ to some path or set the directory of > externalfigure. > > Best regards, > > Dalyoung Hello Dalyoung, thank you for your message! Yes, "~" was the reason for my failure. Its use seems to be linux specific only. If you convert your sp-sizes into pt-sizes (1pt = 65536sp) you will get: (45126287sp,31048991sp) = (688.5725pt,473.7700pt) What do you think, are these pt-values ok to you? In my opinion they seem to be too small. How are they calculated? Cheers, Rudolf ___ 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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
Dear Rudolf, It is working for me. Using my figure, I got (45126287sp,31048991sp) (1372,944) As Hans said, either change ~ to some path or set the directory of externalfigure. Best regards, Dalyoung > 2019. 2. 24. 오전 5:58, ntg-context-requ...@ntg.nl 작성: > > I fear it doesn't work. I used the above code with a test-picture of mine > (in .png and .jpg version) and got: > > (0sp,0sp) > (0,0) > > Now I'm baffled what the explanation could be. Are "mill" or "cow" somehow > specially prepared? I used: > > ConTeXt ver: 2018.03.16 22:20 MKIV beta fmt: 2018.3.21 and > getfiguredimensions[~/my-test-picture.png] > > Rudolf ___ 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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On 2/23/2019 12:37 PM, Rudolf Bahr wrote: On Sat, Feb 23, 2019 at 11:56:32AM +0100, Hans Hagen wrote: On 2/23/2019 11:08 AM, Rudolf Bahr wrote: On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote: On Fri, Feb 22 2019, Rudolf Bahr wrote: The picture sizes in px One gets by invoking for instance graphics Magick's identify in a lua program: Or just img.scan(): \startluacode local image = img.scan{filename = "my-image.jpg"} logs.report("xsize", image.xsize) logs.report("ysize", image.ysize) \stopluacode -- Peter Hi Peter, thank you for pointing to img.scan{}! It's indeed shorter than to invoke Graphics Magick in Lua. Remains the conversion of image sizes into pt. There is an example in the chapter "Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a work in progress). According to there it's necessary to know the resolution in order to convert image sizes from px to pt which at least I don't know. Mostly I can preset one size of a picture (say the width in pt) to be able to place it on a page and assuming x-resolution = y-resolution and keeping width-to-height ratio I calculate the missing size (here the height in pt) in Lua by picture-height-in-px asked-picture-height-in-pt = preset-picture-width-in-pt * picture-width-in-px This is simple and normally it suffices for me. Better use the built-in methods: \starttext \getfiguredimensions[t:/sources/mill.png] (\figurewidth,\figureheight) (\figurexsize,\figureysize) \stoptext as it prevents opening the files multiple times. It's also more futureproof. Hans Hi Hans, I fear it doesn't work. I used the above code with a test-picture of mine (in .png and .jpg version) and got: (0sp,0sp) (0,0) Now I'm baffled what the explanation could be. Are "mill" or "cow" somehow specially prepared? I used: ConTeXt ver: 2018.03.16 22:20 MKIV beta fmt: 2018.3.21 and getfiguredimensions[~/my-test-picture.png] maybe the image is not found ... what if you replace the ~ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On Sat, Feb 23, 2019 at 11:56:32AM +0100, Hans Hagen wrote: > On 2/23/2019 11:08 AM, Rudolf Bahr wrote: > > On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote: > > > On Fri, Feb 22 2019, Rudolf Bahr wrote: > > > > > > > The picture sizes in px One gets by invoking for instance graphics > > > > Magick's identify > > > > in a lua program: > > > > > > Or just img.scan(): > > > > > > \startluacode > > >local image = img.scan{filename = "my-image.jpg"} > > >logs.report("xsize", image.xsize) > > >logs.report("ysize", image.ysize) > > > \stopluacode > > > > > > -- > > > Peter > > > > Hi Peter, > > > > thank you for pointing to img.scan{}! It's indeed shorter than to invoke > > Graphics Magick > > in Lua. Remains the conversion of image sizes into pt. There is an example > > in the chapter > > "Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; > > (a work in > > progress). According to there it's necessary to know the resolution in > > order to convert > > image sizes from px to pt which at least I don't know. Mostly I can preset > > one size of > > a picture (say the width in pt) to be able to place it on a page and > > assuming > > x-resolution = y-resolution and keeping width-to-height ratio I calculate > > the missing > > size (here the height in pt) in Lua by > > > > > > picture-height-in-px > > asked-picture-height-in-pt = preset-picture-width-in-pt * > > > > > > picture-width-in-px > > > > This is simple and normally it suffices for me. > Better use the built-in methods: > > \starttext > > \getfiguredimensions[t:/sources/mill.png] > > (\figurewidth,\figureheight) > > (\figurexsize,\figureysize) > > \stoptext > > as it prevents opening the files multiple times. It's also more futureproof. > > Hans > Hi Hans, I fear it doesn't work. I used the above code with a test-picture of mine (in .png and .jpg version) and got: (0sp,0sp) (0,0) Now I'm baffled what the explanation could be. Are "mill" or "cow" somehow specially prepared? I used: ConTeXt ver: 2018.03.16 22:20 MKIV beta fmt: 2018.3.21 and getfiguredimensions[~/my-test-picture.png] Rudolf ___ 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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On 2/23/2019 11:08 AM, Rudolf Bahr wrote: On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote: On Fri, Feb 22 2019, Rudolf Bahr wrote: The picture sizes in px One gets by invoking for instance graphics Magick's identify in a lua program: Or just img.scan(): \startluacode local image = img.scan{filename = "my-image.jpg"} logs.report("xsize", image.xsize) logs.report("ysize", image.ysize) \stopluacode -- Peter Hi Peter, thank you for pointing to img.scan{}! It's indeed shorter than to invoke Graphics Magick in Lua. Remains the conversion of image sizes into pt. There is an example in the chapter "Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a work in progress). According to there it's necessary to know the resolution in order to convert image sizes from px to pt which at least I don't know. Mostly I can preset one size of a picture (say the width in pt) to be able to place it on a page and assuming x-resolution = y-resolution and keeping width-to-height ratio I calculate the missing size (here the height in pt) in Lua by picture-height-in-px asked-picture-height-in-pt = preset-picture-width-in-pt * picture-width-in-px This is simple and normally it suffices for me. Better use the built-in methods: \starttext \getfiguredimensions[t:/sources/mill.png] (\figurewidth,\figureheight) (\figurexsize,\figureysize) \stoptext as it prevents opening the files multiple times. It's also more futureproof. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote: > On Fri, Feb 22 2019, Rudolf Bahr wrote: > > > The picture sizes in px One gets by invoking for instance graphics Magick's > > identify > > in a lua program: > > Or just img.scan(): > > \startluacode > local image = img.scan{filename = "my-image.jpg"} > logs.report("xsize", image.xsize) > logs.report("ysize", image.ysize) > \stopluacode > > -- >Peter Hi Peter, thank you for pointing to img.scan{}! It's indeed shorter than to invoke Graphics Magick in Lua. Remains the conversion of image sizes into pt. There is an example in the chapter "Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a work in progress). According to there it's necessary to know the resolution in order to convert image sizes from px to pt which at least I don't know. Mostly I can preset one size of a picture (say the width in pt) to be able to place it on a page and assuming x-resolution = y-resolution and keeping width-to-height ratio I calculate the missing size (here the height in pt) in Lua by picture-height-in-px asked-picture-height-in-pt = preset-picture-width-in-pt * picture-width-in-px This is simple and normally it suffices for me. Rudolf ___ 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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On Fri, Feb 22 2019, Rudolf Bahr wrote: > The picture sizes in px One gets by invoking for instance graphics Magick's > identify > in a lua program: Or just img.scan(): \startluacode local image = img.scan{filename = "my-image.jpg"} logs.report("xsize", image.xsize) logs.report("ysize", image.ysize) \stopluacode -- 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
On Tue, Feb 19, 2019 at 10:48:38AM +0100, Bahr Rudolf wrote: > Hi All, > > from an external figure I normally know its width and height in px. > But I don't know its exact sizes in pt. When newsizing the figure > in a document (by the same width-to-height-ratio), I'll do that as > some part of textwidth or textheight, in pt or mm, but not in px, > i.e. by means of [width=]. > Sometimes it would be interesting to know its new height in pt, > and viceversa. > > Is there a variable or something else containing its new size in pt? > > Regards, > Rudolf Hi All, up to now Nobody answered to my question, perhaps it might have been too simple. Indeed One could normally assume: picture-width-in-px preset-picture-width-in-pt = -- picture-height-in-px asked-picture-height-in-pt And according to Adam Riese One gets: preset-picture-width-in-pt * picture-height-in-px asked-picture-height-in-pt = --- picture-width-in-px - The picture sizes in px One gets by invoking for instance graphics Magick's identify in a lua program: local file = assert ( io.popen ( 'gm identify ' .. picture_name, 'r' )) local output = file:read ( '*all' ) file:close () local words = {} for w in string.gmatch ( output, "%g+" ) do words [ #words + 1 ] = w end -- Width and height are found in words[3]: i.e. 5407x3544+0+0 local dims = {} for d in string.gmatch ( words [ 3 ], "%d+" ) do dims [ #dims + 1 ] = d end local px_width = dims [ 1 ] local px_height = dims [ 2 ] - It's a solution at least as long as your Lua supports "io.popen". There might be shorter solutions. Cheers, Rudolf ___ 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] Frame
High list! Another example, instead oft he cow, I took another figure: \setuppapersize [A5] \setupexternalfigures [location=default] \setupindenting [yes, small] \setupwhitespace [small] \defineframedtext [prettyblock] [width=10cm, indenting={yes, small}, background=color, backgroundcolor=lightgreen, foreground=color, foregroundcolor=black, offset=2mm, align=flushleft] \starttext \startprettyblock \setupindenting[next] The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. \placefigure [][fig:church] {Stephanus Church.} {\externalfigure[ma-cb-24][width=.4\textwidth]} \stopprettyblock \setupindenting[next] Below, we have two separate columns; but up here, for the nonce, we have but the one. \startcolumns [n=2] Text, text, text \dots all in the first column \column Words, words, words \dots all in the second column. And look ye here! Even more words! \stopcolumns \stoptext Works great. Many Regards Uschi -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Wolfgang Schuster Gesendet: Donnerstag, 21. Februar 2019 18:24 An: mailing list for ConTeXt users ; Marco Patzer Betreff: Re: [NTG-context] Frame Marco Patzer schrieb am 21.02.19 um 12:19: > On Thu, 21 Feb 2019 10:50:21 + > Ursula Hermann wrote: > >> Here is my example: >> >> \setuppapersize[A5] >> \setupcolors[state=start] > This is the default, no need to start the colours any longer. > >> {\framed >> [width=10cm, >> background=color,backgroundcolor=darkblue, >> foreground=color,foregroundcolor=white, >> align={flushleft}] >> {The Earth, as a habitat for animal life, is in old age and has a >> fatal illness. Several, in fact.\par \setupindenting[yes, small] It >> would be happening whether humans had ever evolved or not. >> >> \externalfigure[cow.pdf][width=1cm]} >> >> \setupwhitespace[small] >> \starttext >> Below, we have two separate columns; but up here, for the nonce, we >> have but the one. >> >> \startcolumns[n=2] % Two columns, please >> Text, text, text \dots >> all in the first column >> \column >> Words, words, words \dots >> all in the second column. >> And look ye here! Even more words! >> \stopcolumns >> \stoptext >> Why can‘t I see the cow? > You're missing > >\setupexternalfigures > [location=default] > > Without setting the location context doesn't check the system > directories for the sample images. > > Furthermore, you're typesetting before \starttext. That's why your > font is monospaced. > > And I try to separate content from style. That's why I move all style > information before \starttext and after \starttext comes only content > and markup (if possible). Nothing wrong with mixing it, but it's > easier to read and easier to change the layout after the fact. > I'd write your example as follows. > > \setuppapersize >[A5] > > \setupexternalfigures >[location=default] > > \setupindenting >[yes, small] > > \setupwhitespace >[small] > > \defineframedtext >[prettyblock] >[width=10cm, > indenting={yes, small}, > background=color, backgroundcolor=darkblue, > foreground=color, foregroundcolor=white, > offset=2mm, > align=flushleft] > > \starttext > > \startprettyblock >\noindentation You don’t need \noindentation when you add “next” to the indenting options. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ ___ 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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?
Hi All, from an external figure I normally know its width and height in px. But I don't know its exact sizes in pt. When newsizing the figure in a document (by the same width-to-height-ratio), I'll do that as some part of textwidth or textheight, in pt or mm, but not in px, i.e. by means of [width=]. Sometimes it would be interesting to know its new height in pt, and viceversa. Is there a variable or something else containing its new size in pt? Regards, Rudolf ___ 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] t-downsample.lua
On 2/17/2019 11:32 AM, Peter Münster wrote: Hi, Please find attached a new version of the module, with some ideas from Marco. Later, I'll upload it to modules.contextgarden.net. Here a usage example: \usemodule[downsample] \setupexternalfigures[ location=default, % find hacker.jpg and mill.png cache=/tmp,% where to put the low resolution images resolution=50, % resolution in DPI conversion=downsample.pdf] % use this module \starttext \externalfigure[hacker][width=0.4\textwidth] \setupexternalfigures[resolution=20] \externalfigure[mill][width=4in, height=3in] \setupexternalfigures[resolution=200] \externalfigure[mill][width=4in, height=3in] \stoptext Hans, it would be nice, to apply this patch, to trigger new conversion, when figure dimensions change: --- grph-inc.lua~ 2019-02-14 17:04:12.0 +0100 +++ grph-inc.lua2019-02-17 08:45:38.129971581 +0100 @@ -864,6 +864,14 @@ newbase = prefix .. newbase end local hash = "" +local width = figures.current().request.width +local height = figures.current().request.height +if width then +hash = hash .. "[w:" .. width .. "]" +end +if height then +hash = hash .. "[h:" .. height .. "]" +end if resolution then hash = hash .. "[r:" .. resolution .. "]" end hm that needs a bit of thinking because here we have cases where we downsample from say 600 to 150 dpi but then use that same one for all kind of sizes (and then a different wd/ht should not trigger an extra downsample) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] t-downsample.lua
Hi, Please find attached a new version of the module, with some ideas from Marco. Later, I'll upload it to modules.contextgarden.net. Here a usage example: \usemodule[downsample] \setupexternalfigures[ location=default, % find hacker.jpg and mill.png cache=/tmp,% where to put the low resolution images resolution=50, % resolution in DPI conversion=downsample.pdf] % use this module \starttext \externalfigure[hacker][width=0.4\textwidth] \setupexternalfigures[resolution=20] \externalfigure[mill][width=4in, height=3in] \setupexternalfigures[resolution=200] \externalfigure[mill][width=4in, height=3in] \stoptext Hans, it would be nice, to apply this patch, to trigger new conversion, when figure dimensions change: --- grph-inc.lua~ 2019-02-14 17:04:12.0 +0100 +++ grph-inc.lua2019-02-17 08:45:38.129971581 +0100 @@ -864,6 +864,14 @@ newbase = prefix .. newbase end local hash = "" +local width = figures.current().request.width +local height = figures.current().request.height +if width then +hash = hash .. "[w:" .. width .. "]" +end +if height then +hash = hash .. "[h:" .. height .. "]" +end if resolution then hash = hash .. "[r:" .. resolution .. "]" end TIA, -- Peter t-downsample.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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] markdown module vs pandoc
On Fri, 15 Feb 2019, Gour wrote: On Fri, 15 Feb 2019 06:11:32 -0500 (EST) Aditya Mahajan wrote: For obvious reasons, the built in markdown module is faster than calling pandoc but I prefer using pandoc rather than the markdown module for two reasons. First, pandoc provides many extensions to the basic markdown syntax which I use frequently and second pandoc has better documentation. Thank you. Markdown is a loosely specified standard and sometimes it can be tricky to figure out how to get a particular behavior. That's correct - I was using reST in the past, but lack of support for e.g. nested inline markup leads to strange and ugly workarounds. Then I was considering AsciiDoc(tor), but consider that for simpler stuff (Pnadoc) markdown could be enough, but for larger bodies of text ConTeXt is without comparison. So, if you are planning to use markdown for simple documents then go with the markdown module but if you have more complicated document structure, use pandoc. Do I inderstand you correctly: for more complicated documents you use Pandoc' markdown and then do Pandoc --> ConTeXt conversion to typeset with the ConTeXt at the end? For simple documents, I use something like this (untested): \usemodule[filter] \defineexternalfilter [markdown] [filter={pandoc -t context -o \externalfilteroutput}, output=\externalfilterbasefile.tex, cache=yes, directory=output, %make sure a sub-dir output exists readcommand=\ReadFile] \starttext \startmarkdown This is a *test* in **markdown**. \stopmarkdown \stoptext For more complicated documents (where I need both TeX and HTML output), I pre-process the input: https://adityam.github.io/context-blog/post/markdown-with-gpp/ Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] markdown module vs pandoc
On Fri, 15 Feb 2019 06:11:32 -0500 (EST) Aditya Mahajan wrote: > For obvious reasons, the built in markdown module is faster than > calling pandoc but I prefer using pandoc rather than the markdown > module for two reasons. First, pandoc provides many extensions to the > basic markdown syntax which I use frequently and second pandoc has > better documentation. Thank you. > Markdown is a loosely specified standard and sometimes it can be tricky to > figure out how to get a particular behavior. That's correct - I was using reST in the past, but lack of support for e.g. nested inline markup leads to strange and ugly workarounds. Then I was considering AsciiDoc(tor), but consider that for simpler stuff (Pnadoc) markdown could be enough, but for larger bodies of text ConTeXt is without comparison. > So, if you are planning to use markdown for simple documents then go > with the markdown module but if you have more complicated document > structure, use pandoc. Do I inderstand you correctly: for more complicated documents you use Pandoc' markdown and then do Pandoc --> ConTeXt conversion to typeset with the ConTeXt at the end? Sincerely, Gour -- Those who are on this path are resolute in purpose, and their aim is one. O beloved child of the Kurus, the intelligence of those who are irresolute is many-branched. ___ 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] markdown module vs pandoc
On Thu, 14 Feb 2019, Gour wrote: I'm interested for using markdown markup and typeset such documents via ConTeXt, but wonder whether it is recommended to use Markdown module or do markdown --> ConTeXt via Pandoc? For obvious reasons, the built in markdown module is faster than calling pandoc but I prefer using pandoc rather than the markdown module for two reasons. First, pandoc provides many extensions to the basic markdown syntax which I use frequently and second pandoc has better documentation. Markdown is a loosely specified standard and sometimes it can be tricky to figure out how to get a particular behavior. So, if you are planning to use markdown for simple documents then go with the markdown module but if you have more complicated document structure, use pandoc. If you use the filter module then you can easily switch back and forth between the two markdown "backends" without changing your source. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] index problem: [entry not flushed]
Dear Wolfgang, >> I couldn’t figure out what relation is there between Theorems and Exam. > The numbers are correct with the latest beta. > > mtx-context | current version: 2019.02.10 17:43 > You are right. The example which I sent last time had no problem in numbers. I checked it by adding definitions one by one and finally found the reason. One line in my environment file cause the problem. \setupenumeration[alternative=serried,width=broad,distance=0.5em] Also, I found very strange phenomena that it depends on the order of appearance of that line. That is, it is OK if the command \setupenumeration… before the \defineenumeration[Exam], but if the command \setupenumeration… after the \defineenumeration[Exam] cause the problem. After change the order of appearance such a commnad in my environment file, the numbers of Exam are correct. Now, I have to find the other possible changes. Please run the following code changing the location of the commnad “\setupenumeration…”. Thank you so much. Best regards, Dalyoung general setting for enumerations:Exam,Theorem,Lemma,Definition \setupenumeration[alternative=serried,width=broad,distance=0.5em] % \setupwhitespace[medium] \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=blue]}, %height=1.3em, title=yes, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank}, after=\blank] \setupbodyfont[rm, 11pt] \starttext \dorecurse{3}{ \startchapter[title={Chapter Title}] \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \stopchapter } \page \placeindex \stoptext % > Wolfgang > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] index problem: [entry not flushed]
Jeong Dal schrieb am 11.02.19 um 11:17: 2. Also, the numbers of examples is not reset even though the new chapter began, for example, Example 2.3, 2.4, 3.5, 3.6 etc. However, I couldn’t make the same error with this code, It never happened without theorems, but it appeared when I added \startTheorem in my book. So, I add "\setcounter[Exam][0]” before the \startchapter everytime. I couldn’t figure out what relation is there between Theorems and Exam. The numbers are correct with the latest beta. mtx-context | current version: 2019.02.10 17:43 Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] index problem: [entry not flushed]
Dear all, I used a customized Theorem structure which is made by the help of experts in this list. I have two questions. 1. Recently I added titles of theorems which was indexed and found a strange error message "[entry not flushed]” in the list of index. Please run the following sample code? %% \defineframed [MyFramed] [frame=off, loffset=1ex, roffset=1ex, foregroundstyle=\ssbf] \startuseMPgraphic{MyFrame} picture p ; numeric o ; path a, b ; pair c ; %p := textext.rt("\FunnyFramed{\enumerationparameter{text} \convertedcounter[Theorem]}") ; p := textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ; % p := textext.rt("\FunnyFramed{\currentconstructiontext}") ; o := BodyFontSize ; a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; p := p shifted (2o,OverlayHeight-ypart center p) ; drawoptions (withpen pencircle scaled 1pt withcolor .625red) ; b := a superellipsed .95 ; draw b ; b := (boundingbox p) superellipsed .95 ; fill b withcolor .85white ; draw b ; draw p withcolor black ; setbounds currentpicture to a ; \stopuseMPgraphic \defineoverlay[MyFrame][\useMPgraphic{MyFrame}] \defineframedtext [MyText] [frame=off, background=MyFrame, before={\blank[line,halfline]}, after={\blank[line]}, offset=\bodyfontsize, width=\textwidth] \defineenumeration[Theorem] [alternative=empty, title=yes, titleleft=, titleright=, text={\translate[en=Theorem, kr=정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, % alternative=command, before=\startMyText, after=\stopMyText] \defineenumeration[Lemma] [alternative=empty, title=no, text={\translate[en=Lemma, kr=보조정리]}, prefix=yes, prefixsegments=chapter, way=bychapter, counter=Theorem, before=\startMyText, after=\stopMyText] \defineenumeration[Exam] [text={\white\translate[en=Example, kr=예제]}, numbercommand={\inframed[corner=round, framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, background=color,backgroundcolor=blue]}, %height=1.3em, title=yes, prefix=yes, prefixsegments=chapter, way=bychapter, before={\blank}, after=\blank] \setupbodyfont[rm, 11pt] \starttext \startchapter[title={First}] \startTheorem This is the first Theorem \stopTheorem \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \startTheorem{\index{OneOne}{\bf OneOne}} This is the first Theorem \stopTheorem \startExam We call it \index{OneTwo}{\bf OneTwo} \stopExam \stopchapter \startchapter[title={Second}] \startTheorem{\index{TwoOne}{\bf TwoOne}} This is the first Theorem \stopTheorem \startExam We call it \index{Two 3}{\bf Two 3} \stopExam \startExam We call it \index{TwoTwo}{\bf TwoTwo} \stopExam \stopchapter \startchapter[title={Third}] \startExam We call it \index{Three 1}{\bf Three 1} \stopExam \startTheorem{\index{ThreeOne}{\bf ThreeOne}} This is the first Theorem \stopTheorem \startExam We call it \index{ThreeThree}{\bf ThreeThree} \stopExam \stopchapter \page \placeindex \stoptext %% How to get rid of the message [entry not flushed]? 2. Also, the numbers of examples is not reset even though the new chapter began, for example, Example 2.3, 2.4, 3.5, 3.6 etc. However, I couldn’t make the same error with this code, It never happened without theorems, but it appeared when I added \startTheorem in my book. So, I add "\setcounter[Exam][0]” before the \startchapter everytime. I couldn’t figure out what relation is there between Theorems and Exam. Thank you for reading. Best regards, Dalyoung ___ 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] Making ConTeXt stop on all or some errors
On 2/7/2019 7:03 PM, Jan U. Hasecke wrote: Am 07.02.19 um 17:46 schrieb Alan Braslau: On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) "Jan U. Hasecke" wrote: At least a missing file should make ConTeXt stop immediately. Why? (I often process with missing figures, etc. Of course, not for a final run, but adding showstoppers leads to overhead and longer processing times. People first coming to ConTeXt look for such bells and whistles as many other programs hold your hand in this way. This also explains why these programs often lack in performance as well.) Alan You see placeholders in the pdf, if a figure is missing. The only info that the color profile is missing is in the log file. You don't see it. i assume that you choose some specific pdf reerence format anyway, \enabletrackers[backend.format] can spit out some details - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Making ConTeXt stop on all or some errors
On Thu, 7 Feb 2019 19:03:35 +0100 "Jan U. Hasecke" wrote: > Am 07.02.19 um 17:46 schrieb Alan Braslau: > > On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) > > "Jan U. Hasecke" wrote: > > > >> At least a missing file should make ConTeXt stop immediately. > > > > Why? > > > > (I often process with missing figures, etc. Of course, not for a final > > run, but adding showstoppers leads to overhead and longer processing > > times. People first coming to ConTeXt look for such bells and whistles > > as many other programs hold your hand in this way. This also explains > > why these programs often lack in performance as well.) > > > > Alan > > > > You see placeholders in the pdf, if a figure is missing. The only info > that the color profile is missing is in the log file. You don't see it. > > juh That was just an example. You are free to write a macro to include color profile files that tests and puts a placeholder or stops processing. The point is that ConTeXt, by design, does not come with bells and whistles, and most mistakes are either silently ignored or flagged in the log file. Anyone making production products to be sent to the printer ought to look at the log files before sending. Alan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Making ConTeXt stop on all or some errors
Am 07.02.19 um 17:46 schrieb Alan Braslau: > On Thu, 7 Feb 2019 07:27:57 +0100 (UTC) > "Jan U. Hasecke" wrote: > >> At least a missing file should make ConTeXt stop immediately. > > Why? > > (I often process with missing figures, etc. Of course, not for a final > run, but adding showstoppers leads to overhead and longer processing > times. People first coming to ConTeXt look for such bells and whistles > as many other programs hold your hand in this way. This also explains > why these programs often lack in performance as well.) > > Alan > You see placeholders in the pdf, if a figure is missing. The only info that the color profile is missing is in the log file. You don't see it. 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] right figure at bottom of page can narrow text block on whole next page
> This has come up a few times on this list. Hans has stated a reluctance > to make a change or add an option to discard the unused vertical space > (see https://www.mail-archive.com/ntg-context@ntg.nl/msg21273.html from > March 2007, and most recently > https://www.mail-archive.com/ntg-context@ntg.nl/msg86872.html in January > 2018). Thank you for those pointers. > The workaround that Hans suggests in that last post , adding the flag > 'high', almost resolves the issue in your example. Right -- or just shifting the figure upward by one paragraph or so. In a long document like a book, pagebreaks need to be adjusted by hand at the end anyway to avoid long stretches of unused bottom space. Adjusting the figure placements slightly can become part of that process. -Sanjoy ___ 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] right figure at bottom of page can narrow text block on whole next page
On 1/29/2019 06:48, Sanjoy Mahajan wrote: \definepapersize[bookcrop][width=137mm,height=221mm] \setuppapersize [bookcrop][bookcrop] \setuplayout[marking=on, location=middle, backspace=13.5mm, width=middle, topspace=32bp, header=10bp, headerdistance=26bp, footerdistance=16bp, footer=10bp, height=578bp, ] \setupinterlinespace[line=1.3em] \setupbodyfont[times,10bp] \starttext \input knuth Silly para Silly para \placefigure[right]{}{\framed[width=100bp,height=75.75bp]{\null}} \input knuth \dorecurse{8}{\par Silly para} \placefigure[right]{}{\framed[width=100bp,height=60.75bp]{\null}} \dorecurse{32}{Silly text } \dorecurse{3}{\input knuth \par} \stoptext This has come up a few times on this list. Hans has stated a reluctance to make a change or add an option to discard the unused vertical space (see https://www.mail-archive.com/ntg-context@ntg.nl/msg21273.html from March 2007, and most recently https://www.mail-archive.com/ntg-context@ntg.nl/msg86872.html in January 2018). The workaround that Hans suggests in that last post , adding the flag 'high', almost resolves the issue in your example. -- Rik ___ 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] text flowing around images
For LaTeX there is a tool called fig2sty which can take an XFig figure and transform it into a LaTeX sty file. Maybe you could adapt it to ConTeXt. https://www.ctan.org/pkg/fig2sty On 6/02/19 9:38 AM, Henning Hraban Ramm wrote: > No hints? > > If it’s not possible, I must redo the whole layout in InDesign. I’d like to > avoid that (footnotes!). > > Best, Hraban > > Am 2019-02-04 um 11:10 schrieb Henning Hraban Ramm : > >> Ahoi, >> >> in my current project I must include a bunch of illustrations in my layout, >> and the text should flow around their irregular shapes (side placement in >> single text column only). >> I got the pictures as TIFFs with alpha channel, but of course I can change >> that. >> >> I’m quite sure I remember that it was possible to let text flow around >> shapes somehow, but I can’t find documentation or a sample. >> I’d be thankful for hints. >> >> Greetlings, Hraban >> --- >> https://www.fiee.net >> http://wiki.contextgarden.net >> https://www.dreiviertelhaus.de >> GPG Key ID 1C9B22FD >> >> ___ >> 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 > ___ > ___ 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] About the macro path intersectionpoint path with Metapost
Hi, I guess your problem is to find the two points of intersection between p and r ? If so, the problem is that intersectionpoint does return the same intersection when there is several, as it is the case here. So a quick solution that you can do is to find intersections for the two part. A drawing is simple than words ! here is the code to illustrate: Happy drawing ! F. \setupcolors[state=start] \starttext \startMPpage path p, q, r, b , u; p:= fullcircle scaled 6cm ; q:= fullcircle scaled 4cm shifted (2.5cm,2cm) ; r:= fullcircle scaled 4cm shifted (-2.5cm,2cm); b:= fullcircle scaled 2cm shifted (0,-3cm); pair A, B ; path rprime ; % Rprime is a a part of r (drawn in black to see it): rprime := r cutbefore point .5 along r; A:= p intersectionpoint r ; B:= p intersectionpoint rprime ; draw A withpen pencircle scaled .1in ; draw B withpen pencircle scaled .1in ; u:= A--B--cycle ; draw p withcolor green; draw q withcolor blue; draw rprime withpen pencircle scaled .05in withcolor black; draw r withcolor red; draw b withcolor magenta; draw u numberstriped (.25,15,5) withcolor magenta ; \stopMPpage \stoptext Le 3 février 2019 à 06:28:37, Fabrice Couvreur (fabrice1.couvr...@gmail.com) a écrit: Hi, I would like to reproduce the attached figure. My problem is to create the points of intersection between the circles. It seems that my approach is not the right one. Thank you. Fabrice \starttext \startMPcode path p, q, r, b ; p:= fullcircle scaled 6cm ; q:= fullcircle scaled 4cm shifted (2.5cm,2cm) ; r:= fullcircle scaled 4cm shifted (-2.5cm,2cm); b:= fullcircle scaled 2cm shifted (0,-3cm); pair A, B ; A:= p intersectionpoint r ; B:= p intersectionpoint r ; path u ; u:= A--B--cycle ; draw p ; draw q ; draw r ; draw b ; draw u numberstriped (.25,15,5) withcolor magenta ; \stopMPcode \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 ___ ___ 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] About the macro path intersectionpoint path with Metapost
Hi, I would like to reproduce the attached figure. My problem is to create the points of intersection between the circles. It seems that my approach is not the right one. Thank you. Fabrice \starttext \startMPcode path p, q, r, b ; p:= fullcircle scaled 6cm ; q:= fullcircle scaled 4cm shifted (2.5cm,2cm) ; r:= fullcircle scaled 4cm shifted (-2.5cm,2cm); b:= fullcircle scaled 2cm shifted (0,-3cm); pair A, B ; A:= p intersectionpoint r ; B:= p intersectionpoint r ; path u ; u:= A--B--cycle ; draw p ; draw q ; draw r ; draw b ; draw u numberstriped (.25,15,5) withcolor magenta ; \stopMPcode \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] right figure at bottom of page can narrow text block on whole next page
Dear List, A figure near the bottom of the page can narrow the text block on the whole next page. I noticed the problem when typesetting my (next) book. But the book is more a maximal than a minimal example. However, from it I made the minimal example included below that uses no external figures. Figure 2 is the bottom of the page and the paragraph flows to its left with a correspondingly narrower text block. So far, so good. But the text block also narrows for the entirity of page 2 and for the first two lines of page 3. I've found the problem on the MkIV 2019.01.07 and 2019.01.28 betas (all on Debian amd64), as well as on the live ConTeXt (which is the 2019.01.28 beta). -Sanjoy == start margin-figure-region.tex = \definepapersize[bookcrop][width=137mm,height=221mm] \setuppapersize [bookcrop][bookcrop] \setuplayout[marking=on, location=middle, backspace=13.5mm, width=middle, topspace=32bp, header=10bp, headerdistance=26bp, footerdistance=16bp, footer=10bp, height=578bp, ] \setupinterlinespace[line=1.3em] \setupbodyfont[times,10bp] \starttext \input knuth Silly para Silly para \placefigure[right]{}{\framed[width=100bp,height=75.75bp]{\null}} \input knuth \dorecurse{8}{\par Silly para} \placefigure[right]{}{\framed[width=100bp,height=60.75bp]{\null}} \dorecurse{32}{Silly text } \dorecurse{3}{\input knuth \par} \stoptext == end margin-figure-region.tex = ___ 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] textext with plain MetaFun
et_extra_specials->begingroup._local_specials_:="";endgroup (SUFFIX0)<- (SUFFIX1)<-reset_extra_specials {begingroup} {_local_specials_:=""} {endgroup} {truecorners:=0} {miterlimit:=10} {linejoin:=1} {linecap:=1} erasegraphictextfile->write.EOF.to.data_mpo_file;let.erasegraphictextfile=relax ; {write} data_mpo_file->job_name&"-mpgraph.mpo" job_name->jobname {("test")&("-mpgraph.mpo")} {let} {fi} draw->addto.currentpicture.if.picture(EXPR0):also(EXPR0)else:doublepath(E XPR0)withpen.currentpen.fi._op_ textext@#(EXPR3)->begingroup.save._s_;string._s_;interim.labeloffset:=textextof fset;noftexpictures:=noftexpictures+1;if.string(EXPR3):if.hobbiestextext:write. _s_&"btex "&(EXPR3)&" etex"to"mptextmp.mp";write.EOF.to"mptextmp.mp";scantokens "input mptextmp"else:write"% figure "&" : "&"texpictures[" imal.noftexpictures&"] := btex "&(EXPR3)&" etex ;"to.jobname&".mpt";if.unknown. texpictures[noftexpictures]:thelabel(SUFFIX2)("unknown",origin)else:thelabel(SU FFIX2)(texpictures[noftexpictures],origin)fi.fi.else:thelabel(SUFFIX2)((EXPR3), origin)fi.endgroup (SUFFIX0)<- (SUFFIX1)<-textext (SUFFIX2)<- (EXPR3)<-"MetaFun" {begingroup} {save} {string} {interim} {labeloffset:=0} {(0)+(1)} {noftexpictures:=1} ## noftexpictures=1 {if} {string("MetaFun")} {true} {if} {false} {write} {decimal(1)} {("% figure ")&("1")} {("% figure 1")&(" : ")} {("% figure 1 : ")&("texpictures[")} {decimal(1)} {("% figure 1 : texpictures[")&("1")} {("% figure 1 : texpictures[1")&("] := btex ")} {("% figure 1 : texpictures[1] := btex ")&("MetaFun")} {("% figure 1 : texpictures[1] := btex MetaFun")&(" etex ;")} {("test")&(".mpt")} {if} {unknown(unknown picture texpictures1)} {true} thelabel@#(EXPR3)(EXPR4)->begingroup.save.p;picture.p;p=(EXPR3)if.not.picture(E XPR3):infont.defaultfont.scaled.defaultscale.fi;(p.shifted((EXPR4)+labeloffset* laboff(SUFFIX2)-(labxf(SUFFIX2)*lrcorner.p+labyf(SUFFIX2)*ulcorner.p+(1-labxf(S UFFIX2)-labyf(SUFFIX2))*llcorner.p)))endgroup (SUFFIX0)<- (SUFFIX1)<-thelabel (SUFFIX2)<- (EXPR3)<-"unknown" (EXPR4)<-(0,0) {begingroup} {save} {picture} {if} {picture("unknown")} {not(false)} {true} {("unknown")infont("cmr10")} {fi} {(picture)scaled(1)} {(unknown picture p)=(picture)} {(0)*((0,0))} {((0,0))+((0,0))} {lrcorner(picture)} {(0.5)*((39.57397,0))} {ulcorner(picture)} {(0.5)*((0,6.9185))} {((19.78699,0))+((0,3.45926))} {(1)-(0.5)} {(0.5)-(0.5)} {llcorner(picture)} {(0)*((0,0))} {((19.78699,3.45926))+((0,0))} {((0,0))-((19.78699,3.45926))} {(picture)shifted((-19.78699,-3.45926))} {restoring p} {endgroup} {else} {fi} {else} {restoring labeloffset=3} {restoring _s_} {endgroup} (EXPR0)<-picture {addto} {if} {picture(picture)} {true} {else} _op_-> endfig->;if._fig_nesting_=1:scantokens.extra_endfig;shipit;endgroup;fi;_fig_nes ting_:=_fig_nesting_-1; {if} {(1)=(1)} {true} {scantokens} resetspotcolors->numeric.spotcolorhash[][]; {numeric} resetcmykcolors->numeric.cmykcolorhash[][][][]; {numeric} add_special_signal->begingroup.if(length._global_specials_<>0)or(length._local_ specials_<>0):special("%%MetaPostSpecials: 2.0 "_special_signal_&" " ecimal._special_div_);fi;endgroup (SUFFIX0)<- (SUFFIX1)<-add_special_signal {begingroup} {if} {length("")} {(0)<>(0)} {length("")} {(0)<>(0)} {(false)or(false)} {false} {endgroup} naturalizepaths->let.fill=normalfill;let.draw=normaldraw; {let} {let} mfun_apply_max_dimensions->if.bbwidth.currentpicture>maxdimensions:currentpictu re:=currentpicture.if.bbheight.currentpicture>bbwidth.currentpicture:ysized.els e:xsized.fi.maxdimensions;elseif.bbheight.currentpicture>maxdimensions:currentp icture:=currentpicture.ysized.maxdimensions;fi; {if} bbwidth->begingroup.if.unknown(EXPR2):0elseif.path(EXPR2)or.picture(EX PR2):xpart(lrcorner(EXPR2)-llcorner(EXPR2))else:0fi.endgroup (SUFFIX0)<- (SUFFIX1)<-bbwidth (EXPR2)<-picture {begingroup} {if} {unknown(picture)} {false} {path(picture)} {picture(picture)} {(false)or(true)} {true} {lrcorner(picture)} {llcorner(picture)} {((19.78699,-3.45926))-((-19.78699,-3.45926))} {else} {xpart((39.57397,0))} {endgroup} {(39.57397)>(14000)} {false} bbheight->begingroup.if.unknown(EXPR2):0elseif.path(EXPR2)or.picture(E XPR2):ypart(urcorner(EXPR2)-lrcorner(EXPR2))else:0fi.endgroup (SUFFIX0)<- (SUFFIX1)<-bbheight (EXPR2)<-picture {begingroup} {if} {unknown(picture)} {false} {path(picture)} {picture(picture)} {(false)or(t
Re: [NTG-context] Update problems
On 1/7/2019 6:47 PM, Weber, Matthias wrote: Update: The page setup works after Hans’ fix. Thanks, that was a relief. I still don’t know what’s going on with PDF inclusion. The ones that cause trouble are kind of old (from 2005), and I could “upgrade” we found the reason but anyway, looking at this pdf file it makes sense to save as pdf from illustrator because now you basically use the illustrator edit file (with a lot of crap in it) and also some versioning (i suspect that the xref is also bad so then you depend on recovering capabilities of readers) Them manually and things work now for this document. I have others that might cause problems, too. Unfortunately, the error message only tells which page couldn’t be flushed but not what figure is causing issues. Going through a hundred figures and trying whether they work is somewhat painful. A more verbose error message would be helpful, or a hint what has changed with pdf import. only the library, not in the way inclusion works Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Update problems
Update: The page setup works after Hans’ fix. Thanks, that was a relief. I still don’t know what’s going on with PDF inclusion. The ones that cause trouble are kind of old (from 2005), and I could “upgrade” Them manually and things work now for this document. I have others that might cause problems, too. Unfortunately, the error message only tells which page couldn’t be flushed but not what figure is causing issues. Going through a hundred figures and trying whether they work is somewhat painful. A more verbose error message would be helpful, or a hint what has changed with pdf import. Thanks, Matthias > On Jan 7, 2019, at 11:26 AM, Weber, Matthias wrote: > > Dear List, > > After a while I decided updating my ConTeXt installation to ConTeXt ver: > 2019.01.07 10:07 MKIV beta fmt: 2019.1.7. > > With an old document of mine I ran into two issues so far: Some of my old pdf > images are not accepted as figures anymore. > > Example: > > \starttext > \externalfigure[cardioid.pdf][width=1.5in]{Cardioid} > \stoptext > Using the following pdf which is version 1.4 > > > More recent PDFs (1.5)seem to work. > > Secondly, paper setup seems to require a new kind of massage. > > \setuppapersize[S6][S6] > > \starttext > \dorecurse{10}{\input knuth} > \input knuth > \stoptext > > produces > > > On the other hand, the garden version looks ok. What could be wrong on my end? > > Thanks! > > Matthias___ > 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] placing an MPGraphic/Lines over multiple table cells
I am trying to place some lines in "Z" shape over several cells of a table. This single "Z" has the intention of blocking manual alterations to the table in empty cells. The cells to blocked are always a coherent rectangle. I hope that makes sense. In the example below, the table with 4 rows, 3 columns has content in column one only, the other 2 columns should have the "Z". Placing the blocking "Z" into every cell is not an option due to formal requirements. What I attempted below a) seems very cumbersome b) doesn't work (the small "Z" doesn't fill the frame). While I can easily place a "Z" into a single cell (in the example), I can't figure out how to cover multiple cells. Furthermore, I would need to do a lot of calculations to figure out the multiple layer placements, column positions, etc. With multiple tables on a page, several pages, that seems error prone. Any suggestions, corrections, hints are most welcome! Kindly, Martin Working example with some comments: % Graphic that draws the "Z", that works fine in a single table cell as seen in the example \startuseMPgraphic{ZRule} rulethickness:= \frameddimension{rulethickness}*3; drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}}); pair topleftcorner, toprightcorner; topleftcorner := (rulethickness, \overlayheight-rulethickness-1.5mm); toprightcorner:= (\overlaywidth-rulethickness, \overlayheight-rulethickness-1.5mm); pair lowerleftcorner, lowerrightcorner; lowerleftcorner := (rulethickness, rulethickness+1.5mm); lowerrightcorner:= (\overlaywidth-rulethickness, rulethickness+1.5mm); draw topleftcorner -- toprightcorner; draw lowerleftcorner -- lowerrightcorner; draw toprightcorner -- lowerleftcorner; \stopuseMPgraphic \defineoverlay[ZRule][\useMPgraphic{ZRule}] \starttext \setupTABLE[c][each][width=30mm] \setupTABLE[r][each][width=6mm] % in an attempt to place the table at known positions, I put it into a layer. Though it is not really "background". \definelayer[datatable][x=0mm, y=0mm,width=\textwidth, height=25mm] \setlayer[datatable][hoffset=0mm, voffset=0mm]{ \bTABLE \bTR \bTD content1 \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD content \eTD \bTD[background=ZRule] \eTD \bTD \eTD \eTR \eTABLE } % Now trying to create another layer covering the table area where the "Z" should go. \definelayer[ZStrike][x=32mm, y=0mm,width=60mm, height=24mm] % The "Z" fails to reach full size of the frame \setlayer[ZStrike][hoffset=0mm, voffset=0mm]{\framed[frame=on,width=60mm,height=24mm]{\useMPgraphic{ZRule}}} % arrange the "background" layers \setupbackgrounds[text][background={datatable,foreground,ZStrike}] \blank[force, 28mm] further content \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Question about defining a path with Metapost
Hi, I need to make a figure with shaded areas and I found this code proposed by Hans. Why does the definition of the r path that Hans proposed give the same result as what I propose ? Thank you. Fabrice \starttext \startMPpage[offset=2pt] path p, q, r ; pair z ; p := unitsquare scaled 4cm ; z := point 3.6 of p ; q := z--urcorner p ; r := z--urcorner p--lrcorner p--llcorner p--cycle ; %r := q -- reverse bottomboundary p -- cycle ; definition of Hans draw p ; draw r numberstriped (.25,10,5) withcolor magenta ; draw thetextext.llft("B", llcorner p) ; draw thetextext.lrt ("C", lrcorner p) ; draw thetextext.ulft("A", ulcorner p) ; draw thetextext.urt ("D", urcorner p) ; draw thetextext.lft ("M", z) ; \stopMPpage \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Itemize lists run into floats - how to add additional spacing
On Wed, 19 Dec 2018 18:29:33 +0100 Hans Hagen wrote: > \setupfloat >[figure] >[default=left,margin=1cm] Thanks for the eye-opener. I realised I applied the margin on the item group instead of the float. Sometimes it's the simple things… 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Itemize lists run into floats - how to add additional spacing
On 12/19/2018 1:15 PM, Marco Patzer wrote: Hi! The bullet of itemize lists runs into the boxes and caption of floats. How to add spacing so the bullet doesn't touch the float? Example: \setupexternalfigures [location=default] \setupfloat [figure] [default=left] \setupitemize [packed, autointro] \starttext \startitemize \startitem Foo \startplacefigure [title=Lorem ipsum dolor sit amet consectetur] \externalfigure [hacker] \stopplacefigure Bar \stopitem \dorecurse{15}{%% \startitem Foobar \stopitem } \stopitemize \stoptext \setupfloat [figure] [default=left,margin=1cm] - 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] Itemize lists run into floats - how to add additional spacing
Hi! The bullet of itemize lists runs into the boxes and caption of floats. How to add spacing so the bullet doesn't touch the float? Example: \setupexternalfigures [location=default] \setupfloat [figure] [default=left] \setupitemize [packed, autointro] \starttext \startitemize \startitem Foo \startplacefigure [title=Lorem ipsum dolor sit amet consectetur] \externalfigure [hacker] \stopplacefigure Bar \stopitem \dorecurse{15}{%% \startitem Foobar \stopitem } \stopitemize \stoptext 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] table cell minimum heights -- help needed
Aditya Mahajan schrieb am 14.12.18 um 15:18: On Thu, 13 Dec 2018, Taco Hoekwater wrote: I am attempting to process html tables that are styled using css, and I have problem with the ‘height’ property. CSS (or rather, the html browser) interprets ‘height’ as if it was a “minheight”, and if the content does not fit, it will just enlarge the height until it does fit. Needless to say: I want that same functionality from the ConTeXt table I am using to generate the PDF and not end up with text crossing row boundaries. And I cannot figure out how to do it, as neither bTABLE’s \bTD nor xtable’s \startxcell interpret a “minheight" parameter. And whatever I put in “height” becomes the absolute value of the cell height. Did I miss something? I cannot imagine that this problem has not come up before… AFAIK, there is no option to do this. The closest option is `autowidth=force` for `\framed` etc. which forces `width` to behaves as `maxwidth`. It will be nice to explicitly add both minwidth/minheight and maxwidth/maxheight options to framed, etc. Adding minwidth is possible without problems but maximum values can be problematic because you have to do a lot of size checks and since framed is used by many other commands you would increase compilation time. The better solution to have maxwidth/maxheight support is to create a new command which uses multiple passes to get the necessary values for both directions (which already happens for natural and extreme tables). Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] table cell minimum heights -- help needed
Hi all, Offlist, Wolfgang sent me a patch for \framed (which \eTD inherits from) that adds a minheight key, and Hans promised to add that to the next beta :) Best wishes, Taco > On 14 Dec 2018, at 15:18, Aditya Mahajan wrote: > > On Thu, 13 Dec 2018, Taco Hoekwater wrote: > >> I am attempting to process html tables that are styled using css, >> and I have problem with the ‘height’ property. CSS (or rather, the html >> browser) interprets ‘height’ as if it was a “minheight”, and >> if the content does not fit, it will just enlarge the height until >> it does fit. >> >> Needless to say: I want that same functionality from the ConTeXt >> table I am using to generate the PDF and not end up with text crossing row >> boundaries. And I cannot figure out how >> to do it, as neither bTABLE’s \bTD nor xtable’s \startxcell >> interpret a “minheight" parameter. And whatever I put in “height” >> becomes the absolute value of the cell height. >> Did I miss something? I cannot imagine that this problem has not >> come up before… > > AFAIK, there is no option to do this. The closest option is `autowidth=force` > for `\framed` etc. which forces `width` to behaves as `maxwidth`. It will be > nice to explicitly add both minwidth/minheight and maxwidth/maxheight options > to framed, etc. > > Aditya___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ Taco Hoekwater Elvenkind BV ___ 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] table cell minimum heights -- help needed
On Thu, 13 Dec 2018, Taco Hoekwater wrote: I am attempting to process html tables that are styled using css, and I have problem with the ‘height’ property. CSS (or rather, the html browser) interprets ‘height’ as if it was a “minheight”, and if the content does not fit, it will just enlarge the height until it does fit. Needless to say: I want that same functionality from the ConTeXt table I am using to generate the PDF and not end up with text crossing row boundaries. And I cannot figure out how to do it, as neither bTABLE’s \bTD nor xtable’s \startxcell interpret a “minheight" parameter. And whatever I put in “height” becomes the absolute value of the cell height. Did I miss something? I cannot imagine that this problem has not come up before… AFAIK, there is no option to do this. The closest option is `autowidth=force` for `\framed` etc. which forces `width` to behaves as `maxwidth`. It will be nice to explicitly add both minwidth/minheight and maxwidth/maxheight options to framed, etc. Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] table cell minimum heights -- help needed
Hi all, I am attempting to process html tables that are styled using css, and I have problem with the ‘height’ property. CSS (or rather, the html browser) interprets ‘height’ as if it was a “minheight”, and if the content does not fit, it will just enlarge the height until it does fit. Needless to say: I want that same functionality from the ConTeXt table I am using to generate the PDF and not end up with text crossing row boundaries. And I cannot figure out how to do it, as neither bTABLE’s \bTD nor xtable’s \startxcell interpret a “minheight" parameter. And whatever I put in “height” becomes the absolute value of the cell height. Did I miss something? I cannot imagine that this problem has not come up before… Best wishes, Taco Example code: \starttext \bTABLE[frame=on] \bTR \bTD[height=20pt] \input tufte \eTD \eTR \eTABLE \blank[10*line] \startxtable[frame=on] \startxrow \startxcell[height=20pt] \input tufte \stopxcell \stopxrow \stopxtable \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] External Figure add caption or alternative text for tagged pdf/x
Hi All. I am trying to embed an image in a pdf so that when you open the pdf in acrobat or another reader the image is correctly tagged as an image and there is alternative text. So far I am able to export the back end tags so that I can see tags on tables and paragraphs, but the image comes through tagged as a paragraph and I am unable to add any alternative text. This is the code I am using: \setupbackend [format=PDF/X-1a:2001, export=yes] \externalfigure[district.pdf][height=10cm] Does anyone have any idea how I could fix this? Thanks! Claire ___ 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] indenting after placefigure
Thanks, indeed this does the trick. But I wonder: Has \placefigure then a default [indentnext=no] instead of abstaining from meddling with the indent setting? dr. Hans van der Meer > On 6 Dec 2018, at 21:25, Pablo Rodriguez wrote: > > On 12/6/18 6:10 PM, Hans van der Meer wrote: >> I used \setupindenting[always,medium]. This works everywhere except >> after a figure placed with \placefigure. Why does placing the figure >> suppress the indent after it? And how can this behaviour be changed? > > I wonder whehter \setupfloat[figure][indentnext=yes] would work here. > > I hope it may help, > > Pablo > -- > http://www.ousia.tk > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ 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] indenting after placefigure
On 12/6/18 6:10 PM, Hans van der Meer wrote: > I used \setupindenting[always,medium]. This works everywhere except > after a figure placed with \placefigure. Why does placing the figure > suppress the indent after it? And how can this behaviour be changed? I wonder whehter \setupfloat[figure][indentnext=yes] would work here. I hope it may help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] indenting after placefigure
I used \setupindenting[always,medium]. This works everywhere except after a figure placed with \placefigure. Why does placing the figure suppress the indent after it? And how can this behaviour be changed? dr. Hans van der Meer ___ 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] Ending strings with non-break space in lang-txt.lua
On 12/5/2018 10:29 PM, Alan Braslau wrote: On Wed, 5 Dec 2018 19:47:31 +0100 Marco Patzer wrote: Hi! I've got a few unfortunate line breaks in my documents. In particular, breaks are introduced in between the string “page” and the number: See figure 1 at page 2. The reason is that many strings in lang-txt.lua end in a space, rather than a non-break space: ["atpage"]={ ["labels"]={ … ["en"]="at page ", … I fixed this by defining \setuplabeltext [en] [atpage=at page\nbsp] So I wonder: Does it ever make sense to have a regular space at the end of those commands? I just skimmed through the file and most, if not all, strings ending in a space would actually benefit from having it replaced by a non-break space IMO. Example: \def\pageref#1%% {\in{figure}[#1] \labeltext{atpage}\at[#1]} \starttext \hsize 3cm See \pageref{foo}. \page \startplacefigure [reference=foo] \stopplacefigure \stoptext I agree, it drives me nuts to see p. 5 or in Figure 8 etc. Also, how about: \at{\labeltext{atpage}}[#1] indeed, that is the command to use (and does this make the space in the label redundant?) In any case it is a bit sloppy... can you experiment with this \unexpanded\def\leftofreferencecontent {\removeunwantedspaces \nobreakspace \ignorespaces} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Ending strings with non-break space in lang-txt.lua
On Wed, 5 Dec 2018 19:47:31 +0100 Marco Patzer wrote: > Hi! > > I've got a few unfortunate line breaks in my documents. In > particular, breaks are introduced in between the string “page” and > the number: > > See figure 1 at page > 2. > > The reason is that many strings in lang-txt.lua end in a space, > rather than a non-break space: > > ["atpage"]={ >["labels"]={ > … > ["en"]="at page ", > … > > I fixed this by defining > > \setuplabeltext > [en] > [atpage=at page\nbsp] > > So I wonder: Does it ever make sense to have a regular space at the > end of those commands? I just skimmed through the file and most, if > not all, strings ending in a space would actually benefit from having > it replaced by a non-break space IMO. > > Example: > > \def\pageref#1%% > {\in{figure}[#1] \labeltext{atpage}\at[#1]} > > \starttext > \hsize 3cm > See \pageref{foo}. > > \page \startplacefigure [reference=foo] \stopplacefigure > \stoptext I agree, it drives me nuts to see p. 5 or in Figure 8 etc. Also, how about: \at{\labeltext{atpage}}[#1] (and does this make the space in the label redundant?) In any case it is a bit sloppy... Alan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Ending strings with non-break space in lang-txt.lua
Hi! I've got a few unfortunate line breaks in my documents. In particular, breaks are introduced in between the string “page” and the number: See figure 1 at page 2. The reason is that many strings in lang-txt.lua end in a space, rather than a non-break space: ["atpage"]={ ["labels"]={ … ["en"]="at page ", … I fixed this by defining \setuplabeltext [en] [atpage=at page\nbsp] So I wonder: Does it ever make sense to have a regular space at the end of those commands? I just skimmed through the file and most, if not all, strings ending in a space would actually benefit from having it replaced by a non-break space IMO. Example: \def\pageref#1%% {\in{figure}[#1] \labeltext{atpage}\at[#1]} \starttext \hsize 3cm See \pageref{foo}. \page \startplacefigure [reference=foo] \stopplacefigure \stoptext 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Text running of the page with default=top float paremeter
Hi! I've got a problem with text running off the page. The culprit is the "default=top" float parameter. Is this expected behaviour? Slightly OT bonus question: What does the “default=auto” parameter do? I added that years ago and have not found documentation what it actually does. I actually have set "default=auto, top, bottom". MWE: \definefloat [smallfigure] [smallfigures] [figure] \setupfloat [smallfigure] [default=outer] \setupfloat [figure] [default=top] %% commenting this fixes the issue \showframe \starttext \startplacefigure \externalfigure \stopplacefigure \startplacesmallfigure \externalfigure \stopplacesmallfigure \dorecurse{4}{\samplefile{knuth}} \stoptext 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Typing Unicode subscript and superscript numbers
> On 2 Dec 2018, at 19:01, Hans Hagen wrote: > > On 12/2/2018 6:33 PM, Hans Åberg wrote: >> Maybe as a part of general features: A font fallback that selects the >> character from a sequence of fonts if not available, which could involve >> ranges, too, but not necessarily. And being able to have untranslated >> throughput. > Using the available fallback mechanism that already can be done. I couldn't figure out how to do it, though. > This super/supscript stuff is a bit more tricky because when a superscript 2 > is in the font, and a superscript 3 isn't, using a fake ^3 alongside that ^2 > quite certainly will look bad because the 2 is normally of a different design > that a scaled down 2, so one then has to replace them all. Then there is the > question of scale and move (up/down). It will look worse not having it at all, when coping from the PDF to the plain text file, that is. :-) > Although I have some experiemntal (font) magic on my computer it will > probably take till next year before it will show up in a beta. Perhaps the stuff that the PDF displays may not need to be what one copies, that is, it displays something that looks good, but when coping as plain text, one gets something that is useful. That is possible for HTML URLs, even though it is a security hazard for such links. ___ 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] Which commands to use to show setups?
Hi Tommaso, \startttyping is a generated command (\definetyping[typing]) and to show the command with \showdefinition you have to use \showdefinition [starttyping:instance:typing] or \showdefinition [starttyping:instance:argument:typing] A complete list with all arguments can be found in setup-mapping-en.pdf. The output of \definition is wrong because there is a wrong check for the number of arguments for the command (because you can pass a list of commands). The \showdefinition command needs also a small change because when you use a instance (e.g. \showdefinition [starttyping:instance:typing]) the caption shows the passed argument (e.g. Definition 1 \starttyping:instance:typing) and not the correct command (e.g. Definition 1 \starttyping). Wolfgang Tommaso Gordini schrieb am 25.11.18 um 09:03: Hi Wolfgang, thank you very much for your code, which works very well. I still have a few doubts about one thing: is it possible that the commands you suggested to me do not work with all ConTeXt commands? For example, if I write \usemodule [setups] \starttext \showdefinition [starttyping] \stoptext I get in the PDF missing: starttyping It's correct? The second question concerns the \definition command. As you can see in the attached PDF, a «and 1» appears below the definition. It's correct? Thank you in advance Il giorno sab 24 nov 2018 alle ore 12:29 Wolfgang Schuster <mailto:wolfgang.schuster.li...@gmail.com>> ha scritto: Tommaso Gordini schrieb am 24.11.18 um 11:45: > Hello, list. > > In my ConTeXt guide, I need to show the syntax of ConTeXt commands. > > Below I paste a MWE showing the different possible commands, but I do > not know if there are others. > I see, however, that the result is different depending on the command > used. > > Do you have any advice to give to me? Which of the commands in the > code should I use in a guide? Or better: do they have to be used > according to needs? > > Are there other commands of this kind? \usemodule[setups] \starttext When you describe a command, e.g. \type{\startdescription{\cmdbasicsetup[...]} ... \stopdescription}: \startbuffer [basicsetup] \cmdbasicsetup [startxtable] \stopbuffer \typebuffer [basicsetup] \getbuffer [basicsetup] When you show the syntax of a command without the options: \startbuffer [shortsetup] \cmdshortsetup [startxtable] \stopbuffer \typebuffer [shortsetup] \getbuffer [shortsetup] When you show the syntax of a command with the options: \startbuffer [fullsetup] \cmdfullsetup [startxtable] \stopbuffer \typebuffer [fullsetup] \getbuffer [fullsetup] When you want to show the name of a command (similar to \tex{type}): \startbuffer [internal] \cmdinternal {startxtable} \stopbuffer \typebuffer [internal] \getbuffer [internal] When you want to show the syntax of a command as a float: \startbuffer [showdefinition] \showdefinition [startxtable] \stopbuffer \typebuffer [showdefinition] \getbuffer [showdefinition] When you want to refer to the definition: \startbuffer [definition] \definition [startxtable] %\definition [startxtable,startembeddedxtable] \stopbuffer \typebuffer [definition] \getbuffer [definition] \page When you have a generated command (e.g. \tex {placefigure}): \startbuffer [instance] \cmdbasicsetupinstance {placefloat} {figure} \cmdshortsetupinstance {placefloat} {figure} \cmdfullsetupinstance {placefloat} {figure} \stopbuffer \typebuffer [instance] \getbuffer [instance] \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Which commands to use to show setups?
Hi Wolfgang, thank you very much for your code, which works very well. I still have a few doubts about one thing: is it possible that the commands you suggested to me do not work with all ConTeXt commands? For example, if I write \usemodule [setups] \starttext \showdefinition [starttyping] \stoptext I get in the PDF missing: starttyping It's correct? The second question concerns the \definition command. As you can see in the attached PDF, a «and 1» appears below the definition. It's correct? Thank you in advance Il giorno sab 24 nov 2018 alle ore 12:29 Wolfgang Schuster < wolfgang.schuster.li...@gmail.com> ha scritto: > > > Tommaso Gordini schrieb am 24.11.18 um 11:45: > > Hello, list. > > > > In my ConTeXt guide, I need to show the syntax of ConTeXt commands. > > > > Below I paste a MWE showing the different possible commands, but I do > > not know if there are others. > > I see, however, that the result is different depending on the command > > used. > > > > Do you have any advice to give to me? Which of the commands in the > > code should I use in a guide? Or better: do they have to be used > > according to needs? > > > > Are there other commands of this kind? > > \usemodule[setups] > > \starttext > > When you describe a command, e.g. > \type{\startdescription{\cmdbasicsetup[...]} ... \stopdescription}: > > \startbuffer [basicsetup] > \cmdbasicsetup [startxtable] > \stopbuffer > > \typebuffer [basicsetup] > \getbuffer [basicsetup] > > When you show the syntax of a command without the options: > > \startbuffer [shortsetup] > \cmdshortsetup [startxtable] > \stopbuffer > > \typebuffer [shortsetup] > \getbuffer [shortsetup] > > When you show the syntax of a command with the options: > > \startbuffer [fullsetup] > \cmdfullsetup [startxtable] > \stopbuffer > > \typebuffer [fullsetup] > \getbuffer [fullsetup] > > When you want to show the name of a command (similar to \tex{type}): > > \startbuffer [internal] > \cmdinternal {startxtable} > \stopbuffer > > \typebuffer [internal] > \getbuffer [internal] > > When you want to show the syntax of a command as a float: > > \startbuffer [showdefinition] > \showdefinition [startxtable] > \stopbuffer > > \typebuffer [showdefinition] > \getbuffer [showdefinition] > > When you want to refer to the definition: > > \startbuffer [definition] > \definition [startxtable] > %\definition [startxtable,startembeddedxtable] > \stopbuffer > > \typebuffer [definition] > \getbuffer [definition] > > \page > > When you have a generated command (e.g. \tex {placefigure}): > > \startbuffer [instance] > \cmdbasicsetupinstance {placefloat} {figure} > \cmdshortsetupinstance {placefloat} {figure} > \cmdfullsetupinstance {placefloat} {figure} > \stopbuffer > > \typebuffer [instance] > \getbuffer [instance] > > \stoptext > > > Wolfgang > setups-1.tex Description: TeX document setups-1.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Which commands to use to show setups?
Tommaso Gordini schrieb am 24.11.18 um 11:45: Hello, list. In my ConTeXt guide, I need to show the syntax of ConTeXt commands. Below I paste a MWE showing the different possible commands, but I do not know if there are others. I see, however, that the result is different depending on the command used. Do you have any advice to give to me? Which of the commands in the code should I use in a guide? Or better: do they have to be used according to needs? Are there other commands of this kind? \usemodule[setups] \starttext When you describe a command, e.g. \type{\startdescription{\cmdbasicsetup[...]} ... \stopdescription}: \startbuffer [basicsetup] \cmdbasicsetup [startxtable] \stopbuffer \typebuffer [basicsetup] \getbuffer [basicsetup] When you show the syntax of a command without the options: \startbuffer [shortsetup] \cmdshortsetup [startxtable] \stopbuffer \typebuffer [shortsetup] \getbuffer [shortsetup] When you show the syntax of a command with the options: \startbuffer [fullsetup] \cmdfullsetup [startxtable] \stopbuffer \typebuffer [fullsetup] \getbuffer [fullsetup] When you want to show the name of a command (similar to \tex{type}): \startbuffer [internal] \cmdinternal {startxtable} \stopbuffer \typebuffer [internal] \getbuffer [internal] When you want to show the syntax of a command as a float: \startbuffer [showdefinition] \showdefinition [startxtable] \stopbuffer \typebuffer [showdefinition] \getbuffer [showdefinition] When you want to refer to the definition: \startbuffer [definition] \definition [startxtable] %\definition [startxtable,startembeddedxtable] \stopbuffer \typebuffer [definition] \getbuffer [definition] \page When you have a generated command (e.g. \tex {placefigure}): \startbuffer [instance] \cmdbasicsetupinstance {placefloat} {figure} \cmdshortsetupinstance {placefloat} {figure} \cmdfullsetupinstance {placefloat} {figure} \stopbuffer \typebuffer [instance] \getbuffer [instance] \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] German introduction to context
Hi Axel, thanks a lot for this introduction. Am 02.11.18 um 10:07 schrieb Axel Kielhorn: > Hello! > > As promised I’ve uploaded my ConTeXt introduction to github. > You can find it at > https://github.com/AKielhorn/Context-Intro > > I used MkIV syntax for \startsection \stopsection but gave up on > \startparagraph \stoparagraph. > > Is there a way to auto convert that or do I have to add these command once I > want to generate tagged PDF? > > Feel free to comment, this is the second time I use ConTeXt and I wanted to > keep notes about the things I need. > > Future plan: > Learn more about bibliography. > Create PDF/A (or /UA). > More math as I need it. > > Alternative environments to change the look. If you are familiar with LaTeX (as a user) many things are obvious in ConTeXt, at least for me. Early showstoppers – at least for me – are configuration and the definition of styles etc. At first you think, wow, this key-value pairing is nice, but then you realize that you never know which keys are available and what values can be applied. What kind of brackets must be used? Why do some commands have two, three, four brackets for options? The next showstopper is the define-setup system and the possibility to give names to your macros. I always thought: Well, there is a well defined system in it, I am only too dumb to grasp it. I discovered setup-en.pdf and tried to figure out how to read it. I discovered showsetup only to see that \showsetup{setuphead} just gives me a list of options but no explanation. It would be great if showsetup would give explanations to the keys and values. I like to learn using try-and-error, but I would love to have a systematic introduction to the concepts of ConTeXt. Maybe you can add some of this in your introduction to make it a starting point for users speaking German. 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] hyphenation
Untested: \setupreferenceformat[style=\nohyphens] Wolfgang Hans van der Meer schrieb am 26.10.18 um 13:38: Using roman numbers in figures I encountered a case where XIII.9 was hyphenated into XI-II.9. A bit unclear, in my opinion. Easily repairable with something like \def\myfigure[#1]{{\nohyphens\in{figure}[#1]}} Just an observation, not really a problem but maybe something waiting to be fixed. dr. Hans van der Meer ___ 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] hyphenation
On 10/26/2018 1:38 PM, Hans van der Meer wrote: Using roman numbers in figures I encountered a case where XIII.9 was hyphenated into XI-II.9. A bit unclear, in my opinion. Easily repairable with something like \def\myfigure[#1]{{\nohyphens\in{figure}[#1]}} Just an observation, not really a problem but maybe something waiting to be fixed. \nl \hyphenation{XIII} - 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] hyphenation
Using roman numbers in figures I encountered a case where XIII.9 was hyphenated into XI-II.9. A bit unclear, in my opinion. Easily repairable with something like \def\myfigure[#1]{{\nohyphens\in{figure}[#1]}} Just an observation, not really a problem but maybe something waiting to be fixed. dr. Hans van der Meer ___ 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] Strange behavior with the command \inframed{}
Hi Aditya, Sorry but with this file, there are some problems, especially with the last item. Thanks. Fabrice Le mar. 23 oct. 2018 à 09:46, Fabrice Couvreur a écrit : > Hi Aditya, > Thanks. > Fabrice > > Le lun. 22 oct. 2018 à 12:45, Aditya Mahajan a écrit : > >> On Mon, 22 Oct 2018, Fabrice Couvreur wrote: >> >> > Hi, >> > When I use the \inframed{} command twice, they are not on the same >> baseline. >> > Thank you. >> > Fabrice >> > >> > \starttext >> Add \dontleavehmode >> >\inframed{\m{I\times X=A^{-1}\times B}} ; \inframed{\m{A^{-1}\times >> A >> > \times X=A^{-1}\times B}} >> > \stoptext >> >> See >> >> https://wiki.contextgarden.net/Unexpected_behavior#Unsolicited_Vertical_Mode >> >> Aditya >> >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> >> ___ > > \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \define\ItemCommand {\hskip\zeropoint\relax\autoinsertnextspace} \setupitemgroup [itemize] [color=black, style=bold, distance=\zeropoint] \setupitemgroup [itemize:1] [option={n,packed,fit,intext}, command=\ItemCommand] \setupitemgroup [itemize:2] [lefttext=, righttext=, option={a,text}] \starttext \placerecipe{}{ \startxtable[align={lohi,middle},bodyfont=9pt,offset=0.5ex] \startxrow \startxcell[nx=5,frame=off,align={right}] Prénom : Marion \stopxcell \stopxrow \startxrow \startxcell \rotate[rotation=30,width=1.5cm]{\darkred Admise} \stopxcell \startxcell Anglais \stopxcell \startxcell Maths \stopxcell \startxcell[width=1.5cm] Culture générale \stopxcell \startxcell[width=2.25cm] Économie \stopxcell \stopxrow \startxrow \startxcell Note/20 \stopxcell \startxcell 12 \stopxcell \startxcell 14 \stopxcell \startxcell 8 \stopxcell \startxcell 11 \stopxcell \stopxrow \startxrow[frame=off] \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell[frame=on] \bf Moyenne 11,8 \stopxcell \stopxrow \startxrow \startxcell[nx=5,frame=off,align={right}] Prénom : Hichem \stopxcell \stopxrow \startxrow \startxcell \rotate[rotation=30,width=1.5cm]{\darkred Admis } \stopxcell \startxcell Anglais \stopxcell \startxcell Maths \stopxcell \startxcell Culture générale \stopxcell \startxcell[width=2cm] Économie \stopxcell \stopxrow \startxrow \startxcell Note/20 \stopxcell \startxcell 13 \stopxcell \startxcell 15 \stopxcell \startxcell 10 \stopxcell \startxcell 16 \stopxcell \stopxrow \startxrow[frame=off] \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell \stopxcell \startxcell[frame=on] \bf Moyenne 14,5 \stopxcell \stopxrow \startxrow \startxcell[nx=5,frame=off,align={right}] Prénom : Lucas \stopxcell \stopxrow \startxrow \startxcell \rotate[rotation=30,width=1.5cm]{\darkred Refusé} \stopxcell \startxcell Anglais \stopxcell \startxcell Maths \stopxcell \startxcell Culture générale \stopxcell \startxcell[width=2cm] Économie \stopxcell \stopxrow \startxrow \startxcell Note/20 \stopxcell \startxcell 9 \stopxcell \startxcell 8 \stopxcell
Re: [NTG-context] what defines the font size?
On 10/16/2018 9:07 AM, Arthur Reutenauer wrote: On Mon, Oct 15, 2018 at 10:59:57PM +0200, Hans Hagen wrote: On 10/15/2018 10:02 PM, Ulrike Fischer wrote: None. The font decides about its size. actually, the designer ... I quite liked the idea of the font itself deciding on its size, of its own free will ;-) To stress the point, there is nothing that can intrinsically define the size of a font in the computer age. It’s partly arbitrary. It’s the same for clothes, actually. In the UK, my shirt size is a 15½ and my hat size is 7⅝. Go figure. so given that when picking up a conference t-shirts at bachotex you have to get one size smaller than you expect, one can also assume that the gyre collection designsize is somewhat oversized Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] what defines the font size?
On Mon, Oct 15, 2018 at 10:59:57PM +0200, Hans Hagen wrote: > On 10/15/2018 10:02 PM, Ulrike Fischer wrote: >> None. The font decides about its size. > actually, the designer ... I quite liked the idea of the font itself deciding on its size, of its own free will ;-) To stress the point, there is nothing that can intrinsically define the size of a font in the computer age. It’s partly arbitrary. It’s the same for clothes, actually. In the UK, my shirt size is a 15½ and my hat size is 7⅝. Go figure. Best, Arthur ___ 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] Text around a table (xtables)
Hi Pablo, Thank you, I thought that indicating width = 1.7cm, the size of the cells would have been 1.7cm. Fabrice Le mer. 10 oct. 2018 à 19:46, Pablo Rodriguez a écrit : > On 10/10/18 7:26 PM, Fabrice Couvreur wrote: > > Hello, > > Why is the text wrapping around the board or far too far ? > > Hi Fabrice, > > replace the following command: > > \startxtable[align={middle,lohi}] > > It works now. It is rather weird that the total width for the table is > 1.7cm and one of its cells is 3.5cm. > > I hope it helps, > > Pablo > > > > Thank you. > > Fabrice > > > > \definefloat > > [recipe] > > [figure] > > > > \setupfloat > > [recipe] > > [default={right,none}] > > > > \starttext > > \placerecipe{}{% > > \startxtable[align={middle,lohi},width=1.7 > > cm] > > \startxrow[background=color,backgroundcolor=gray] > > \startxcell[width=3.5cm,frame=off,align={middle,right}, > > background=color,backgroundcolor=white] > > Consommation pour la production de 1 UM > > \hfill\startMPcode drawarrow > > (0,0)--(0,0.35cm)--(0.35cm,0.35cm)withpen pencircle scaled 1bp; > \stopMPcode > > \stopxcell > > \startxcell > > Ind. > > \stopxcell > > \startxcell > > Agri. > > \stopxcell > > \stopxrow > > \startxrow > > \startxcell[background=color,backgroundcolor=gray] > > Ind. > > \stopxcell > > \startxcell > > 0,5 > > \stopxcell > > \startxcell > > 0,2 > > \stopxcell > > \stopxrow > > \startxrow > > \startxcell[background=color,backgroundcolor=gray] > > Agri. > > \stopxcell > > \startxcell > > 0,2 > > \stopxcell > > \startxcell > > 0,6 > > \stopxcell > > \stopxrow > > \startxrow > > \startxcell[nx=3,frame=off,align={right}] > >Lecture du tableau : pour la production d'un bien équivalent à 1 > > UM, l'industrie consomme l'équivalent de 0,5 UM de sa propre production > > et l'équivalent de 0,2 UM de la production de l'agriculture. > > \stopxcell > > \stopxrow > > \stopxtable > > } > > \dorecurse{10}{\input knuth} > > \stoptext > > > > > ___ > > If your question is of interest to others as well, please add an entry > to the Wiki! > > > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > ___ > > > > > -- > http://www.ousia.tk > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ ___ 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 ___