11 Replies Latest reply on Mar 30, 2015 7:56 PM by miz sue

    no indent first paragraph

    miz sue

      Hello!

       

      I've just encountered a problem which I'm sure has already been resolved somewhere, but I can't find the exact answer. I have prepared an epub using Indesign CS6. I created 2 css style sheets which I alternate as needed when I export to epub. The first style sheet has no indenting on all paragraphs with space between paragraphs. The second style sheet has indents for all paragraphs. In my INDD file, my body has no indents, so each paragraph is <p>.

       

      I'm learning now that the style I should be using is no indent on the first paragraph of each chapter but all other paragraphs are indented. What I've done is go back to each 1st paragraph and apply a no indent style; then in my css created a corresponding rule. Is there an easier method than this? I shudder if I had a 50 chapter book to fix. So my question is: do I need to apply a style to each particular paragraph or is there some neat css solution?

       

      Many thanks,

      Sue

        • 1. Re: no indent first paragraph
          vladan saveljic Level 4

          Try this solution in InDesign:

          first at all you have to make a paragraph style "Body text no indent"

          if all your chapter begenning with, for example, paragraph style called "Chapter Title" you can use grep find - change:

           

          find:

          (?<=\r)

          format: para style "Chapter Title"

           

          change:

          notthing

          format: para style "Body text no indent"

          • 2. Re: no indent first paragraph
            BobLevine MVP & Adobe Community Professional

            Give all the styles a tag of p. Set up the css with a p tag having an indent along with whatever styling you want to add. Then create a CSS rule for p+p and the only thing you need to do there is specify no indent. Make sure that p+p follows p in the CSS.

            • 3. Re: no indent first paragraph
              miz sue Level 1

              Hi Bob!

               

              Thanks for your reply. I thought the solution would be in CSS. Would you say that this should work?

               

              p {

                  font-family:"Times New Roman", serif;

                  font-size:1em;

                  color:#000000;

                  line-height:1.2;

                  margin-bottom:1em;

                  margin-right:0px;

                  margin-top:0px;

                  text-align:left;

                  text-decoration:none;

                  text-indent:1.5em;

              }

              pp {text-indent:0em;

              }

               

              Thanks!

              Sue

              • 4. Re: no indent first paragraph
                miz sue Level 1

                Hi Premio_Oscar!

                 

                Thanks for your reply. I have the chapter headings set up as <H1> tags and the body as <p> tags. I formatted the <p> to have a 1.5em indent. I'm trying to find the easiest solution that the first paragraph following the H1 won't indent. Bob has provided an option within CSS that I'm going to try first. I do understand what you are saying but I would have to identify the first paragraph rather than the chapter heading.

                 

                Thanks!

                Sue

                • 5. Re: no indent first paragraph
                  BobLevine MVP & Adobe Community Professional

                  p+p

                   

                   

                   

                  That indicates any p tag that follows a p tag.

                  • 6. Re: no indent first paragraph
                    miz sue Level 1

                    Thanks Bob! I'm going to start working on an epub now and try that out. I'll report back on my success.

                    • 7. Re: no indent first paragraph
                      miz sue Level 1

                      Hi Bob!

                       

                      Well I've had an interesting result ... in my indd file, the body is <p> with 0 indenting. My CSS is:

                       

                      p {

                          font-family:"Times New Roman", serif;

                          font-size:1em;

                          color:#000000;

                          line-height:1.2;

                          margin-bottom:1em;

                          margin-right:0px;

                          margin-top:0px;

                          text-align:left;

                          text-decoration:none;

                          text-indent:1.5em;

                      }

                      p+p {text-indent:0em;

                      }

                       

                      What is strange, is that each first line at the beginning is indented and the remainder is not. Its the reverse of what I was looking to do. So I have my H1, followed by 5 paragraphs. H1 has no indent, first paragraph is indented and the rest are not. Do you have any idea what I'm doing wrong?

                       

                      Thanks,

                      Sue

                      • 8. Re: no indent first paragraph
                        miz sue Level 1

                        I changed the p+p to H1+p and that resolved which paragraphs indented and the first which didn't (what I wanted).  Of course, the offside is in the html TOC, my first entry doesn't indent while the rest do. 2 steps forward ...

                        • 9. Re: no indent first paragraph
                          BobLevine MVP & Adobe Community Professional

                          I’m replying by email and apparently the forum didn’t like that plus sign I was using.

                           

                          Keep in mind what this does. The first p tag is defined by p. Every other p tag that follows a p tag (p+p) is being indented because that’s what you’ve told it to do.

                           

                          So what we need to do here is simply remove the indent on the first p tag and then just define an indent for the p+p. I may have misunderstood what you needed in my original reply.

                          • 10. Re: no indent first paragraph
                            BobLevine MVP & Adobe Community Professional

                            That’ll work only if the first p tag always follows an h1.

                            • 11. Re: no indent first paragraph
                              miz sue Level 1

                              Hi Bob,

                               

                              Thanks for clarifying this. I started thinking the same thing about reversing where I inserted the indent data. I just tried it and that worked. So I removed the H1+p and went back to p+p. I did go back into InDesign and created an additional paragraph style of no indent and then updated my CSS too. I did this so that some of the front matter wouldn't indent either. Personally, I don't like the look of indents but since it can be required, I needed to learn this.

                               

                              I really appreciate your assistance Bob - thank you so much!

                               

                              ... until the next problem ... : )

                               

                              Sue