January 25, 2017
On Wed, 25 Jan 2017 11:58:45 +0000, Chris wrote:

> On Tuesday, 24 January 2017 at 14:27:15 UTC, aberba wrote:
>> Which one works well? I'm more concerned about syntax highlighting and line numbering (in some cases). Support for custom fonts.
> 
> I know people who write articles and their Ph.D.
> thesis in LaTeX to get maximum control over the layout (to avoid
> Word-like surprises).

If you are submitting a paper to an academic journal, they will tell you what format they expect. If you sent a paper as a Word document when they require LaTeX, they will reject it with a note telling you to use LaTeX instead. Conversely, if they expect Word documents, they will reject anything in LaTeX.

As a PhD student, your advisor will tell you what format to use. This will almost certainly match the most commonly used file format for journal submissions in your field.

Regardless, you want *consistency* more than control. If you submit to a CS journal, they will often give you a .sty file -- this sets up page layout and the like, taking control away from the writer of the article. If you submit to a humanities journal, they might have a Word document template. They might also simply give style requirements that you must obey.

> The downside is the source code.
> It's not very nice to read and you get lost easily. And try to get back
> after a year and change something!

It's like C++. If you use the same restricted subset that you understand concretely, you shouldn't have a bad time. If you use a different set of packages and macros every document, you're in for a world of hurt.

> Also, you have to convert it to PDF
> each time you wanna (proof)read it, so you usually deal with two layouts
> at the same time (source code and PDF/HTML), which is time consuming and
> error prone.

It separates the writing / editing process from the proofing process and gives you a significantly different format for proofing. This is helpful for catching errors.

I wouldn't use htlatex. Instead of a simple <em> or <i> tag, it produces <span class="autogenerated-i-1"> type things. Which is okay if you just want to throw it up online, but if you want to produce an ebook with maximum compatibility, simpler HTML is better.

> A lot of publishers will prefer Word, because they can easily edit it and if they have their own layout section, they will transform Word to txt and paste it into say Adobe InDesign.

Change tracking and commenting are the huge things publishers use Word for.

> I for my part have stopped worrying about it too much. Just write the text (in Word or an Ascii editor)

If it's a few pages, it's painful and error-prone to retro-add formatting once you finished the content. If it's a hundred pages, you might need to spend several weeks to format it. That doesn't seem like a good tradeoff to me.
January 25, 2017
On 1/24/2017 6:27 AM, aberba wrote:
> Which one works well? I'm more concerned about syntax highlighting and line
> numbering (in some cases). Support for custom fonts.

I've used Ddoc to publish a couple of Kindle books.
January 26, 2017
On Thursday, 26 January 2017 at 02:41:24 UTC, Walter Bright wrote:
> On 1/24/2017 6:27 AM, aberba wrote:
>> Which one works well? I'm more concerned about syntax highlighting and line
>> numbering (in some cases). Support for custom fonts.
>
> I've used Ddoc to publish a couple of Kindle books.

https://www.amazon.com/s/ref=dp_byline_sr_ebooks_1?ie=UTF8&text=Walter+Bright&search-alias=digital-text&field-author=Walter+Bright&sort=relevancerank

"The Historian's History of the World Vol. 1: Prolegomena: Egypt, Mesopotamia"

What about Vol. 2? ;)
January 26, 2017
On Wednesday, 25 January 2017 at 20:07:22 UTC, Chris Wright wrote:
> On Wed, 25 Jan 2017 11:58:45 +0000, Chris wrote:
>
>> On Tuesday, 24 January 2017 at 14:27:15 UTC, aberba wrote:
>>> Which one works well? I'm more concerned about syntax highlighting and line numbering (in some cases). Support for custom fonts.
>> 
>> I know people who write articles and their Ph.D.
>> thesis in LaTeX to get maximum control over the layout (to avoid
>> Word-like surprises).
>
> If you are submitting a paper to an academic journal, they will tell you what format they expect. If you sent a paper as a Word document when they require LaTeX, they will reject it with a note telling you to use LaTeX instead. Conversely, if they expect Word documents, they will reject anything in LaTeX.

They usually accept both Word and LaTeX and provide templates. I've never heard of LaTeX only though, because a lot of academics wouldn't want to use it - and shouldn't be forced to.

> As a PhD student, your advisor will tell you what format to use. This will almost certainly match the most commonly used file format for journal submissions in your field.

Not true. It's about what the printing company accepts - and they are usually fine with LaTeX or a PDF generated out of it. A Ph.D. thesis still has to be printed and bound. I think PDF is accepted for digital storage.

> Regardless, you want *consistency* more than control. If you submit to a CS journal, they will often give you a .sty file -- this sets up page layout and the like, taking control away from the writer of the article. If you submit to a humanities journal, they might have a Word document template. They might also simply give style requirements that you must obey.

Er, yes. That's how it works. Always ask the publisher first. But that wasn't the question. The question was Markdown or LaTeX, and if you want to generate your own PDF for e.g. a M.A. or Ph.D., some people prefer LaTeX because of the fine grained control it offers. I don't know a single Ph.D. student who used Word who didn't have to fight with Word stubbornly restructuring the layout. The footnotes, the graphics ... a nightmare.

>> The downside is the source code.
>> It's not very nice to read and you get lost easily. And try to get back
>> after a year and change something!
>
> It's like C++. If you use the same restricted subset that you understand concretely, you shouldn't have a bad time. If you use a different set of packages and macros every document, you're in for a world of hurt.

Unfortunately, you need to add packages for various reasons, e.g. IPA (not the beer!) and Maths extensions, formatting extensions etc. The odd macro will also make sense.

