Re: [NTG-context] Natural Tables---Including a bit of cell style in a \define
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 ___
Re: [NTG-context] Natural Tables---Including a bit of cell
Hans, This didn't quite achieve what I was looking for. I was hoping for the formatting of circuit 4 in the output file test.pdf, rather than what was produced for circuit 8. I modified the definition of \spare so that by default a 15A breaker is assumed unless otherwise specified. However, a more pressing problem is this: If I remove the comments from the row previous, i.e., I have two rows for which I want nr=2, I get the strange artifact in test+.pdf where the second row gets wrapped up a row. Even with the comments in place, the last row is single height. What I really want are two double height rows similar to circuits 2 and 4 but for the entire row. advTHANKSance Message: 1 Date: Wed, 23 Nov 2011 09:38:51 +0100 From: Hans Hagenpra...@wxs.nl To: pavneet_ar...@waroc.com,mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] Natural Tables---Including a bit of cell style in a \define Message-ID:4eccb11b.2010...@wxs.nl Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 - -- - - Pavneet Arora \setuppapersize[legal] \setuplayout[header=0in,footer=0in,topspace=0.75in,backspace=1.25in] \setuppagenumbering[location=] \setupbodyfont[11pt] \starttext %\showlayout[pt,in] %\showbodyfont \define\unused{ {\inframed [foregroundstyle=type, background=color, backgroundcolor=gray, frame=off] {\tt [Unused]}} } \def\spare{\dosingleempty\doSpare} \def\doSpare[#1]{% \iffirstargument {\tt [#1]} \else {\tt [15A]} \fi {\tt [Spare]} } \startalignment[center] {\tfb Electrical Room Electrical Panel} \blank {\tfa\sc Electrical Panel} \blank {\tfa Panel Model: Siemens} \blank {\tfb \tt [DRAFT---To Be Verified]} \blank[2*big] \stopalignment \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,loffset=0.1in] \setupTABLE[r][4,6][topframe=on] \setupTABLE[r][1][topframe=on,bottomframe=on] \setupTABLE[r][last][bottomframe=on] \midaligned{ \bTABLE \bTABLEbody \bTR \bTD Circuit \eTD \bTD Description \eTD \bTD Circuit \eTD \bTD Description \eTD \eTR \bTR \bTD 1A \eTD \bTD Roof Heating Control Panel \eTD \bTD [nr=2] 2 \eTD \bTD [nr=2] F1 Master Ensuite Steam Unit \eTD \eTR \bTR \bTD 1B \eTD \bTD Recreation Room Plugs \eTD \eTR \bTR \bTD 3A \eTD \bTD Attic Roof Drain Heating Cables \eTD \bTD [nr=2] 4 \eTD \bTD [background=color,backgroundcolor=gray,nr=2] \spare \eTD \eTR \bTR \bTD 3B \eTD \bTD \spare \eTD \eTR % \bTR % \bTD [nr=2] 5 \eTD \bTD [nr=2] Bedrooms 2+3 Arc Fault Plugs \eTD % \bTD [nr=2] 6 \eTD \bTD [nr=2] Roof Heating Cable \eTD % \eTR \bTR \bTD [nr=2] 7 \eTD \bTD [nr=2] Bedroom 4 Arc Fault Plug \eTD \bTD [nr=2] 8 \eTD \bTD [nr=2] \unused \eTD \eTR \eTABLEbody \eTABLE } \stoptext test.pdf Description: Adobe PDF document test+.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Natural Tables---Including a bit of cell
On Wed, 23 Nov 2011, Pavneet Arora wrote: Hans, This didn't quite achieve what I was looking for. I was hoping for the formatting of circuit 4 in the output file test.pdf, rather than what was produced for circuit 8. I modified the definition of \spare so that by default a 15A breaker is assumed unless otherwise specified. A slightly ugly solution. \def\unusedbTD {\dosingleempty\dounusedbTD} \def\dounusedbTD[#1]% {\bTD[foregroundstyle=type,background=color, backgroundcolor=gray,frame=off] [Unused] } and then use \bTD [nr=2] 8 \eTD \unusedbTD[nr=2] \eTD You can also look at xtables for an easier way to change settings of cell. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Natural Tables---Including a bit of cell style in a \define
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 test.pdf Description: Adobe PDF document \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 ___ 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 ___