ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Natural Tables---Including a bit of cell style in a \define
@ 2011-11-22 12:08 Pavneet Arora
  2011-11-23  8:38 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Pavneet Arora @ 2011-11-22 12:08 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

I am creating documentation labeling the circuits of electrical and network 
panels for a project of mine.

Enclosed is a minimal example.

What I would like is to define two macros:  \unused and \spare (\unused 
referring to a circuit with no breaker installed, while \spare referring to a 
circuit with a breaker, but no load).  I wish these definitions to not only 
include the represented text and font directives, i.e., {\tt [Unused]}, but also 
shade the cell in a background color.  However, I cannot seem to figure out how 
to do that.  Including the `[background=color,backgroundcolor=gray]' in the 
\define seems to be expanded back simply as text.

Any suggestions?

advTHANKSance.

-- 
-----
- Pavneet Arora


[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 15742 bytes --]

[-- Attachment #3: test.tex --]
[-- Type: text/x-tex, Size: 1387 bytes --]

\setuppapersize[letter]
\setuplayout[header=0in,footer=0in,topspace=0.75in,backspace=1.25in]
\setuppagenumbering[location=]
\starttext
% \showlayout
% \showbodyfont
\define\unused{{\tt [Unused]}}
\define\spare{{\tt [Spare]}}
\startalignment[center]
{\tfb\sc Storage Room Electrical Panel}
\blank
{\tfa Panel Model: Cutler-Hammer}
\blank
{\tfb \tt [DRAFT---To Be Verfied]}
\blank[2*big]

\setupTABLE[frame=off]
\setupTABLE[r][each][height=0.35in]
\setupTABLE[c][1,3][align={center,lohi},width=0.75in]
\setupTABLE[c][2,4][align={flushleft,lohi},width=2.25in,offset=2mm]
\setupTABLE[r][1][topframe=on,bottomframe=on]
\setupTABLE[r][last][bottomframe=on]
\setupTABLE[c][3][leftframe=on]
\setupTABLE[r][4][topframe=on]
\setupTABLE[r][6][topframe=on]
\setupTABLE[1,2][6][bottomframe=on]
\bTABLE
\bTABLEbody
	\bTR
		\bTD Circuit \eTD
		\bTD Description \eTD
		\bTD Circuit \eTD
		\bTD Description \eTD
	\eTR
	\bTR
		\bTD [nr=2] 1 \eTD \bTD [nr=4] Electrical Baseboard Heater \eTD
		\bTD 2A \eTD \bTD[background=color,backgroundcolor=gray] \unused \eTD
	\eTR
	\bTR
		\bTD 2B \eTD \bTD \unused \eTD
	\eTR
	\bTR
		\bTD [nr=2] 3 \eTD
		\bTD 4A \eTD \bTD Island Plugs \eTD
	\eTR
	\bTR
		\bTD 4B \eTD \bTD Dishwasher \eTD
	\eTR
	\bTR
		\bTD [nr=2] 5 \eTD \bTD [nr=2] \spare  \eTD
		\bTD 6A \eTD \bTD Freezer \eTD
	\eTR
	\bTR
		\bTD 6B \eTD \bTD Counter Plugs \eTD
	\eTR
\eTABLEbody
\eTABLE
\stoptext

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Natural Tables---Including a bit of cell style in a \define
  2011-11-22 12:08 Natural Tables---Including a bit of cell style in a \define Pavneet Arora
@ 2011-11-23  8:38 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2011-11-23  8:38 UTC (permalink / raw)
  To: pavneet_arora, mailing list for ConTeXt users

On 22-11-2011 13:08, Pavneet Arora wrote:
> I am creating documentation labeling the circuits of electrical and
> network panels for a project of mine.
>
> Enclosed is a minimal example.
>
> What I would like is to define two macros: \unused and \spare (\unused
> referring to a circuit with no breaker installed, while \spare referring
> to a circuit with a breaker, but no load). I wish these definitions to
> not only include the represented text and font directives, i.e., {\tt
> [Unused]}, but also shade the cell in a background color. However, I
> cannot seem to figure out how to do that. Including the
> `[background=color,backgroundcolor=gray]' in the \define seems to be
> expanded back simply as text.
>
> Any suggestions?

\define\unused
   {\inframed
     [foregroundstyle=type,
      background=color,
      backgroundcolor=gray,
      frame=off]
    {[Unused]}}



-----------------------------------------------------------------
                                           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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-23  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 12:08 Natural Tables---Including a bit of cell style in a \define Pavneet Arora
2011-11-23  8:38 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).