CalPolyCSC / thesis-template

A LaTeX template for Cal Poly Master's theses which conforms to the guidelines given by the graduate education department.
MIT License
52 stars 59 forks source link

Question: How to make the section numbers appear in chapter body #16

Closed yabberyabber closed 6 years ago

yabberyabber commented 6 years ago

Is there a way to make the section numbers appear next to the section in the document body? Looking through ucthesis.cls it looks like I can turn on some mark but the code is extremely dense.

Right now when I type

\section{Type Qualifiers on the Call Graph}

I get something that looks like the following:

Type Qualifiers on the Call Graph

but I would really prefer if it would show something like the following:

2.2 Type Qualifiers on the Call Graph

Is there a way I can tell the section command that I'd like to see the number?

AndrewGuenther commented 6 years ago

Just going to chime in here so it doesn't look like this repo is dead.

I don't know how to do this personally, but I am sure there is a way. Is this something requested by the thesis format guide, or just personal taste?

yabberyabber commented 6 years ago

This is not mentioned in the thesis formal guide; it's just personal taste. I've seen it in other UC theses so I'll keep looking around to see how they do it. I'll follow up here if I find out how to do it :+1:

yabberyabber commented 6 years ago

I've found a solution although I'm not sure what other side-effects it might have. Below is the patch I applied to main.tex

-\titleformat*{\section}{\normalsize\bfseries}
-\titleformat*{\subsection}{\small\bfseries}
-\titleformat*{\subsubsection}{\small\bfseries}
-\titleformat*{\paragraph}{\small\bfseries}
-\titleformat*{\subparagraph}{\small\bfseries}
+\titleformat{\section}[block]{\normalsize\bfseries}{\thesection. }{}{}
+\titleformat{\subsection}[block]{\small\bfseries}{\thesubsection. }{}{}
+\titleformat{\subsubsection}[block]{\small\bfseries}{\thesubsubsection. }{}{}
+\titleformat{\paragraph}[block]{\small\bfseries}{}{}{}
+\titleformat{\subparagraph}[block]{\small\bfseries}{}{}{}

This is mostly a matter of personal taste so I don't think it would be worth adding to the template