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 am using the changebar package to display a sideline along certain paragraphs for stylistic reasons.

The default behavior of changebar seems to be to show the sideline alongside footnotes as well as the paragraphs. I was wondering if there was an easy way to (i) show the sidebar along a paragraph in the body of the text while (ii) not showing the sidebar alongside in the footnotes of the paragraph.

I know I can insert \cbend before the start of each footnote and \cbstart after it, but the text I am working with is around 70 pages long and this seems like a rather cumbersome method, so I was wondering if there was an easier way to accomplish this.

In terms of code: is there an easy way to display the changebar alongside the main paragraph, but not alongside footnotes 1 and 2, without manually inserting cbstart/cbend around footnotes?

Example:

\documentclass{article}
\usepackage{changebar}
\begin{document}
\section{Intro}

{\cbstart}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor mauris id tortor interdum pharetra\footnote{This is the first footnote.}. Vestibulum sagittis facilisis augue quis viverra. Aenean gravida 
rutrum leo, vel tincidunt neque feugiat et. Morbi eu nulla nec lorem tristique viverra. Praesent nec odio at felis aliquet vestibulum vel a risus. Fusce quam est, eleifend et rutrum et, malesuada non ante. Class aptent taciti 
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pellentesque justo id sapien consequat dictum vel in sem. Fusce volutpat, diam eu egestas egestas, neque leo adipiscing velit, non fermentum 
erat purus eu nisl. Vestibulum vitae venenatis augue. Fusce tellus velit, aliquet non bibendum commodo, vulputate sed ipsum. Proin mollis\footnote{This is the second footnote.} bibendum tellus, porta sagittis ante lobortis quis. 
Cras neque elit, sollicitudin at tincidunt et, eleifend ac dui. Maecenas id metus sit amet velit ullamcorper mattis at sollicitudin neque. Sed ut euismod augue.{\cbend}
\end{document}
share|improve this question
    
You should use \footnotemark inside the \cbstart ... \cbend group, and then \footnotetext outside it. Does that work for you? –  Werner May 14 '12 at 17:22
    
Thanks for this. This is an improvement, although it would still require quite a bit of manual re-arranging of the file (but it is easier than to bracket out all footnotes with cbstart/cbends). I was wondering if there is a way to do this automatically for the entire document without having to edit individual footnote markers (Sorry if this was not entirely clear). –  swrichards May 14 '12 at 18:28
    
It should be possible to collect the footnotes within the \cb... block and process them at the end (at \cbend). That would require a little work though, but I'll look into it. –  Werner May 14 '12 at 18:51

1 Answer 1

up vote 8 down vote accepted

The changebar package internally uses \ltx@footnotetext (a replacement of the kernel \@footnotetext command) to include the bar if changebars are active, and if so, wraps the the footnote text in changebars. To "reverse" this behaviour, the following reassignment will do the job:

\documentclass{article}
\usepackage[paperheight=10cm]{geometry}% just for the example
\usepackage{changebar}

\makeatletter
\let\@footnotetext\ltx@footnotetext
\makeatother

\begin{document}

\section{Intro}

{\cbstart}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor mauris id tortor interdum pharetra\footnote{This is the first footnote.}. Vestibulum sagittis facilisis augue quis viverra. Aenean gravida 
rutrum leo, vel tincidunt neque feugiat et. Morbi eu nulla nec lorem tristique viverra. Praesent nec odio at felis aliquet vestibulum vel a risus. Fusce quam est, eleifend et rutrum et, malesuada non ante. Class aptent taciti 
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pellentesque justo id sapien consequat dictum vel in sem. Fusce volutpat, diam eu egestas egestas, neque leo adipiscing velit, non fermentum 
erat purus eu nisl. Vestibulum vitae venenatis augue. Fusce tellus velit, aliquet non bibendum commodo, vulputate sed ipsum. Proin mollis\footnote{This is the second footnote.} bibendum tellus, porta sagittis ante lobortis quis. 
Cras neque elit, sollicitudin at tincidunt et, eleifend ac dui. Maecenas id metus sit amet velit ullamcorper mattis at sollicitudin neque. Sed ut euismod augue.{\cbend}

\end{document}

enter image description here

If this is also the desired behaviour for footnotes inside a minipage, a similar reassignment for \@mpfootnotetext will be necessary:

\documentclass{article}
\usepackage[paperheight=18cm]{geometry}% just for the example
\usepackage{changebar}

\makeatletter
\let\@footnotetext\ltx@footnotetext
\let\@mpfootnotetext\ltx@mpfootnotetext
\makeatother

\begin{document}

\section{Intro}

\noindent\begin{minipage}{\textwidth}
{\cbstart}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor mauris id tortor interdum pharetra\footnote{This is the first footnote.}. Vestibulum sagittis facilisis augue quis viverra. Aenean gravida 
rutrum leo, vel tincidunt neque feugiat et. Morbi eu nulla nec lorem tristique viverra. Praesent nec odio at felis aliquet vestibulum vel a risus. Fusce quam est, eleifend et rutrum et, malesuada non ante. Class aptent taciti 
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pellentesque justo id sapien consequat dictum vel in sem. Fusce volutpat, diam eu egestas egestas, neque leo adipiscing velit, non fermentum 
erat purus eu nisl. Vestibulum vitae venenatis augue. Fusce tellus velit, aliquet non bibendum commodo, vulputate sed ipsum. Proin mollis\footnote{This is the second footnote.} bibendum tellus, porta sagittis ante lobortis quis. 
Cras neque elit, sollicitudin at tincidunt et, eleifend ac dui. Maecenas id metus sit amet velit ullamcorper mattis at sollicitudin neque. Sed ut euismod augue.{\cbend}
\end{minipage}

\vfill

{\cbstart}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor mauris id tortor interdum pharetra\footnote{This is the first footnote.}. Vestibulum sagittis facilisis augue quis viverra. Aenean gravida 
rutrum leo, vel tincidunt neque feugiat et. Morbi eu nulla nec lorem tristique viverra. Praesent nec odio at felis aliquet vestibulum vel a risus. Fusce quam est, eleifend et rutrum et, malesuada non ante. Class aptent taciti 
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pellentesque justo id sapien consequat dictum vel in sem. Fusce volutpat, diam eu egestas egestas, neque leo adipiscing velit, non fermentum 
erat purus eu nisl. Vestibulum vitae venenatis augue. Fusce tellus velit, aliquet non bibendum commodo, vulputate sed ipsum. Proin mollis\footnote{This is the second footnote.} bibendum tellus, porta sagittis ante lobortis quis. 
Cras neque elit, sollicitudin at tincidunt et, eleifend ac dui. Maecenas id metus sit amet velit ullamcorper mattis at sollicitudin neque. Sed ut euismod augue.{\cbend}

\end{document}

enter image description here

share|improve this answer
    
That did the trick: many thanks! –  swrichards May 14 '12 at 21:27

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.