[NTG-context] MkIV XML and |c|c|c|
Hi, I'm trying to glue MkIV XML handling to ConTeXt's tabulation. My markup has a HTML-style table model, with an arbitary number of col elements. My problem is to produce the |c|c|c|c| format based on the number of col elements I have, rather than hardcoding a specific number of columns. I thought I could do something like this, but unfortunately the string produced by \xmlconcat{#1}{col}{\|} seems to be ignored: % in practice this would produce various alignments, not just c \startxmlsetups xml:col c \stopxmlsetups \startxmlsetups xml:table \starttabulate[\|\xmlconcat{#1}{col}{\|}\|] \xmlall{#1}{thead|tbody} \stoptabulate \stopxmlsetups Whereas this works fine, as I'd expect: \starttabulate[|c|c|c|c|] (I'm also confused about the escaping for \| there. I guess the [] is a special environment, with | being given a different catcode, perhaps?) Is there a way to do this, with the number of columns and their alignment generated from the input XML? Thanks, -- Kate ___ If your question is of interest to others as well, please add an 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] reference to structureuservariable
Hi, How can I read a structureuservariable at the end of the section, when there are subsections? Example: --8---cut here---start-8--- \starttext \startsection[title=sec][foo=bar] % \edef\myFoo{\structureuservariable{foo}} % workaround \startsubsection[title=sub 1] sub 1 \stopsubsection \startsubsection[title=sub 2] sub 2 \stopsubsection \par foo is \structureuservariable{foo}. % foo is \myFoo. % workaround \stopsection \startsection[title=sec][foo=bar] no subsections...\par foo is \structureuservariable{foo}. \stopsection \stoptext --8---cut here---end---8--- Is there a clean way or do I need to use something like the above workaround? TIA for any hints, -- Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] reference to structureuservariable
Hi Peter, you can use \namedstructureuservariable{section}{foo} to access the foo variable of the section. Wolfgang On 20.01.2014 10:39:01, Peter Münster pmli...@free.fr wrote: Hi, How can I read a structureuservariable at the end of the section, when there are subsections? Example: --8---cut here---start-8--- \starttext \startsection[title=sec][foo=bar] % \edef\myFoo{\structureuservariable{foo}} % workaround \startsubsection[title=sub 1] sub 1 \stopsubsection \startsubsection[title=sub 2] sub 2 \stopsubsection \par foo is \structureuservariable{foo}. % foo is \myFoo. % workaround \stopsection \startsection[title=sec][foo=bar] no subsections...\par foo is \structureuservariable{foo}. \stopsection \stoptext --8---cut here---end---8--- Is there a clean way or do I need to use something like the above workaround? TIA for any hints, -- Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] align text in nodes (tikz)
How i can fix that: This works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {This\\ works}; \stoptikzpicture This don´t works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm, align=center}] \node[mynode] (A) at (5cm, 8cm) {Align\\ (don´t work)}; \stoptikzpicture ConTeXt ver: 2013.12.22 19:05 MKIV beta fmt: 2013.12.23 int: english/english Jorge ___ If your question is of interest to others as well, please add an 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 bar gap with pgfplots/tikz and custom colour
Dear list, I'm using pgfplots to create some bar charts with error bars, and I want to use custom colours for them. This works, but if I mix a custom colour with another colour, it results in a gap between the error bar line and the error bar mark. If two custom colours are mixed, the gap seems to be doubled. Mixing with predefined colours works normally. MWE: \usemodule[tikz] \usemodule[pgfplots] \definecolor[Blue] [h=3465a4] \definecolor[White] [h=ff] \pgfplotsset{compat=newest} \starttext \starttikzpicture \startaxis[ybar, error bars/y dir=both, error bars/y explicit] \addplot+[blue!50!white] coordinates {(1,5) +- (0,3)}; \addplot+[Blue] coordinates {(1,5) +- (0,3)}; \addplot+[Blue!50!white] coordinates {(1,5) +- (0,3)}; \addplot+[Blue!50!White] coordinates {(1,5) +- (0,3)}; \stopaxis \stoptikzpicture \stoptext Kind regards, Joshua Krämer ___ If your question is of interest to others as well, please add an 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] New header
On 1/20/2014 10:34 AM, Fabrice Couvreur wrote: Hi, Here is the resulting file with LuaLaTeX. Thank you. 2014/1/18 Fabrice Couvreur fabrice1.couvr...@gmail.com mailto:fabrice1.couvr...@gmail.com Hi, I use the following header to my statements made with tittlesec package. \makeatletter \newcommand{\@classe}[1]{} \newcommand{\classe}[1]{\gdef\@classe{#1}} \newcommand{\@typedevoir}[1]{} \newcommand{\typedevoir}[1]{\gdef\@typedevoir{#1}} \newcommand{\@numerodevoir}[1]{} \newcommand{\numerodevoir}[1]{\gdef\@numerodevoir{#1}} \AtBeginDocument{\section{\@typedevoir\space\no\@numerodevoir}} \titleformat{\section}[frame] {\normalfont} {\footnotesize\enspace\itshape\@classe\enspace--\enspace Le \@date\enspace} {10pt} {\Large\scshape\bfseries\filcenter} \makeatother I want to gradually move to ConTeXt and I tried to create the same header. But I do not yet know all the commands to do with ConTeXt. \setuptextrules [style=\it,location=top] \define[6]\MyHeader{% \textrule[top]{#1\space--\space\date[d=#2,m=#3,y=#4]}{\startlinealignment[middle]{\cap \bf #5 \space n\high{{o}}\space {#6}}\stoplinealignment\blank\textrule}} \starttext \MyHeader{Seconde GTA}{11}{1}{2014}{Devoir de Mathématiques}{7} \stoptext Thank you. an exercise in - mkvi - metapost - framed - definitions don't forget to start your tex file with this line: % macros=mkvi \starttext \starttexdefinition MyOtherHeader #where #day #month #year #title #number \defineoverlay[whatever][\useMPgraphic{whatever}] \startuseMPgraphic{whatever} draw OverlayBox withpen pencircle scaled .5pt dashed evenly ; picture p ; p := textext(\it\quad#where\space\endash\space\date[d=#day,m=#month,y=#year]\quad) shifted .5[ulcorner OverlayBox,urcorner OverlayBox]; fill boundingbox p withcolor white ; draw p ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \framed [ width=\hsize, height=5em, foregroundstyle=\cap\bf, background=whatever, frame=off, ] { #title \space n\high{o} \space #number } \stoptexdefinition \MyOtherHeader{Seconde GTA}{11}{1}{2014}{Devoir de Mathématiques}{7} \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - % macros=mkvi \starttext \starttexdefinition MyOtherHeader #where #day #month #year #title #number \defineoverlay[whatever][\useMPgraphic{whatever}] \startuseMPgraphic{whatever} draw OverlayBox withpen pencircle scaled .5pt dashed evenly ; picture p ; p := textext(\it\quad#where\space\endash\space\date[d=#day,m=#month,y=#year]\quad) shifted .5[ulcorner OverlayBox,urcorner OverlayBox]; fill boundingbox p withcolor white ; draw p ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \framed [ width=\hsize, height=5em, foregroundstyle=\cap\bf, background=whatever, frame=off, ] { #title \space n\high{o} \space #number } \stoptexdefinition \MyOtherHeader{Seconde GTA}{11}{1}{2014}{Devoir de Mathématiques}{7} \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] MkIV XML and |c|c|c|
On 1/19/2014 11:53 AM, Kate F wrote: Hi, I'm trying to glue MkIV XML handling to ConTeXt's tabulation. My markup has a HTML-style table model, with an arbitary number of col elements. My problem is to produce the |c|c|c|c| format based on the number of col elements I have, rather than hardcoding a specific number of columns. I thought I could do something like this, but unfortunately the string produced by \xmlconcat{#1}{col}{\|} seems to be ignored: % in practice this would produce various alignments, not just c \startxmlsetups xml:col c \stopxmlsetups \startxmlsetups xml:table \starttabulate[\|\xmlconcat{#1}{col}{\|}\|] \xmlall{#1}{thead|tbody} \stoptabulate \stopxmlsetups Whereas this works fine, as I'd expect: \starttabulate[|c|c|c|c|] (I'm also confused about the escaping for \| there. I guess the [] is a special environment, with | being given a different catcode, perhaps?) Is there a way to do this, with the number of columns and their alignment generated from the input XML? \usmeodule[cals] also see the test suite mkiv/xml/tables* etc - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] MPpositiongraphic: I don't know when it's going to work and when it's not.
On 1/19/2014 8:00 AM, Elspeth McGullicuddy wrote: \setupbackgrounds[paper][background={ my first overlay, %% Doesn't work anymore if I comment this line. my fourth overlay}] so that is effectively background={ my first overlay, my fourth overlay} spaces after , are gobbled so if you want to comment things like that do this \setupbackgrounds[paper][background={% my first overlay,% my fourth overlay% }] now you can comment one of both lines - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] MPpositiongraphic: I don't know when it's going to work and when it's not.
On 1/19/2014 8:00 AM, Elspeth McGullicuddy wrote: \framed [ background=my first overlay,my fourth overlay,align=middle,width=7cm] { have attached it: \hpos{three}{{\em here}}, the} here background=my first overlay and my fourth overlay a key without value so: be careful with spaces and commas - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] align text in nodes (tikz)
I found this solution: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {\framed[width=4cm,location=middle,align=center]{it's\\ (framed )}}; \stoptikzpicture Jorge 2014/1/20 DesdeChaves desdecha...@gmail.com How i can fix that: This works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {This\\ works}; \stoptikzpicture This don´t works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm, align=center}] \node[mynode] (A) at (5cm, 8cm) {Align\\ (don´t work)}; \stoptikzpicture ConTeXt ver: 2013.12.22 19:05 MKIV beta fmt: 2013.12.23 int: english/english Jorge -- Atentamente DesdeChaves ___ If your question is of interest to others as well, please add an 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] Comment after \startseparatedlist[...]
Dear list, if there is a comment after \startseparatedlist[...] from the database module, context fails. Thus, this example in the wiki doesn't work: http://wiki.contextgarden.net/M-database Minimal example: \usemodule[database] \defineseparatedlist[Test] [ before=\bTABLE, after=\eTABLE, left=\bTD, right=\eTD, first=\bTR, last=\eTR ] \starttext \startTest % problematic comment Eins, zwei, drei \stopTest \stoptext Kind regards, Joshua Krämer ___ If your question is of interest to others as well, please add an 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] Comment after \startseparatedlist[...]
On 1/20/2014 9:02 PM, Joshua Krämer wrote: Dear list, if there is a comment after \startseparatedlist[...] from the database module, context fails. Thus, this example in the wiki doesn't work: http://wiki.contextgarden.net/M-database Minimal example: \usemodule[database] \defineseparatedlist[Test] [ before=\bTABLE, after=\eTABLE, left=\bTD, right=\eTD, first=\bTR, last=\eTR ] \starttext \startTest % problematic comment Eins, zwei, drei \stopTest \stoptext in fact you get: \startTest Eins, zwei, drei \stopTest because of the comment and we ignore all till the end of the first line Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Reference in a startcombination environment
Dear friends I would like to know if I can make a reference (via \in, \at, etc.) in a \startcombination ... \stopcombination environment to each subfigure. For example, I have a Figure 1.1. (Sky) contains (a) the moon (b) the stars. How could get it to appear in the text see Figure 1.1. (b)? Thanks very much. Manuel ___ If your question is of interest to others as well, please add an 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] Reference in a startcombination environment
Hi, you can the second optional argument of \in to give a suffix for the float number. On 20.01.2014 23:56:33, MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es wrote: Dear friends I would like to know if I can make a reference (via \in, \at, etc.) in a \startcombination ... \stopcombination environment to each subfigure. For example, I have a Figure 1.1. (Sky) contains (a) the moon (b) the stars. How could get it to appear in the text see Figure 1.1. (b)? Thanks very much. Manuel ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Reference in a startcombination environment
Hi, you can use the second optional argument of \in to give a suffix for the float number. \setupexternalfigures[location=default] \starttext \startplacefigure[title={Combination},reference={fig:test}] \startcombination[2*1] \startcontent \externalfigure[cow][width=4cm] \stopcontent \startcaption a \stopcaption \startcontent \externalfigure[mill][width=4cm] \stopcontent \startcaption b \stopcaption \stopcombination \stopplacefigure The \in{figure}{a}[fig:test] shows a dutch cow. \stoptext Wolfgang On 20.01.2014 23:56:33, MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es wrote: Dear friends I would like to know if I can make a reference (via \in, \at, etc.) in a \startcombination ... \stopcombination environment to each subfigure. For example, I have a Figure 1.1. (Sky) contains (a) the moon (b) the stars. How could get it to appear in the text see Figure 1.1. (b)? Thanks very much. Manuel ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Reference in a startcombination environment
Thank you very much for your help, Wolfgang. When you come to Spain I'll buy you a paella for your work. De: ntg-context-boun...@ntg.nl ntg-context-boun...@ntg.nl en nombre de Wolfgang Schuster schuster.wolfg...@gmail.com Enviado: lunes, 20 de enero de 2014 23:18 Para: mailing list for ConTeXt users Asunto: Re: [NTG-context] Reference in a startcombination environment Hi, you can use the second optional argument of \in to give a suffix for the float number. \setupexternalfigures[location=default] \starttext \startplacefigure[title={Combination},reference={fig:test}] \startcombination[2*1] \startcontent \externalfigure[cow][width=4cm] \stopcontent \startcaption a \stopcaption \startcontent \externalfigure[mill][width=4cm] \stopcontent \startcaption b \stopcaption \stopcombination \stopplacefigure The \in{figure}{a}[fig:test] shows a dutch cow. \stoptext Wolfgang On 20.01.2014 23:56:33, MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es wrote: Dear friends I would like to know if I can make a reference (via \in, \at, etc.) in a \startcombination ... \stopcombination environment to each subfigure. For example, I have a Figure 1.1. (Sky) contains (a) the moon (b) the stars. How could get it to appear in the text see Figure 1.1. (b)? Thanks very much. Manuel ___ If your question is of interest to others as well, please add an 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 ___