LaTeX forum ⇒ Text FormattingBox around the title is broken

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Box around the title is broken

Postby latexforever » Thu Sep 24, 2009 4:37 pm

Hello,

When using the Rejne fncychap's parameter, my \chapter boxes are partly broken.

Here is a MWE:

  1. \documentclass[10pt,a4paper,twoside,final,makeidx,openright]{book}
  2.  
  3. \usepackage[latin1]{inputenc}
  4. \usepackage[frenchb,english]{babel}
  5.  
  6. \usepackage{rotating}
  7. \usepackage{lscape}
  8. \usepackage[Rejne]{fncychap}
  9.  
  10.  
  11. \begin{document}
  12.  
  13. \begin{landscape}
  14. \chapter{Dummy Chapter}
  15. Dummy text.
  16. \end{landscape}
  17.  
  18. \end{document}


What can I do? Thanks.

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

Postby gmedina » Thu Sep 24, 2009 4:50 pm

Hi,

do you intend to write all your document in landscape format? If this is so, then you could load the geometry package with the landscape option:

  1. \documentclass{book}
  2. \usepackage[landscape]{geometry}
  3. \usepackage[Rejne]{fncychap}
  4.  
  5.  
  6. \begin{document}
  7.  
  8. \chapter{Dummy Chapter}
  9. Dummy text.
  10.  
  11. \end{document}


By the way, makeidx is not a class option; you can delete it from this line:

  1. \documentclass[10pt,a4paper,twoside,final,makeidx,openright]{book}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

User avatar
Stefan Kottwitz
Site Admin
Posts: 9604
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Sep 24, 2009 5:05 pm

Just in case, if you really want to use the landscape environment you could use this workaround after loading fncychap:
  1. \let\oldDOTI\DOTI
  2. \renewcommand*\DOTI[1]{\setlength{\textwidth}{\linewidth}\oldDOTI{#1}}


If the complete document should be in landscape format I agree with gmedina.

Stefan
LaTeX.org admin

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

Postby gmedina » Thu Sep 24, 2009 5:15 pm

Another option, if the landscape environment must be used (i.e., if not the totality of the document shoud be in landscape format), is to use the titlesec package to imitate the Rejne style for chapters[1]. The code looks something like the following:

  1. \documentclass{book}
  2. \usepackage{lscape}
  3. \usepackage{titlesec}
  4.  
  5. \titleformat{\chapter}[frame]
  6. {\normalfont}
  7. {\filcenter\enspace{\Huge\thechapter}\enspace\filcenter}
  8. {35pt}
  9. {\Huge\filcenter}
  10. \titlespacing*{\chapter}
  11. {0pt}{50pt}{65pt}
  12.  
  13. \begin{document}
  14.  
  15. \begin{landscape}
  16. \chapter{Dummy Chapter}
  17. Dummy text.
  18. \end{landscape}
  19.  
  20. \end{document}


[1] In fact, the titlesec package allows the user to easily define the styles predefined by the fncychap package, and besides, you can create a wide variety of new styles.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Postby latexforever » Thu Sep 24, 2009 5:24 pm

Thanks for all your answers. My problem is now solved. I used
  1. \let\oldDOTI\DOTI
  2. \renewcommand*\DOTI[1]{\setlength{\textwidth}{\linewidth}\oldDOTI{#1}}
, as suggested by Stefan. I saved the other solutions too.

(I did not want my whole document to be in landscape format.)


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests