I'm a newbie to Latex (ordered some books, before anybody says I should
I'm using \documentclass{book} to typset a novel. I wrote the novel in Word (bad me), then discovered the world of Latex, so saved it as a text file, and am now trying to get it to compile properly by using pdflatex in Winshell.
I've figured out how to set chapter headings and even managed to get the headers and footers sorted. But what is bugging me is that, as in many books - and even in this post - the chapters have little sections separated by a blank line. The first paragraph of each of these sections shouldn't be indented, but of course they are. Short of wading through the entire book and keying in \noindent at the start of each of these paragraphs, is there anything I can do?
stepec
Last edited by stepec on Sat Aug 07, 2010 5:01 pm, edited 1 time in total.
We need to see a minimal example of the code you’re using that’s creating the problem. How are you creating these blank lines?
Paragraphs immediately following \chapter commands and \section commands are not indented by default in the book class, but I don’t even know how you’re creating these blank lines and what the default value would be there.
Are you trying to make it so that no paragraphs are indented anywhere? If so, then you might want to load the parskip package.
I would recommend changing the document class from book to, for example, scrbook (from the KOMA-Script bundle), since the latter implements mechanisms to eliminate the indentation in every paragraph and to increase the vertical distance between consecutive paragraphs. Refer to the user guide for further details (pages 49 and following).
And this is the problem, in Winshell, some way through the chapter:
90 list and circled Claire with heavy strokes of his pencil. He glanced up as the 91 sun slid behind the greasy clouds again and darkness swept over the street as 92 if someone, somewhere, had pulled a giant curtain.
93
94 ###
95
96 As their gaze met through ochre rays a day or so later, his lips murmured 97 Claire and even though her own lips formed a slight smile, he did not think it
This text is dumped directly from the "save as text" option in Word (sorry line numbers gone skewed for this screen dump). What I want to do is do a search and replace on the ### (which screw up winshell anyway) - specifically, replace the ###, the previous blank line and the following blank line with \medskip and then \noindent so that the "As their gaze met..." paragraph isn't indented.
I can't figure out how to do this, partly because I can't see how to represent a blank line or carriage return in the "search" box and partly because I'm not sure I can insert the \noindent properly.
Obviously I could go through the whole book and insert \noindent at the start if all these sections, which would be a pain.
I could go through and mark them all as sections: also tedious, and this would only work if I could somehow switch off the section head and numbering.
This leaves me with the option of finding some sort of command which reads "after a medskip, don't indent the next paragraph. But that defeats me.
I cunningly replaced all the ### with \section*{} and that has solved the basic problem. Now I'm hard at work trying to figure out how to reduce the space between sections
\usepackage{titlesec}
\titlespacing*{\section}%
{0em}% horizontal space to the left of section title, if any
{0\baselineskip}% vertical space before section title, set to 0 lines
{0\baselineskip}% vertical space after section title, set to 0 lines
And use that in the body of your document. It is defined as \section*{} so it does the same thing, but this will make it easier to make global changes later on if you change your mind about how these should look; you’ll just need to redefine the command, not find/replace every instance.
Great stuff. I had found my way to the titlesec package but couldn't make a lot of sense of it. Lo and behold your answer told me I was on the right track and solves the problem. Thanks very much -
Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules. You should also read the descriptions in Section 2.4 about the tagging of source code.