... now with 35% more arrogance!

Tuesday, May 14, 2013

Layout Interlude

I was planning on posting Part 6 of the Layout Tutorial today, but I'm way behind, partly because of family activities this past weekend, partly because I'm working out a simpler way to do the things I plan to cover in Parts 6 and 7. As I believe I already said in Part 5, we're running up against the limitations of what you can do for layout and design that applies to all kinds of products. Want to stick a PNG or JPEG image in between two paragraphs and let the web browser, ereader, or PDF creation software decide where it should go? That works fine. Want to use an SVG? Oops, can't directly include an SVG in a PDF using a LaTeX engine; you have to embed the SVG in a PDF, by itself, then include that as your image. Want to use that PDF image in your EPUB? Nope, you have to use the SVG. Want the text to wrap around the contour of the image? That's what I'm working on now. I can *do* it, I'm just looking for an easier way to do it that I can explain and not have people scream "What the hell are you doing to me?"

Sycarion had a question for me a while back, and I offered to help, but I haven't heard back. The issue is an error code when trying to make tables using Markdown and Pandoc. I can check your source file, Sycarion, if you get back to me. In the meantime, my best guess is that it's an issue I ran into myself: character encodings. Pandoc only reads UTF-8, which supports a lot of characters, including accented characters; however, occasionally I would put an é in my text, like when spelling "mêlée", and the text file would save as the wrong character encoding, so Pandoc would choke.

The Pandoc docs suggest using iconv in a pipe to change the encoding to UTF-8 before sending text to Pandoc, then piping it back to iconv to get your preferred character encoding. However, I believe TED Notepad will do the conversion for you, if you remember. It appears that it uses ANSI encoding instead of UTF-8 by default. A quick visit to Options > Settings.. > File will let you fix that.

2 comments:

  1. Sorry that I didn't get back to you. RL has been quite full.

    It turned out to be an encoding issue. Some files created in Windows and others on a Mac. Soon, I'd forget which was created on what and then...

    snit in a comment. Sorry about that, don't know what I was on that day.

    Oddly enough, Dokuwiki can convert its own markup syntax into html, epub, pdf and more. Someone has even figured out how to generate a Windows Help file from it. I have that "sort of" working, I'll see where it leads.

    Thanks again. Look forward to what you come up with. It's a great series.

    ReplyDelete
    Replies
    1. Incidentally, I found another UTF-8 checkbox in the Filter creation dialog. My instructions above were probably incomplete.

      Pandoc can do a lot of other conversions, including MediaWiki (Wikipedia,) OpenOffice documents, MS Word, etc. And it can be used as a plugin for WordPress and a couple wiki/blogging apps. I won't be covering those, though, because this is too big a job already. Part 6, scheduled for this Thursday, covers web graphics, Part 7 will either be EPUB or PDF graphics, and then I move on to advanced templates for things like One Page Dungeon.

      Delete