>> Also, you have to convert it to PDF
>> each time you wanna (proof)read it, so you usually deal with two layouts
>> at the same time (source code and PDF/HTML), which is time consuming and
>> error prone.
>
> It separates the writing / editing process from the proofing process and gives you a significantly different format for proofing. This is helpful for catching errors.

It is helpful to catch errors (cf. the "Save and preview" function on this forum), that's why I always read my LibreOffice documents as PDF as well. However, constantly switching between two representations introduces additional errors.

> I wouldn't use htlatex. Instead of a simple <em> or <i> tag, it produces <span class="autogenerated-i-1"> type things. Which is okay if you just want to throw it up online, but if you want to produce an ebook with maximum compatibility, simpler HTML is better.
>
>> A lot of publishers will prefer Word, because they can easily edit it and if they have their own layout section, they will transform Word to txt and paste it into say Adobe InDesign.
>
> Change tracking and commenting are the huge things publishers use Word for.

Yes, if they edit it on the screen. Some editors remove all formatting, print it and read it on the paper. Formatting and change tracking is not always advisable, because it can introduce errors like notes or tracked changes that are exported alongside the normal text. You'd be surprised at how many writers spend hours fighting with Word, trying to format everything only to have it removed by the editor.

Either you are given a template / style guide to adhere to, in which case they probably have an automatic conversion tool, or you shouldn't bother too much with formatting, because they have their in-house layout crew.

>> I for my part have stopped worrying about it too much. Just write the text (in Word or an Ascii editor)
>
> If it's a few pages, it's painful and error-prone to retro-add formatting once you finished the content. If it's a hundred pages, you might need to spend several weeks to format it. That doesn't seem like a good tradeoff to me.

Usually you only add "Header (1, 2, 3)" etc. Of course, emphasis (bold, italic etc.). has to be marked in the text somehow, else you'll never find it again. Then you can add / insert the graphics and tables. Not too big a deal. It's worse having to restructure an existing layout I think.
January 26, 2017
On Thursday, 26 January 2017 at 02:41:24 UTC, Walter Bright wrote:
> On 1/24/2017 6:27 AM, aberba wrote:
>> Which one works well? I'm more concerned about syntax highlighting and line
>> numbering (in some cases). Support for custom fonts.
>
> I've used Ddoc to publish a couple of Kindle books.

Ddoc seem like a more straight foward approach for documenting code but for an ebook, the lack of tables, images, and other typesettings (without using HTML) makes it inappropriate for my use case.

Will most likely go with markdown and use other solutions for theming it. Then pandoc it to PDF

Asiicdoc seem to be more capable but the extra learning curve is ...
January 26, 2017
On 1/26/2017 1:12 AM, qznc wrote:
> "The Historian's History of the World Vol. 1: Prolegomena: Egypt, Mesopotamia"
>
> What about Vol. 2? ;)

Too much work :-(
January 26, 2017
On 1/26/2017 7:02 AM, aberba wrote:
> Ddoc seem like a more straight foward approach for documenting code but for an
> ebook, the lack of tables, images, and other typesettings (without using HTML)
> makes it inappropriate for my use case.


I did this book:

https://www.amazon.com/Historians-History-World-Vol-Prolegomena-ebook/dp/B00REVL4BC/

It uses tables, images, and multiple fonts, all with Ddoc. It's not perfect, and the Kindle encoding has limitations, but I was able to get it remarkably close to the way the original book looked.

Of course, your specific requirements may preclude this, but Ddoc is very capable.
January 27, 2017
On Tuesday, 24 January 2017 at 14:27:15 UTC, aberba wrote:
> Which one works well? I'm more concerned about syntax highlighting and line numbering (in some cases). Support for custom fonts.

Well I worked with Latex, I hate it. If you do go that route here is some syntax highlighting

https://github.com/JesseKPhillips/dlang-latex-listings

If you would like to have your examples compiled/tested you can use/modify:

https://github.com/JesseKPhillips/listings-dlang-extractor

Enjoy finding the best typesetter for your project.
January 27, 2017
On Thursday, 26 January 2017 at 23:28:37 UTC, Walter Bright wrote:
> On 1/26/2017 7:02 AM, aberba wrote:
>
>
> I did this book:
>
> https://www.amazon.com/Historians-History-World-Vol-Prolegomena-ebook/dp/B00REVL4BC/
>

Is it the same as this:

https://www.kobo.com/ie/en/ebook/the-historians-history-of-the-world-in-twenty-five-volumes-prolegomena-egypt-mesopotamia

It's €3.99 there and only £1.50 (€1.76) on Amazon. However, I don't do kindle. I recently got interested in exactly this topic, especially Mesopotamia. Would it be a good introduction?
January 27, 2017
On Wednesday, 25 January 2017 at 10:57:41 UTC, Russel Winder wrote:
> Asciidoc (and it's continuation Asciidoctor) was invented to be a human usable front end to the DocBook/XML toolchain – and it still works for this. Humans should not have to write XML. Hence Asciidoctor.

DocBook FTW, other magical formats are beyond pathetic. What? Asccidoc, Asciidoctor, Markdown, SO Markdown, GH Markdown, this Markdown, that Markdown, Restructured text, yaml, TeX, LaTeX, XeLaTeX, people invented tons of formats just to markup text for books and tons of their clones, extensions and incompatibilities, it's just laughable. Guess what % character means it those magical languages, or why Markdown chose an opposite approach to BBcode for square brackets, because it's more fun this way? XML is one uniform regular readable syntax for everything, it consists of only tags, attributes and comments, no arbitrary magical special characters for god only knows what.