Xref: utzoo comp.text.tex:3192 comp.lang.apl:526 Path: utzoo!attcan!uunet!cs.utexas.edu!yale!cs.yale.edu!newsbase!duchier From: duchier@cs.yale.edu (Denys Duchier) Newsgroups: comp.text.tex,comp.lang.apl Subject: Re: TeX Puzzle II Message-ID: Date: 3 Oct 90 17:39:34 GMT References: <1990Oct3.024630.6222@midway.uchicago.edu> Sender: news@cs.yale.edu Reply-To: duchier-denys@cs.yale.edu Followup-To: comp.text.tex Distribution: na Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 46 Nntp-Posting-Host: albania.ai.cs.yale.edu In-reply-to: c3ar@zaphod.uchicago.edu's message of 3 Oct 90 02:46:30 GMT In article <1990Oct3.024630.6222@midway.uchicago.edu> c3ar@zaphod.uchicago.edu (Walter C3arlip) writes: > ways. I would like to use braces above and below the expression to > identify the groupings. Something like this: > > p q > |-----------||-----------| > abcdefgaaaabbbbccccdefghabecde > |-----||----------||---------| > x y z > > where the "|-------|" represent braces. (This would indicate something > like "xyz = abcpqe". There is a trivial solution if you are willing to use a fixed-width font such as \tt (otherwise, you can use the same technique, but the specifications become more cumbersome, e.g. you might have to specify the actual substring rather than just the number of characters). \documentstyle{article} \begin{document} %% %% define new length \foo to be as wide as a letter in \tt. %% \newlength{\foo} \settowidth{\foo}{\tt a} %% %% \O{N}{LABEL} starts an overbrace which extends over the next N %% characters and has LABEL stacked on top. %% \def\O#1#2{\hbox to0pt{$\overbrace {\hbox{\strut\hskip#1\foo}}^{\hbox{\tt#2}}$\hss}} %% %% \U{N}{LABEL} similarly for an underbrace %% \def\U#1#2{\hbox to0pt{$\underbrace {\hbox{\strut\hskip#1\foo}}_{\hbox{\tt#2}}$\hss}} %% %% Now your example %% \begin{center} \tt \leavevmode \U{7}{x}abc\O{13}{p}defg\U{12}{y}aaaabbbbc\O{13}{q}ccc\U{11}{z}defghabecde \end{center} \end{document} --Denys