1

Can you please help with this problem. Well, i try to make my chapter's heading more intersting and I found a style that I like from Vincent Zoonekynd’s web-page, http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html.

However, when I compile this code, it gives an error: file psboxit.sty not found.

Thank you in advance😊

\documentclass{12pt,a4paper,book}
\usepackage{psboxit,pstcol}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  \reset@font
  \parindent \z@ 
  \vspace*{10\p@}%
  \hbox{%
    \vbox{%
      \hsize=2cm%
      \begin{tabular}{c}
        \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
            \thechapter}%
          \vrule height 0pt depth 0pt width 10pt%
          }
      \end{tabular}%
      }%
    \vbox{%
      \advance\hsize by -2cm
      \hrule height 0.4pt depth 0pt width \hsize
      \par
      \vskip 6pt%
      \hspace{20pt}%
      \parbox{260pt}{%
        \Huge \bfseries #1}%
      }%
    }%
  \vskip 100\p@
}
\def\@makeschapterhead#1{%
  \reset@font
  \parindent \z@ 
  \vspace*{10\p@}%
  \hbox{%
    \vbox{%
      \hsize=2cm%
      \begin{tabular}{c}
        \scshape \strut \phantom{\@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
            \vphantom{\thechapter}}%
          \vrule height 0pt depth 0pt width 10pt%
          }
      \end{tabular}%
      }%
    \vbox{%
      \advance\hsize by -2cm
      \hrule height 0.4pt depth 0pt width \hsize
      \par
      \vskip 6pt%
      \hspace{20pt}%
      \parbox{260pt}{%
        \Huge \bfseries #1}%
      }%
    }%
  \vskip 100\p@
}
\begin{document}
\chapter{Introduction}
\end{document}

enter image description here

  • Your first line should probably be \documentclass[12pt,a4paper]{book}. The package psboxit seems to be outdated. Anyways, as the error tells you, you obviously don’t have it installed. You could download it from CTAN and put it in your working directory. As the package is quite old you could try to solve your problem using pstricks maybe. Or you could have a look at the package titlesec. – Jasper Habicht Aug 23 '18 at 18:45
  • Thank you for your respinse. I tried to find it in CTAN but i didn't succeed – Siham Aug 23 '18 at 21:27
  • Just one strike of Google: ctan.org/pkg/psboxit . – Jasper Habicht Aug 23 '18 at 21:53
  • I actually found this one but i could not upload it. I don't kniw why??? – Siham Aug 23 '18 at 22:29
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Sep 16 '18 at 13:06
2

Probably not the most elegant solution, but maybe a starting point for the wanted format using titlesec.

\documentclass[12pt,a4paper]{book}
\usepackage{titlesec,calc,xcolor,lipsum}

\titleformat{\chapter}[display]{\bfseries}{}{0pt}%
  {\raisebox{-5mm}[0pt][0pt]{%
    \begin{minipage}{20mm}
      \centering{\mdseries\footnotesize\textsc{Chapitre}}\\[2pt]%
      \rule{10mm}{30mm}\hspace{-10mm}%
      \raisebox{25mm}{\parbox{10mm}{\centering\textcolor{white}{\thechapter}}}%
    \end{minipage}}%
  \rule{\textwidth-20mm}{.4pt}\\%
  \hspace*{25mm}}[\vspace*{10mm}]

\begin{document}
\chapter{Introduction}
\lipsum[1]

\end{document}

enter image description here


Edit:

You may want to add a separate format for numberless chapter-like titles:

\titleformat{name=\chapter,numberless}[display]
  {\bfseries}{}{0pt}{\rule{\textwidth}{.4pt}\\%
  \hspace*{5mm}}
  • Thank you so much. Its perfect for me. I will try it in my tex. Thznk you you are the best. – Siham Aug 23 '18 at 21:28
  • I tried your code. The rrsult was good however it was applied even for the table contents and the abstract and aknowledgement. I just want it for the chapters because for abstract i did \ chapter*{abstract} .......how can i fix that N.B my thesis is in frensh . thank you – Siham Aug 23 '18 at 21:36
  • See my edit. You may add a separate formate for “chapters” that are numberless. – Jasper Habicht Aug 23 '18 at 21:49
  • I got a warning " font shape T1 lmr bx sc undefined font using T1/lmr/bx/n instead ???? – Siham Aug 23 '18 at 22:47
  • It means that you don’t have a font that is both bold and has small caps. It will be replaced by the regular bold font. – Jasper Habicht Aug 23 '18 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.