[NTG-context] Table in header, or multicolumn header
Hello everyone, I'm starting to write some technical documents for a customer. I used MS Word in the past because that's what they use, then switched to OO Writer for the last job, but I'm not very comfortable with neither of them, so I decided to switch to ConTeXt. However, I'm facing with a problem. Page headings must contain a three columns table, with a logo in the left cell, a title in the middle one and finally some rows with a document reference number, the issue, the issue date and "page/pages" numbers. I'm not sure if I should use the \startcolumns environment (but it doesn't seems to work in headers or footers) or one of the various table environments. Could you give me some advice? I attached a screenshot of what the header looks like in Writer. Thank you, Marco Pallante <>___ If your question is of interest to others as well, please add an 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] Table in header, or multicolumn header
Am 13.12.2013 um 16:00 schrieb Marco Pallante : > Hello everyone, > > I'm starting to write some technical documents for a customer. I used MS > Word in the past because that's what they use, then switched to OO > Writer for the last job, but I'm not very comfortable with neither of > them, so I decided to switch to ConTeXt. > > However, I'm facing with a problem. Page headings must contain a three > columns table, with a logo in the left cell, a title in the middle one > and finally some rows with a document reference number, the issue, the > issue date and "page/pages" numbers. > > I'm not sure if I should use the \startcolumns environment (but it > doesn't seems to work in headers or footers) or one of the various table > environments. > > Could you give me some advice? > > I attached a screenshot of what the header looks like in Writer. You can try to use a table but there is a possibility for problems when you use xtables in your document which are split across pages. \startsetups[header:table] \startembeddedxtable[align={middle,lohi},strut=no] \startxrow \startxcell[width=0.25\paperwidth,nr=4] %\externalfigure[logo] \stopxcell \startxcell[width=0.40\paperwidth,nr=4] Document title \stopxcell \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Doc No. \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Revision \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Data \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Pagina \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \pagenumber/\lastpagenumber \stopxcell \stopxcellgroup \stopxrow \stopembeddedxtable \stopsetups \setupheadertexts[\texsetup{header:table}] \starttext \dorecurse{30}{\input knuth\par} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Table in header, or multicolumn header
Wolfgang, Your solution seems to work perfectly: I get exactly what I want (I only have to remove frames around cells). I don't understand the possible problems: are you saying that if I use xtables in the body of the document (other than in the header), and those tables split across pages it could give unexpected behaviours? What if I don't use xtables in the body, but other tabular environments that allow splitting, such as TABLE or Linetable (I'm reading from the wiki, I never used that)? Thank you very much! Bye, Marco Pallante > > You can try to use a table but there is a possibility for problems when you > use xtables > in your document which are split across pages. > > \startsetups[header:table] > > \startembeddedxtable[align={middle,lohi},strut=no] > \startxrow > \startxcell[width=0.25\paperwidth,nr=4] > %\externalfigure[logo] > \stopxcell > \startxcell[width=0.40\paperwidth,nr=4] > Document title > \stopxcell > > \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] > > \startxcell[width=0.10\paperwidth,align={flushright,lohi}] > Doc No. > \stopxcell > > \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] > \unknown > \stopxcell > \stopxcellgroup > \stopxrow > \startxrow > > \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] > > \startxcell[width=0.10\paperwidth,align={flushright,lohi}] > Revision > \stopxcell > > \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] > \unknown > \stopxcell > \stopxcellgroup > \stopxrow > \startxrow > > \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] > > \startxcell[width=0.10\paperwidth,align={flushright,lohi}] > Data > \stopxcell > > \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] > \unknown > \stopxcell > \stopxcellgroup > \stopxrow > \startxrow > > \startxcellgroup[height=0.25\headerheight,foregroundstyle=small] > > \startxcell[width=0.10\paperwidth,align={flushright,lohi}] > Pagina > \stopxcell > > \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] > \pagenumber/\lastpagenumber > \stopxcell > \stopxcellgroup > \stopxrow > \stopembeddedxtable > > \stopsetups > > \setupheadertexts[\texsetup{header:table}] > > \starttext > \dorecurse{30}{\input knuth\par} > \stoptext > > Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___