#Quote inserts empty lines in LaTeX

Deplate
2008-06-19
2013-04-17
  • PILCH Hartmut

    PILCH Hartmut - 2008-06-19

    The Quote environment seems broken, starting from v 0.8.1.  It was fine in v 0.8.0.

    In LaTeX, an empty line is inserted between each two lines.  This in itself seems undesirable, but it leads to complete failure when such an empty line is inserted in the middle of a Deplate macro.

    I'm trying to repair this by patching the Ruby sources, but I'm not very familiar with these sources.

    Any suggestions?

     
    • PILCH Hartmut

      PILCH Hartmut - 2008-06-19

      I have now changed deplate/fmt/latex.rb by simply disabling the wrapping in the Quote environment.

      I'll publish a patch at

        http://a2e.de/adv/deplate

      where I maintain the Deplate RPM package for my opensuse meta-distribution.

       
    • Tom Link

      Tom Link - 2008-06-19

      It seems the problem stems from format_quote() in latex.rb. The body gets wrapped twice and thus inserting the extraneous newlines. The easiest solution would be to remove the call to wrap_text():

      def format_quote(invoker)
              env = invoker.args["long"] ? "quotation" : "quote"
              # elt = wrap_text(invoker.elt)
              elt = invoker.elt
              format_environment(invoker, env, elt)
      end

      I'm not sure if this is a more subtle problem though. I'll have to check when this problem was introduced but this could take a while.

       
    • PILCH Hartmut

      PILCH Hartmut - 2008-06-19

      This problem is quite pervasive.

      I've had to disable wrap_text in a lot of places in latex.rb in order to get texts compiled that compiled without problems in v 0.8.

      There seems to be a cumulation of line-wrapping.

      In any case, I don't see any merit in wrapping what doesn't need to be wrapped in a latex text.  If the author of the deplate source text doesn't want it wrapped in the source, why should he want it wrapped for LaTeX?

       
      • Tom Link

        Tom Link - 2008-06-19

        Could you please send me a sample input file so that I can better understand these problems?

        Most newlines are stripped when reading the input (with the exception of verbatim, native etc.).

         
    • Tom Link

      Tom Link - 2008-07-07

      For the records, you should be able to switch off line wrapping by setting wrapMargin to 0.

      #VAR: wrapMargin=0

       
    • Brett

      Brett - 2008-07-09

      Hi,

      I'm having the same problem with footnotes.

      For the record
      #VAR: wrapMargin=0

      does not do anything for me.

      I second the suggestion above -- I don't wrap my txt files, and I don't want my tex files wrapped either.

       
      • Tom Link

        Tom Link - 2008-07-09

        The problem with not wrapping tex files is that certain implementations of tex have a limit on the line size. Basically, that's the reason why deplate does all this wrapping in the first place.

        It's possible that you'll also have to set
        #VAR: wrapMarginInner=0

        The wrap method currently is in a state of flux.

        I'll check the footnote problem. My test cases ignore whitespace which in general is a good thing but is also the reason why this problem passed unobserved.

         
      • Tom Link

        Tom Link - 2008-07-09

        The version in CVS is supposed to solve this problem. Maybe somebody could give it a try.

         
    • Brett

      Brett - 2008-07-11

      I checked out the CVS version, built the gem, and installed it (I'm a ruby newb, so that was easiest).

      And it works! Cool. Thanks.

       
      • Tom Link

        Tom Link - 2008-07-11

        Thanks for testing.

        In the meantime, I released 0.8.3 which should be the CVS version you checked out.

        In general, the CVS version should be good. It's possible though that new features change until the next release.

         

Log in to post a comment.