Page Layoutruled margins

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
tiz
Posts: 8
Joined: Tue Aug 11, 2009 6:10 pm

ruled margins

Post by tiz »

Does anyone know if it's possible to create ruled margins in a document?

I'm writing up my thesis and I want to have the main story running through it but with large blocks of text inserted that are noticably different to the main text explaining certain aspects as I go (sounds confusing I know but it's the only way I can persuade it to make any sense). So far all I've managed is to do the inserts with narrower margins but given that they sometimes run over several pages it makes it hard to tell that they're any different to the main text, also some environments (proposition for example) just go straight back to the normal text width in the middle anyway. I thought a nice double ruled margin on the left next to the insert text would make it really clear but I can't work out if that's even possible.

If ruled margins aren't possible I'm open to any suggestions as to how to achieve distincively different blocks of text. There is a lot of maths in both types of text so it needs to be able to cope with that.

Any help would be very much appreciated.

Tiz.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

ruled margins

Post by localghost »

Perhaps the framed package can be useful. It offers the leftbar environment. Since it has no manual, you have to look at the STY file itself.


Best regards
Thorsten
tiz
Posts: 8
Joined: Tue Aug 11, 2009 6:10 pm

Re: ruled margins

Post by tiz »

You're a genius!
Thankyou!
tiz
Posts: 8
Joined: Tue Aug 11, 2009 6:10 pm

Re: ruled margins

Post by tiz »

Back again! The line is perfect but a bit on the attention grabbing side. Would it be possible to change the colour of the line at all? Ideally to a nice light grey but a pale colour that will print as light grey in B&W would do.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

ruled margins

Post by frabjous »

The below works for me:

Code: Select all

\documentclass{article}
\usepackage{xcolor}
\usepackage{framed}

% modify 0.7 higher for a lighter shade of gray, 
% or lower for a darker shade
\newcommand{\grayleftbar}[1]{\textcolor[gray]{0.7}{%
    \begin{leftbar}\textcolor{black}{#1}\end{leftbar}}}                                                

\begin{document}
\grayleftbar{%
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 
\begin{equation}
  a=b
\end{equation}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

ruled margins

Post by localghost »

Another option would be to modify the leftbar environment. The code for this environment is taken from the source of the package.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{babel}
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{blindtext}

\colorlet{shadecolor}{gray!25}   % you may try 'blue' here
\renewenvironment{leftbar}{%
  \def\FrameCommand{\textcolor{shadecolor}{\vrule width 3pt} \hspace{10pt}}%
  \MakeFramed {\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}

\begin{document}
  \begin{leftbar}
    \blindtext
  \end{leftbar}
\end{document}
The color 'shadecolor' determines also the color for the shaded environment which is provided by this package, too. Just in case you want to use that environment at other places.
tiz
Posts: 8
Joined: Tue Aug 11, 2009 6:10 pm

Re: ruled margins

Post by tiz »

I went with the 2nd option, it's perfect, thankyou!
Post Reply