How to change the spacing between numbering and text in subsection












2















I am a Master student and currently I am writing the thesis. My University did provide a template but it is in Microsoft Office Word but I am using latex. The attached figure is the example of the heading and the table of content. Heading sampleTOC sample
I need the word CHAPTER 1 and INTRODUCTION set to center but the section remain on the left. Besides, the tableofcontents generate a different style of TOC compare the template of my University. Any suggestion and modification to make thing works?
Thank You.



documentclass[12pt,a4paper]{report}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}

begin{document}
tableofcontents
chapter{INTRODUCTION}
section{What is a flow}
end{document}









share|improve this question

























  • Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

    – Kurt
    Jan 9 at 4:48











  • The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

    – K3iTH
    Jan 9 at 5:09






  • 2





    You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

    – Johannes_B
    Jan 9 at 6:17






  • 3





    Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

    – TeXnician
    Jan 9 at 7:23






  • 2





    And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

    – Schweinebacke
    Jan 9 at 7:27
















2















I am a Master student and currently I am writing the thesis. My University did provide a template but it is in Microsoft Office Word but I am using latex. The attached figure is the example of the heading and the table of content. Heading sampleTOC sample
I need the word CHAPTER 1 and INTRODUCTION set to center but the section remain on the left. Besides, the tableofcontents generate a different style of TOC compare the template of my University. Any suggestion and modification to make thing works?
Thank You.



documentclass[12pt,a4paper]{report}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}

begin{document}
tableofcontents
chapter{INTRODUCTION}
section{What is a flow}
end{document}









share|improve this question

























  • Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

    – Kurt
    Jan 9 at 4:48











  • The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

    – K3iTH
    Jan 9 at 5:09






  • 2





    You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

    – Johannes_B
    Jan 9 at 6:17






  • 3





    Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

    – TeXnician
    Jan 9 at 7:23






  • 2





    And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

    – Schweinebacke
    Jan 9 at 7:27














2












2








2








I am a Master student and currently I am writing the thesis. My University did provide a template but it is in Microsoft Office Word but I am using latex. The attached figure is the example of the heading and the table of content. Heading sampleTOC sample
I need the word CHAPTER 1 and INTRODUCTION set to center but the section remain on the left. Besides, the tableofcontents generate a different style of TOC compare the template of my University. Any suggestion and modification to make thing works?
Thank You.



documentclass[12pt,a4paper]{report}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}

begin{document}
tableofcontents
chapter{INTRODUCTION}
section{What is a flow}
end{document}









share|improve this question
















I am a Master student and currently I am writing the thesis. My University did provide a template but it is in Microsoft Office Word but I am using latex. The attached figure is the example of the heading and the table of content. Heading sampleTOC sample
I need the word CHAPTER 1 and INTRODUCTION set to center but the section remain on the left. Besides, the tableofcontents generate a different style of TOC compare the template of my University. Any suggestion and modification to make thing works?
Thank You.



documentclass[12pt,a4paper]{report}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}

begin{document}
tableofcontents
chapter{INTRODUCTION}
section{What is a flow}
end{document}






sectioning koma-script scrreprt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 9 at 7:42









Schweinebacke

21.4k4475




21.4k4475










asked Jan 9 at 4:33









K3iTHK3iTH

254




254













  • Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

    – Kurt
    Jan 9 at 4:48











  • The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

    – K3iTH
    Jan 9 at 5:09






  • 2





    You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

    – Johannes_B
    Jan 9 at 6:17






  • 3





    Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

    – TeXnician
    Jan 9 at 7:23






  • 2





    And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

    – Schweinebacke
    Jan 9 at 7:27



















  • Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

    – Kurt
    Jan 9 at 4:48











  • The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

    – K3iTH
    Jan 9 at 5:09






  • 2





    You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

    – Johannes_B
    Jan 9 at 6:17






  • 3





    Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

    – TeXnician
    Jan 9 at 7:23






  • 2





    And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

    – Schweinebacke
    Jan 9 at 7:27

















Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

