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.

I want to create a big single curly bracket over a paragraph of text. I will be using this for many, many paragraphs. I want to make it left and/or right idented. This is for a conversational styled work.

Edit 1: What I want: http://imgur.com/eD89EPb

I would like to know the same for square brackets, too. I've tried using some normal math modes, but the text goes off the page.

Edit 2: I'm now using the first response here: by Peter Grill: Dynamically sized brackets/parentheses for text

How can I get the LEFT bracket to "work" without all the text being compressed on one side? I get badness 10000.

Dump:

\documentclass[12pt]{memoir}

\newcommand{\LBracket}[4][0.1\textwidth]{%
\begin{math}%
  \left.% 
  \parbox{#1}{#3}\vphantom{\parbox{#1}{#4}}%
  \right#2%
  \parbox{#1}{#4}\vphantom{\parbox{#1}{#3}}%
\end{math}
}%

\newcommand{\RBracket}[4][0.9\textwidth]{%
\begin{math}%
  \left.% 
  \parbox{#1}{#3}\vphantom{\parbox{#1}{#4}}%
  \right#2%
  \parbox{#1}{#4}\vphantom{\parbox{#1}{#3}}%
\end{math}
}%


\begin{document}


\RBracket{)}
{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsu}
{Words}% Use a round )

\LBracket{\{}
{Words}
{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsu}% ETC


\end{document}

Edit 3: In the interim: i'm using Werner's response in the link above. I am able to rescale without much trouble. But changing symbols is I cannot do.

How can I change the bracket symbol? e.g. to { or [ etc.? I cannot find where this controlled for in the code.

\documentclass[11pt]{memoir}
\usepackage[margin=15mm]{geometry}% http://ctan.org/pkg/geometry
 \usepackage{xparse}% http://ctan.org/pkg/xparse
 \usepackage{varwidth}% http://ctan.org/pkg/varwidth
 \begin{document}

 \newsavebox{\leftbox} \newsavebox{\rightbox}%

\NewDocumentCommand{\lrboxbrace}{s O{0.05\linewidth} m O{0.8\linewidth} m}{% \lrboxbrace[<lwidth>]{<ltext>}[<rwidth>]{<rtext>}
  \begin{lrbox}{\leftbox}% Left box
    \IfBooleanTF{#1}% starred/unstarred
      {\begin{varwidth}{#2}#3\end{varwidth}}
      {\begin{minipage}{#2}#3\end{minipage}}
  \end{lrbox}
  \begin{lrbox}{\rightbox}% Right box
    \IfBooleanTF{#1}% starred/unstarred
      {\begin{varwidth}{#4}#5\end{varwidth}}
      {\begin{minipage}{#4}#5\end{minipage}}
  \end{lrbox}
  \ensuremath{\left.\usebox\leftbox\rule{0pt}{\ht\rightbox}\right\}\usebox\rightbox}
}

  \lrboxbrace%
   {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.}


 \end{document}

Edit 4: For the paragraph with only one bracket, I'm trying to figure a solution. Went I try to leave an empty space in the brackets where "Word" would be, it causes a misalignment. The two paragraphs are no longer placed perfectly underneath each other. The one with {} is positioned slightly left to the first paragraph.

Obviously this is due to the proportional sizes specified. But I want that to remain so it can adjust according to any document specific. But in the interim I put an underscore there, but it brings up bad errors. What should I do?

Tex:

\documentclass[oldfontcommands,12pt]{memoir}
\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
\usepackage{musixtex}
\usepackage{feyn}
\usepackage{feynmp}

% Bracket commands:
%% Box array setup:
\newsavebox{\leftbox} \newsavebox{\rightbox}%
%%% Box Bracket Command:
\NewDocumentCommand{\boxbrace}{s O{\{} O{\}} O{0.05\linewidth} m O{0.8\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}
}


%%%%%%%%%%%%%%%%%%%%%%%%%% 

\begin{document}

Example of full brackets on both sides. By default it fully covers
both sides of the paragraph.
\begin{center}
  \boxbrace {abc}%
  {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.}
\end{center}

Example of only one bracket: just fill the relevant comment area with
a single full stop.
\begin{center}
  \boxbrace [\lbrace][.] {abc}%
  {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.}
\end{center}

With a second one to follow
\begin{center}
  \boxbrace [.][\rbrace] {_}%
  {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.}
\end{center}

Errors turn up here. Otherwise with just a space it's misaligned like
this:
\begin{center}
  \boxbrace [.][\rbrace] { }%
  {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.}
\end{center}

\end{document}

Edit 5: Bach 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!

Command:

  %% 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}
  }

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}
share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Jubobs Apr 23 '13 at 23:40
    
I would say the location/direction of the bracket and braces (top rather than sides) make this "related" rather than "duplicate". Unless, of course, I fully misunderstood what "over a paragraph text" means and "left and/or right indented"... Hmmmm. –  Werner Apr 23 '13 at 23:47
3  
Would you be able to clarify what you mean by "over a paragraph text" as well as "left and/or right indented"? –  Werner Apr 23 '13 at 23:51
    
Wener: "over a paragraph text": brackets that encompass the whole of the paragraph laterally. "left and/or right indented": brackets positioned on the left hand side of the page and vice versa. Please see edit 2; for I'm trying to use a different symbol...It seems to work better than the first attempt I've tried; with regards to respecting page margins. Thanks –  Grey Apr 26 '13 at 14:47
    
I think you should change to the title to "Big brackets around text" –  Andrew Swann Apr 26 '13 at 16:06
add comment

3 Answers 3

up vote 8 down vote accepted

The brace in Werner's code is hiding in the final line of the macro as \} preceeded by \right. Here is a simple modification of his code to make the brace an optional argument, providing a right brace too and tweaking a bit of spacing:

Sample output

\documentclass[11pt]{memoir}

\usepackage[margin=15mm]{geometry}% http://ctan.org/pkg/geometry
\usepackage{xparse}% http://ctan.org/pkg/xparse
\usepackage{varwidth}% http://ctan.org/pkg/varwidth

\begin{document}

\newsavebox{\leftbox} \newsavebox{\rightbox}%

\NewDocumentCommand{\lrboxbrace}{s O{\{} O{\}} O{0.05\linewidth} m O{0.8\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}
}

\begin{center}
  \lrboxbrace {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.}
\end{center}

\begin{center}
  \lrboxbrace[{[}][{]}] [0.4\textwidth]{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. }%
  [0.4\textwidth]{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.}
\end{center}

\begin{center}
  \lrboxbrace[\langle][\rangle] {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.}
\end{center}

\begin{center}
  \lrboxbrace[\Vert][\Vert] {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.}
\end{center}

 \end{document}
share|improve this answer
    
Thanks for showing where /{ was! But I get on line 47: ! Missing delimiter (. inserted). This makes the brackets tiny and not scale to the paragraphs size. –  Grey Apr 27 '13 at 12:20
    
Copying and pasting the above code into a new document compiles without error for me and produces the given output. Perhaps you have a typo? –  Andrew Swann Apr 27 '13 at 12:28
    
Could I be missing a package? I'm running linux. here's a screendump: i've tried on a different Latex program and I get the same problem: i39.tinypic.com/35hpyk7.jpg –  Grey Apr 27 '13 at 13:05
    
My guess would be that you have an old version of xparse - I would need to see the .log file to confirm that. As a workaround you might try writing \lrboxbrace[\lbrack][\rbrack] instead of \lrboxbrace[{[}][{]}] –  Andrew Swann Apr 27 '13 at 13:31
    
Thanks Andrew! I think this solves it for me! But if I ever want to use that [{}][{}] functionality would I need to update my xparse.sty? Log: pastebin.com/LqfGKTWD –  Grey Apr 27 '13 at 13:37
show 5 more comments

Let me suggest a way using the package tcolorbox. Based on the layer TikZ you can use a lot of option to manipulate the output. The following is very simple and provides an example of a left brace environment. Of course you are free to add other one.

\documentclass[11pt]{memoir}
\usepackage{showframe}
\usepackage{tikz,lipsum}
\usetikzlibrary{decorations.pathreplacing}
\usepackage[listings,theorems,skins,breakable]{tcolorbox}
\tcbset{skin=enhanced}
\newtcolorbox{lbracebox}[1][Word]{%
   colback=green!5,frame hidden,enlarge left by=2cm,width=\linewidth-2cm,%
  overlay unbroken = {\draw [line width=2pt,decorate,decoration={brace,amplitude=10pt},]%
                     (frame.south west)-- (frame.north west)
                    node [black,midway,left,xshift=-.6cm] {#1};},% 
}

\usepackage{lipsum}
\begin{document}
\begin{lbracebox}{Word}
\lipsum[1]
\end{rbracebox}

\begin{lbracebox}[$P_w$]
\lipsum[1]
\end{rbracebox}
\end{document}

enter image description here

share|improve this answer
    
Do you need the package showframe? Or is it just for testing? –  azetina Apr 26 '13 at 18:14
    
@azetina: Just for testing. :-) –  Marco Daniel Apr 26 '13 at 18:19
add comment

A solution could be the package schemata. The commands \schema or \Schema can print open/close braces (or brackets or parenthesis). These commands can be nested to enclose a test or make tree-like diagrams.

Note that additionally you must enclose each part with no wrapping in a \schemabox to avoid that each part spread to all the text width, instead of fill a minimum (or optionally fixed) width. When wrapping is needed, this can solved including a minipage environment inside the \schemabox.

mwe

\documentclass[10pt]{article}
\usepackage{schemata} % the important package
\usepackage{microtype} % better spacing in narrow paragraph 

% \mytext macro (simple sample text to avoid typing)  
\def\mytext{All work and no play  makes Jack a dull boy. }%

% \idea{width} make paragraphs inside braces diagrams of custom width   
\newcommand{\idea}[1]{
\schemabox{
\begin{minipage}{#1\textwidth}
\mytext \mytext
\end{minipage}
}
}



% Diagram style: Use () or [] instead of {}
% \BoBraces (default)
% \DoParens
% \DoBrackets

\begin{document}


\section*{Jack Torrance's novel structure}

% Introducing hipothesis (normal paragraphs) 
\mytext \mytext \mytext \mytext 

\vspace{3ex}

% SHEMATIC ABSTRACT
\Schema[open]{0ex}{2ex}{\schemabox{Jack}}
{\Schema[close]{0ex}{2ex}{\schemabox{all work\\ no play}}
{\schemabox{dull boy}}} 


% UNDERSTANDING ELEMENTS FROM THE IDEA 
% note that closing parenthesis is smaller (nested) Compare by above.
\vspace{3ex}
\DoParens 
 \schema[open]{\schemabox{All work and no play \\ makes Jack a dull boy}}{\schema[close]{\schemabox{All work\\ and\\no play}}
 {\schemabox{makes Jack a dull boy}}}

\DoBrackets
%
%CONCEPT RELATIONSHIPS FULL EXPLAINED 
% now with braces of equal size
\vspace{3ex}

\Schema[open]{0ex}{8ex}{\idea{.25}}{
\Schema[close]{0ex}{8ex}{\idea{.15}}{\idea{.50}}}

% note that close brace is smaller (nested)

% RAMIFICATIONS OF THE MAIN CONCEPT 
\vspace{3ex}
\DoBraces % return to default

\schema[open]{\idea{.15}}{
\schema[close]{\idea{.25}}{\idea{.50}}
\schema[close]{\idea{.35}}{\idea{.40}}} 

% CONCLUSION (more normal paragraphs)
\vspace{3ex}
 \mytext \mytext \mytext \mytext 

\end{document}
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.