4 Replies Latest reply on Aug 6, 2014 11:25 PM by Arvindkmar

    Removing the Forced Line Breaks

    Arvindkmar Level 1

      Hi All,


      Please Help!


      • Removing the Forced Line Breaks/Soft Enters/manual paragraph breaks from Indesign file.


      We need to remove the Forced Line Breaks from Indesign manually for the content to be properly aligned in ePUB.


      If we click the option “Forced Line Breaks” when exporting the ePUb file the forced line breaks are also removed from the codes snippets leaving extra spaces between the codes.


      To explain in detail the screenshot is as follows:


        In the below screenshot there are soft enters given in the paragraph to balance the text.

      Where as in code Soft Enters are given in the code the content which is in blue, because the code is big enough and we cannot fit it in 1 line as its restricted to the printable area.


      Paragraph and Code with Soft Enters.png

      When exporting to ePUb if the “Remove Force Line Break” option is clicked. It removes the Forced line break all over the book, whereas we want the Line breaks to be retained in “Code Snippets” which are in blue color


      Replacing the Soft enters and the Space bar spaces with no content/no space.

      Paragraph and Code Removing the Soft Enters.png

      Request someone to please suggest some way to get out of this.

        • 1. Re: Removing the Forced Line Breaks
          evansreb Level 1

          Assuming this is a reflowable ePub rather than a fixed layout ePub, I would suggest not using soft returns to balance text anywhere. If you choose a particular place to break a line with a soft return, it will be a mess if it’s viewed on a narrow screen, or with larger type than you expect, because the turn lines will wrap back to the left margin giving an odd choppy right margin. I don’t imagine anyone would expect to read an eBook about coding on a smart phone, but they might try to read it on a smallish eReader.


          If you have the book set up for print publication with your preferred line breaks, make a copy of the file specifically for ePub export and remove all the soft returns. Then set up the code paragraph style with a hanging indent that is wider than the furthest left indent you are using. For instance, using a block left indent of 10p with a first line negative indent of –7p makes your code lines begin with a 3p left indent (code is indented in your example), and lets the lines rebreak as needed on any width eReader, with all turn lines further indenting to 10p. You’d have to figure out the right amounts for the first line indent and hanging indent, of course, so the monospace font stays aligned when text over-runs turn text to the next lne.


          Rebecca Evans

          • 2. Re: Removing the Forced Line Breaks
            Arvindkmar Level 1

            Hi Rebecca,


            Thanks for your reply much appreciated.


            Yes, I have working on reflowable ePUB.


            When the Hanging Indent to the code is given referring to a specific line, the Indent to the continued line comes proper. But if there is a new line with spaces before it, the indentation doesn't come properly in the Print file, but the epub file is fine I cant see any extra space in between.


            I have attached the screenshot for your reference. The content Hightlighted in red is coming fine, as I have the Hanging Indent is given in reference to the 1st line. But there are space before the 2nd Line Highlighted in green and the Hanging Indent is not coming as required.


            Hagning Indent in Code.png


            Please reply if any changes needs to be done.

            • 3. Re: Removing the Forced Line Breaks
              evansreb Level 1

              The hanging indent is not based on the first letter in a line, it is based on the left margin. Your indent for continued lines is not deep enough. You need to find the code line that begins with the most spaces and then set the continued-line indent so that it indents further than those spaces at the beginning of the line.


              If you want different hanging indents for lines that begin with spaces, you’ll need to create more than one paragraph style. I would advise against that, though, because it is clearer to the reader if all turn lines indent to the same place. That way they know a turn line is not a new indented code line.

              Screen Shot 2014-08-05 at 9.54.16 AM.png

              • 4. Re: Removing the Forced Line Breaks
                Arvindkmar Level 1

                Thanks for the reply Rebecca.


                Your are absolutely right. We cant have paragraph style with hanging indents for lines that begin with spaces.


                Is there any way in CSS or Javascript through which we can remove the spaces.