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.

Is there one package to produce frames looking like the one above in the following ASCII example ? I don't want dashed lines.

                                              |
                                          ----+--
      Bla, bla, bla, bla, bla, bla, bla, ...  |
      Bla, bla, bla, bla, bla, bla, bla, ...  |
      Bla, bla, bla, bla, bla, bla, bla, ...
      Bla, bla, bla, bla, bla, bla, bla, ...
   |  Bla, bla, bla, bla, bla, bla, bla, ...
   |  Bla, bla, bla, bla, bla, bla, bla, ...
 --+----
   |

PRECISION : I'm looking for something working like standard frames for paragraphs.

share|improve this question
    
I believe that the geometry package has a showcrop option. There is also a crop pacakge. –  Peter Grill Oct 29 '11 at 22:52
1  
Maybe TikZ ? :P –  percusse Oct 29 '11 at 22:54
    
Could you clarify: is that a representation of a page with crop marks, or a paragraph with an unusual "frame" within the page boundaries? –  Brent.Longborough Oct 29 '11 at 23:02
    
Tht's been done... –  projetmbc Oct 29 '11 at 23:24

4 Answers 4

up vote 20 down vote accepted

You can define your own environment to add the frame; you can do something along these lines:

\documentclass{article}
\usepackage{lipsum} % just to generate text for the example

\newenvironment{MyFrame}
  {\par\hfill\rlap{\kern-0.5cm\rule{1cm}{0.4pt}\kern-0.2cm\rule[-0.8cm]{0.4pt}{1cm}}%
    \vskip-\baselineskip}
  {\par\kern-0.5cm\hskip-0.9cm\rule{0.4pt}{1cm}\kern-0.2cm\rule[0.2cm]{1cm}{0.4pt}\par}

\begin{document}

\begin{MyFrame}
\lipsum*[1]
\end{MyFrame}

\end{document}

enter image description here

Using the help of the xparse package is easy to define a more sophisticated version of the MyFrame environment (this idea was suggested by Werner in a comment); in the following example, the new environment will have six optional arguments; the syntax is

\begin{MyFrame}[<length>][<rule thick.>][<hor. sep.>][<color>][<factor>][<vert. sep.>]
<contents>
\end{MyFrame}

where <length> controls the length of the rules used (default=1cm), <rule thick.> controls the "thickness" of the rules (defualt=0.4pt), <hor. sep.> controls the horizontal distance between the rules and the text (default=0.8cm), <color> allows you to select, with the help of the xcolor package, the color for the rules (default=black), <factor> is a number controlling the point of intersection of each pair of rules used for the frame (default=3), and <ver. sep.> controls the vertical distance between the rules and the text (default=2ex). Play with the values and you'll get some interesting frames. A little example:

\documentclass{article}
\usepackage{xparse}
\usepackage{xcolor}

\newcommand\Text{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra
metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices.}% just to generate text for the example

