Jump to content

hanging indent


mclisa81

Recommended Posts

Hi everyone,

 

I'm attaching a link to the pdf for clarity.

 

Basically, I need a javascript rule that will accomplish a hanging indent for quote marks on the left and right of a text quote. Any help would be appreciated. I don't need help formatting the sizes etc, just the indents for the text. If the text on the 2nd line fills the line, I would want to keep the indent of the left quote mark.

 

Thanks

 

http://www2.printable.com/ccs_loadfile.asp?CCID=393922&FID=336904&version=1

Link to comment
Share on other sites

I'm attaching a link to the pdf for clarity.

Sorry, I can't see it. That link is only accessible after logging in to your PrintOne site. You should simply attach the PDF to the post instead.

Basically, I need a javascript rule that will accomplish a hanging indent for quote marks on the left and right of a text quote. Any help would be appreciated. I don't need help formatting the sizes etc, just the indents for the text. If the text on the 2nd line fills the line, I would want to keep the indent of the left quote mark.

You can accomplish a "hanging indent" by setting the left indent of the paragraph greater than the first line indent, either in the Paragraph Formatting dialog or with the "lindent" attribute of the <p> tag.

 

If you set the first line indent to the same position as your initial tab stop, you can simply type the opening quotation mark and a tab, and the first line will appear to be indented at the same position as the subsequent lines. That should handle the opening (left) quotation mark pretty well.

 

The closing (right) quotation is a bit trickier. You can also set the right indent on the paragraph, again, either in the Paragraph Formatting dialog or with the "rindent" attribute of the <p> tag. Getting a quotation mark to show up at the right margin, outside the right indent position, is the challenge. I would basically fake this out by putting a tag such as <p quad=R leading=1> before the quotation mark. It will still be offset vertically a bit from the last line of text, but with the margin it probably will look fine. You can fiddle with it more with superscript settings and such as well.

 

Try this:

var text =  "We the people of the United States, in order to form a more perfect union, " +
           "establish justice, insure domestic tranquility, provide for the common defense, " +
           "promote the general welfare, and secure the blessings of liberty to ourselves " +
           "and our posterity, do ordain and establish this Constitution for the United States of America."
return "The following paragraph will appear to have a hanging indent " +
           "a half-inch on either side from the quotation marks:" +
           '<p lindent=3600 rindent=3600 tabstops="0;3600,Left;">&ldquor;<t>' +
           NormalizeEntities(text) +
           '<p quad=R rindent=0 leading=1>&rdquor;';

Link to comment
Share on other sites

Dan,

 

Sorry about that. Here is the attachment with 3 different scenarios. I've been working with this this morning using your suggestion and I have the right side figured out and the vertical alignments. I think the left side is actually trickier because.....The line with the left opening quotes will determine the longest line. So any other lines below, cannot fall beyond the opening quote. If the customer puts in a return, which shortens the lines, then a predefined tab wouldn't work, would it? I've also noticed another thing in their design, they have the period "hanging" on the right with the closing quote. I was able to fix that, assuming there will always be a period at the end of the last sentence, but I found another problem as I was "mocking" up the pdf for you. If they have any other punctuation on the right, like the "comma" in the 3rd example, they are probably going to want that to "hang". Would I be better off telling the customer that this is not an option, that the punctuation (besides the quotes) will not hang outside of the margins? I hope I'm explaining this correctly.

hangingquotes.pdf

Link to comment
Share on other sites

Sorry about that. Here is the attachment with 3 different scenarios. I've been working with this this morning using your suggestion and I have the right side figured out and the vertical alignments. I think the left side is actually trickier because.....The line with the left opening quotes will determine the longest line. So any other lines below, cannot fall beyond the opening quote. If the customer puts in a return, which shortens the lines, then a predefined tab wouldn't work, would it?

Ah, I see, yes, a picture is worth a thousand words. I didn't realize that the entire paragraph was going to be right-aligned. That actually makes the "left side" much easier to deal with. Try something like this:

return '<p quad=R lindent=2400 rindent=1200>' + 
   '<span pointsize=20>&ldquor;  </span>' +
   NormalizeEntities(text) +
   '<span pointsize=20><p quad=R rindent=0 leading=1>&rdquor;</span>';

(Make sure that the "Use legacy line leading" box is NOT checked in the Global Paragraph Settings.)

I've also noticed another thing in their design, they have the period "hanging" on the right with the closing quote. I was able to fix that, assuming there will always be a period at the end of the last sentence, but I found another problem as I was "mocking" up the pdf for you. If they have any other punctuation on the right, like the "comma" in the 3rd example, they are probably going to want that to "hang". Would I be better off telling the customer that this is not an option, that the punctuation (besides the quotes) will not hang outside of the margins? I hope I'm explaining this correctly.

Sorry, there's no provision in FusionPro to account for this kind of sophisticated InDesign-like hanging identation, where certain characters are allowed to "hang" outside the rest of the text. There's probably some complex algorithm that could be coded up with Text Measurement and some JavaScript to find the punctuation characters, but basically, hanging the opening and closing quotes is the best I can reasonably do for you in the context of this forum.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...