LaTeX forum ⇒ Page LayoutProblem with the color of the separating line!

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
kunigami
Posts: 9
Joined: Mon Feb 16, 2009 8:27 pm

Problem with the color of the separating line!

Postby kunigami » Tue Feb 17, 2009 4:38 am

Hi all,

I'm using the following configuration for a document:

  1. \documentclass[landscape,twocolumn,letterpaper]{article}
  2. \usepackage{color}
  3. \setlength{\columnseprule}{0.5pt} % default=0pt (no line)


But the separating line is colored yellow. If I don't include the color package it stays black. I'd like to know if there's a way to change the separating line color, like I did with its width.

Thanks,

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Postby gmedina » Wed Feb 18, 2009 2:58 am

Hi,

the following solution involves a change in the definition of \@outputdblcol. The code below illustrates this approach; I marked the one line that had to be changed with a comment showing the original setting:
  1. \documentclass[landscape,twocolumn,letterpaper]{article}
  2. \usepackage{xcolor}
  3. \usepackage{lipsum}%just to generate some text
  4.  
  5. \makeatletter
  6. \def\@outputdblcol{%
  7. \if@firstcolumn
  8. \global \@firstcolumnfalse
  9. \global \setbox\@leftcolumn \box\@outputbox
  10. \else
  11. \global \@firstcolumntrue
  12. \setbox\@outputbox \vbox {%
  13. \hb@xt@\textwidth {%
  14. \hb@xt@\columnwidth {%
  15. \box\@leftcolumn \hss}%
  16. \hfil
  17. {\color{blue}\vrule \@width\columnseprule}%original:
  18. %\normalcolor\vrule \@width\columnseprule
  19. \hfil
  20. \hb@xt@\columnwidth {%
  21. \box\@outputbox \hss}%
  22. }%
  23. }%
  24. \@combinedblfloats
  25. \@outputpage
  26. \begingroup
  27. \@dblfloatplacement
  28. \@startdblcolumn
  29. \@whilesw\if@fcolmade \fi
  30. {\@outputpage
  31. \@startdblcolumn}%
  32. \endgroup
  33. \fi
  34. }
  35. \makeatother
  36. \setlength\columnseprule{1pt}
  37.  
  38. \begin{document}
  39.  
  40. \lipsum[1-20]
  41.  
  42. \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

kunigami
Posts: 9
Joined: Mon Feb 16, 2009 8:27 pm

Postby kunigami » Wed Feb 18, 2009 8:24 pm

Wow! Thanks a lot! That worked fine.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 7 guests