– Kurt
Jan 9 at 4:48





Welcome to TeX.SE! What should subsection*{1.1 What is flow} do? Use instead subsection{What is flow}. Please make your given code snippet compilable!

– Kurt
Jan 9 at 4:48













The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

– K3iTH
Jan 9 at 5:09





The reason I used subsection*{1.1 What is flow} is to avoid the default numbering as it shown 0.0.1 but I need 1.1.

– K3iTH
Jan 9 at 5:09




2




2





You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

– Johannes_B
Jan 9 at 6:17





You are doing this all wrong. It starts with an unnumbered chapter that you number by hand. Please read an introduction to LaTeX.

– Johannes_B
Jan 9 at 6:17




3




3





Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

– TeXnician
Jan 9 at 7:23





Please do not edit your question to completely change the requirements of an answer. Rather ask a new question instead.

– TeXnician
Jan 9 at 7:23




2




2





And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

– Schweinebacke
Jan 9 at 7:27





And please do ask only one question per question. For ToC configuration please ask another question (if you cannot find a similar one that already answers your question).

– Schweinebacke
Jan 9 at 7:27










1 Answer
1






active

oldest

votes


















5














Please note, you should not do the numbering of chapters, sections and subsections manually. One of the basic features of LaTeX is, that numbering is done automatically, table of contents is done automatically and also cross references from one section to another is done automatically. All these things are configurable. One feature of KOMA-Script is, that a lot of things are highly configurable. But this needs to use the correct commands. Without using the correct commands you would have to do almost everything manually. This is nothing you would like.



Chapter headings with prefix line "Chapter Nr." can be used with KOMA-Script option chapterprefix. And then you can reconfigure the font sizes, the horizontal and vertical skips and several other attributes of the headings. Here is an example:



