Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

hanging indents on centered text

Return to Member Forum

  • Author
    Posts
    • #14331090
      Flavio Mini
      Participant

      by using a paragraph style I would like to create a hanging indent on centered text.

    • #14331092
      David Blatner
      Keymaster

      Do you have a picture of what this should look like? You cannot upload here, but you can put the picture on a sharing site and link to it.

      More on hanging indents here:

    • #14331100
      Flavio Mini
      Participant

      Hanging indent centered the second line is offset
      Whereas hanging indent on justified left lines up
      2 images found here
      https://www.dropbox.com/sh/tf1mrkponbkf9q7/AAC1S_JSpyskun7RWYht4dO6a?dl=0

    • #14331114
      David Blatner
      Keymaster

      Ah! I see now. That is going to be very tricky. But it would be easy if you use a table. Put the “Figure 1” in one column, and the other text in the second column.

      Or maybe you can use an anchored frame, like in this poetry example:

      Setting Poetry, Flush Left, Center on Longest Line

    • #14331655

      Not really tricky! Just a 6-lines simplistic script! [I’ve just counted in my head]

      (^/) The Jedi

      • #14331670
        David Blatner
        Keymaster

        LOL. Michel is back!
        Yes, I am sure it is very possible with scripting. :-)

    • #14331671
      Flavio Mini
      Participant

      Great Michael (^/)The Jedi
      but what is the answer:)

    • #14331672

      David, je serai de retour quand tu supprimeras ta modération débile [5h de décalage entre mon post et son affichage].

      LOL

      • #14331675
        David Blatner
        Keymaster

        Bien, j’ai fait le changement. J’espère que vous pouvez jouer selon les règles! J’ai hâte que vous aidiez les gens plus que de les rendre fous.

    • #14331676

      Ok! … Simplement pour vérifier !

      (^/)

    • #14331677

      Cool ! Merci David.

      Il ne te reste plus qu’à annuler la modération sur les commentaires du reste de ton site web et le décret de bannissement de ton shérif sur Facebook !

      A+ et merci pour ta joie de me voir revenir ! [ je note également que tu as fait beaucoup de progrès en Français ! ;-) ]

      (^/) The Jedi, who is [nearly] back!

      • #14331679
        David Blatner
        Keymaster

        Well, thank goodness for Google Translate. :-)
        I did remove the moderation here… I thought I did. But it looks like something might still be stuck. So please forgive me, and be patient.

    • #14331687

      @ David Blatner: Done? …

      (^/) The Jedi

    • #14331691
      Flavio Mini
      Participant

      Bonjour Michel moi aussi je suis en attente.
      pendant que nous attendon David es-ce que ill y’a une façon de change le nom de la figure dans le texte
      j’aimerais que la refence dans le texte est comme fig. xx.xx au lieu de Figure. xx-xx

    • #14331764
      Flavio Mini
      Participant

      The tip center on the longest line does not suit what I need. nice tip I can use that in another part of the book

      I have a figure text box that is 2.5″ wide or 5″
      what I need to do is center the text in this text box
      no problem for that all I have to do is set the center option.
      but if the the text line is too long the second line will flow and also be centered.
      what I would like is that the second and all other lines line up with the first word in the figure description
      it would be very useful
      many figures in this book that I am working on

      Again thank you for the help

    • #14331770
      Flavio Mini
      Participant

      Oooop’s
      forgot to mention something
      the maximum figure size width is 2.375 and 5.00
      ;)

    • #14331837

      I was wrong: I needed 7 code-lines!

      (^/) The Jedi

      /*
      _FRIdNGE-0662_Justif-Center.jsx
      Script written by FRIdNGE, Michel Allio [26/10/2020]
      See: https://creativepro.com/topic/hanging-indents-on-centered-text/ [Flavio Mini, 21/10/2020]
      Object: Left-indent calculated on para first line parameters. Not use a “tab” as delimiter but another space-type.
      */

      app.doScript(“main()”, ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, “Justif-Center! …”);

      function main()
      {
      var mySel = app.selection[0].paragraphs[0],
      myLeft = mySel.lines[0].insertionPoints[0].horizontalOffset – app.selection[0].parentTextFrames[0].geometricBounds[1];
      myRight = app.selection[0].parentTextFrames[0].geometricBounds[3] – mySel.lines[0].insertionPoints[-2].horizontalOffset;
      mySel.justification = Justification.LEFT_ALIGN;
      mySel.leftIndent = myLeft;
      mySel.rightIndent = myRight;
      mySel.firstLineIndent = -myLeft + myRight;
      }

    • #14331851
      Flavio Mini
      Participant

      Thank you very much for the help
      I am totally new with scripting
      no idea on how to create or save scripts
      I know how to import a script into InDesign
      but: How do I save the script that Michel has so graciously provided

      I can copy from . /* upto and include the last}

      paste into what an editor (in my case TextEdit)
      and then what?

      Flavio

    • #14331856
      Flavio Mini
      Participant

      Man you guys are awesome

    • #14331857

      Just place the cursor in the para you want to be treated!
      Simplistic!

      (^/)

      • #14331858
        David Blatner
        Keymaster

        Perhaps I am missing something obvious, but what does this mean: “Not use a ‘tab’ as delimiter but another space-type”?

        I was getting a syntax error… I see how that our forum also changes the “-” to an en dash! That is strange. So line 14 and 15 were causing problems until I changed the code to this:

        /*
        _FRIdNGE-0662_Justif-Center.jsx
        Script written by FRIdNGE, Michel Allio [26/10/2020]
        See: https://creativepro.com/topic/hanging-indents-on-centered-text/ [Flavio Mini, 21/10/2020]
        Object: Left-indent calculated on para first line parameters. Not use a “tab” as delimiter but another space-type.
        */

        app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Justif-Center! …");

        function main()
        {
        var mySel = app.selection[0].paragraphs[0],
        myLeft = mySel.lines[0].insertionPoints[0].horizontalOffset - app.selection[0].parentTextFrames[0].geometricBounds[1];
        myRight = app.selection[0].parentTextFrames[0].geometricBounds[3] - mySel.lines[0].insertionPoints[-2].horizontalOffset;
        mySel.justification = Justification.LEFT_ALIGN;
        mySel.leftIndent = myLeft;
        mySel.rightIndent = myRight;
        mySel.firstLineIndent = -myLeft + myRight;
        }

    • #14331861
      Flavio Mini
      Participant

      David instead of using a tab delimiter how about and indent to here mac indesign shortcut “cmd\”

      Just tried it and it works wonderfully

      YAAAAAAAAAAAAA!!!!!

      this reduces my styles from 3 different styles to just 1

      imagine 3 styles for Figure number, 3 for Tables, 3 For Examples , 3 for Problems

      That’s 4 styles instead of 12…….

    • #14331862

      That’s the “light” version!

      The “batch” version works for all the doc with just “1click”!

      But you will have to find it … in a galaxy far far away!

      (^/)

    • #14331863
      Flavio Mini
      Participant

      I will follow the force….

      no I am trying the other little problem of changing Figure to fig.

      Stay tuned on the other help request…..

Viewing 19 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads