Text Formatting ⇒ Strange format change overnight
Strange format change overnight
Hi,
I am seeing a really weird change in the toc format this morning. Here is how it looked last night: And here is how the same document looks when compiled this morning: As can be seen, the spacing is messed up. In case anyone is curious, the purpose of this document was to test changing the format/style of section...paragraph headings.
The document (and the class file) is attached below. Until this morning, I had not had such a problem with the toc when using this class file before. Can someone figure out what is going on here? Thanks!
I am seeing a really weird change in the toc format this morning. Here is how it looked last night: And here is how the same document looks when compiled this morning: As can be seen, the spacing is messed up. In case anyone is curious, the purpose of this document was to test changing the format/style of section...paragraph headings.
The document (and the class file) is attached below. Until this morning, I had not had such a problem with the toc when using this class file before. Can someone figure out what is going on here? Thanks!
- Attachments
-
- ndsuthesis.cls
- (17.01 KiB) Downloaded 491 times
-
- prgraph.tex
- (938 Bytes) Downloaded 560 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Strange format change overnight
If such things happen the first question must always be: “What was the last thing I did?” and then undo it. If that helps you know at least to source for the problem. Have you added any package? Have you redefined some length or skip value?
Regards
Regards
site moderator & package author
Re: Strange format change overnight
I did infact update MikTeX at some point. How do I revert these updated packages to the previous version? I only know of the uninstall option in the Package Manager (I need some of the packages for my document).
Strange format change overnight
I have found the cause (thanks cgnieder)- now to fix it!
My initial issue was to change the default paragraph heading style. For some time I had been using:
to get the style in the above example.
However I felt that my method was ugly/messy/inelegant (also the spacing after the paragraph heading was not to my liking), and tried to look for a better, nicer way to get required style. Some search led me to the following (which is used in my example):
But using this code messed up the before/after spacing of the subsection and subsubsection headings, so I put in similar code to fix that and that is how the problem arose (I didn't catch it last night because it takes multiple runs to rebuild the toc
)
At this point, removing the offending code has fixed the toc spacing problem, but I would still like to find a good way to change the paragraph heading style. So any suggestions for that are appreciated.
My initial issue was to change the default paragraph heading style. For some time I had been using:
Code: Select all
\newcommand{\para}[1]{\paragraph{#1\\*}\hspace{4mm}}
However I felt that my method was ugly/messy/inelegant (also the spacing after the paragraph heading was not to my liking), and tried to look for a better, nicer way to get required style. Some search led me to the following (which is used in my example):
Code: Select all
\makeatletter\renewcommand\paragraph{
\@startsection{paragraph}{4}{0mm}
{0.5\baselineskip}{0.5\baselineskip}
{\normalfont\bfseries}
}\makeatother

At this point, removing the offending code has fixed the toc spacing problem, but I would still like to find a good way to change the paragraph heading style. So any suggestions for that are appreciated.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Strange format change overnight
Search the forum for solutions by the titlesec package.niteshs wrote:[…] At this point, removing the offending code has fixed the ToC spacing problem, but I would still like to find a good way to change the paragraph heading style. So any suggestions for that are appreciated.
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
Strange format change overnight
I tried using:
This gave me the paragraph heading style I wanted, but messed with with all the other headings (all other heading were now un-nunmbered and un-bolded) ! Is that normal? If I use the
In the titlesec examples I have found in this forum, only the specific section of interest was modified each time.
Edit: I just realized I had mentioned "to get the style in the above example" earlier in this thread, but there was no such example
Here is how the default paragraph looks: And here is how I want it to look: Like I mentioned, my solution
Code: Select all
\usepackage{titlesec}
\titleformat{\paragraph}{\bfseries}{\theparagraph}{1em}{}
titlesec
package, do I have to format ALL existing headings to appear like they were before? That doesn't seem right 
Edit: I just realized I had mentioned "to get the style in the above example" earlier in this thread, but there was no such example

Here is how the default paragraph looks: And here is how I want it to look: Like I mentioned, my solution
\newcommand{\para}[1]{\paragraph{#1\\*}\hspace{4mm}}
works, but I would like to use a "nicer" solution.- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Strange format change overnight
Do your homework and prepare a proper minimal example that clearly reproduces the undesired behaviour instead of a theoretical description.niteshs wrote:I tried using:This gave me the paragraph heading style I wanted, but messed with with all the other headings (all other heading were now un-nunmbered and un-bolded) ! Is that normal? If I use theCode: Select all
\usepackage{titlesec} \titleformat{\paragraph}{\bfseries}{\theparagraph}{1em}{}
titlesec
package, do I have to format ALL existing headings to appear like they were before? That doesn't seem right :? In the titlesec examples I have found in this forum, only the specific section of interest was modified each time.[…]
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
Strange format change overnight
I pretty much gave up on trying to use a different solution for the paragraph style when the strangeness decided to kick in again
I am now having problems with the
Here is an mwe:
And the class file:
Incidentally, regarding my previous question about the paragraph format, using the titlesec package helped with the following:
but only with the article class. Using the above custom class messed up everything. Adding this code to the above mwe should show this problem.

I am now having problems with the
subsubsection
heading (it appears in line with the previous paragraph):
This happens only with the custom class that I have been using (with no such problems until now). To make sure everything is clean, I downloaded a fresh copy of the class file but am still seeing this problem.Here is an mwe:
Code: Select all
\documentclass{ndsuthesis}
\usepackage{blindtext}
\usepackage{chngcntr}
\counterwithin{paragraph}{subsubsection}
\setcounter{secnumdepth}4
\begin{document}
\tableofcontents
\mainbody
\section{Introduction}
\blindtext
\subsection{Something}
\blindtext
\subsubsection{Another}
\blindtext
\paragraph{Para}
\blindtext
\paragraph{Paratwo}
\blindtext
\subsubsection{Test}
\blindtext
\subsection{Blahblah}
\blindtext
\section{second}
\blindtext
\end{document}
Code: Select all
\usepackage{titlesec}
\titleformat{\paragraph}{\bfseries}{\theparagraph}{1em}{}
Strange format change overnight
This strange behaviour is a bug in the
The definition of
As for adapting
Regards
PS: It may be desirable to redefine
ndsuthesis
class. It defines \subsubsection
in line 359 like this:Code: Select all
\renewcommand{\subsubsection}{\secdef\NDSUssseca\NDSUsssecb}
\newcommand{\NDSUssseca}[2][?]{% --> \subsubsection[toc-entry]{title}
\refstepcounter{subsubsection}
\noindent {\bf \thesubsubsection. #2} \par
\addcontentsline{toc}{subsubsection}
{\hspace{13mm}\thesubsubsection.\;\;#1}
\addtocontents{toc}{\quad}}
\newcommand{\NDSUsssecb}[2][?]{% --> \subsubsection*[toc-entry]{title}
\noindent {\bf #2} \par
\ifthenelse{\equal{#1}{?}}{%
\addcontentsline{toc}{subsubsection}{\hspace{13mm}#2}
\addtocontents{toc}{\quad}}{%
\addcontentsline{toc}{subsubsection}{\hspace{13mm}#1}
\addtocontents{toc}{\quad}}}
\NDSUssseca
(and \NDSUsssecb
in case of a unnumbered subsubsection) is where things go wrong. You might want to redefine it like this:Code: Select all
\renewcommand*{\NDSUssseca}[2][?]{% --> \subsubsection[toc-entry]{title}
\refstepcounter{subsubsection}%
\par \addvspace{\baselineskip}% <= new
\noindent {\bf \thesubsubsection. #2} \par
\addcontentsline{toc}{subsubsection}
{\hspace{13mm}\thesubsubsection.\;\;#1}%
\addtocontents{toc}{\quad}%
\nobreak}% <= new
\newcommand{\NDSUsssecb}[2][?]{% --> \subsubsection*[toc-entry]{title}
\par \addvspace{\baselineskip}% <= new
\noindent {\bf #2} \par
\ifthenelse{\equal{#1}{?}}{%
\addcontentsline{toc}{subsubsection}{\hspace{13mm}#2}%
\addtocontents{toc}{\quad}}{%
\addcontentsline{toc}{subsubsection}{\hspace{13mm}#1}%
\addtocontents{toc}{\quad}}%
\nobreak}% <= new
\paragraph
: you should probably define it in a similar way as the class does:
Code: Select all
\renewcommand{\paragraph}{\secdef\NDSUparaa\NDSUparab}
\newcommand{\NDSUparaa}[2][?]{% --> \paragraph[toc-entry]{title}
\refstepcounter{paragraph}
\par \addvspace{\baselineskip}%
\noindent {\bf \theparagraph. #2} \par
\addcontentsline{toc}{paragraph}
{\hspace{13mm}\theparagraph.\;\;#1}%
\addtocontents{toc}{\quad}%
\nobreak}% <= new
\newcommand{\NDSUparab}[2][?]{% --> \paragraph*[toc-entry]{title}
\par \addvspace{\baselineskip}%
\noindent {\bf #2} \par
\ifthenelse{\equal{#1}{?}}{%
\addcontentsline{toc}{paragraph}{\hspace{13mm}#2}%
\addtocontents{toc}{\quad}}{%
\addcontentsline{toc}{paragraph}{\hspace{13mm}#1}%
\addtocontents{toc}{\quad}}%
\nobreak}
PS: It may be desirable to redefine
\subsection
as well. It's possible that the current definition allows page breaks between the title and the first paragraph.site moderator & package author
Strange format change overnight
Thanks cgnieder, I have added your definitions to the class and all seems to be working fine now.
I have a few questions though:
1) Originally, section titles appeared as expected (on their own lines). When I tried to edit the class to include a format for the paragraph title based on the other existing section titles (like you just suggested), it messed up the subsubsection titles (this was before you provided the above solution).
Commenting out, or deleting the edit did not revert things back, even getting a fresh copy of the class file did not help. So the change was somehow being propagated independent of the class file? Any idea what might be going on?
2) Why was the
Anyway, maybe there is no way to figure out what went wrong. I am glad my document is back on track (for now
)- Thanks again!
I have a few questions though:
1) Originally, section titles appeared as expected (on their own lines). When I tried to edit the class to include a format for the paragraph title based on the other existing section titles (like you just suggested), it messed up the subsubsection titles (this was before you provided the above solution).
Commenting out, or deleting the edit did not revert things back, even getting a fresh copy of the class file did not help. So the change was somehow being propagated independent of the class file? Any idea what might be going on?
2) Why was the
subsubsection
affected but not subsection
?Anyway, maybe there is no way to figure out what went wrong. I am glad my document is back on track (for now
