Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Back again! Currently attempting a dual bracket thing: where word {para}{para} word, are all on one line. I'm trying to play around with the code. But I cannot seem to get it to work. Here's my attempt. Any advice much appreciated!

This is following the similar previous question I had here that was answered here: Big brackets around Text

Example of want trying to achieve:

![](http://imgur.com/2LGQnoe)

  \documentclass[oldfontcommands,11pt]{memoir}
  % Page Layout
  \usepackage[margin=1in, paperwidth=8.5in, paperheight=11in]{geometry}%   http://ctan.org/pkg/geometry
  \usepackage{xparse}% http://ctan.org/pkg/xparse
  \usepackage{varwidth}% http://ctan.org/pkg/varwidth

  %% Dual Convo Bracket Command:
  \NewDocumentCommand{\dboxbrace}{s O{\{} O{\}} O{0.05\linewidth} m O{0.4\linewidth} m  }{% \lrboxbrace[<lbrace>][<rbrace>][<lwidth>]{<ltext>}[<rwidth>]{<rtext>}

    \begin{lrbox}{\leftlatbox}% Left Lateral box
      \IfBooleanTF{#1}% starred/unstarred
        {\begin{varwidth}{#4}#5\end{varwidth}}
        {\begin{minipage}{#4}#5\end{minipage}}
    \end{lrbox}
    \begin{lrbox}{\rightmedbox}% Right Medial box
      \IfBooleanTF{#1}% starred/unstarred
        {\begin{varwidth}{#6}#7\end{varwidth}}
        {\begin{minipage}{#6}#7\end{minipage}}
    \begin{lrbox}{\leftmedbox}% Left Medial box
      \IfBooleanTF{#1}% starred/unstarred
        {\begin{varwidth}{#4}#5\end{varwidth}}
        {\begin{minipage}{#4}#5\end{minipage}}
    \end{lrbox}
    \begin{lrbox}{\rightlatbox}% Right Lateral box
      \IfBooleanTF{#1}% starred/unstarred
        {\begin{varwidth}{#6}#7\end{varwidth}}
        {\begin{minipage}{#6}#7\end{minipage}}      
    \end{lrbox}
    \ensuremath{\usebox\leftlatbox\left#2\usebox\rightmedbox\right#3\left#2\usebox\leftmedbox\right#3\usebox\rightlatbox}
  }

    \begin{document}

    % Example of attempted use
         %% Example of dual Work
          \begin{center}
              \dboxbrace {word} {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed
    eleifend tincidunt enim, eu tincidunt felis auctor quis. Aenean eget
    enim urna.  Pellentesque tincidunt adipiscing velit a
    fermentum. \endgraf Lorem ipsum dolor sit amet, consectetur
    adipiscing elit. Sed eleifend tincidunt enim, eu tincidunt felis
    auctor quis. Aenean eget enim urna.  Pellentesque tincidunt
    adipiscing velit a fermentum.} {Lorem ipsum dolor sit amet, sectetur   adipiscing elit. Sed
    eleifend tincidunt enim, eu tincidunt felis auctor quis. Aenean eget
    enim urna.  Pellentesque tincidunt adipiscing velit a
    fermentum. \endgraf Lorem ipsum dolor sit amet, consectetur
    adipiscing elit. Sed eleifend tincidunt enim, eu tincidunt felis
    auctor quis. Aenean eget enim urna.  Pellentesque tincidunt
    adipiscing velit a fermentum.} {word}
                \end{center}
    \end{document}
share|improve this question
add comment

2 Answers

Using a completely different approach:

\documentclass{article}
\usepackage{scalerel}
\parskip 1em
\begin{document}

\def\mytext{blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah}

\def\lftmk{\{}
\def\rgtmk{\}}

word
\scaleleftright[2ex]{\lftmk}{\parbox{4cm}{\mytext}}{\rgtmk}
\scaleleftright[2ex]{\lftmk}{\parbox{4cm}{\mytext\mytext}}{\rgtmk}
word

\def\lftmk{(}
\def\rgtmk{)}

word
\scaleleftright[2ex]{\lftmk}{\parbox{4cm}{\mytext\mytext}}{\rgtmk}
\scaleleftright[2ex]{\lftmk}{\parbox{4cm}{\mytext}}{\rgtmk}
word

\end{document}

enter image description here

And with scalerel, even non-adjustable symbols can be used as the delimiters, for example < and >, etc. The scalerel package will scale them.

share|improve this answer
    
Thanks, but I've spend around one hour trying to install the scalerel sty in linux, to try out your code! I've placed it in /usr/local/share/texmf/texmf-local/tex/latex/scalerel . I've ran sudo texhash & rebooted: it's generated a ls R file and still texmaker doesn't recognise it! If you have an idea I'd greatly appreciate it. Thanks. –  Grey Jun 14 '13 at 15:48
    
In the meantime, i've just placed the sty in my working folder. I think I'm looking for a option that retains the quality of the braces; hence the more complex code; that I originally used. –  Grey Jun 14 '13 at 15:56
    
Can't help, but good luck, with linux local settings. It is true that scalerel doesn't use the extensibility of symbols to achieve its end state. Rather it using constrained scaling (or constrained stretching) in which the overall scaled width (or aspect raio) is constrained. For many applications, such a look is acceptable. For others, maybe not so much. In my solution, I limited the brace scaling to a 2ex width. –  Steven B. Segletes Jun 14 '13 at 16:13
add comment
up vote 0 down vote accepted

Here's a bit of code I've made to solve my problem: a work-around that uses two commands wrapped together in an mbox to fit it on one line: Enjoy!

Command:

%Savebox:
\newsavebox{\leftbox} \newsavebox{\rightbox}
% Dual Convo Command:
 % Dual Left Command:
 \NewDocumentCommand{\ldboxbrace}{s O{\{} O{\}} O{0.04\linewidth} m O{0.38\linewidth} m}{% \lrboxbrace[<lbrace>][<rbrace>][<lwidth>]{<ltext>}[<rwidth>]{<rtext>}
 \begin{lrbox}{\leftbox}% Left box
 \IfBooleanTF{#1}% starred/unstarred
 {\begin{varwidth}{#4}#5\end{varwidth}}
 {\begin{minipage}{#4}#5\end{minipage}}
 \end{lrbox}
 \begin{lrbox}{\rightbox}% Right box
 \IfBooleanTF{#1}% starred/unstarred
 {\begin{varwidth}{#6}#7\end{varwidth}}
 {\begin{minipage}{#6}#7\end{minipage}}
 \end{lrbox}
 \ensuremath{\usebox\leftbox\left#2\,\usebox\rightbox\,\right#3}
 }
 % Dual Right Command:
 \NewDocumentCommand{\rdboxbrace}{s O{\{} O{\}} O{0.38\linewidth} m O{0.04\linewidth} m}{% \lrboxbrace[<lbrace>][<rbrace>][<lwidth>]{<ltext>}[<rwidth>]{<rtext>}

 \begin{lrbox}{\leftbox}% Left box
 \IfBooleanTF{#1}% starred/unstarred
 {\begin{varwidth}{#4}#5\end{varwidth}}
 {\begin{minipage}{#4}#5\end{minipage}}
 \end{lrbox}
 \begin{lrbox}{\rightbox}% Right box
 \IfBooleanTF{#1}% starred/unstarred
 {\begin{varwidth}{#6}#7\end{varwidth}}
 {\begin{minipage}{#6}#7\end{minipage}}
 \end{lrbox}
 \ensuremath{\left#2\usebox\leftbox\right#3\usebox\rightbox}
 }

Example:

\begin{center}
\mbox{
\ldboxbrace {abc} % The left bracket
    {Loren ipsum dolor sit amet, consectetur adipiscing elit. Sed
  eleifend tincidunt enim, eu tincidunt felis auctor quis. Aenean eget
  enim urna.  Pellentesque tincidunt adipiscing velit a
  fermentum. \endgraf Lorem ipsum dolor sit amet, consectetur
  adipiscing elit. Sed eleifend tincidunt enim, eu tincidunt felis
  auctor quis. Aenean eget enim urna.  Pellentesque tincidunt
  adipiscing velit a fermentum.}

\rdboxbrace  {Loren ipsum dolor sit amet, consectetur adipiscing elit. Sed
  eleifend tincidunt enim, eu tincidunt felis auctor quis. Aenean eget
  enim urna.  Pellentesque tincidunt adipiscing velit a
  fermentum. \endgraf Lorem ipsum dolor sit amet, consectetur
  adipiscing elit. Sed eleifend tincidunt enim, eu tincidunt felis
  auctor quis. Aenean eget enim urna.  Pellentesque tincidunt
  adipiscing velit a fermentum.} %The rigth bracket
  {abc}
  }
\end{center}

Thanks again guys.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.