4

I have a very long document with a large number of tables in the appendices. These tables were a tad wide, so I change the page layout to landscape using the landscape command. To make it readable by humans, I include the pdflscape package which kindly rotates the pages when viewed on a computer screen.

Now, I'm trying to do change-bars using latexdiff and it seems to not care much for landscape pages. The bar doesn't actually seem to line up with anything (in fact, it seems to not even be visible if there are lengthy footers). I'm wondering if there is a clever solution to this problem - perhaps adjusting margins?

I tried looking through the documentation for pdflscape and nothing is sticking out to me for this one.

MWE:

\documentclass[11pt]{article}
\usepackage[letterpaper,portrait,left=1in,right=1.5in,top=1.5in,bottom=1in,headheight=1in,headsep=.5in]{geometry}
\usepackage[pdftex,traceon,rightbars]{changebar}
\usepackage{pdflscape}

\begin{document}
\cbstart{I have correct changebar.}\cbend
\begin{landscape}
\cbstart{I do not have correct changebars}\cbend
\end{landscape}
\end{document}
5
  • \cbstart does not take a required argument - only an optional one. outerbars and rightbars are inconsistent. (This doesn't solve the problem - it just improves the coherence.)
    – cfr
    Commented Oct 28, 2015 at 3:10
  • Right, \cbstart doesn't take any arguments - the braces were just to be consistent with how \DIFadd works with latexdiff. Good catch on outerbars - I misread that section of the manual. Commented Oct 28, 2015 at 3:44
  • I wouldn't mind overriding the \changebarsep to some hard-coded value that pushes the bars to the correct place, but it seems that this can only be set once in the preamble? Not sure why, because \changebarwidth can be changed anywhere... Any idea why? Commented Oct 29, 2015 at 1:04
  • Did you ever find a better solution than the one proposed by touhami below?
    – FRob
    Commented Jun 8, 2020 at 17:09
  • @FRob I'm no longer on that project, but we were satisfied with the provided solution. Commented Jun 9, 2020 at 7:29

1 Answer 1

2
+50

Here is a solution.

Edit here is with the original settings

\documentclass[11pt]{article}
\usepackage[pdftex,traceon,rightbars]{changebar}
\usepackage{pdflscape}

\usepackage{blindtext} 

\begin{document} 
\cbstart{I have correct changebars}\cbend

\begin{landscape}
\addtolength{\changebarsep}{\hsize}
\makeatletter\cb@positions\makeatother

\cbstart{I have correct changebars}\cbend 
\blindtext

\end{landscape}
\makeatletter\cb@positions\makeatother

\cbstart{I have correct changebars}\cbend 
\blindtext 
\end{document}

and this with typearea package

\documentclass[11pt]{article}
\usepackage{typearea}
\usepackage[pdftex,traceon,rightbars]{changebar}

\makeatletter
\newenvironment{landscape}{%
\KOMAoptions{paper=landscape,DIV=last}
\cb@positions}{%
\KOMAoptions{paper=portrait,DIV=last}
\cb@positions}
\makeatother 

\usepackage{blindtext} 

\begin{document} 
\cbstart{I have correct changebars}\cbend
\blindtext 

\begin{landscape}
\cbstart{I have correct changebars}\cbend 
\blindtext
\end{landscape}

\cbstart{I have correct changebars}\cbend 
\blindtext 
\end{document}
6
  • When I compile that, the landscape page isn't really landscape... it looks like the text box is landscape but the paper remains portrait. Commented Oct 30, 2015 at 23:00
  • you don't want it like this? I think it's better. I will see.
    – touhami
    Commented Oct 30, 2015 at 23:08
  • I mean, the text and bars are off the edge and can't be seen when viewing the PDF. But ideally the landscape functionality from original example since the final document will be printed, and it has headers/footers. Commented Oct 31, 2015 at 0:06
  • @JacobSchaer answer edited
    – touhami
    Commented Oct 31, 2015 at 0:27
  • I'm going to test more on Monday and mark this as the answer if I don't find anything. So far it looks to be working with everything I have. I did notice that loading the pdflscape package before the changebar package will cause the landscape pages to not work correctly, so that was part of my problem during earlier testing. Commented Oct 31, 2015 at 2:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .