Re: [NTG-context] externalfigure vs. draw externalfigure in metafun
In article calbomsadxdyx8q9pmva2_cpm3rq8j1mxkepqgnasjtafuhc...@mail.gmail.com, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: Dear Hans, I have problems with externalfigure inside metapost. In MKII, only externalfigure something.png; works, while in MKIV only draw externalfigure something.png; is accepted. Is there any chance to accept one of the syntaxes in both flavours? Thank you, Mojca Minimal example: \starttext \startMPpage % only good for MKII externalfigure abc.png xyscaled (5cm,8cm); % only good for MKIV % draw externalfigure abc.png xyscaled (5cm,8cm); \stopMPpage \stoptext Does the following workaround work for you? def mydraw text t = def f = begingroup t endgroup enddef; if picture f : draw f ; fi enddef; mydraw externalfigure abc.png xyscaled (5cm,8cm); Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] externalfigure vs. draw externalfigure in metafun
In article nvitacolonna-9462e1.4817092...@news.gmane.org, Nicola nvitacolo...@gmail.com wrote: Does the following workaround work for you? def mydraw text t = def f = begingroup t endgroup enddef; if picture f : draw f ; fi enddef; mydraw externalfigure abc.png xyscaled (5cm,8cm); This may be better: def mydraw text t = _mydraw begingroup t endgroup enddef; def _mydraw primary f = if picture f : draw f ; fi enddef; mydraw externalfigure abc.png xyscaled (5cm,8cm); Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] externalfigure vs. draw externalfigure in metafun
In article calbomsbm2thsup+kzjlkfd8pba2bbt7jvf-bvrwkrkz3+wb...@mail.gmail.com, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: do you have any idea what exactly would have to be fixed in ConTeXt core code? Edit mp-spec.mp and change the line draw p withcolor ... with image(draw p withcolor ...) The line is in the body of the doexternalfigure macro. Then, 'draw externalfigure ...' should work in mkii, too. Note: knowledge of ConTeXt internals - which I don't have - is needed to be sure that the patch doesn't break anything. Hence, the above is to be considered as a wild guess of mine. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] ANN: Metappeal 0.1.0
Hi, although the following is an announcement of a pure MetaPost library, I thought that it might be of interest to this list, given the tight integration of MetaPost with ConTeXt. Metappeal is an extension to Plain MetaPost, providing a lightweight framework for consistent development in MetaPost. Metappeal 0.1.0 is the second release of this newborn project, bringing you new prominent features: - classes and templates; - delegation; - new basic data structures (bigints, bigstrings); - much better documentation (which is different from very good documentation). in addition to a unit testing framework, other data structures (arrays, records, stacks, lists, trees, mboxes, ...) and parametrized code blocks. Nothing graphical yet, sorry, apart from mboxes (getting classes right was hard enough). Metappeal is available from: http://users.dimi.uniud.it/~nicola.vitacolonna/home/content/metappeal and feedback is welcome. Happy MetaPost development! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] metapost question
In article 0e2e620e-1148-41ad-9966-54a594fcc...@xs4all.nl, Hans van der Meer havdm...@xs4all.nl wrote: I cannot find the answer to the following question in Knuth's Metafont book. The following definition with a trailing text argument: def mydef (expr a, b, c) text modifier = if modifier = empty: else: fi enddef; How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error. A text argument is a (more or less) arbitrary sequence of tokens—that is, loosely speaking, any “chunk” of MetaPost code. I must do the switch, because fill modifier with an empty modifier gives horrible results. Usage would be calls like: mydef(1,2,3) withcolor green; % with modifier text mydef(1,2,3); % without modifier text This is the best I could think of: vardef emptytext?@# text t = (str @# = empty.sandwich) enddef; def mydef(expr a,b,c) text t = if begingroup emptytext? empty t sandwich endgroup: % t is empty draw unitsquare scaled 1cm; else: % t is not empty fill unitsquare scaled 1cm t ; fi; enddef; The key is the 'emptytext? empty t sandwich;' line: if t is empty, @# matches 'empty.sandwich', otherwise it matches 'empty' possibly followed by something else (depending on what t actually is). The undelimited text parameter of emptytext? is needed to “swallow” whatever tokens are left (possibly none) after matching the implicit suffix parameter. Note that begingroup and endgroup are necessary in the if clause, otherwise emptytext?'s undelimited text parameter will match beyond the colon. In practice, you should rename 'sandwich' to some token that you are pretty sure will never occur as the beginning of the text argument when you invoke mydef. I'd be glad to hear about other solutions: this question has bugged me for some time… Regards, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Style file for iPad?
In article 20120306134022.GB29209@khaled-laptop, Khaled Hosny khaledho...@eglug.org wrote: On Tue, Mar 06, 2012 at 10:40:20PM +1100, Alasdair McAndrew wrote: Yes, but what ebook formats handle mathematics and diagrams? Plus the poor layout support in almost all ebook readers (brain dead paragraph builder, no hyphenation, no OpenType support etc. etc. they are usually pieces of junk for any remotely complex text layout job). It's worse than pre-TeX printed books. Which makes me wonder: is anyone in the world addressing this? Are there people in the TeX community involved in the standardization processes (say, Epub3, but also the various W3C specifications), who could push forward ideas from TeX, like minimum requirements for the algorithms that rendering engines should use? These questions (together with sighs) arise every time I see a web page especially with mathematical notation… Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] XeConTeXt and Euler
Hi, I'm pretty new to ConTeXt, so please bear with me if the following has already been asked (I have not found any answer in the archives, though). My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check). I guess the problem is the different encoding (and possibly the use of virtual fonts), but I know that Euler works in XeTeX: is it possible to make it work in XeConTeXt? Below you find my sample code. Nicola %!TEX TS-program = XeConTeXt %!TEX encoding = UTF-8 Unicode \definetypeface[Charis][rm][Xserif][Charis SIL][default][encoding=uc] \definetypeface[Doulos][rm][Xserif][Doulos SIL][default][encoding=uc] \definetypeface[Gentium][rm][Xserif][Gentium][default][encoding=uc] \definetypeface[Charis][mm][math][euler][euler] % encoding??? \definetypeface[Doulos][mm][math][euler][euler] \definetypeface[Gentium][mm][math][euler][euler] \startbuffer Unicode text works fine here, but formulas do not: \startformula \breve x^n + \bar y^n = \hat z^n. \stopformula \stopbuffer \starttext \switchtobodyfont[Charis] \getbuffer \switchtobodyfont[Doulos] \getbuffer \switchtobodyfont[Gentium] \getbuffer \showmathcharacters \stoptext \end ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] XeConTeXt and Euler
In article [EMAIL PROTECTED], Aditya Mahajan [EMAIL PROTECTED] wrote: On Sun, 18 Mar 2007, nicola wrote: My goal is to use an arbitrary text font together with the Euler math font. I am able to use a few combinations in ConTeXt, e.g. Palatino with Euler, without problems. But when I switch to XeConTeXt (to use my system's fonts), some Euler's math accents do not show up properly (\hat) or not at all (\acute, \grave, \bar, \breve, \dot, \ddot, \tilde, \check). AFAIU, Euler does not have these accents. They are pulled from the text font. That is a bit tricky because different text encodings have accents at different locations. Right now, there is only suport for ec and texnansi. You can try to add support for uc encoding by telling ConTeXt about location of accents in uc encoding. Look at the code at the end of math-eul.tex Ok, I see. Where is \definemathsymbol documented? The third argument is not very clear to me. Nicola ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] ! Unable to make mpx file.
In article [EMAIL PROTECTED], Steve MC Han [EMAIL PROTECTED] wrote: I was wondering if you could give me some direction. I'm having this error message in doing metapost. ! Unable to make mpx file. l.78 label.bot(btex $\hbox{\sf Rectangle}$ etex, (0,-.6u)); I don't know if that can help, but I had a similar problem some time ago. Try tex --parse-first-line --interaction=nonstopmode mpxerr.tex to see the error message. In my case, it turned out that the problem was format-related: latex.fmt had been written by pdfetex, but makempx was calling tex instead of pdfetex. The solution was to add the line: TEX=pdfetex to texmf.cnf. I was experiencing the problem with gwTeX, though: since I am using TeX Live 2007 I have no problem at all. For your reference, this is the thread: http://thread.gmane.org/gmane.comp.tex.metapost/323/focus=330 Nicola ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Relationship among mptopdf, mpost and latex
Hi, some time ago I needed to include a png file into a MetaPost picture and I did it with the MetaFun macro externalfigure. I compiled the code with mptopdf and the result was fine. Since I had no previous experience with it, my code used LaTeX, not ConTeXt, for the labels. I have recently updated my distributions (TeX Live 2007 and gwTeX on Mac OS X) and the same code does not work any longer in either distribution. A minimal example reproducing the problem is as follows: verbatimtex %latex \documentclass{article} \begin{document} etex beginfig(0); externalfigure pic.png scaled 15mm shifted origin; label.bot(btex $x$ etex, origin); endfig; end; The error mptopdf gives is: ! Undefined control sequence. l.44 \documentclass {article} as if the code were not interpreted as LaTeX code. I have tried the following two variants, but with no positive results: 1) I have used input TEX; TEXPRE(%latex char(10) \documentclass{article}\begin{document}); TEXPOST(\end{document}); instead of the verbatimtex.. etex block, and label.bot(TEX(x_1), origin); to draw the label. In this case, mptopdf does not complain, but I see '0' instead of the label in the output. 2) I have added input mp-tool; input mp-spec; to both the original code above and to variant 1) and I have typeset with mpost. The results are original code) the png picture is not shown in the output; variant 1) I get the error: ! Unable to make mpx file. l.3 btex x_1 etex So, I kindly ask someone to help me tidy things up. In particular: a) Is it possible to include the MetaFun macros when using mpost? b) Is it possible to use the %latex syntax with mptopdf? Nicola ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Relationship among mptopdf, mpost and latex
In article [EMAIL PROTECTED], Hans Hagen [EMAIL PROTECTED] wrote: Taco Hoekwater wrote: Mojca Miklavec wrote: I remember that Hans claimed that texmfstart (or texexec) could be convinced to process LaTeX documents (and there is some mention of latex command in core indeed), but I never managed to make it work. LaTeX has worked only in the very beginning, when I was still using latex somewhat regularly, and afaik I was the only tester of that code (Btw, that means texexec dates back to at least the year 2000). i can probably extend texexec easily to do the multipass latex thing (just as i support plain tex) but it has a low priority (useless to make something that no one will use or only one or two users) About mptopdf: something is definately wrong there, and it really should be fixed. It is totally pointless when mptopdf processes only context-based files properly, since these are the only ones that do not _need_ mptopdf in the first place. i remember fixing something because a latex user asked for it but usually don't test that (samep for supp-pdf), so if i get solutions i can put them in (i need to rewrite the thing anyway) I have browsed mptopdf.pl code and I have discovered that I can process my original example with mptopdf --rawmp --metafun example.mp (en passant, it would be nice if 'mptopdf --help' showed the available options). The script recognizes when LaTeX is being used (lines 78--84), but unless --rawmp is given, it processes the file with texexec (which, as far as I have understood, does not currently work correctly with LaTeX, even if it probably should). It has turned out that the combination mptopdf/latex seems quite an unusual one: apparently, a ConTeXt user does not need to care about LaTeX stuff (of course); on the other hand, a LaTeX user might want to include the powerful MetaFun macros in raw MetaPost files (that was my case), without using ConTeXt. The latter can be accomplished as shown above, which implies mpost --tex=latex --progname=mpost --mem=metafun So, why not change mptopdf.pl so that it uses the command above when the latex switch is present and texexec only when there is no LaTeX related stuff? That is, change lines 86-100 to read: if ($Latex) { # Use mpost + metafun macros $mpbin = mpost --tex=latex --progname=mpost --mem=metafun ; } else { $mpbin = texexec --mptex $PassOn ; } The rationale here is that, probably, the more complicated processing by texexec is not relevant to the LaTeX user. My other question was: is page 5, ?1 in metafun-p.pdf obsolete? As I have already pointed out, 'input mp-tool; input mp-spec;' at the beginning of my original example results in no errors, but the output has a blank figure. Or is this a question for the metapost mailing list? Nicola ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] unicode in metafun?
In article [EMAIL PROTECTED], Andrea Valle [EMAIL PROTECTED] wrote: Hi to all, I'm plotting a phonetic formant chart with metapost inside context. I know I can't use TIPA, but I would be happy with utf8. I did something similar with XeTeX and ConTeXt using the \sometxt macro, e.g.: \definetypeface[myface][rm][Xserif][Charis SIL][default][encoding=uc] \starttext \startreusableMPgraphic{fig} u := 1cm; draw origin--(0,u)--(0,2u)--(0,3u); dotlabel.lft(\sometxt{Q}, origin); dotlabel.rt(\sometxt{R}, origin); dotlabel.lft(\sometxt{Ã¥ ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] \loadcurrentMPgraphic from metafun manual
Hi, I have tried the following example (metafun-p.pdf, p. 112-3): \startMPgraphic draw unitsquare xscaled 5cm yscaled 1cm withpen pencircle scaled 2mm withcolor .625red; \stopMPgraphic \hbox \bgroup \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic \quad \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic \egroup but nothing is drawn unless I remove the setups in curly braces (in which case a rectangle 5cm x 1cm is drawn). Is there a different way to pass options to the figure inclusion macro? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] drawoptions in \startMPinclusions
Hi, the following code \startMPinclusions drawoptions(withpen pencircle scaled 1mm); u := 1cm; \stopMPinclusions \startreusableMPgraphic{foo} draw origin--(u,u); \stopreusableMPgraphic \starttext \midaligned{\reuseMPgraphic{foo}} \stoptext produces a line with default thickness, not 1mm wide. Is this a bug? Or do I misunderstand the purpose of \startMPinclusions (I have assumed that it inserts the text verbatim inside each figure definition)? I am using ConTeXt ver: 2007.01.12 15:56 MKII fmt: 2007.6.8 int: english/english Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Several environments in a project?
Hi, I have a project with a few products sharing the same layout, which is specified in a global environment file. Each product is in a separate subdirectory together with its components. Then, I want to put some setups and figure definitions in product-specific environments and I do it like this: \startproduct OneProduct \project MyProject \environment OneProductDir/LocalEnvironment ... The problem is that the local environment is not read when I typeset a particular component, but only when I typeset the whole product. How can I fix that? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Several environments in a project?
In article [EMAIL PROTECTED], Aditya Mahajan [EMAIL PROTECTED] wrote: On Mon, 18 Jun 2007, fiëé visuëlle wrote: Am 2007-06-18 um 12:50 schrieb nicola: I have a project with a few products sharing the same layout, which is specified in a global environment file. Each product is in a separate subdirectory together with its components. Then, I want to put some setups and figure definitions in product-specific environments and I do it like this: \startproduct OneProduct \project MyProject \environment OneProductDir/LocalEnvironment ... The problem is that the local environment is not read when I typeset a particular component, but only when I typeset the whole product. How can I fix that? Put your product specific settings in the product file. AFAIU, they will not be executed. There is really no clean way of doing this without adding extra markup. Suppose I have a product file which says \startproduct product \environemnt env1 \environemnt env2 Title Text \component one \component two \stopproduct and a component \startcomponent one \product product text \stopcomponent How can TeX parse the product file without typesetting title text? It would have been simple if title text was surronded by some markup, but it is not. This is one of the reasons projects are not supposed to have any matertial that will be typeset. So, the short answer is just add \environment commands in your components. Ok, I had thought about it: it just doesn't feel the right way to me (logically, as the enviroment is common to all components, it should be put at a level that is common to all components...) Another way is to use localenvironments in your environment file, but I have never used them myself. I have read about \localenvironment and tried it a bit, but without much success: I must say that I find the documentation about it a bit cryptic. I would gladly see a usage example by someone more knowledgeable than myself... Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Label loops within a XeConTeXt document
Hi, given the following XeConTeXt document (I use ConTeXt ver: 2007.01.12): \definetypeface[MyMainFace][rm][Xserif][Charis SIL][default][encoding=uc] \definetypeface[MyMainFace][mm][math][euler][euler] \setupbodyfont[MyMainFace,10pt] \startuseMPgraphic{foo} for i = 0 upto 10: % Draw a label at position (i*cm,0) endfor; \stopuseMPgraphic \starttext \midaligned{\useMPgraphic{foo}} \stoptext is it possible to replace the comment with an instruction (or a macro), such that I do not get compilation errors and I get consistent font usage? I have tried the following possibilities: a) label(test,(i*cm,0)); % Complains about missing metrics for font b) label(\textext{test},(i*cm,0)); % Ditto c) label(btex test $x$ etex,(i*cm,0)); % Results in wrong font d) label(\sometxt{test},(i*cm,0)); % Ok, right font, but loop is ignored The best option to my knowledge is \sometxt, but I have read that it cannot be used in loops. Before I start unrolling all the loops in my figures 1) is it possible to specify the fonts in an MPenviroment? If so, how? 2) is there some hack, maybe along the lines of the following (not working) example? vardef prepare(expr n) = save s; string s; s = ; for i = 0 upto n-1: s := s label(\sometxt{test},( decimal(i) *cm,0));; endfor; s enddef; scantokens(prepare(10)); Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Label loops within a XeConTeXt document
In article [EMAIL PROTECTED], Aditya Mahajan [EMAIL PROTECTED] wrote: On Sat, 23 Jun 2007, nicola wrote: Hi, given the following XeConTeXt document (I use ConTeXt ver: 2007.01.12): \definetypeface[MyMainFace][rm][Xserif][Charis SIL][default][encoding=uc] \definetypeface[MyMainFace][mm][math][euler][euler] \setupbodyfont[MyMainFace,10pt] \startuseMPgraphic{foo} for i = 0 upto 10: % Draw a label at position (i*cm,0) endfor; \stopuseMPgraphic \starttext \midaligned{\useMPgraphic{foo}} \stoptext is it possible to replace the comment with an instruction (or a macro), such that I do not get compilation errors and I get consistent font usage? I have tried the following possibilities: a) label(test,(i*cm,0)); % Complains about missing metrics for font b) label(\textext{test},(i*cm,0)); % Ditto This is strange. Do you also get this error if you use pdftex instead of xetex? c) label(btex test $x$ etex,(i*cm,0)); % Results in wrong font d) label(\sometxt{test},(i*cm,0)); % Ok, right font, but loop is ignored The best option to my knowledge is \sometxt, but I have read that it cannot be used in loops. Before I start unrolling all the loops in my figures 1) is it possible to specify the fonts in an MPenviroment? If so, how? Just as you will specify fonts in your regular document. Putting the same definitions inside \startMPinclusions... \stopMPinclusions does not seem to work with XeTeX. Have you checked \startTeXtexts ...\stopTeXtexts? See Section 4.4 of Mojca's MyWay on \sometxt (http://dl.contextgarden.net/myway/sometxt.pdf) Ah, I did not know about those commands: that works! Just a silly question, though: how do I change \startTeXtexts \dorecurse{10}{\TeXtext{\recurselevel}{$x_{\recurselevel}$}} \stopTeXtexts so that I can print labels from x_0 up to x_9? Do I need to use \defineconversion and \convertnumber? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Macro with suffix
Hi, I have read http://thread.gmane.org/gmane.comp.tex.context/3540, but why does the following \appendtoks \let\#\hashletter \to \everyMPgraphic \startuseMPgraphic{foo} vardef [EMAIL PROTECTED](expr x) = enddef; \stopuseMPgraphic \startuseMPgraphic{goo} \includeMPgraphic{foo} foo.foo(1); \stopuseMPgraphic \starttext \useMPgraphic{goo} \stoptext gives the error: ! Undefined control sequence. argument vardef [EMAIL PROTECTED] (expr x) = enddef; \handleuseMPgraphic #1#2#3-#3 argument \includeMPgraphic {foo} foo.foo(1); \writecheckedMPgraphic ...icfalse \edef \ascii {#1 }\convertcommand \ascii \t... \startMPgraphic ...hic \writecheckedMPgraphic {#1} \stopwritingMPgraphic \handleuseMPgraphic ...MPgraphic #3\stopMPgraphic \ifMPrun \else \loadMPgrap... ... Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Label loops within a XeConTeXt document
1) is it possible to specify the fonts in an MPenviroment? If so, how? Just as you will specify fonts in your regular document. Putting the same definitions inside \startMPinclusions... \stopMPinclusions does not seem to work with XeTeX. It is MPenvironent and not MPinclusions. I do not have xetex, so I can not test this. Ok, even if I put those definitions in an MPenvironment the text fonts do not change (I guess the mechanism for font selection is slightly different in XeTeX). how do I change \startTeXtexts \dorecurse{10}{\TeXtext{\recurselevel}{$x_{\recurselevel}$}} \stopTeXtexts so that I can print labels from x_0 up to x_9? Do I need to use \defineconversion and \convertnumber? No, use \dostepwiserecuse. The general syntax is \dostepwiserecurse {from} {to} {step} {action} so \dostepwiserecurse {0} {9} {1} {\TeXtext{\recurselevel}{$x_{\recurselevel}$} should work. Thank you very much! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Label loops within a XeConTeXt document
how do I change \startTeXtexts \dorecurse{10}{\TeXtext{\recurselevel}{$x_{\recurselevel}$}} \stopTeXtexts so that I can print labels from x_0 up to x_9? Do I need to use \defineconversion and \convertnumber? No, use \dostepwiserecuse. The general syntax is \dostepwiserecurse {from} {to} {step} {action} so \dostepwiserecurse {0} {9} {1} I guess it must be \dostepwiserecurse {0} {9} {1} {} {\TeXtext{\recurselevel}{$x_{\recurselevel}$} should work. I have tried that, but sometxt(0) prints nothing. Anyway, I have solved it like this: \startTeXtexts \TeXtext{0}{$x_0$} \dorecurse{30}{\TeXtext{\recurselevel}{$x_{\recurselevel}$}} \stopTeXtexts Thanks again! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Labels in figures with wrong bounding box
Hi, I am typesetting a document with XeConTeXt, containing many MetaPost figures. All the labels in the figures are typeset using \sometxt{} and sometxt(). For some reasons, in the final document some of them appear horribly stretched or shrinked as if their bounding box has not been computed correctly (even after typesetting the document n times). I have absolutely no clue why that happens, but I imagine it is some strange interaction in the environment file, because if I typeset any of the problematic figures by itself in a different document with a minimal environment everything is fine. My environment file is quite long and I cannot find a short example showing the problem. The deformed labels seem to be always among those written by \sometxt (but not all of them are wrong!), while those written using sometxt() seem always ok. What may it depend upon? Nicola PS: I am aware of the interaction between sometxt() and \sometxt: I would like to point out that the labels are *not* messed up: they are the correct labels, just appearing deformed. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Labels in figures with wrong bounding box
In article [EMAIL PROTECTED], nicola [EMAIL PROTECTED] wrote: Hi, I am typesetting a document with XeConTeXt, containing many MetaPost figures. All the labels in the figures are typeset using \sometxt{} and sometxt(). For some reasons, in the final document some of them appear horribly stretched or shrinked as if their bounding box has not been computed correctly (even after typesetting the document n times). I have absolutely no clue why that happens, but I imagine it is some strange interaction in the environment file, because if I typeset any of the problematic figures by itself in a different document with a minimal environment everything is fine. My environment file is quite long and I cannot find a short example showing the problem. The deformed labels seem to be always among those written by \sometxt (but not all of them are wrong!), while those written using sometxt() seem always ok. What may it depend upon? Ok, I solved the problem by getting rid of all \sometxt commands and replacing them by low-level sometxt(). Mojca's My Way about sometxt says If you want to prevent clashes, use higher numbers in [\TeXtext's] arguments. I use numbers beyond 1000. I definitely do not have 1000 labels and, in fact, the correct labels are put in the correct places. But it seems that the two commands do not like each other anyway. Is it really not advisable to use them in the same document? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [OT] Spacing research
Hi, people in this list may be interested in reading this: http://aldusleaf.org/rhea.php Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OOP in Metafun.
In article cadvh14ul9igw6wyvymg80hymiaxxhzfoc0no_4+dr70knok...@mail.gmail.com, Andre Caldas andre.em.cal...@gmail.com wrote: Hello, list! I am writing down a macro package for commutative diagrams using metafun. This is my first try: https://bitbucket.org/andrecaldas/math-video-classes/src/9a050eab20348c9a9c9e5 0740618173648979f45/src/environments/diagrams.tex?at=default Used here: https://bitbucket.org/andrecaldas/math-video-classes/src/9a050eab2034/src/prod ucts/assorted/open_mapping_theorem/notes/introduction.tex?at=default#cl-106 But I would like to use some object oriented like approach. That is, I'd like the diagram data structure to be set up like this: d = CD.new; d.vertex($X$); d.arrow($f$); d.vertex($Y$); d.newline; d.arrow($\pi$); d.arrow($\pi$); d.vertex($A$); d.arrow($g$); d.vertex($B$); or even in some thelabel similar fashion, d = CD.new; CD.vertex(d, $X$); CD.arrow(d, $f$); CD.vertex(d, $Y$); CD.newline(d); CD.arrow(d, $\pi$); CD.arrow(d, $\pi$); CD.vertex(d, $A$); CD.arrow(d, $g$); CD.vertex(d, $B$); How do I do that in METAFUN/METAPOST? You may want to take a look at my attempt: http://users.dimi.uniud.it/~nicola.vitacolonna/home/content/metappeal It is a library intended to provide a minimal framework for “oo-like” constructs. It is a work in progress (actually, I have not worked on it for a while since I didn't receive any feedback) and the documentation is a bit messy, but the core is stable and well tested and should be compatible with MetaFun. It is all based on a pair of macros that generalize MetaPost declarations, a first draft of which is shortly described here: http://oldwww.gust.org.pl/projects/pearls/2011p/index_html For the functionality you are describing, you may just need to grab the file metappeal.mp (and the files that it includes) and include it in your source. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OOP in Metafun.
In article CADVh14XYT3Mi6aPUOv4Py==_gjy=MAFEH-hQbmRVE=r_d-t...@mail.gmail.com, Andre Caldas andre.em.cal...@gmail.com wrote: But I would like to use some object oriented like approach. [...] How do I do that in METAFUN/METAPOST? You may want to take a look at my attempt: http://users.dimi.uniud.it/~nicola.vitacolonna/home/content/metappeal Looks nice! I didn't find any license explaining the licensing terms. In the documentation there is a Disclaimer. In short, do what you want with the code, but do not blame me ;) Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] mptopdf does not work with filenametemplate
Given the following source file foo.mp: beginfig(0); filenametemplate foo.eps; endfig; end; running 'mptopdf foo.mp' results in: MPtoPDF 1.3.3 : no filename matches foo (because it is looking for foo.0, of course). I've read that 'filenametemplate' is going to be deprecated in favor of 'outputtemplate': will mptopdf be compatible with that command? Or is mptopdf also going to be replaced by something else (sorry, I'm not following the recent developments very closely)? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to unfill a picture?
In article 769ba7780906240342s4939ac2foe7bfd783ad2e8...@mail.gmail.com, Zhichu Chen zhichu.c...@gmail.com wrote: Well, my example is too simple. Actually, I was trying to draw a treble clef If your goal is to draw a path with pens of varying width (kind of calligraphic strokes),'penpos' and 'penstroke' may be your friends (defined in plain.mp). This is what I've come out with by about 15 minutes of trial and error (disclaimer: this is my first attempt at using these macros beyond trying to draw a sans-serif 'l' - I'm not a designer at all): fill unitsquare scaled 12cm shifted (-6cm,-6cm) withcolor .625red; b = 2pt; % Default pen width w = 30mm; % Width of treble clef h = 100mm; % Height of treble clef % Specify breadth and angle of pen at keypoints: penpos 1 (0.5b, 30); penpos 1.5 (b, 15); penpos 2 (3b, 0); penpos 3 (5b, -90); penpos 4 (3b, -180); penpos 5 (b, 90); penpos 6 (5b,0); penpos 6.5 (4b, -30); penpos 7 (.5b, 0); penpos 8 (5b, 90); penpos 9 (3b, -180); penpos 10 (b, -180); % Fix x coords of keypoints x1=0; x1.5=1/2[x1,x2]; x5=x1=x3=x8; x10=1/2[x9,x1]; x7=1/2[x3,x4]; x4-x6=w; x1=1/2[x2,x4]; x3-x2=x2-x6; x9=1/2[x1,x2]; x6.5=1/2[x5,x6]; % Fix y coords of keypoints y1=0; y1.5=y1; y6=y2=y4=1/2[y3,y1]; y3-y1=y1-y5=1/10h; y5-y10=2(y3-y1); y8-y7=y3-y1; y9=y7; y8-y3=y3-y10; y6.5=1/2[y6,y7]; drawoptions (withcolor background); % Draw (an incomplete and ugly) treble clef penstroke z1e .. z1.5e .. z2e .. z3e .. z4e .. z5e .. z6e .. z6.5e .. z7e .. z8e .. z9e .. z10e; drawoptions(withcolor black); labels.lft(1,1.5,2,3,4,5,6,6.5,7,8,9,10); You must take special care never to cross the left and right edges of the pen. See The METAFONTbook for details and examples. Regards, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] ConTeXt Minimals and TEXMFCACHE
Hi, according to the wiki “ConTeXt minimals does not touch anything outside its installation folder”, but if TEXMFCACHE is not set by setuptex, actually many files may be written outside the ConTeXt minimals folder, and (as in my case) they may conflict with the files written by ConTeXt from TeX Live in the same cache folder. Is there any reason why exporting TEXMFCACHE is commented out in setuptex? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt Minimals and TEXMFCACHE
In article 4c76dc46.70...@wxs.nl, Hans Hagen pra...@wxs.nl wrote: Is there any reason why exporting TEXMFCACHE is commented out in setuptex? You can set it up in a texmfcnf.lua file in your texmf-local/web2c tree. Anyway, it is unlike to conflict as I hash the path so one cache can serve many trees. Ah, I hadn't realized that! That simplifies things a lot! Thanks, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt Minimals and TEXMFCACHE
In article aanlktim8p_nsu=qf8r9ojvbd=bpzitwd_baov+exh...@mail.gmail.com, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: The variable TEXMFCACHE is set in tex/texmf/web2c/texmfcnf.lua and that one should do the job. Under usual circumstances at least. If that one is not being respected, something might be wrong. Do you have any other texmfcnf.lua file somewhere else? No, I export TEXMFCACHE in my .profile, because I want the cache to be inside my home folder. After running setuptex, ConTeXt minimals uses that rather than the path specified in texmfcnf.lua. Since now I know that luatex-cache can be shared, for me this is perfectly fine. I just had to adjust the TeXShop engines (I am on Mac OS X) by explicitly setting TEXMFCACHE for XeTeX and MKII, besides MKIV. So, if I get it right, the value in texmfcnf.lua is used unless TEXMFCACHE is set. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt Minimals and TEXMFCACHE
In article aanlktimbrxn-yhfa9bqyrejmcfuyehqxr-+ix6ne5...@mail.gmail.com, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: TEXMFCACHE is not used by MKII (neither in pdfTeX nor in XeTeX). Right. I have tried unset TEXMFCACHE texexec hello.tex in the command line and it just runs texexec (as expected). But from TeXShop (using the engines for MKII and XeTeX described at http://wiki.contextgarden.net/ConTeXt_Minimals/Mac_Installation), for some reason mtxrun is run before texexec on the first compilation, which creates the cache in the location specified by texmfcnf.lua (unless I set TEXMFCACHE). And sourcing setuptex doesn't change anything. Maybe some other environment variable should be set in those engines? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt Minimals and TEXMFCACHE
In article 4c782d26.6040...@wxs.nl, Hans Hagen pra...@wxs.nl wrote: On 27-8-2010 8:17, Nicola wrote: In article aanlktimbrxn-yhfa9bqyrejmcfuyehqxr-+ix6ne5...@mail.gmail.com, Mojca Miklavecmojca.miklavec.li...@gmail.com wrote: TEXMFCACHE is not used by MKII (neither in pdfTeX nor in XeTeX). Right. I have tried unset TEXMFCACHE texexec hello.tex in the command line and it just runs texexec (as expected). Sorry, my mistake. If I unset TEXMFCACHE, then mtxrun is run also from the command line and the behaviour is consistent with what happens from TeXShop - which, in turn, is consistent with what Hans explains below. we used to have texmfstart as script runner (all scripts are located and started by a runner which is faster than using some kpse locator esp when having nested runs as with metafun in mkii) so, texexec used to be texmfstart texexec however, nowadays mtxrun is the runner and it replaces texmfstart for mkii as well and in order to do this, it needs the file database and that one ends up in the cache so even for mkii there is a cache needed (when I'm in the mood I'll check the lua texutil variant in which case we can also kick out ruby which is currently only needed for mkii) Hans Everything is clear now. Thank you! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Font sizes, vertical spacing, footnote symbols
Hi, I have a set of specifications for a document and I am having some problems implementing it. I am using MKIV from TeX Live 2010. I have some difficulty with these requirements in particular: 1) title: 17pt, boldface, capital letters; 12pt spacing before and 3pt spacing after the title; Now I use \setuphead[title][align=middle,style={\bfd\cap},before={},after={}] How can I ensure that the font size is exactly 17pt? How to I specify precise vertical spacing? 3) All § must be indented 1.25cm; \setupindenting[1.25cm,yes,first] But the first § of each Section is not indented. 4) footnote symbol: * I use \setupnote[footnote][numberconversion=set 3] but I get stars instead of asterisks. Can you please help me with these? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Font sizes, vertical spacing, footnote symbols
In article e4503573-6803-4484-baed-7a816726e...@gmail.com, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 06.12.2010 um 13:46 schrieb Nicola: Hi, I have a set of specifications for a document and I am having some problems implementing it. I am using MKIV from TeX Live 2010. I have some difficulty with these requirements in particular: 1) title: 17pt, boldface, capital letters; 12pt spacing before and 3pt spacing after the title; Now I use \setuphead[title][align=middle,style={\bfd\cap},before={},after={}] How can I ensure that the font size is exactly 17pt? How to I specify precise vertical spacing? \definefont[TitleStyle][SerifBold at 17pt] Oh, I see... I should have read co-fonts.pdf more carefully! textstyle=WORD, That's new to me. before={\blank[12pt]}, after={\blank[3pt]}, Too easy :) Somehow, I had come to believe that only predefined values could be used (medium, big, ...) But the first § of each Section is not indented. \setuphead [section] [indentnext=yes] That's also pretty obvious now that I see it. 4) footnote symbol: * I use \setupnote[footnote][numberconversion=set 3] but I get stars instead of asterisks. How about „set 1“ or „set 2“? If none of them fits you can create your own conversionset with \defineconversion[nicola][*,**,***,,*,...] Yes, this is what I need. I must confess that I have learned more from your examples than after a whole afternoon browsing through the various docs :) Thanks, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Help: tweaking bibliography style
Hi, currently, in my document, an article reference looks like this: [1] Thor, A. U. (2010). ConTeXt is great. My Own Publishing, 2(4), 23-34. with the title in italics. How to make the year appear at the end and how to make the publisher in italics, too? I would like such changes to apply to other types of references as well (books, inproceedings, etc...) Second, \cite[Thor:2010,Bar:2009] produces something like [6 and 9]. How do I get rid of 'and' and get simply [6,9]? This is my current setup (mainly code copied from the Wiki): \usemodule[bib] \setupbibtex[database=my-biblio,sort=author] \def\bracketed#1{\hbox to 20pt{\hfill [{#1}]}} \setuppublications[ sorttype=bib, numbering=yes, numbercommand=\bracketed ] \unprotect\def\UCauthor#1#2#3#4#5% {\bf\bibdoif{#2}{#2\bibalternative\c!vonsep}% #3\bibalternative\c!surnamesep \bibdoif{#5}{#5\bibalternative\c!juniorsep}% \bibdoif{#4}{#4\unskip}} \protect \setuppublicationlist[ artauthor=\UCauthor, editor=\UCauthor, author=\UCauthor, namesep={, }, lastnamesep={, }, finalnamesep={, } ] A last, less important, question: the Wiki suggests to \usemodule[bibltx]. If I do so, I get the warning “module bibltx not found”. It seems that omitting that module has no consequences. Is it needed at all? If so, for what? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help: tweaking bibliography style
In article nvitacolonna-f968f4.10292114122...@news.gmane.org, Nicola nvitacolo...@gmail.com wrote: Hi, currently, in my document, an article reference looks like this: [1] Thor, A. U. (2010). ConTeXt is great. My Own Publishing, 2(4), 23-34. with the title in italics. How to make the year appear at the end and how to make the publisher in italics, too? I would like such changes to apply to other types of references as well (books, inproceedings, etc...) Second, \cite[Thor:2010,Bar:2009] produces something like [6 and 9]. How do I get rid of 'and' and get simply [6,9]? Sorry for the noise: somehow, I hadn't noticed that a fairly complete bib manual exists. Now I realise how flexible the module is. As for bibltx, I assume that it is deprecated. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Help with Times font, footnote symbols and captions
Hi, a document of mine (compiled with the latest mkiv beta) contains the following setup: \usetypescript[times][ec] \setupbodyfont[times,10pt] \defineconversion[onlyasterisks][*,*,*,*,*] \setupnote[footnote][numberconversion=onlyasterisks,bodyfont=9pt] \setupcaptions[inbetween={\blank[6pt]},width=max,align=middle,style=bold, suffix={.}] I have some trouble with the following, however: 1) The asterisks in the footnotes appear in the margin. I can I align the * below the main text? 2) How can I make the text in the captions at 9pt? I have checked in the wiki and in the ConTeXt manual, but I cannot do the above. Besides, is the used font Times New Roman (sorry for the question, but I do not have Acrobat installed right now, and I do not know how to check the font in the pdf file)? If not, how can I use Times New Roman with mkiv? Thanks in advance, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with Times font, footnote symbols and captions
In article AANLkTi=d63vzhdzay27yollyyp-axrhausa4mwx-h...@mail.gmail.com, luigi scarso luigi.sca...@gmail.com wrote: # pdffonts test.pdf That's great! I didn't know about pdffonts… Well, I don't know much about fonts in general :) So, now that's quite complicated (for me). This is what I get: name type emb sub uni object ID - --- --- --- - MAYMBF+TeXGyreTermes-BoldCID Type 0C yes yes yes 18 0 YYCTGW+TeXGyreTermes-Italic CID Type 0C yes yes yes 19 0 MRLZOQ+TeXGyreTermes-Regular CID Type 0C yes yes yes 20 0 PJSRME+txsy Type 1yes yes no 29 0 ADYQWN+TeXGyreTermes-Regular CID Type 0C yes yes yes 30 0 JHYYBD+TeXGyreTermes-Italic Type 1yes yes no 31 0 SDGCFO+rtxmi Type 1yes yes no 32 0 GOISLI+TeXGyreTermes-Regular CID Type 0C yes yes yes 33 0 GQGRIV+LMMono10-Regular CID Type 0C yes yes yes 37 0 VKFEDD+TimesNewRomanPSMT TrueType yes yes no 44 0 WTQJQL+Times-Roman TrueType yes yes no 45 0 WWKUXC+TimesNewRomanPSMT TrueType yes yes no 64 0 GFUUDN+TimesNewRomanPSMT TrueType yes yes no 79 0 YTRUAX+TimesNewRomanPSMT TrueType yes yes no 98 0 UBKRGH+TeXGyreTermes-BoldItalic CID Type 0C yes yes yes113 0 EZQBWI+TimesNewRomanPSMT TrueType yes yes no 120 0 YTUNRR+TimesNewRomanPSMT TrueType yes yes no 135 0 HMXOTK+TimesNewRomanPSMT TrueType yes yes no 150 0 FQSXLW+TimesNewRomanPSMT TrueType yes yes no 171 0 UYMOQM+AppleSymbols TrueType yes yes yes172 0 KKTZRF+TimesNewRomanPSMT TrueType yes yes no 193 0 ZTVNCA+Times-Roman TrueType yes yes no 213 0 LWXRQW+TimesNewRomanPSMT TrueType yes yes no 214 0 I guess Apple Symbols and txsy are there because of mathematical symbols, but what about Termes and Times-Roman? Also, is that TimesNewRomanPSMT the “official” Times New Roman, or a “quasi”-Times? I ask because my publisher seems to have strict font requirements, and has asked me to check that my paper be entirely in Times New Roman… Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with Times font, footnote symbols and captions
In article ec21325a-9931-40ed-ac3c-3bab8...@googlemail.com, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 25.03.2011 um 12:51 schrieb Nicola: Hi, a document of mine (compiled with the latest mkiv beta) contains the following setup: \usetypescript[times][ec] \setupbodyfont[times,10pt] \setupbodyfont is enough, you don’t need \usetypescript here and font encoding (i.e. “ec”) are gone. Ok. Please bear with me, understanding of font handling mechanisms is still beyond my reach. This is the best I was able to do so far to use Times New Roman: \starttypescript [serif] [myfont] \definefontsynonym [Serif] [name:timesnewroman] \definefontsynonym [SerifBold] [name:timesnewromanbold] \definefontsynonym [SerifItalic] [name:timesnewromanitalic] \definefontsynonym [SerifSlanted][name:timesnewromanitalic] \definefontsynonym [SerifBoldItalic] [name:timesnewromanbolditalic] \stoptypescript \definetypeface [myfont] [rm] [serif] [myfont] \definetypeface [myfont] [mm] [math] [times] \setupbodyfont[myfont,rm,10pt] \definefont[FigureCaptionStyle][SerifBold at 9pt] \setupcaptions[inbetween={\blank[6pt]},width=max,align=middle,style=FigureCaption Style,suffix={.}] Is this the mkiv way? Nicola ps: for aligning footnote symbols, I have no clue yet. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with Times font, footnote symbols and captions
In article nvitacolonna-165382.17254325032...@news.gmane.org, Nicola nvitacolo...@gmail.com wrote: ps: for aligning footnote symbols, I have no clue yet. Never mind, just stumbled upon \setupnotedefinition in the wiki. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with Times font, footnote symbols and captions
In article 113278bd-de8c-4f2a-9311-2c972d0f4...@googlemail.com, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Mac: \usetypescriptfile[type-mac] \setupbodyfont[timesnewroman] All: \usemodule[simplefonts] \setmainfont[Times New Roman] That's was I had tried in the first place. But how can I change the math font then? ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with Times font, footnote symbols and captions
In article 76d2e755-4b9c-44c0-9a78-45ab357bf...@googlemail.com, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 26.03.2011 um 12:13 schrieb Nicola: In article 113278bd-de8c-4f2a-9311-2c972d0f4...@googlemail.com, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: \usemodule[simplefonts] \setmainfont[Times New Roman] That's was I had tried in the first place. But how can I change the math font then? \setmathfont[times] Embarassingly easy :) But, maybe, that should be mentioned in simplefonts README and/or added to the wiki. Thanks to all who replied: my document is now fine and I've learned a bunch of stuff. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] mptopdf overwrites and deletes pdf file?
Hi, consider a folder containing foo.tex and foo.mp. Suppose that, when compiled, foo.mp outputs foo.1. Then, the following: texexec foo.tex mptopdf foo.mp will end up having foo.pdf deleted. I guess this is because mptopdf creates foo.pdf out of foo.mp *and then* renames it into foo-1.mp. Is it true? Is there a workaround (something like -jobname), other than using different names? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] METAPOST -- specifying an unknown point coordinate by giving the angle from another known point
In article 771da05a1002251718l55669a0co770b5a78bed84...@mail.gmail.com, James Fisher jameshfis...@gmail.com wrote: This isn't specifically a ConTeXt question, but via it I've run into a seemingly simple problem in METAPOST that I just can't solve. I'm trying to draw a parallelogram by specifying: (1) the length of sides parallel to the x-axis; (2) the total height of the figure; (3) one of the interior angles. Curiously enough, nobody has posted a solution that uses 'whatever', so here it is: z0 = origin;% bottom left z1 = (5,0); % bottom right y3 = y2 = 10; z3 = z0 + whatever*dir(87); % z3 is obtained by starting at z0 and % moving along dir(87) z2-z1 = whatever*(z3-z0); % The line z1--z2 is parallel to z0--z3 That is, what you were trying to achieve: angle(z3-z0) = dir(87); can be written instead: z3 - z0 = whatever*dir(87); Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Custom verb-c inside my working directory
Hi, in MKII the following code produces the wrong result ('* x;') \usemodule[verb-c] \starttext \startC int* x; \stopC \stoptext I know that I should use \definetyping[C][option=C] instead of \usemodule. The fact is, what I am actually loading is a customized verb-c file that I've put inside my working directory (and I have also renamed). How to reconcile the use of \definetyping with a local file? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] List of all bibliography items is empty in mkiv
Hi, the following code results in an empty output when typeset by MKIV on my system: \usemodule[bib] \setuppublications[criterium=all] \setupbibtex[database=mypublications] \starttext \placepublications \stoptext \end The same code typeset with MKII produces the list of all bibliography items in the .bib file, as expected. Is it a bug or is MKIV different in some respect? If it is a bug, is there a workaround? What I use: ConTeXt ver: 2010.05.24 13:05 MKII ConTeXt ver: 2010.05.24 13:05 MKIV LuaTeX, Version beta-0.60.1-2010042810 Below you find the log file. Nicola (/Users/nicola/Documents/test.tex publications: loading formatting style from bxml-apa (/usr/local/texlive/2009/texmf-dist/tex/context/base/bxml-apa.mkiv) ConTeXt ver: 2010.05.24 13:05 MKIV fmt: 2010.6.3 int: english/english system : cont-new loaded (/usr/local/texlive/2009/texmf-dist/tex/context/base/cont-new.tex systems : beware: some patches loaded from cont-new.tex (/usr/local/texlive/2009/texmf-dist/tex/context/base/cont-new.mkiv)) system : cont-fil loaded (/usr/local/texlive/2009/texmf-dist/tex/context/base/cont-fil.tex loading : ConTeXt File Synonyms ) system : cont-sys loaded (/usr/local/texlive/2009/texmf-config/tex/context/user/cont-sys.tex (/usr/local/texlive/2009/texmf-dist/tex/context/base/type-def.mkiv) (/usr/local/texlive/2009/texmf-dist/tex/context/base/type-lua.mkiv) (/usr/local/texlive/2009/texmf-dist/tex/context/base/type-siz.mkiv) (/usr/local/texlive/2009/texmf-dist/tex/context/base/type-otf.mkiv)) system : test.top loaded % % begin of optionfile % % % runtime options files (command line driven) % \unprotect % % special commands, mostly for the ctx development team % % feedback and basic job control % % handy for special styles % \startluacode % document = document or { } % document.arguments={ % [syntex]=1, % } % document.files={ % test.tex, % } % \stopluacode % % process info % \setupsystem[inputfile=test.tex] % \setupsystem[\c!n=1,\c!m=1] % % modes % % options (not that important) % \startsetups *runtime:options % \setupoutput[pdftex] % \stopsetups % % styles and modules % \startsetups *runtime:modules % \stopsetups % % done % \protect \endinput % % end of optionfile % (test.top) fonts : preloading latin modern fonts {/usr/local/texlive/2009/texmf-dist/fonts/map/dvips/lm/lm-math.map}{/usr/ local/texlive/2009/texmf-dist/fonts/map/dvips/lm/lm-rm.map}{/usr/local/te xlive/2009/texmf-dist/fonts/map/pdftex/context/mkiv-base.map} bodyfont: 12pt rm is loaded language: language en is active system : module bib loaded (/usr/local/texlive/2009/texmf-dist/tex/context/base/m-obsolete.tex systems : skipping obsolete module ) publications: wrote a new auxiliary file cont-en.aux systems : begin file test.tex at line 7 systems : end file test.tex at line 9 ) mkiv lua stats : used config path - /usr/local/texlive/2009/texmf.cnf;/usr/local/texlive/2009/texmf/web2c/tex mf.cnf mkiv lua stats : used cache path - /Users/nicola/Library/texmf mkiv lua stats : input load time - 0.114 seconds mkiv lua stats : stored bytecode data - 213 modules, 53 tables, 266 chunks mkiv lua stats : loaded tex modules- 1 requested, 1 found (*-obsolete), 0 missing mkiv lua stats : node list callback tasks - 6 unique task lists, 1 instances (re)created, 286 calls mkiv lua stats : cleaned up reserved nodes - 29 nodes, 9 lists of 410 mkiv lua stats : node memory usage - 19 glue_spec mkiv lua stats : used backend - pdf (backend for directly generating pdf output) mkiv lua stats : loaded patterns - en:us:pat:exc:2 mkiv lua stats : startup time - 0.579 seconds including runtime option file processing mkiv lua stats : callbacks - direct: 373, indirect: 4334, total: 4707 mkiv lua stats : result saved in file - test.pdf mkiv lua stats : loaded fonts - 32 files: lmmono12-regular.otf lmmono8-regular.otf lmmono9-regular.otf lmroman12-bold.otf lmroman12-regular.otf lmroman7-bold.otf lmroman7-regular.otf lmroman9-bold.otf lmroman9-regular.otf lmsans12-regular.otf lmsans8-regular.otf lmsans9-regular.otf eufb10.tfm eufb7.tfm eufm10.tfm eufm7.tfm msam10.tfm msam7.tfm msbm10.tfm msbm7.tfm lmex10.tfm lmmi12.tfm lmmi7.tfm lmmi9.tfm lmmib10.tfm lmmib7.tfm lmsy10.tfm lmsy7.tfm lmsy9.tfm rm-lmr12.tfm rm-lmr7.tfm rm-lmr9.tfm mkiv lua stats : fonts load time - 0.304 seconds mkiv lua stats : luatex banner - this is luatex, version beta-0.60.1-2010042810 mkiv lua stats : control sequences - 30645 of 265536 mkiv lua stats : current memory usage - 51 MB (ctx: 52 MB) mkiv lua stats : runtime - 1.389 seconds ___ If your question is of interest to others as well
Re: [NTG-context] List of all bibliography items is empty in mkiv
In article 4c2dc522.9040...@elvenkind.com, Taco Hoekwater t...@elvenkind.com wrote: On 07/02/2010 12:37 PM, Nicola wrote: Hi, the following code results in an empty output when typeset by MKIV on my system: \usemodule[bib] \setuppublications[criterium=all] \setupbibtex[database=mypublications] \starttext \placepublications \stoptext \end The same code typeset with MKII produces the list of all bibliography items in the .bib file, as expected. Is it a bug or is MKIV different in some respect? If it is a bug, is there a workaround? \placepublications[criterium=all] Shouldn't that have the same effect as \setuppublications[criterium=all]? In any case, I still get no output. I have also run (again) luatools --selfupdate mtxrun --selfupdate luatools --generate context --make but I get no output yet. Then, I have tried to typeset with my ConTeXt Minimals installation (ConTeXt ver: 2010.06.10 15:24 MKIV), with the same result (no output). But with ConTeXt Minimals MKII, the output is fine (even without following your suggestion). Btw, in both versions of MKII, the following does *not* produce a list of publications: \usemodule[bib] \setupbibtex[database=mypublications] \starttext \placepublications[criterium=all] \stoptext \end What can I check next? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] List of all bibliography items is empty in mkiv
In article 4c2dceb2.90...@elvenkind.com, Taco Hoekwater t...@elvenkind.com wrote: On 07/02/2010 01:26 PM, Nicola wrote: \usemodule[bib] \setupbibtex[database=mypublications] \starttext \placepublications[criterium=all] \stoptext \end What can I check next? You could try adding some text or even a section command. At some point it should start working (probably even without an explicit \cite anywhere). Nevertheless, it looks like a bug. Unfortunately, adding text or sectioning command doesn't help. Today I have updated ConTeXt Minimals as usual, using sh ./first-setup.sh, but the version I've got is 2010.05.24 (whereas I had 2010.06.10). Why? Needless to say, I don't get any output yet. Since nobody has confirmed that the problem I have described can be reproduced, I must infer that it is something related to my particular setup. So, I will provide more details on my configuration (sorry for the verbosity), hoping that someone will spot something that should be fixed. Under the latest Mac OS X, I use both (stable) ConTeXt from TeX Live 2009 and an installation of ConTeXt Minimals (beta) in ~/Library/texmf/context-minimals. This is how I update ConTeXt in TeX Live, step by step: 1) update the ConTeXt distribution to the latest stable release: sudo rsync -av rsync://contextgarden.net/minimals/current/context/current/ /usr/local/texlive/2009/texmf-dist/ 2) Update LuaTeX executable: sudo rsync -av rsync://contextgarden.net/minimals/current/bin/luatex/osx-universal/bin/l uatex /usr/local/texlive/2009/bin/universal-darwin/ 3) Re-build LuaTeX format files: cd /usr/local/texlive/2009/texmf-var/web2c/luatex sudo luatex -ini luatex.ini sudo luatex -ini lualatex.ini sudo luatex -ini dviluatex.ini sudo luatex -ini dvilualatex.ini 4) Update XeTeX executable: sudo rsync -av rsync://contextgarden.net/minimals/current/bin/xetex/osx-universal/bin/xe tex /usr/local/texlive/2009/bin/universal-darwin/ 5) Re-build XeTeX format files: sudo fmtutil-sys --byfmt xelatex sudo fmtutil-sys --byfmt xetex 7) Update MetaPost executable: sudo rsync -av rsync://contextgarden.net/minimals/current/bin/metapost/osx-universal/bin /mpost /usr/local/texlive/2009/bin/universal-darwin/ 8) Update MetaPost format files: sudo fmtutil-sys --byfmt mpost sudo fmtutil-sys --byfmt metafun cd /usr/local/texlive/2009/texmf-var/web2c/metapost/ sudo mpost -ini mfplain dump 9) Fix permissions of some executables (I always have to do this: is it a known bug?) cd /usr/local/texlive/2009/texmf-dist/scripts/context/lua sudo chmod +x luatools.lua mtxrun.lua cd /usr/local/texlive/2009/texmf-dist/scripts/context/perl sudo chmod +x *.pl cd /usr/local/texlive/2009/texmf-dist/scripts/context/stubs/unix/ sudo chmod +x * 10) Update MKII format files: sudo mktexlsr sudo -H texexec --make --all sudo -H texexec --make --xtx --all (here I use -H because I want the format files to be written under /usr/local/texlive and not in ~/Library/texmf/web2c) 11) Update MKIV format files: luatools --generate context --make Note that these last two commands are run without sudo, because I have chosen to have luatex-cache under ~/Library/texmf, so I have added export TEXMFCACHE=~/Library/texmf to my .profile. And here is how I update ConTeXt Minimals: 0) Move to the right directory: cd ~/Library/texmf/context-minimals 1) Update first-setup.sh: curl -o first-setup.sh http://minimals.contextgarden.net/setup/first-setup.sh 2) Update ConTeXt Minimals: sh ./first-setup.sh --extras=all 3) Set environment variables (I do this every time before using ConTeXt Minimals of course): source ./tex/setuptex export TEXMFCACHE=$TEXROOT/texmf-cache Note that I also change TEXMFCACHE, not to conflict with stable ConTeXt. 4) Re-build format files: mktexlsr texexec --make --all texexec --make --xtx --all luatools --selfupdate mtxrun --selfupdate luatools --generate context --make texexec --make mpost That's it. A last remark: I have noticed that I have a .texlive2009 folder in my home folder, with the following content: texmf-var/texdoc/cache-tlpdb.lua texmf-var/web2c/pdftex/pdftex.fmt texmf-var/web2c/pdftex/pdftex.log Is it safe to delete? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] No bibliography in the output, depends on file name
Hi, maybe this is a known issue, but I couldn't find anything about it, so I'm reporting it. I'm writing a ConTeXt document called modern-c++.tex (in OS X 10.7.5). The content of the file is: \setupbibtex[database={modern-c++}, sort=author] \setuppublications[numbering=yes] \starttext \completepublications[criterium=all] \stoptext (Well, I haven't started to write my notes yet.) When typesetting it, though, no bibliography is printed (I've tried with Mark II/IV from MacTeX and with the latest Mark IV stable/beta). Renaming the .tex file to cplusplus.tex solves the problem (there is no need to rename the .bib file). Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Citations and links
When I use \cite[Author:2016], the (Author, 2016) in the output is hyperlinked to the reference. But when I use \cite[Author1:2016,Author2:2015], the resulting (Author1, 2016 and Author2, 2015) is not hyperlinked. Is it possible to get hyperlinks in the latter case, too? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Citations and links
On 2016-06-13 14:29:37 +, Alan BRASLAU said: On Mon, 13 Jun 2016 12:38:39 +0200 Nicola <nvitacolo...@gmail.com> wrote: When I use \cite[Author:2016], the (Author, 2016) in the output is hyperlinked to the reference. But when I use \cite[Author1:2016,Author2:2015], the resulting (Author1, 2016 and Author2, 2015) is not hyperlinked. Is it possible to get hyperlinks in the latter case, too? I get multiple hyperlinks for equivalent use. This is your example adapted to reproduce my problem (I do not know how to use the buffer in this case, so you have to move the references into main.bib): \setupinteraction [state=start] \setupbibtex[database={main}] \setuppublications[alternative=apa] \starttext \cite[Author1:2016,Author2:2015] \cite[Author1:2016] \page \placepublications[criterium=text] \stoptext Amyway, your example works for me (actually, the layout of the references turns out even better), so I will switch to using the commands you have suggested. Btw, I cannot find any documentation about them in the wiki. Thanks, Nicola You need to send a MWE. In the case of bibliographies, a MWE can include the .bib dataset in a buffer, as follows: \setupinteraction [state=start] \usebtxdefinitions [apa] \startbuffer [bib] @article{Author1:2016, author={Author1}, year=2016, } @article{Author2:2015, author={Author2}, year=2015, } \stopbuffer \usebtxdataset [bib.buffer] \starttext \cite[Author1:2016,Author2:2015] \page \placelistofpublications \stoptext 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Error: attempt to perform arithmetic on global 'ex' (a nil value)
I have started to get the error in the subject when typesetting the following document with recent betas: \starttext $P\/$) \stoptext Removing \/ (or the parenthesis) fixes the error. Is this a regression? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Set default background color or pattern for tables
I'd like to set a default background color for all the tables in my document. This is what I have tried (using the latest beta): \setuptables[background=color,backgroundcolor=red] \starttext \starttable[|cm|] \HL \NC \bf R \NC \AR \NC A \NC \AR \HL \NC \bot \NC \AR \NC 1 \NC \AR \stoptable \stoptext No red background, though. What am I missing? The next step would be how to use a hatched pattern, but for now I'd be happy with a flat color. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Set default background color or pattern for tables
On 2016-05-30 16:45:37 +, Wolfgang Schuster said: Nicola 30. Mai 2016 um 17:45 I'd like to set a default background color for all the tables in my document. This is what I have tried (using the latest beta): \setuptables[background=color,backgroundcolor=red] \starttext \starttable[|cm|] \HL \NC \bf R \NC \AR \NC A \NC \AR \HL \NC \bot \NC \AR \NC 1 \NC \AR \stoptable \stoptext No red background, though. What am I missing? The next step would be how to use a hatched pattern, but for now I'd be happy with a flat color. The table environment does not support backgrounds but you can use the tabulate environment. \starttext \defineframedcontent[nicola][frame=off,background=color,backgroundcolor=yellow] \setuptabulate[frame=nicola] Thanks, it works! And it does with tables, too. From there, I think I know how to use a MetaPost pattern instead. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Execute ConTeXt script from outside a project's directory
Hello, I am looking for a way to run ConTeXt from an arbitrary (Unix) directory. I have tried with --path: cd / mtxrun --path /My/Project/Directory --script context main.tex but that just prints a path and exits: /Applications/ConTeXt-Beta/tex/texmf-context/scripts/context/stubs/unix/context Is there a way to specify a project's directory? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-10 12:48:32 +, Hans Hagen said: On 2/10/2016 12:36 PM, Nicola wrote: (1) I conclude that .dfont fonts are not dealt properly by ConTeXt, or that I am missing some configuration step. indeed the latest mkiv does not support dfonts any longer Ok, good to know. Any suggestion on how to select a font within a .ttc? Btw, I read in the wiki(*) that “the current version of LuaTeX (0.60) has severe problems dealing with the new TrueType collection fonts in Snow Leopard (Mac OS 10.6).” Is that still the case with the current LuaTeX (I am on El Capitan)? That might explain my results. What is the best practice: do you recommended using only ttf and otf fonts? Nicola (*) http://wiki.contextgarden.net/Fonts_in_LuaTeX#Querying_the_font_database ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-10 14:13:37 +, Hans Hagen said: Ok, good to know. Any suggestion on how to select a font within a .ttc? normally by name Btw, I read in the wiki(*) that “the current version of LuaTeX (0.60) has severe problems dealing with the new TrueType collection fonts in Snow Leopard (Mac OS 10.6).” 0.60 is ancient ... we have approx 0.90 now Is that still the case with the current LuaTeX (I am on El Capitan)? That might explain my results. i don't use osx but others can tell you What is the best practice: do you recommended using only ttf and otf fonts? ttc is okay So, if someone using OS X could tell me how to, say, use Avenir Light or Avenir Next Ultra Light (both are .ttc), that would be much appreciated :) Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-10 15:49:37 +, Taco Hoekwater said: It seems the ttc extractor fails in the current beta, at least on osx. After a —reload of the fonts, I get similar results to Nicola: only one indexed font is found for each of the .ttc files (always the last index). I have exactly the same for the beta. Let me add that things do not look right with ConTeXt from TeX Live either. Try this: 1) remove the cache from ~/Library/texlive/2015/texmf-var 2) luatools --generate 3) mtxrun --script fonts --list --all --pattern=avenirnextcondensed* 4) Typeset my test document using Avenir Next Condensed. 5) mtxrun --script fonts --reload 6) mtxrun --script fonts --list --all --pattern=avenirnextcondensed* 7) Typeset again. My results: 3) I see all the entries, plus some spurious ones, which are probably synthesized by the script (e.g., avenirnextcondensedblack). 4) The PDF is an empty document (`unknown font` in the console). 6) I see only avenirnextcondensed and avenirnextcondensedbold: the rest is gone. 7) The document is typeset in boldface (at least the font is found). Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-10 15:19:01 +, Pablo Rodriguez said: I’m not OS user, but the following works with Junction (https://www.theleagueofmoveabletype.com/junction): \definefontfamily[mainface][ss][Junction][tf=style:light] Thanks, that indeed does the trick (modulo Taco's comment in another post). Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-11 08:36:12 +, Taco Hoekwater said: On 10 Feb 2016, at 21:04, Hans Hagen <pra...@wxs.nl> wrote: On 2/10/2016 5:44 PM, Nicola wrote: On 2016-02-10 15:19:01 +, Pablo Rodriguez said: I’m not OS user, but the following works with Junction (https://www.theleagueofmoveabletype.com/junction): \definefontfamily[mainface][ss][Junction][tf=style:light] Thanks, that indeed does the trick (modulo Taco's comment in another post). mtxrun --script font --reload —force That fixed the issue for me. Not for me. After that command, I do see all the entries again, but when I typeset my document the font is not found. I paste the log below. Hans has suggested: can you delete the fonts path in the texmf-cache Do you mean texmf-var/fonts? Here is what I done, step by step: 0) `sudo mv /usr/local/texlive/2015/texmf-var/fonts ~/.Trash`. 1) delete all the cache files in /usr/local/texlive/2015/texmf-var/luatex-cache and in ~/Library/texlive/texmf-var/luatex-cache; 2) At this point, running context or 'luatools --generate' results in: resolvers | trees | analyzing '/Users/nicola/Library/texmf' mtxrun | unknown script 'context.lua' or 'mtx-context.lua' 3) Run `mtxrun --generate` (without sudo). This creates ~/Library/texlive/texmf-var/luatex-cache/context; 4) run `mtxrun --script fonts --list --all --pattern=avenirnextcondensed*`: this runs for a while and at the end I get: fonts | names | accessing the data table failed avenirnextcondensed avenirnextcondensedultralightitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 0 avenirnextcondensedblack avenirnextcondensedheavyitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 2 avenirnextcondensedbold avenirnextcondensedbold /System/Library/Fonts/Avenir Next Condensed.ttc index: 11 avenirnextcondensedbolditalic avenirnextcondensedbolditalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 10 avenirnextcondenseddemi avenirnextcondenseddemibolditalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 8 avenirnextcondenseddemibold avenirnextcondenseddemibold /System/Library/Fonts/Avenir Next Condensed.ttc index: 9 avenirnextcondenseddemibolditalic avenirnextcondenseddemibolditalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 8 avenirnextcondensedheavy avenirnextcondensedheavy /System/Library/Fonts/Avenir Next Condensed.ttc index: 3 avenirnextcondensedheavyitalicavenirnextcondensedheavyitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 2 avenirnextcondenseditalic avenirnextcondenseditalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 7 avenirnextcondensedlight avenirnextcondensedultralightitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 0 avenirnextcondensedmedium avenirnextcondensedmedium /System/Library/Fonts/Avenir Next Condensed.ttc index: 6 avenirnextcondensedmediumitalic avenirnextcondensedmediumitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 5 avenirnextcondensednormal avenirnextcondensedregular /System/Library/Fonts/Avenir Next Condensed.ttc index: 4 avenirnextcondensedregularavenirnextcondensedregular /System/Library/Fonts/Avenir Next Condensed.ttc index: 4 avenirnextcondensedultralight avenirnextcondensedultralight /System/Library/Fonts/Avenir Next Condensed.ttc index: 1 avenirnextcondensedultralightitalic avenirnextcondensedultralightitalic /System/Library/Fonts/Avenir Next Condensed.ttc index: 0 I don't know whether the first line of this output indicates a problem. 5) Typeset the document. This takes ~10s and the result is an empty document (font not found). 6) Run `mtxrun --script fonts --list --all --pattern=avenirnextcondensed*`: resolvers | trees | analyzing '/Users/nicola/Library/texmf' avenirnextcondensed avenirnextcondensedbold /System/Library/Fonts/Avenir Next Condensed.ttc index: 11 avenirnextcondensedbold avenirnextcondensedbold /System/Library/Fonts/Avenir Next Condensed.ttc index: 11 7) Typeset again. Result: font found, document typeset in boldface. 8) Run `mtxrun --script font --reload --force`. After that, mtxrun shows me the same output as in step 4. Typesetting the document several times always results in `unknown font`. Document and log below. Nicola \definefontfamily [myfamily] [serif] [Avenir Next Condensed] \setupbodyfont[myfamily] \starttext \tf Regular, \it Italic \bf Bold and \bi BoldItalic \stoptext resolvers | trees | analyzing '/Users/nicola/Library/texmf' mtx-context | run 1: luatex --fmt="/Users/nicola/Library/texlive/2015/texmf-var/luatex-ca
[NTG-context] How to use Helvetica Neue Light (OS X)?
I am coming back to using ConTeXt after a relatively long hiatus, so I am trying to re-learn old things and learn the new stuff. Please bear with me. I want to use OS X's Helvetica Neue Light in a document. How may I do that? I have tried: \definefontfamily [myfamily] [serif] [Helvetica Neue Light] but, fair enough, that results in `font with asked name 'unknown' is not found`. If I use \definefontfamily [myfamily] [serif] [Helvetica Neue] then the document is typeset in Helvetica Neue, but in boldface. Why? Using mtxrun, all the relevant files are found: mtxrun --script fonts --list --all --pattern=neue* helveticaneue helveticaneuebold /System/Library/Fonts/HelveticaNeue.dfont index: 13 helveticaneuebold helveticaneuebold /System/Library/Fonts/HelveticaNeue.dfont index: 13 helveticaneuedeskinterface helveticaneuedeskinterfaceregular /System/Library/Fonts/HelveticaNeueDeskInterface.ttc index: 9 helveticaneuedeskinterfacenormalhelveticaneuedeskinterfaceregular /System/Library/Fonts/HelveticaNeueDeskInterface.ttc index: 9 helveticaneuedeskinterfaceregular helveticaneuedeskinterfaceregular /System/Library/Fonts/HelveticaNeueDeskInterface.ttc index: 9 How do I specify the font's weight? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-09 22:15:47 +, Nicola said: I want to use OS X's Helvetica Neue Light in a document. How may I do that? I have investigated the issue a bit more and it seems that I have a more fundamental problem with fonts. More specifically, I have tested the latest beta (ConTeXt 0.63 2016.02.08 15:35) and the TeX Live version (ConTeXt 0.61 2015.05.18 12:26), with inconsistent results. The beta is a fresh install, where I have only executed: sh ./first-setup.sh --modules=all --engine=luatex . ./tex/setuptex luatools --generate This is a selection of fonts that I have tried (the name is the name that I have used as an argument to \definefamily): Name SuffixTeXLive ConTeXt ConTeXt Beta --- Baskerville .ttc OK OK Courier .dfont unknown font unknown font Geneva.dfont OK unknown font Helvetica .dfont OK unknown font Helvetica Neue.dfont Nearly OK(*) unknown font Helvetica Neue Desk Interface .ttc Nearly OK(*) Nearly OK(**) Hoefler .ttc unknown font unknown font Hoefler Text .ttc unknown font unknown font Hoefler Text Ornaments.ttc unknown font unknown font Menlo .ttc OK OK Monaco.dfont OK unknown font Optima.ttc OK OK Palatino .ttc OK OK Source Code Pro .otf OK Nearly OK(***) Times .dfont unknown font unknown font Times Roman .dfont unknown font unknown font (*) Instead of bold, bold italic is used (**) Instead of bold italic, bold is used (!) (***) Italic and bold italic are shown as regular and italic, resp. In general, I have no problems with .ttf and .otf fonts (with the exception of Source Code Pro, see the table). From the above: (1) I conclude that .dfont fonts are not dealt properly by ConTeXt, or that I am missing some configuration step. (2) I suspect that I also have a naming issue (e.g., see Hoefler and Times). This is what mtxrun gives me for Hoefler (for both ConTeXt versions): mtxrun --script fonts --list --all --pattern=hoefl* hoeflertext hoeflertextornaments /Library/Fonts/Hoefler Text Ornaments.ttf hoeflertextblack hoeflertextblack /Library/Fonts/Hoefler Text.ttc index: 2 hoeflertextblackitalic hoeflertextblackitalic /Library/Fonts/Hoefler Text.ttc index: 4 hoeflertextitalichoeflertextitalic /Library/Fonts/Hoefler Text.ttc index: 3 hoeflertextnormalhoeflertextornaments /Library/Fonts/Hoefler Text Ornaments.ttf hoeflertextornaments hoeflertextornaments /Library/Fonts/Hoefler Text Ornaments.ttf hoeflertextregular hoeflertextregular /Library/Fonts/Hoefler Text.ttc index: 1 (3) I still don't now how to select, say, Helvetica Light or Avenir Black. For the record, in LuaLaTeX I use \setsansfont{Helvetica Neue Light}, and it works. The document I have used for the tests is pretty basic, but I paste it below for completeness. Nicola \definefontfamily [myfamily] [serif] [Some Font] %[style=Light] \setupbodyfont[myfamily] \starttext \scale[width=\textwidth]{\switchtobodyfont [6pt]\tf Regular, \it Italic \bf Bold and \bi BoldItalic} \scale[width=\textwidth]{\switchtobodyfont [8pt]\tf Regular, \it Italic \bf Bold and \bi BoldItalic} \scale[width=\textwidth]{\switchtobodyfont [10pt]\tf Regular, \it Italic \bf Bold and \bi BoldItalic} \scale[width=\textwidth]{\switchtobodyfont [12pt]\tf Regular, \it Italic \bf Bold and \bi BoldItalic} \scale[width=\textwidth]{\switchtobodyfont[17.3pt]\tf Regular, \it Italic \bf Bold and \bi BoldItalic} \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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-11 10:14:10 +, Taco Hoekwater said: It looks like \definefontfamily depends on actual separate font files. This worked for me: \definefontfamily [myfamily] [serif] [Avenir Next Condensed] [tf=name:Avenir Next Condensed Regular, bf=name:Avenir Next Condensed Bold, bi=name:Avenir Next Condensed Bold Italic, it=name:Avenir Next Condensed Italic] Thanks, this works (after a --force --reload, even in beta)! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-11 10:32:14 +, Wolfgang Schuster said: Besides the \definefontfamily you can also write the required typescripts yourself, below is a example for the normal Avenir Next fonts. Thanks! The typescript works for me, at least with the beta. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to use Helvetica Neue Light (OS X)?
On 2016-02-11 11:03:41 +, Wolfgang Schuster said: Nicola 11. Februar 2016 um 11:49 On 2016-02-11 10:32:14 +, Wolfgang Schuster said: Thanks! The typescript works for me, at least with the beta. This is no surprise because typescripts are contexts native way to load fonts and even the \definefontfamily command creates a typescript for your fonts. Does the typescript rely on some features present in the beta but not in TeX Live 2015? I ask because with ConTeXt from TeX Live the first two \input blocks are typeset with the default font (Latin Modern, I think) and the last two blocks in Avenir Next Light (no boldface). The log has: fonts > otf loading > loading '/System/Library/Fonts/Avenir Next.ttc', hash 'avenir-next-avenirnext-regular' fonts > otf loading > loading done fonts > otf loading > loading failed due to read error fonts > defining > font with asked name 'Avenir Next' is not found using lookup 'file' fonts > defining > unknown font 'Avenir Next', loading aborted fonts > defining > unable to define 'Avenir Next' as 'avenir-12pt-ss-tf-0--0' [...] fonts > otf loading > loading '/System/Library/Fonts/Avenir Next.ttc', hash 'avenir-next-avenirnext-bold' fonts > otf loading > loading done fonts > otf loading > loading failed due to read error fonts > defining > font with asked name 'Avenir Next' is not found using lookup 'file' fonts > defining > unknown font 'Avenir Next', loading aborted fonts > defining > unable to define 'Avenir Next' as 'avenir-12pt-ss-bf-0--0' [...] fonts > otf loading > loading '/System/Library/Fonts/Avenir Next.ttc', hash 'avenir-next-avenirnext-medium' fonts > otf loading > loading done fonts > otf loading > loading failed due to read error fonts > defining > font with asked name 'Avenir Next' is not found using lookup 'file' fonts > defining > unknown font 'Avenir Next', loading aborted fonts > defining > unable to define 'Avenir Next' as 'avenir-light-12pt-ss-bf-0--0' Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Disappearing \rrbracket
I have a problem with the symbol in the subject. This is a minimal document: \starttext $\llbracket x\rrbracket$ $\bigl\llbracket x\bigr\rrbracket$ $\Bigl\llbracket x\Bigr\rrbracket$ $\biggl\llbracket x\biggr\rrbracket$ $\Biggl\llbracket x\Biggr\rrbracket$ \stoptext Using ConTeXt from TeX Live 2015, \rrbracket is rendered only in the first case (current beta is ok). Can you reproduce this? Is there a workaround? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Stacking math symbols
I find it a bit surprising that ConTeXt gives 'missing } inserted' with: \starttext\startformula \mathop=^{\rm def} \stopformula\stoptext (\mathop{=}^... is fine, though). The above formula is correct in Plain (Lua)TeX (in fact, it is copied from The TeX Book). Why does ConTeXt need braces? (Before you point it out: I know that I should use \stackrel…) Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Stacking math symbols
On 2016-02-23 21:11:11 +, Hans Hagen said: On 2/23/2016 7:31 PM, Nicola wrote: I find it a bit surprising that ConTeXt gives 'missing } inserted' with: \starttext\startformula \mathop=^{\rm def} \stopformula\stoptext (\mathop{=}^... is fine, though). The above formula is correct in Plain (Lua)TeX (in fact, it is copied from The TeX Book). Why does ConTeXt need braces? this is because \mathop is redefined (in th eprocess assuming a braced argument) ... this is a mkii leftover which is actually no longer needed (mkii needed more tweaks to get fonts right) you can add this to cont-new.mkiv \let\mathop\normalmathop but i'd use { } anyway Thanks for the clarification! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vim snippets
On 2016-02-22 10:23:40 +, David Nebauer said: Hi, Newbie question: are there any vim snippets available for context? I don't know of any (apart from what has already been posted). Are you using UltiSnips? Here are a few I am using, adapted from tex.snippets: snippet "s(tart)?" "start / stop" br \start${1:something} ${0:${VISUAL}} \stop$1 endsnippet snippet enum "Enumerate" b \startitemize[n] \item $0 \stopitemize endsnippet snippet item "Itemize" b \startitemize \item $0 \stopitemize endsnippet snippet it "Individual item" b \item $0 endsnippet IMHO, it takes less to write your own snippets perfectly suited to your writing style (e.g., I like a newline after each \item) than trying to understand (sometimes overly complicated) snippets written by others. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Disappearing \rrbracket
On 2016-02-24 19:19:19 +, Hans Hagen said: On 2/24/2016 5:48 PM, Nicola wrote: I have a problem with the symbol in the subject. This is a minimal document: \starttext $\llbracket x\rrbracket$ $\bigl\llbracket x\bigr\rrbracket$ $\Bigl\llbracket x\Bigr\rrbracket$ $\biggl\llbracket x\biggr\rrbracket$ $\Biggl\llbracket x\Biggr\rrbracket$ \stoptext Using ConTeXt from TeX Live 2015, \rrbracket is rendered only in the first case (current beta is ok). Can you reproduce this? Is there a workaround? use context from the contextgarden (more recent luatex too) I have followed the instructions at http://wiki.contextgarden.net/Mac_Installation rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh . sh ./first-setup.sh --context=current --modules=all --engine=luatex It fails with ! Undefined control sequence. l.1020 \pdfoutput \zerocount in syst-ini.mkiv. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Deprecated $…$ for inline math?
I read in the wiki (http://wiki.contextgarden.net/Math) that $…$ for inline math is deprecated in favor of \m{…} and more verbose variants. Is that really the case? If so, what is the reason and what are the differences? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Vertically centered text in each page
Inspired by Aditya's "make a presentation in 40 commits" example, I have defined my own environment for slides. A part of it looks like this: %%% \startreusableMPgraphic{header:background} fill OverlayBox leftenlarged BackSpace rightenlarged CutSpace topenlarged TopSpace withcolor OverlayColor ; setbounds currentpicture to OverlayBox enlarged max(BackSpace,CutSpace) ; \stopreusableMPgraphic \defineoverlay[header:background][\reuseMPgraphic{header:background}] \define[2]\MySlide{\framed[ frame=off, background=header:background, backgroundcolor=orange, width=\textwidth, align=flushleft ]{#2}} \definehead[slide][subject] \setuphead[slide][ style=\ssb, command=\MySlide, color=white, page=yes, ] \starttext \startslide[title={Slide One}] \vfill text \vfill \stopslide \startslide[title={Slide Two}] \vfill text \vfill \stopslide \stoptext %%% As you see, I am using \vfill to have the text vertically centered. How do I setup the slide command to do that by default? I have tried putting {before,after,beforesection,aftersection}=\vfill in various combinations in \setuphead, but I cannot obtain the desired effect. Related to the code above, I have another question: if I remove the comma after page=yes, slides are not split into different pages. Is it normal that a comma is required at the end of an argument list? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertically centered text in each page
On 2016-02-19 11:23:18 +, Marco Patzer said: On Fri, 19 Feb 2016 11:54:12 +0100 Nicola <nvitacolo...@gmail.com> wrote: How do I setup the slide command to do that by default? I have tried putting {before,after,beforesection,aftersection}=\vfill in various combinations in \setuphead, but I cannot obtain the desired effect. \setuphead[slide][ style=\ssb, command=\MySlide, color=white, insidesection=\vfill, aftersection=\vfill, page=yes] insidesection, of course! Thanks, that does it. I have noticed that in a few circumstances vertical alignment is not desired. How do I override the default settings on a per-slide basis? Something like: \startslide[title={...},insidesection=,aftersection=] (which does not work). if I remove the comma after page=yes, slides are not split into different pages. Is it normal that a comma is required at the end of an argument list? The missing comma is not the issue, it's the space. Ah, right. For other commands space is not a problem. Go figure. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertically centered text in each page
On 2016-02-19 14:17:02 +, Hans Hagen said: On 2/19/2016 1:36 PM, Marco Patzer wrote: On Fri, 19 Feb 2016 12:51:14 +0100 Nicola <nvitacolo...@gmail.com> wrote: On 2016-02-19 11:23:18 +, Marco Patzer said: On Fri, 19 Feb 2016 11:54:12 +0100 Nicola <nvitacolo...@gmail.com> wrote: How do I setup the slide command to do that by default? I have tried putting {before,after,beforesection,aftersection}=\vfill in various combinations in \setuphead, but I cannot obtain the desired effect. \setuphead[slide][ style=\ssb, command=\MySlide, color=white, insidesection=\vfill, aftersection=\vfill, page=yes] insidesection, of course! Thanks, that does it. I have noticed that in a few circumstances vertical alignment is not desired. How do I override the default settings on a per-slide basis? Something like: \startslide[title={...},insidesection=,aftersection=] (which does not work). No clue why that doesn't work. Wait for others to chime in. Here's a workaround, though: \unprotect \setuphead [slide] [insidesection=\doifnot{\structureuservariable\c!align}\c!top\vfill, aftersection=\doifnot{\structureuservariable\c!align}\c!top\vfill] \protect no need for unprotect is you use \doifnot{\structureuservariable{align}}{top}\vfill Marco, Hans, thanks! It works like a charm. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Diamond, and Unicode math symbols
I'm looking for a symbol similar to \lozenge, but squarer (like \Diamond in some LaTeX packages, see The Comprehensive Symbol List, p. 112). Any idea how I may typeset it in ConTeXt (MKIV)? \diamond is too small. I am using TeX Gyre Pagella Math if that matters. I also have a couple of questions about \showmathfontcharacters: 1) does that list show all and only the symbols available in the current font, or a predefined list of symbols? 2) The list shows a Unicode point for each symbol, but not the corresponding TeX command (if it exists). Say I need U+02B31 (three leftwards arrows), and I don't want to bother searching TCSL above. May I use the Unicode code point to define a control sequence in ConTeXt that prints the symbol? If so, how? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Diamond, and Unicode math symbols
On 2016-03-11 20:57:28 +, Hans Hagen said: On 3/11/2016 9:18 PM, Mikael P. Sundqvist wrote: I could not find a diamond on p. 112 in my version of the comprehensive symbol list, but maybe: \definefontfamily[myface][rm][TeX Gyre Pagella] \definefallbackfamily[myface][mm][Xits][range={"025C7}] \definefontfamily[myface][mm][TeX Gyre Pagella Math] \setupbodyfont[myface] \starttext You could try $⋄\quad ⃟ $ from Pagella or $◇$ from Xits. \stoptext There is a nice document, unicode-symbols.pdf you can have a look in for a list of (unicode) math symbols. there are s-math-*.mkiv files that can generate all kind of lists you can run s-mkiv-repertoire.mkiv to get a comparison (at the end of the file you can see how) % list here (some 8 fonts) that you have on your system: \showmathcharacterssetbodyfonts{lucidaot,cambria,xits,modern,pagella,termes,bonum,schola,dejavu} \starttext \setupbodyfont[pagella, 12pt] \showmathfontrepertoire \stoptext you can click around (on a decent high res screen) Hans, Mikael, thanks for your suggestions, all of them valuable. Borrowing the symbol from Xits is a fine solution. The comparison tables come in very handy, too. Thanks again, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Diamond, and Unicode math symbols
On 2016-03-10 21:00:21 +, Nicola said: I'm looking for a symbol similar to \lozenge, but squarer […] Any idea how I may typeset it in ConTeXt (MKIV)? Unless I am overlooking something, there is no such symbol in TeX Gyre Pagella Math, so maybe this is not possible. 2) The list shows a Unicode point for each symbol, but not the corresponding TeX command (if it exists). Ok, this is not correct: the command is there, for symbols that have one. But how do I use symbols with no associated TeX command? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Help with t-vim module and math
Hi, I am using the Vim module to typeset code, and I've found a situation where I'd like to use some math symbols, but not in comments. I am not sure whether it can be done. This is what I have tried: \usemodule[vim] \definefontfamily[slidesfont][mono][Latin Modern Mono Light] \definefallbackfamily[slidesfont][mono][Xits][range={"0222A}] \definevimtyping[pascal][syntax=pascal] \starttext \startpascal X := Y ∪ Z; \stoppascal \stoptext The ∪ symbol does not appear in the output. Am I completely off-track? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with t-vim module and math
On 2016-04-13 11:53:51 +, Hans Hagen said: On 4/13/2016 11:19 AM, Nicola wrote: Hi, I am using the Vim module to typeset code, and I've found a situation where I'd like to use some math symbols, but not in comments. I am not sure whether it can be done. This is what I have tried: \usemodule[vim] \definefontfamily[slidesfont][mono][Latin Modern Mono Light] \definefallbackfamily[slidesfont][mono][Xits][range={"0222A}] \definevimtyping[pascal][syntax=pascal] \starttext \startpascal X := Y ∪ Z; \stoppascal \stoptext The ∪ symbol does not appear in the output. Am I completely off-track? use dejavu mono instead of lm mono Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in my document: is there a light variant? Also, can't the fallback mechanism be used? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-01 15:35:07 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: I'm using the latest beta, and I need syntax coloring for SQL (PostgreSQL variant). According to the wiki, there is no SQL syntax coloring available for MKIV yet, but I'd be happy to be wrong :) You can use the vim module: https://github.com/adityam/filter/blob/master/vim-README.md I've set up your module and it works perfectly. It saved me a lot of time! But I need help for one more thing: \inlineMYLANG{X} adds a new line before and after X, as in \startMYLANG X \stopMYLANG. How do I prevent that? Well, why is that the case to begin with? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Tables vs tables (deprecation paranoia again)
I read in the wiki that my beloved \starttable...\stoptable is deprecated. Tabulate seems their next of kin, but... does it support cells spanning more than one row? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 14:45:54 +, Aditya Mahajan said: On Wed, 2 Mar 2016, Nicola wrote: On 2016-03-02 02:14:33 +, Aditya Mahajan said: I do not load the default vimrc, because that drastically slows down the module. That makes sense. So, Vim is run with something like `vim -u NONE`, I guess. Yes. And if the vimrc option is used, then it is saved on file, and vim -u \vimrc_filename is run. Crystal clear, thanks! \startvimrc[name=pgsql] set nocompatible set runtimepath+=~/.vim/bundle/pgsql let g:sql_type_default='pgsql' % ... \stopvimrc I will add a note to the docs about runtimepath. When I wrote the module, bundle was not popular, but it is the default now. I use Pathogen, and `bundle` is its default path for plugins. But recently Vim has introduced a feature called `packages` in the core (:h packages), so one may expect that in the future the default will be `pack`. Nicola___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 20:11:56 +, Aditya Mahajan said: You can change the space before and after display environments using spacebefore and spaceafter keys (see the documentation of filter module[1], which is used by the vim module) Thanks, it works! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-01 21:53:10 +, Hans Hagen said: just fyi (as aditya already provided you a solution) there are three highlighters - the build-in one, for which one can define additional variants (there are few defined, some assume proper syntax, some are line based) Just to clarify, this is the Lua-based "pretty printers" mentioned in the wiki, is it? - the module by aditya which (i assume) also needs vim installed - a relative new mechanism based on the scite lexers that i use (for not it is loaded by \usemodule[scite] ...which does require Scite? (I've tried your example and it doesn't get highlighted.) Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 02:14:33 +, Aditya Mahajan said: I do not load the default vimrc, because that drastically slows down the module. That makes sense. So, Vim is run with something like `vim -u NONE`, I guess. Instead, there is an option to create a specific vimrc using: \startvimrc[name=pgsql] let g:sql_type_default='pgsql' \stopvimrc and then \definevimtyping[SQL][..., vimrc=pgsql, ...] By default, the script searches everything in `runtimepath`. If your local vim folder is not in runtimepath, you can set the runtimepath in the vimrc above. I had to set both runtimepath and nocompatible. Maybe this should be noted in the docs, or the module could run `vim -u NONE -N` (who needs compatible nowadays?). So, for future reference, this works: \startvimrc[name=pgsql] set nocompatible set runtimepath+=~/.vim/bundle/pgsql let g:sql_type_default='pgsql' % ... \stopvimrc 2) Are pscolor and blackandwhite the only possibilities to customize the colors? This is important, I need the syntax highlighting to match my document's colors. It is relatively easy to tune the color scheme. See, for example how pscolor is defined: https://github.com/adityam/filter/blob/cc9d9017bfdd7fe0d67b4723570e960ec6c52e43/t-vim.tex#L280 You can create similar mappings for your favorite color scheme (It does require a bit of knowledge of vim syntax groups). Perfect, thanks! Finally, your Readme tells to use \definevimtyping[...][...], but I have found that I need to use put all the options together: \defienvimtyping[...]. What I mean is \definevimtyping[SQL][numbering=on], etc. Ops, dumb oversight on my part. Thanks for your help and your amazing module, Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to avoid overriding a control sequence?
On 2016-03-07 18:47:20 +, luigi scarso said: On Mon, Mar 7, 2016 at 7:40 PM, Nicola <nvitacolo...@gmail.com> wrote: How do I check in ConTeXt whether a control sequence is already defined (to avoid redefining it by accident)? kind of \ifdefined\writebanner \else \unexpanded\def\writebanner{\writestring} \fi ? That works, thanks! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] How to avoid overriding a control sequence?
How do I check in ConTeXt whether a control sequence is already defined (to avoid redefining it by accident)? Marginally related to the above, I have tried to use \show, only to discover, to my surprise, that it gives an error. For example: \show\NL \end Does ConTeXt override some of TeX primitives? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to avoid overriding a control sequence?
On 2016-03-07 20:16:45 +, Hans Hagen said: On 3/7/2016 7:40 PM, Nicola wrote: How do I check in ConTeXt whether a control sequence is already defined (to avoid redefining it by accident)? Marginally related to the above, I have tried to use \show, only to discover, to my surprise, that it gives an error. For example: \show\NL \end Does ConTeXt override some of TeX primitives? yes, like \month ... but in general if you use uppercase or camelcase you're quite safe (there are some math symbols with uppercase but if you define your own commands you will probably not use those) ... mechanisms like tables that use \NC and so define them local I see. Local commands are a good idea. I usually use camelcase, but since I wanted to define some two-letter sequences, I thought I'd better be cautious. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-01 15:35:07 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: I'm using the latest beta, and I need syntax coloring for SQL (PostgreSQL variant). According to the wiki, there is no SQL syntax coloring available for MKIV yet, but I'd be happy to be wrong :) You can use the vim module: https://github.com/adityam/filter/blob/master/vim-README.md That's a pretty impressive module, thanks! I didn't know about it. I have a couple of questions: 1) Vim's SQL highlighting is a bit peculiar, in that a user is allowed to set a SQL dialect (:h sql-dialects) with SQLSetType or by setting g:sql_type_default or b:sql_type_override. For example, the effect of putting let g:sql_type_default='pgsql' in my vimrc is that, when a sql buffer is created, Vim searches for syntax/pgsql.vim instead of the default syntax file (sqloracle.vim, I think). Note that the filetype remains 'sql'. I have tried to set a SQL dialect inside a \startvimrc/\stopvimrc block, but without success (if that matters, I have this plugin in my ~/.vim folder: https://github.com/lifepillar/pgsql.vim). I have also tried \definevimtyping[SQL][syntax=pgsql], but then I don't get any highlighting, which makes me think that the module does not search my ~/.vim folder. Does the module work only with syntaxes in core Vim? 2) Are pscolor and blackandwhite the only possibilities to customize the colors? This is important, I need the syntax highlighting to match my document's colors. Finally, your Readme tells to use \definevimtyping[...][...], but I have found that I need to use put all the options together: \defienvimtyping[...]. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Custom syntax highlighting
I'm using the latest beta, and I need syntax coloring for SQL (PostgreSQL variant). According to the wiki, there is no SQL syntax coloring available for MKIV yet, but I'd be happy to be wrong :) If I am not wrong, I'd like to write my own syntax file, but not starting from scratch. I cannot find any pret-* files in the beta, though. Should they be downloaded separately? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 11:06:34 +, Nicola said: On 2016-03-02 02:14:33 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: On 2016-03-01 15:35:07 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: I'm using the latest beta, and I need syntax coloring for SQL (PostgreSQL variant). According to the wiki, there is no SQL syntax coloring available for MKIV yet, but I'd be happy to be wrong :) You can use the vim module: https://github.com/adityam/filter/blob/master/vim-README.md I have a relatively minor problem with linked highlight groups. As far as I can see, the module resolves linked groups so that, for example, if String links to Constant, then the generated code for 'a string' will be something like \SYN[Constant]{'a string'}, rather than \SYN[String]{'a string'}. In my specific case, strings use the sqlString group, which links by default to String, which in turn links to Constant. Is there a way to decouple linked highlight groups, so that, for example, I may distinguish Constant from String? I have already tried to put commands like hi! clear sqlString hi! link String NONE etc... in the vimrc block, to no avail. Ok, I have found it: hi! link sqlString NONE With that, I get \SYN[sqlString]{'a string'}, as expected. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 02:14:33 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: On 2016-03-01 15:35:07 +, Aditya Mahajan said: On Tue, 1 Mar 2016, Nicola wrote: I'm using the latest beta, and I need syntax coloring for SQL (PostgreSQL variant). According to the wiki, there is no SQL syntax coloring available for MKIV yet, but I'd be happy to be wrong :) You can use the vim module: https://github.com/adityam/filter/blob/master/vim-README.md I have a relatively minor problem with linked highlight groups. As far as I can see, the module resolves linked groups so that, for example, if String links to Constant, then the generated code for 'a string' will be something like \SYN[Constant]{'a string'}, rather than \SYN[String]{'a string'}. In my specific case, strings use the sqlString group, which links by default to String, which in turn links to Constant. Is there a way to decouple linked highlight groups, so that, for example, I may distinguish Constant from String? I have already tried to put commands like hi! clear sqlString hi! link String NONE etc... in the vimrc block, to no avail. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Custom syntax highlighting
On 2016-03-02 09:13:07 +, Hans Hagen said: On 3/2/2016 9:56 AM, Nicola wrote: On 2016-03-01 21:53:10 +, Hans Hagen said: - a relative new mechanism based on the scite lexers that i use (for not it is loaded by \usemodule[scite] ...which does require Scite? (I've tried your example and it doesn't get highlighted.) the sql lexer is in the upcoming beta and i just added the start/stop but this should work [snip] Indeed it does. You don't need scite installed so it's quite efficient as it's the method that is used, not the binary (and the context related lexers ship with the context distribution). That's clear now, thanks! Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with t-vim module and math
On 2016-04-13 13:33:27 +, Wolfgang Schuster said: Nicola 13. April 2016 um 15:28 On 2016-04-13 12:47:56 +, Wolfgang Schuster said: Nicola 13. April 2016 um 14:17 On 2016-04-13 11:53:51 +, Hans Hagen said: Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in my document: is there a light variant? Also, can't the fallback mechanism be used? Yes it can but you have to enable your custom typeface with \setupbodyfont which wasn’t done in your example. You're right, but I have done it in my original document. Even with that, the fallback symbol does not show up: \usemodule[vim] \definefontfamily[slidesfont][mono][Latin Modern Mono Light] \definefallbackfamily[slidesfont][mono][DejaVu Sans Mono][range={"0222A}] \definevimtyping[pascal][syntax=pascal] \setupbodyfont[slidesfont] \starttext \startpascal X := Y ∪ Z; \stoppascal \stoptext You have to move the fallback setting before the font where you want to apply the fallback, i.e. \definefallbackfamily […] […] […] \definefontfamily […] […] […] Great, it works! Thanks to ConTeXt and this mailing list, I've cut down the time to prepare a presentation dramatically, while improving its quality and avoiding frustration (compared to LaTeX Beamer+listings). Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Help with t-vim module and math
On 2016-04-13 12:47:56 +, Wolfgang Schuster said: Nicola 13. April 2016 um 14:17 On 2016-04-13 11:53:51 +, Hans Hagen said: Thanks, that works. Unfortunately, DejaVu Sans Mono looks too heavy in my document: is there a light variant? Also, can't the fallback mechanism be used? Yes it can but you have to enable your custom typeface with \setupbodyfont which wasn’t done in your example. You're right, but I have done it in my original document. Even with that, the fallback symbol does not show up: \usemodule[vim] \definefontfamily[slidesfont][mono][Latin Modern Mono Light] \definefallbackfamily[slidesfont][mono][DejaVu Sans Mono][range={"0222A}] \definevimtyping[pascal][syntax=pascal] \setupbodyfont[slidesfont] \starttext \startpascal X := Y ∪ Z; \stoppascal \stoptext Nicola___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Questions about Scite lexers
I'm trying to define a custom scite lexer for a toy language I'm using. So far, I've copied a lexer from the distribution, changed its name and keywords, and it's all fine. I have a few questions, though: 1) my custom scite-context-lexer-.lua is found only if I put it in the distribution. It there a way to have it in my project's folder instead? 2) How do I customize colors? 3) Is it possible to embed TeX commands in \startscite..\stopscite environments, like /BTEX../ETEX in built-in typing? 4) Are scite lexers documented somewhere besides the source code? 5) May I rely on this feature to be stable? 6) It is my understanding that pret-xxx.lua files are obsolete. Is it correct? (If so, it would be nice to update the wiki to reflect that). To be clear, I'm not interested in using the Scite application. I just need to typeset formatted verbatim code. The vim module is fantastic and I already use it, but there are cases where I need a syntax not supported by Vim (and I'd rather avoid defining it on the Vim side) and/or need to embed TeX commands (anywhere, not only in comments). Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Questions about Scite lexers
On 2016-04-13 15:39:57 +, Hans Hagen said: 6) It is my understanding that pret-xxx.lua files are obsolete. Is it correct? (If so, it would be nice to update the wiki to reflect that). no, they are not obsolete (the scite lexers are often also syntax checkers so they are more strict) ... the pret files are more or less working in the same way (they date from before scite got that kind of lexers) Thanks for your answers. I'd like to go with \definetyping then, because I need /BTEX../ETEX. I have found an old document of mine, which uses a (slightly customized) pret-c.lua, located inside the project's folder. It compiles, but I don't get syntax highlighting. Is it because pret-c is not searched in the project's directory? (According to http://wiki.contextgarden.net/Verbatim#Pretty_printing the file should be found.) This is a minimal version: \setupinteraction [state=start] \setupcolors [state=start] \setuptyping [option=color] \definetyping [C][option=C, tab=4] \definecolor [Ccomment][darkblue] \definetyping [CPP] [option=C,tab=2, bodyfont=small] \starttext \startC int main() { return 0; } // Comment \stopC \startCPP int main() { return 0; } // Comment \stopCPP \stoptext Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Questions about Scite lexers
On 2016-04-14 05:10:18 +, Christoph Reller said: On Wed, Apr 13, 2016 at 10:39 PM Christoph Reller <christoph.rel...@gmail.com> wrote: Nicola <nvitacolo...@gmail.com> wrote on Wed., 13. Apr. 2016 19:36: I have found an old document of mine, which uses a (slightly customized) pret-c.lua, located inside the project's folder. It compiles, but I don't get syntax highlighting. Is it because pret-c is not searched in the project's directory? Alternatively you can set the TEXMF_LOCAL environment variable to some directory where your "private" texmf-tree resides. Note that after this you have to run context --generate in order for context to find the modules in your texmf-tree. Also note that the compilation logfile written by context tells you what modules have been found in which locations. I hope this helps, Christoph Sorry, the environment variable should be named TEXMFLOCAL, without the underscore Thanks for all the suggestions. I will experiment a bit, and come back to the mailing list for further questions. Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Equivalent of extras option in new bibliography system?
In the past (MKII) I used citations of the form: \cite[extras={, p.~24}][Author:2016] The extras option seems to be ignored by MKIV's bibliography system. What is the equivalent of the above? Nicola ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___