fchauvel / flap

Flattening LaTeX projects
https://fchauvel.github.io/flap
GNU General Public License v3.0
17 stars 2 forks source link

Comments replaced by newline cause havoc #12

Closed steven-murray closed 7 years ago

steven-murray commented 8 years ago

Hi,

After applying FLaP to my latex project, I tried compiling the created "merged.tex" file. However, it didn't compile, because it had odd spacing in some of the calls. This is because I have lines like:

\documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,%1headlines,% letterpaper a4paper
                 footinclude=true,cleardoublepage=empty,abstractoff, % <--- obsolete, remove (todo)
                BCOR=5mm,paper=a4,fontsize=11pt,%11pt,a4paper,%
                american,%
                %listof = withchapterentry,
                ]{scrreprt}

The commented line gets replaced with a newline, but that won't compile. If however comments are replaced with an empty string, it compiles. I don't know if this would break anything else however.

fchauvel commented 8 years ago

This issue requires some investigation, but I get the feeling that we are reaching here the limits of using substitutions using regular expression (on which FLaP is based). I will look further into that and let you know if I can find a fix.

steven-murray commented 8 years ago

I don't know about something completely robust, but in the code engine.py line 173, I just changed the replacement from '\n' to "" and it worked for me.

fchauvel commented 7 years ago

I close this issues as FLaP v0.4.0 addresses it. Let me know if you face further problems.