documentclass[
12pt,
% a4paper,% Can be removed, because it is the default.
chapterprefix,% Use chapter headings with prefix line (see scrguien.pdf).
]{scrreprt}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}
% margin (must you use such an ugly margin setup?
% usepackage{times}% http://ctan.org/pkg/times
usepackage{newtxtext,newtxmath}% times is obsolete this is one of the alternatives
setkomafont{disposition}{normalcolorbfseries}% sectfont is deprecated (see scrguien.pdf)
usepackage{scrhack}% to improve e.g. setspace (see scrguien.pdf).
usepackage[onehalfspacing]{setspace}% You can setup onehalfspacing already loading the package.
usepackage[document]{ragged2e}% Note: The option also influences the ToC, LoF, LoT etc.
usepackage{graphicx}
usepackage{amsmath,amssymb,latexsym}
pagenumbering{roman}% seems scrbook would be the better choice
renewcommand*{raggedchapter}{centering}% Avoid usage of sectsty to reduce
% the possibility of compatibility issues.
RedeclareSectionCommand[innerskip=baselineskip,afterskip=baselineskip,font=normalsize,prefixfont=normalsize]{chapter}% see scrguien.pdf
RedeclareSectionCommands[beforeskip=-baselineskip,afterskip=baselineskip,font=normalsize]{section,subsection}% see scrguien.pdf
% changes of headings number format:
renewcommand*{chapterformat}{% add MakeUppercase to the original definition
mbox{%
MakeUppercase{% added
chapappifchapterprefix{nobreakspace}%
}%
thechapterautodot
IfUsePrefixLine{}{enskip}}%
}
renewcommand*{sectionformat}{%
makebox[3em][l]{thesectionautodot}% 3em is the width resevered for the number
}
renewcommand*{subsectionformat}{%
makebox[3em][l]{thesubsectionautodot}% 3em is the width resevered for the number
}


usepackage{blindtext}% for example dummy text only
begin{document}
chapter{INTRODUCTION}
section{What is flow}
blindtext
section{Gravity current}
blindtext
subsection{Compositional gravity current}
blindtext
subsection{ Particle-driven current}
blindtext
end{document}


resulting in:



two pages of the example document



Please read an introduction to LaTeX and after the introduction the documentation of the used commands and options in the KOMA-Script manual.






share|improve this answer
























  • Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

    – K3iTH
    Jan 9 at 7:49











  • @K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

    – Schweinebacke
    Jan 9 at 8:43











  • Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

    – K3iTH
    Jan 9 at 12:16













  • Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

    – K3iTH
    Jan 10 at 9:27













  • @K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

    – Schweinebacke
    Jan 12 at 9:41













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469292%2fhow-to-change-the-spacing-between-numbering-and-text-in-subsection%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Please note, you should not do the numbering of chapters, sections and subsections manually. One of the basic features of LaTeX is, that numbering is done automatically, table of contents is done automatically and also cross references from one section to another is done automatically. All these things are configurable. One feature of KOMA-Script is, that a lot of things are highly configurable. But this needs to use the correct commands. Without using the correct commands you would have to do almost everything manually. This is nothing you would like.



Chapter headings with prefix line "Chapter Nr." can be used with KOMA-Script option chapterprefix. And then you can reconfigure the font sizes, the horizontal and vertical skips and several other attributes of the headings. Here is an example:



documentclass[
12pt,
% a4paper,% Can be removed, because it is the default.
chapterprefix,% Use chapter headings with prefix line (see scrguien.pdf).
]{scrreprt}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}
% margin (must you use such an ugly margin setup?
% usepackage{times}% http://ctan.org/pkg/times
usepackage{newtxtext,newtxmath}% times is obsolete this is one of the alternatives
setkomafont{disposition}{normalcolorbfseries}% sectfont is deprecated (see scrguien.pdf)
usepackage{scrhack}% to improve e.g. setspace (see scrguien.pdf).
usepackage[onehalfspacing]{setspace}% You can setup onehalfspacing already loading the package.
usepackage[document]{ragged2e}% Note: The option also influences the ToC, LoF, LoT etc.
usepackage{graphicx}
usepackage{amsmath,amssymb,latexsym}
pagenumbering{roman}% seems scrbook would be the better choice
renewcommand*{raggedchapter}{centering}% Avoid usage of sectsty to reduce
% the possibility of compatibility issues.
RedeclareSectionCommand[innerskip=baselineskip,afterskip=baselineskip,font=normalsize,prefixfont=normalsize]{chapter}% see scrguien.pdf
RedeclareSectionCommands[beforeskip=-baselineskip,afterskip=baselineskip,font=normalsize]{section,subsection}% see scrguien.pdf
% changes of headings number format:
renewcommand*{chapterformat}{% add MakeUppercase to the original definition
mbox{%
MakeUppercase{% added
chapappifchapterprefix{nobreakspace}%
}%
thechapterautodot
IfUsePrefixLine{}{enskip}}%
}
renewcommand*{sectionformat}{%
makebox[3em][l]{thesectionautodot}% 3em is the width resevered for the number
}
renewcommand*{subsectionformat}{%
makebox[3em][l]{thesubsectionautodot}% 3em is the width resevered for the number
}


usepackage{blindtext}% for example dummy text only
begin{document}
chapter{INTRODUCTION}
section{What is flow}
blindtext
section{Gravity current}
blindtext
subsection{Compositional gravity current}
blindtext
subsection{ Particle-driven current}
blindtext
end{document}


resulting in:



two pages of the example document



Please read an introduction to LaTeX and after the introduction the documentation of the used commands and options in the KOMA-Script manual.






share|improve this answer
























  • Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

    – K3iTH
    Jan 9 at 7:49











  • @K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

    – Schweinebacke
    Jan 9 at 8:43











  • Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

    – K3iTH
    Jan 9 at 12:16













  • Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

    – K3iTH
    Jan 10 at 9:27













  • @K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

    – Schweinebacke
    Jan 12 at 9:41


















5














Please note, you should not do the numbering of chapters, sections and subsections manually. One of the basic features of LaTeX is, that numbering is done automatically, table of contents is done automatically and also cross references from one section to another is done automatically. All these things are configurable. One feature of KOMA-Script is, that a lot of things are highly configurable. But this needs to use the correct commands. Without using the correct commands you would have to do almost everything manually. This is nothing you would like.



Chapter headings with prefix line "Chapter Nr." can be used with KOMA-Script option chapterprefix. And then you can reconfigure the font sizes, the horizontal and vertical skips and several other attributes of the headings. Here is an example:



documentclass[
12pt,
% a4paper,% Can be removed, because it is the default.
chapterprefix,% Use chapter headings with prefix line (see scrguien.pdf).
]{scrreprt}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}
% margin (must you use such an ugly margin setup?
% usepackage{times}% http://ctan.org/pkg/times
usepackage{newtxtext,newtxmath}% times is obsolete this is one of the alternatives
setkomafont{disposition}{normalcolorbfseries}% sectfont is deprecated (see scrguien.pdf)
usepackage{scrhack}% to improve e.g. setspace (see scrguien.pdf).
usepackage[onehalfspacing]{setspace}% You can setup onehalfspacing already loading the package.
usepackage[document]{ragged2e}% Note: The option also influences the ToC, LoF, LoT etc.
usepackage{graphicx}
usepackage{amsmath,amssymb,latexsym}
pagenumbering{roman}% seems scrbook would be the better choice
renewcommand*{raggedchapter}{centering}% Avoid usage of sectsty to reduce
% the possibility of compatibility issues.
RedeclareSectionCommand[innerskip=baselineskip,afterskip=baselineskip,font=normalsize,prefixfont=normalsize]{chapter}% see scrguien.pdf
RedeclareSectionCommands[beforeskip=-baselineskip,afterskip=baselineskip,font=normalsize]{section,subsection}% see scrguien.pdf
% changes of headings number format:
renewcommand*{chapterformat}{% add MakeUppercase to the original definition
mbox{%
MakeUppercase{% added
chapappifchapterprefix{nobreakspace}%
}%
thechapterautodot
IfUsePrefixLine{}{enskip}}%
}
renewcommand*{sectionformat}{%
makebox[3em][l]{thesectionautodot}% 3em is the width resevered for the number
}
renewcommand*{subsectionformat}{%
makebox[3em][l]{thesubsectionautodot}% 3em is the width resevered for the number
}


usepackage{blindtext}% for example dummy text only
begin{document}
chapter{INTRODUCTION}
section{What is flow}
blindtext
section{Gravity current}
blindtext
subsection{Compositional gravity current}
blindtext
subsection{ Particle-driven current}
blindtext
end{document}


resulting in:



two pages of the example document



Please read an introduction to LaTeX and after the introduction the documentation of the used commands and options in the KOMA-Script manual.






share|improve this answer
























  • Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

    – K3iTH
    Jan 9 at 7:49











  • @K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

    – Schweinebacke
    Jan 9 at 8:43











  • Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

    – K3iTH
    Jan 9 at 12:16













  • Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

    – K3iTH
    Jan 10 at 9:27













  • @K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

    – Schweinebacke
    Jan 12 at 9:41
















5












5








5







Please note, you should not do the numbering of chapters, sections and subsections manually. One of the basic features of LaTeX is, that numbering is done automatically, table of contents is done automatically and also cross references from one section to another is done automatically. All these things are configurable. One feature of KOMA-Script is, that a lot of things are highly configurable. But this needs to use the correct commands. Without using the correct commands you would have to do almost everything manually. This is nothing you would like.



Chapter headings with prefix line "Chapter Nr." can be used with KOMA-Script option chapterprefix. And then you can reconfigure the font sizes, the horizontal and vertical skips and several other attributes of the headings. Here is an example:



documentclass[
12pt,
% a4paper,% Can be removed, because it is the default.
chapterprefix,% Use chapter headings with prefix line (see scrguien.pdf).
]{scrreprt}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}
% margin (must you use such an ugly margin setup?
% usepackage{times}% http://ctan.org/pkg/times
usepackage{newtxtext,newtxmath}% times is obsolete this is one of the alternatives
setkomafont{disposition}{normalcolorbfseries}% sectfont is deprecated (see scrguien.pdf)
usepackage{scrhack}% to improve e.g. setspace (see scrguien.pdf).
usepackage[onehalfspacing]{setspace}% You can setup onehalfspacing already loading the package.
usepackage[document]{ragged2e}% Note: The option also influences the ToC, LoF, LoT etc.
usepackage{graphicx}
usepackage{amsmath,amssymb,latexsym}
pagenumbering{roman}% seems scrbook would be the better choice
renewcommand*{raggedchapter}{centering}% Avoid usage of sectsty to reduce
% the possibility of compatibility issues.
RedeclareSectionCommand[innerskip=baselineskip,afterskip=baselineskip,font=normalsize,prefixfont=normalsize]{chapter}% see scrguien.pdf
RedeclareSectionCommands[beforeskip=-baselineskip,afterskip=baselineskip,font=normalsize]{section,subsection}% see scrguien.pdf
% changes of headings number format:
renewcommand*{chapterformat}{% add MakeUppercase to the original definition
mbox{%
MakeUppercase{% added
chapappifchapterprefix{nobreakspace}%
}%
thechapterautodot
IfUsePrefixLine{}{enskip}}%
}
renewcommand*{sectionformat}{%
makebox[3em][l]{thesectionautodot}% 3em is the width resevered for the number
}
renewcommand*{subsectionformat}{%
makebox[3em][l]{thesubsectionautodot}% 3em is the width resevered for the number
}


usepackage{blindtext}% for example dummy text only
begin{document}
chapter{INTRODUCTION}
section{What is flow}
blindtext
section{Gravity current}
blindtext
subsection{Compositional gravity current}
blindtext
subsection{ Particle-driven current}
blindtext
end{document}


resulting in:



two pages of the example document



Please read an introduction to LaTeX and after the introduction the documentation of the used commands and options in the KOMA-Script manual.






share|improve this answer













Please note, you should not do the numbering of chapters, sections and subsections manually. One of the basic features of LaTeX is, that numbering is done automatically, table of contents is done automatically and also cross references from one section to another is done automatically. All these things are configurable. One feature of KOMA-Script is, that a lot of things are highly configurable. But this needs to use the correct commands. Without using the correct commands you would have to do almost everything manually. This is nothing you would like.



Chapter headings with prefix line "Chapter Nr." can be used with KOMA-Script option chapterprefix. And then you can reconfigure the font sizes, the horizontal and vertical skips and several other attributes of the headings. Here is an example:



documentclass[
12pt,
% a4paper,% Can be removed, because it is the default.
chapterprefix,% Use chapter headings with prefix line (see scrguien.pdf).
]{scrreprt}
usepackage[tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1.in]{geometry}
% margin (must you use such an ugly margin setup?
% usepackage{times}% http://ctan.org/pkg/times
usepackage{newtxtext,newtxmath}% times is obsolete this is one of the alternatives
setkomafont{disposition}{normalcolorbfseries}% sectfont is deprecated (see scrguien.pdf)
usepackage{scrhack}% to improve e.g. setspace (see scrguien.pdf).
usepackage[onehalfspacing]{setspace}% You can setup onehalfspacing already loading the package.
usepackage[document]{ragged2e}% Note: The option also influences the ToC, LoF, LoT etc.
usepackage{graphicx}
usepackage{amsmath,amssymb,latexsym}
pagenumbering{roman}% seems scrbook would be the better choice
renewcommand*{raggedchapter}{centering}% Avoid usage of sectsty to reduce
% the possibility of compatibility issues.
RedeclareSectionCommand[innerskip=baselineskip,afterskip=baselineskip,font=normalsize,prefixfont=normalsize]{chapter}% see scrguien.pdf
RedeclareSectionCommands[beforeskip=-baselineskip,afterskip=baselineskip,font=normalsize]{section,subsection}% see scrguien.pdf
% changes of headings number format:
renewcommand*{chapterformat}{% add MakeUppercase to the original definition
mbox{%
MakeUppercase{% added
chapappifchapterprefix{nobreakspace}%
}%
thechapterautodot
IfUsePrefixLine{}{enskip}}%
}
renewcommand*{sectionformat}{%
makebox[3em][l]{thesectionautodot}% 3em is the width resevered for the number
}
renewcommand*{subsectionformat}{%
makebox[3em][l]{thesubsectionautodot}% 3em is the width resevered for the number
}


usepackage{blindtext}% for example dummy text only
begin{document}
chapter{INTRODUCTION}
section{What is flow}
blindtext
section{Gravity current}
blindtext
subsection{Compositional gravity current}
blindtext
subsection{ Particle-driven current}
blindtext
end{document}


resulting in:



two pages of the example document



Please read an introduction to LaTeX and after the introduction the documentation of the used commands and options in the KOMA-Script manual.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 9 at 7:17









SchweinebackeSchweinebacke

21.4k4475




21.4k4475













  • Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

    – K3iTH
    Jan 9 at 7:49











  • @K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

    – Schweinebacke
    Jan 9 at 8:43











  • Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

    – K3iTH
    Jan 9 at 12:16













  • Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

    – K3iTH
    Jan 10 at 9:27













  • @K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

    – Schweinebacke
    Jan 12 at 9:41





















  • Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

    – K3iTH
    Jan 9 at 7:49











  • @K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

    – Schweinebacke
    Jan 9 at 8:43











  • Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

    – K3iTH
    Jan 9 at 12:16













  • Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

    – K3iTH
    Jan 10 at 9:27













  • @K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

    – Schweinebacke
    Jan 12 at 9:41



















Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

– K3iTH
Jan 9 at 7:49





Thanks a lot for the help. That's the format I need. But the top header spacing gap is too big, may I know which is the section I need to edit to reduce the gap? Thank you.

– K3iTH
Jan 9 at 7:49













@K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

– Schweinebacke
Jan 9 at 8:43





@K3iTH You mean the space above the chapter heading? In this case add an appropriate beforeskip value to the RedeclareSectionCommand[…]{chapter} command. Please read the documentation of the command in den manual before.

– Schweinebacke
Jan 9 at 8:43













Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

– K3iTH
Jan 9 at 12:16







Ya is the spacing about the work CHAPTER 1. There is a spacing gap when you compare page 1 and page 2 side by side. The text on page 2 is slightly higher than CHAPTER 1 on page 1. Thanks for the explanation. I will read the documentation of the command to understand and learn more.

– K3iTH
Jan 9 at 12:16















Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

– K3iTH
Jan 10 at 9:27







Hi there, I manage to adjust the spacing to match the required template, but I am facing another problem to add subsubsection. I follow the code by replacing subsection to subsubsection and added subsubsection to the RedeclareSectionCommands and added renewcommand, but the heading is generated with text and without the number. I tried to change to the number for the width reserved for the number but still no luck. Thank You

– K3iTH
Jan 10 at 9:27















@K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

– Schweinebacke
Jan 12 at 9:41







@K3iTH If you have an additional question, please ask a new question and add a link from that new question to the question/answer here, if this would be useful. Currently, I do not understand your question from you last comment. Maybe you are searching for secnumdepth???

– Schweinebacke
Jan 12 at 9:41




















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469292%2fhow-to-change-the-spacing-between-numbering-and-text-in-subsection%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

ts Property 'filter' does not exist on type '{}'

mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window