I'm new in Latex and I need some Help:
I want to create an environment or a command, drawing me a sidebar beside my text, equation or graphic on the outside of my page.
I've found a solution to draw a sidebar, which continues over Pages, and I'm also able to change the side of the bar:
Code: Select all
\documentclass[a5paper,10pt,twoside,]{scrbook}
\usepackage[left=2cm,right=1.5cm,top=1cm,bottom=0.5cm,includeheadfoot]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{lipsum}
\usepackage{framed}
\usepackage{mdframed}
\newmdenv[topline=false,rightline=false,bottomline=false,leftline=true]{leftb}
\newmdenv[topline=false,rightline=true,bottomline=false,leftline=false]{rightb}
\newlength{\leftbarwidth}
\setlength{\leftbarwidth}{2pt}
\newlength{\leftbarsep}
\setlength{\leftbarsep}{5pt}
\usepackage{ifthen}
\newenvironment{Beispiel}
{
\begin{leftb}
\begin{addmargin}[0cm]{0cm}
}
{
\end{addmargin}
\end{leftb}
}
\begin{document}
\begin{Beispiel}
\lipsum[1-7]
\end{Beispiel}
\end{document}
Code: Select all
\usepackage{ifthen}
\newcounter{pl}
\newcounter{pl2}
\newenvironment{Testd}
{
\stepcounter{pl}\label{pl-\thepl}%
\ifthenelse{\isodd{\pageref{pl-\thepl}}}%
{\begin{leftb}}
{\begin{rightb}}
}
{
\stepcounter{pl2}\label{pl2-\thepl2}%
\ifthenelse{\isodd{\pageref{pl2-\thepl2}}}%
{\end{leftb}}
{\end{rightb}}
When the Text goes over two Pages, the environment will get in trouble because it want to end the environment with the wrong \end
Does anybody got a solution? Sorry for my english and thanks for Help

EDIT:
So far, I try to figure out a way to draw a vertical line with tikz behind the text. My Question is: Is there an option to use the start of my environment (\begin{Beispiel}) as the first height-position-point of my line an the end of my environment as the second height-position-point ?
Once again:
My problem is:
I want to get a line on the outer side of my text (book)