• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Delete first line indents of page starting paragraphs

Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hi there!

Could find no solution to that one:

Let’s assume all the paragraphs of my 350-pages document have a »First Line Left Indent«, all right. While this is perfectly fine with me in average cases, I don’t like it at all if a given paragraph starts at the top of a page (text frame).

In other words: If the beginning of a page (text frame) coincides with the beginning of its first paragraph, I would like to change that paragraph to have no First Line Left Indent.

How can that be fixed »automatically« within the whole document?

Thanks a lot for any hints with this!

Views

3.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 23, 2017 Feb 23, 2017

Maybe I'm wrong but, now, I think it would be better to make reference to the "index" of the character!

var myDoc = app.activeDocument,   

myChar0 = myDoc.textFrames.everyItem().characters[0].getElements(),   

C = myChar0.length;   

while (C--) if ( myChar0.index == myChar0.paragraphs[0].characters[0].index ) myChar0.paragraphs[0].firstLineIndent = 0;

(^/) 

Votes

Translate

Translate
People's Champ ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

It can't be done automatically -- there's no way of telling a paragraph style to behave differently if it falls at the top of a page.

It could of course be scripted.

But even then, you would need to rerun the script every time some reflow occurs.

Ariel

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Of course, in the simplest case where there is no risk of reflow, and everything is set up, something like this might work:

app.activeDocument.textFrames.everyItem().paragraphs[0].firstLineIndent = 0;

However, there are a lot of oversimplifications here (for instance, if a paragraph begins on the previous page and continues onto the next page...)

Ariel

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Thanks, Ariel. I have very, very little knowledge (and even less any skills) with scripting. Well, it’s a scripting line you stated before, right?

In the Paragraph-Style-Options-palette, I spotted something called GREP Style. Well, sounds promising ... Can that feature be of any help here?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Klаus  wrote

In the Paragraph-Style-Options-palette, I spotted something called GREP Style. Well, sounds promising ... Can that feature be of any help here?

No.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Grep styles are very useful, but they won't help you here, because there's no way of creating a special setting for "top of page". And indeed, there's nothing in paragraph styles that can do that.

I'm pretty sure that a scripting solution is your only hope of automating this...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hi,

This doesn't work! …

Capture d’écran 2017-02-23 à 15.54.46.png

var myDoc = app.activeDocument,

myChar0 = myDoc.textFrames.everyItem().characters[0].getElements(),

C = myChar0.length;

while (C--) {

    var myOffset0 = myChar0.horizontalOffset,

    myPara = myChar0.paragraphs[0],

    myIndent = myPara.firstLineIndent;

    if ( myOffset0 == 20 )  myIndent = 0;

    }

Thanks in advance for help!

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

This new approach (imho better) seems to work! 

var myDoc = app.activeDocument,   

myChar0 = myDoc.textFrames.everyItem().characters[0].getElements(),   

C = myChar0.length;   

while (C--) if ( myChar0.contents == myChar0.paragraphs[0].characters[0].contents ) myChar0.paragraphs[0].firstLineIndent = 0;

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

  1.     var myOffset0 = myChar0.horizontalOffset, 

Thanks in advance for help!

Obi, rather than using h offset you can test whether the first line of a paragraph is on the same page as the last line via the parentTextFrames[0] property.

It's easier for me to do it in AppleScript. Here the selection is a text frame and I'm checking where the first and last lines of its first paragraph are:

tell application "Adobe InDesign CC 2014"

    set a to item 1 of parent text frames of first line of paragraph 1 of selection

    set b to item 1 of parent text frames of last line of paragraph 1 of selection

    if a is not equal to b then

        display dialog "First paragraph does not start on this page"

    else

        display dialog "First paragraph starts on this page"

    end if

end tell

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Hi Rob,

I've modified my approach (I didn't see you comment!)! 

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Maybe I'm wrong but, now, I think it would be better to make reference to the "index" of the character!

var myDoc = app.activeDocument,   

myChar0 = myDoc.textFrames.everyItem().characters[0].getElements(),   

C = myChar0.length;   

while (C--) if ( myChar0.index == myChar0.paragraphs[0].characters[0].index ) myChar0.paragraphs[0].firstLineIndent = 0;

(^/) 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