\DeclareDocumentEnvironment{MyFrame}{O{1cm}O{0.4pt}O{0.8cm}O{black}O{3}O{2ex}}
  {\par\hfill\rlap{%
      \bgroup\color{#4}%
      \hskip-\dimexpr#1-#3\relax\rule{#1}{#2}%
      \hskip-\dimexpr#1/#5\relax\rule[-\dimexpr#1-\dimexpr#1/#5\relax]{#2}{#1}%
      \egroup
    }%
   \vskip-\dimexpr#1/#5+\dimexpr#1/#5-#6\relax%
  }
  {\par\nobreak\offinterlineskip\vskip-\dimexpr#1/#5+\dimexpr#1/#5-#6\relax\noindent%
      \hskip-#3\bgroup\color{#4}%
      \rule{#1}{#2}\hskip-\dimexpr#1-\dimexpr#1/#5-#2\relax%
      \rule[-\dimexpr#1/#5-#2\relax]{#2}{#1}\egroup\par
  }

\begin{document}

\begin{MyFrame}
\Text
\end{MyFrame}

\begin{MyFrame}[3cm][4pt][1.5cm][red!60]
\Text
\end{MyFrame}

\begin{MyFrame}[1.5cm][2pt][1.3cm][blue][2][8ex]
\Text
\end{MyFrame}

\begin{MyFrame}[1cm][7pt][0.6cm][olive!60][4][0ex]
\Text
\end{MyFrame}

\end{document}

enter image description here

As requested in one comment, here's the definition of the \MyFrame environment (with the same six optional arguments) required for producing a four-corner version of the frame:

\DeclareDocumentEnvironment{MyFrame}{O{1cm}O{0.4pt}O{0.8cm}O{black}O{3}O{2ex}}
  {\par\noindent\hskip-#3\bgroup\color{#4}%
      \rule{#1}{#2}\hskip-\dimexpr#1-\dimexpr#1/#5-#2\relax%
      \rule[-\dimexpr#1-\dimexpr#1/#5\relax]{#2}{#1}\egroup
      \hfill\rlap{%
        \bgroup\color{#4}%
        \hskip-\dimexpr#1-#3\relax\rule{#1}{#2}%
        \hskip-\dimexpr#1/#5\relax\rule[-\dimexpr#1-\dimexpr#1/#5\relax]{#2}{#1}%
        \egroup
    }%
   \vskip-\dimexpr#1/#5+\dimexpr#1/#5-#6\relax%
  }
  {\par\nobreak\offinterlineskip\vskip-\dimexpr#1/#5+\dimexpr#1/#5-#6\relax\noindent%
      \hskip-#3\bgroup\color{#4}%
      \rule{#1}{#2}\hskip-\dimexpr#1-\dimexpr#1/#5-#2\relax%
      \rule[-\dimexpr#1/#5-#2\relax]{#2}{#1}\egroup
      \hfill\rlap{%
        \bgroup\color{#4}%
        \hskip-\dimexpr#1-#3\relax\rule{#1}{#2}%
        \hskip-\dimexpr#1/#5\relax\rule[-\dimexpr#1/#5-#2\relax]{#2}{#1}%
        \egroup
    }%
  \par
}

And the following code (same preamble as before)

\begin{MyFrame}
\Text
\end{MyFrame}\vskip\baselineskip

\begin{MyFrame}[1.5cm][3pt][1cm][red!60][4][5.5ex]
\Text
\end{MyFrame}\vskip\baselineskip

\begin{MyFrame}[1cm][7pt][0.6cm][olive!60][4][0ex]
\Text
\end{MyFrame}

now produces the following result:

enter image description here

share|improve this answer
    
Is it possible to make MyFrame take arguments so that you can modify (say) the distance outside the margin, the width of the rule, and the length of the rule? Something to the effect of \begin{MyFrame}[<width>][<thickness>][<length>], all being optional with some default value as in your example. –  Werner Oct 30 '11 at 0:38
1  
@Werner: yes, or course; see my updated answer. Now you can control the distance outside the margin, the width of the rules, their length, and three more attributes. Thanks for suggesting this improvement. –  Gonzalo Medina Oct 30 '11 at 3:41
    
That's awesome! I guess one final miracle would be if these paragraph decorations would not influence \parskip, thereby leaving the natural gap between paragraphs. –  Werner Oct 30 '11 at 4:02
    
That's wonderfull ! Thanks a lot Gonzalo. One last question, what are the changes to make so as to have a four corners version ? –  projetmbc Oct 30 '11 at 10:49
    
@projetmbc: see my updated answer. –  Gonzalo Medina Oct 31 '11 at 1:47

Try my new crbox package:

\documentclass{minimal}
\usepackage{crbox}
\setlength{\fboxsep}{10pt}
\begin{document}
\crbox{\parbox{0.8\textwidth}{
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy tex
}}

\bigskip
\crbox[curved]{\parbox{0.8\textwidth}{
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy tex
}}

\bigskip
\crbox[hollowcurved]{\parbox{0.8\textwidth}{
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy tex
}}
\end{document}

and this is the output:

enter image description here

share|improve this answer
    
Thanks. The problem is that I'm no searching for that kind of outputs. –  projetmbc Oct 30 '11 at 9:51

Here is an example using the crop package:

enter image description here

\documentclass[a5paper]{article}
\usepackage[a4,center]{crop}
\usepackage{lipsum}

\crop[cross,noinfo]

\begin{document}
\lipsum[1]
\end{document}

For the case where you only want specific marks to be shown, you can use the \cropdef command to disable the unwanted marks.


And with the geometry package:

enter image description here

\documentclass{article}
\usepackage[showcrop,
papersize={8.5in,11.0in},
layoutsize={6.5in,9.0in},layoutoffset=1.0in
]{geometry}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\end{document}

Note that you need to specify the layout size smaller than paper size to see the crop marks.

share|improve this answer
    
Sorry, I've edited my question. I have been searching for one solution working with pargraphs. –  projetmbc Oct 30 '11 at 9:53

You could also use tabular:

\documentclass{article}

\begin{document}
\begin{tabular}{ccp{10pt}cp{10pt}cc}
 & \vline & & & & & \\
\cline{1-3}
 & \vline & & & & & \\
 & \vline & & Bla, bla, bla, bla, bla, bla, bla & & & \\
 & \vline & & Bla, bla, bla, bla, bla, bla, bla & & & \\
 & & & Bla, bla, bla, bla, bla, bla, bla & & & \\
 & & & Bla, bla, bla, bla, bla, bla, bla & & & \\
 & & & Bla, bla, bla, bla, bla, bla, bla & & & \\
 & & & Bla, bla, bla, bla, bla, bla, bla & & \vline & \\
 & & & Bla, bla, bla, bla, bla, bla, bla & & \vline & \\
 & & & & & \vline & \\
\cline{5-7}
 & & & & & \vline & \\
\end{tabular} 
\end{document}

But @Gonzalo Medina's answer is much more elegant.

enter image description here

share|improve this answer
    
Thanks, even if I prefere the solution of Gonzalo. –  projetmbc Oct 30 '11 at 9:54

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.