TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to redefine the chapter headings using some code that I took from a friend. It works fine when I create a dvi and I see it in Okular (it doesn't look fine using Evince), but when I try generate a pdf either with pdflatex or dvipdf, the headings look wrong. I've no idea what the problem can be.

Here is an example. Thanks in advance.



% Title for chapters
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
  \parindent \z@
        \scshape \strut \@chapapp{} \\
        \psboxit{box 0 0 0 setrgbcolor fill}{%
          \vrule depth 8em width 0pt%
          \vrule height 0pt depth 0pt width 10pt%
          {\white \LARGE \bfseries
            \strut \vrule height 1em depth 0pt width 0pt
          \vrule height 0pt depth 0pt width 10pt%
      \advance\hsize by -2cm
      \hrule height 0.4pt depth 0pt width \hsize
      \vskip 6pt%
        \LARGE \bfseries #1
  \vskip 100\p@

Intro here.
share|improve this question
Since your goal is to produce PDF output, I recommend to use TikZ instead of PSTricks. The latter requires to produce DVI and PostScript, but TikZ is capable of directly generating PDF output. Further you could benefit of pdfTeX features. – Stefan Kottwitz Dec 7 '10 at 14:58
Could you explain what you are trying to achieve with this code so that we can suggest a better way to do it for compiling to pdf. I tried to run your MWE, but got a huge black rectangle covering a lot of the page... – Seamus Dec 7 '10 at 15:02
up vote 2 down vote accepted

Here's a possible solution using titlesec and TikZ; the new style for the chapter titles is defined through a command:


  { }{}{0pt}
      blackrec/.style={draw,fill=black,minimum height=3cm,minimum width=0.8cm},%
      remember picture,overlay]
   \node[blackrec] (BS) at (0.5,0) {};
   \node[anchor=north,yshift=-0.3cm] at (BS.north)%
   \node[anchor=south] at (BS.north) {\scshape\chaptername};
   \draw[ultra thick] (1.6,1) -- (\textwidth,1);
   \node[anchor=north,align=left,text width=0.83\textwidth,xshift=6cm,yshift=-0.1cm] at (1,1)    

\chapter{Introduction }



Here's the result (I only include an image for the chapter corresponding to "Introduction"):

share|improve this answer
I tried it and it look great! But it must be noted that this only works with PDFLaTeX. Thanks! – tamalet May 26 '11 at 20:29

Use the memoir class and check the »MemoirChapterStyles« document for the BlueBox (VZ39) chapter style.

share|improve this answer
Thanks for your answers. @Seamus. I'm writing my thesis. I want it to look like this cse.chalmers.se/~russo/russothesis.pdf @Stefan. In the end I need a pdf, but because of some graphics I need to first create a dvi. I will have a look a TikZ any way, thanks. @Thronsten. I will also have a look at memoir, but it's a 200 pages documents based on llncs. Changing the class may not be so easy. – tamalet Dec 12 '10 at 16:24

You could also try using dvips and then converting to PDF; that would give the PSTricks code a chance to run...

share|improve this answer
I tried that but it still looks different. I also tried replacing pstrics with TikZ but I get some errors. In the end I just went with another chapter headings. Thanks everyone for your help. – tamalet Dec 20 '10 at 9:58

Your Answer


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.