There would be a number of ways to check. Looping thru all of the document's characters could be slow. In my example the loop would be thru the document's text frames and only testing the first paragraph of each.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Rob,

My approach only searches the first char of each text frame [in a simple layout as one text frame per page].

In my sample, 12 pages, so 12 first "page" chars!

Playing with the char "index" will avoid some cases where the first char on the page equals the first para char!

About Jane's comment, I agree! I don't see for what reason Klaus wants to get such a result! …

I personally just did it for … my [JS] learning! 

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/Obi-wan+Kenobi  wrote

About Jane's comment, I agree! I don't see for what reason Klaus wants to get such a result! …

I personally just did it for … my [JS] learning! 

Yes, as a puzzle, it's cool! But as Typography—not so much...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/Obi-wan+Kenobi  schrieb

Maybe I'm wrong but, now, I think it would be better to make reference to the "index" of the character!

var myDoc = app.activeDocument,     myChar0 = myDoc.textFrames.everyItem().characters[0].getElements(),     C = myChar0.length;     while (C--) if ( myChar0.index == myChar0.paragraphs[0].characters[0].index ) myChar0.paragraphs[0].firstLineIndent = 0; 

(^/) 

Any chance to help with a »defunct« version of it, which will detect those page starting paragraphs only and put me there, without changing anything? To leave the appropriate action to me?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

I am trying to think of a reason why not indenting a body text paragraph if it happens to fall at the top of a page would be a good idea in the first place.

It's fun to figure out a solution, but does that make it something you want to actually do in a 350-page document?

It is correct to not indent the first paragraph after a heading or a break. But please re-think about the top of the page! And please don't let it be something that will be making its way into my pile of things to read!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

I am trying to think of a reason why not indenting a body text paragraph if it happens to fall at the top of a page would be a good idea in the first place.

It is correct to not indent the first paragraph after a heading or a break. But please re-think about the top of the page!

Yes, it is common to have no indent after a headline. I wonder if that's what the OP is after?

Screen Shot 2017-02-23 at 11.35.08 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/rob+day  schrieb

Yes, it is common to have no indent after a headline. I wonder if that's what the OP is after?

No.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/rob+day  wrote

It is correct to not indent the first paragraph after a heading or a break. But please re-think about the top of the page!

Yes, it is common to have no indent after a headline. I wonder if that's what the OP is after?

Apparently not!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

The first line indent is something that disturbs the otherwise smooth top left shape of a paragraph, right? So why would you use it anyway? The only (very) good reason: to help the reader’s eye finding the beginning of a new paragraph after it finished reading the one just on top of it. It cuts a nice gap into the bleak »wall of words« on the left, to be a hint for the eye. That’s it.

All that is not necessary if the given paragraph starts at the top of the page. No problem at all for the eye to find its beginning.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

The problem is not "finding" the beginning of the paragraph. It's knowing that the sentence starts a new paragraph.

What you are trying to do is going to make it harder for the reader to understand if a sentence that starts on the top of a left-hand page is an actual continuation of the paragraph before it or not.

You may not have any respect for the author's (writer's) wishes to designate a certain set of words as a new thought, but I assure you most authors and editors would not appreciate this bizarre way of formatting text.

Of course it is very possible that you are the author of your own design. If so, I strongly encourage you to ask the designer to change the formatting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/Sandee+Cohen  schrieb

What you are trying to do is going to make it harder for the reader to understand if a sentence that starts on the top of a left-hand page is an actual continuation of the paragraph before it or not.

The reader will know, for he noticed the end of the preceding paragraph at the bottom of the preceding page, with its last line ending somewhere away from the right margin.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

The reader will know, for he noticed the end of the preceding paragraph at the bottom of the preceding page, with its last line ending somewhere away from the right margin.

A professional copy editor's not going to buy that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/rob+day  schrieb

The reader will know, for he noticed the end of the preceding paragraph at the bottom of the preceding page, with its last line ending somewhere away from the right margin.

A professional copy editor's not going to buy that.

Some of them do. You may check your collection of contemporary fiction books to discover some nice examples 🙂 Not too much of them, but that even adds status to them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2017 Feb 23, 2017

Copy link to clipboard

Copied

Not too much of them, but that even adds status to them.

and ee cummings didnt like punctuation

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines