General ⇒ Create a fancy section heading layout?
Create a fancy section heading layout?
Hi!
I have a bit of a problem and wonder if anyone can help me.. I found a very nice document layout, like the one found at "http://www-ra.phys.utas.edu.au/~jsteven ... s_p103.jpg" (The chapter number is large, colored and above the chapter title). This layout is meant for the documentclass "book". (The code for the style is found at "http://www-ra.phys.utas.edu.au/~jsteven ... style.html"). I wonder if anyone knows how to get the same style for the documentclass "article"? Since there are no chapters in articles, I'm trying to get the style to work on section headings instead, i.e. the section heading should be the same with the section number large and colored, above the section title. I've tried for hours without result! =( Does anyone have some tips how to change the section headings to some fancy layout, I'd be really grateful! Cheers!
/Ida
I have a bit of a problem and wonder if anyone can help me.. I found a very nice document layout, like the one found at "http://www-ra.phys.utas.edu.au/~jsteven ... s_p103.jpg" (The chapter number is large, colored and above the chapter title). This layout is meant for the documentclass "book". (The code for the style is found at "http://www-ra.phys.utas.edu.au/~jsteven ... style.html"). I wonder if anyone knows how to get the same style for the documentclass "article"? Since there are no chapters in articles, I'm trying to get the style to work on section headings instead, i.e. the section heading should be the same with the section number large and colored, above the section title. I've tried for hours without result! =( Does anyone have some tips how to change the section headings to some fancy layout, I'd be really grateful! Cheers!
/Ida
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Create a fancy section heading layout?
The code uses a package called psboxit, which was developed for LaTeX2.09 and therefore must be considered obsolete. A similar style could be achieved by combining the quotchap and the titlesec package. After reading the related documentations, feel free to ask further questions.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Create a fancy section heading layout?
Hi Thorsten, and thank you for helping me out!localghost wrote:The code uses a package called psboxit, which was developed for LaTeX2.09 and therefore must be considered obsolete. A similar style could be achieved by combining the quotchap and the titlesec package. After reading the related documentations, feel free to ask further questions.
Best regards
Thorsten
I've tried to look in quotchap.sty to get some ideas, but since I'm a newbie when it comes to LaTex, I didn't completely succeed.. I've written my own sty-file to do what I want, and it looks like:
Code: Select all
\RequirePackage[calcwidth]{titlesec}
\RequirePackage{color}
\definecolor{seccol}{rgb}{0,0.8,0.3}
\titleformat{\section}[hang]{\sffamily\bfseries}
{\color{seccol}\Huge\thesection}{0pt}{\linebreak\huge\raggedleft}[{\titlerule[0.5pt]}]
Ida
Re: Create a fancy section heading layout?
Hi all,
I have a question, using the section format posted above how do you make colorbox around the section name?
Thanks
I have a question, using the section format posted above how do you make colorbox around the section name?
Thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Create a fancy section heading layout?
At the moment I have no idea. But perhaps you find some useful hints in the documentation of the titlesec package.Hamed wrote:Hi all,
I have a question, using the section format posted above how do you make colorbox around the section name?
Thanks
Best regards and welcome aboard
Thorsten
Just replace the \Huge command in your definition of the section format by the following sequence, which works fine for me.idaham wrote:[...] Although, the section number is too small (\Huge here), and when I try to change it to something bigger, using ex. \fontsize it doesn't work! I've also tried to change the font of the section number (number only, not the section title!), without any success... Should I write those commands somewhere around where I added the \color command? [...]
Code: Select all
\fontsize{36}{42}\selectfont
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Create a fancy section heading layout?
Just replace the \Huge command in your definition of the section format by the following sequence, which works fine for me.idaham wrote:[...] Although, the section number is too small (\Huge here), and when I try to change it to something bigger, using ex. \fontsize it doesn't work! I've also tried to change the font of the section number (number only, not the section title!), without any success... Should I write those commands somewhere around where I added the \color command? [...]
Code: Select all
\fontsize{36}{42}\selectfont
Hello again Thorsten and thanks for all your help!
I've tried your suggestion with \fontsize{36}{42}\selectfont, which works fine. The problem is that I want an even bigger size, say 100 or something. The size doesn't seem to get any larger than 40. The weird thing is that this command is the same as the one defined in quotchap.sty:
Code: Select all
\usefont{T1}{\@defaultcnfont}{b}{n}\fontsize{150}{130}\selectfont%
\color{chaptergrey}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Create a fancy section heading layout?
Hi Ida,
try the fix-cm package:
Stefan
try the fix-cm package:
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{fix-cm}
\begin{document}
\fontsize{100}{120}\selectfont Huge text
\end{document}
LaTeX.org admin
Create a fancy section heading layout?
Stefan, you're a lifesaver!Stefan_K wrote:Hi Ida,
try the fix-cm package:StefanCode: Select all
\documentclass[a4paper,10pt]{article} \usepackage{fix-cm} \begin{document} \fontsize{100}{120}\selectfont Huge text \end{document}
This worked perfectly! I don't know how long I've been trying to get it to work without succeeding... Thank you so much! Cheers,
Ida
PS. If anyone is interested in this section style, here's the code for my sty-file:
Code: Select all
\RequirePackage[calcwidth]{titlesec}
\RequirePackage{color}
\usepackage{fix-cm}
\definecolor{seccol}{rgb}{0,0.8,0.3} % This is a kind of greenish color... you can define the exact color you want here!
\titleformat{\section}[hang]{\sffamily\bfseries}{
\fontsize{100}{100}\selectfont\color{seccol}\thesection}{0pt}{\linebreak\huge\raggedleft}[{\titlerule[0.5pt]}]
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Create a fancy section heading layout?
You should get the desired result with any postscript font, too. Just try some font packages from the CTAN Catalogue.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10