fchauvel / flap

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

\begin{frame}[fragile] #5

Open gro1729 opened 8 years ago

gro1729 commented 8 years ago

Very often I need "fragile" slides.

According to my "philosophy" : "One slide, one file"

"fragile"-slides do not have to have an identation. "flap" ignores my indentation-guidelines. This is a very serious problem.

fchauvel commented 8 years ago

Could you provide me an example of such a slide, and how it references other resources?

gro1729 commented 8 years ago

1 2 3

Have a look at these slides. The first slides compiles, the second does not but the third one compiles again. The "\begin" and "\end" of "fragile" slides may not be indented. In Flap 0.2.1, I have in mind, I have seen in the merged file some aditional white space before the "\begin" of an included file.

fchauvel commented 8 years ago

At first sight, this seems like a tricky issue with the use of regex. I will check and let you know when I got a fix.

gro1729 commented 8 years ago

Sorry, I pressed the wrong button.

fchauvel commented 8 years ago

I had a quick look over lunch and the test I added passes just fine (see https://github.com/fchauvel/flap/blob/96678dccad08f4dd148076c6515bc60e23133198/tests/unit/engine.py#L384-L400).

I am wondering whether this results from the way FLaP processes input{foo}directives. As FLaP exactly replaces inclusion directives by the content of the related file, the first line of the content may be indented in the merged file, if the inclusion directive is indented in the original source file. See the example below:

Main file
Included File (foo.tex)
Output File
<--->\input{foo}
\begin{frame}
some content
\end{frame}
<--->\begin{frame}
some content
\end{frame}

Could this be an explanation in your case?