Page Layout ⇒ ruled margins
ruled margins
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.
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
ruled margins
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
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: ruled margins
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.
ruled margins
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}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
ruled margins
Another option would be to modify the leftbar environment. The code for this environment is taken from the source of the package.
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.
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}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: ruled margins
I went with the 2nd option, it's perfect, thankyou!