olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.78k stars 236 forks source link

Question: With chapters as subfolder of one root folder, how to compile PDF, epub or md with chapters? #978

Open bertput opened 2 years ago

bertput commented 2 years ago

Hello, Looking through the wiki, it looks like you're supposed to put your chapters at root level. If I do that, I can generate PDF, epub, or MD with no problem, and chapters all come out as you would expect.

However, if I put all my chapters under a single root folder (as some folks here in the forum suggest), my compiled PDF, epub or MD generate chapters one level lower than they should, even if I use the export settings as shown in this screenshot: 20211216T004700-manuskript-export-screenshot

Organizing my project this way has some advantages:

If it's possible to organize your manuscript as chapters under a single root folder, and still have your compiled output be at chapter level, I'd love to know how to do it... I cannot seem to find it in the wiki or in forum posts.

Cheers, Bert

bertput commented 2 years ago

Oh, BTW: This is v0.13.1 from github :-)

TheJackiMonster commented 2 years ago

So the problem is that it won't be indented correctly? Maybe this could be solved with own categories to filter out other folders. I assume I need a similar project first to test around. ^^'

bertput commented 2 years ago

Yes, when your folders are at root level, compiling will create chapters. But if you put all the folders inside the root folder, compiling generates sections (if you want to think of it in LaTeX terms).

I did find a setting that allows you to select all folders under a given root folder when compiling but it also has a warning that it is not implemented yet. I tried it anyway and of course it made no difference :-)

That setting is under the "Filters" text which is really a button, although not obvious LOL

AlanDunaway commented 2 years ago

I use Level 2 for chapters. You can also unmark the level 1, and the folder name will not show if you do so. Like: Level 1: Book Name Level 2: Chapter Name Level 3: Chapter Text

Yes, when your folders are at root level, compiling will create chapters. But if you put all the folders inside the root folder, compiling generates sections (if you want to think of it in LaTeX terms).

I did find a setting that allows you to select all folders under a given root folder when compiling but it also has a warning that it is not implemented yet. I tried it anyway and of course it made no difference :-)

That setting is under the "Filters" text which is really a button, although not obvious LOL

Unmark them in the Outline instead. That will make sure they won't be exported.

bertput commented 2 years ago

Hi @AlanDunaway -- yes, that's what I'm trying to do, but I haven't figured out the magic sauce yet. Please understand, I'm not trying to troll, and I have looked through as much documentation as I could find, but I don't know how to do that. So if you know what settings to use (presumably in compile), could you share?

Even better, maybe add a HOWTO page to the wiki that describes how someone could achieve this?

AlanDunaway commented 2 years ago

Hi @AlanDunaway -- yes, that's what I'm trying to do, but I haven't figured out the magic sauce yet. Please understand, I'm not trying to troll, and I have looked through as much documentation as I could find, but I don't know how to do that. So if you know what settings to use (presumably in compile), could you share?

Even better, maybe add a HOWTO page to the wiki that describes how someone could achieve this?

Sure, Just uploaded a guide, will add it to the wiki(it's a external link to my Google Drive document).

AlanDunaway commented 2 years ago

@bertput It's the last link in the How To area at the Wiki. Don't worry, it's a safe file, an alternative account of mine. If you have any questions, feel free to ask here.

bertput commented 2 years ago

Hi Alan, Yeah I'm not seeing that file or the HOWTO entry. Maybe it has to go through a pull request process or something?

AlanDunaway commented 2 years ago

Hi Alan, Yeah I'm not seeing that file or the HOWTO entry. Maybe it has to go through a pull request process or something?

Wiki>Using>How To>How to Export with Manuskript and Post Process with Calibre

bertput commented 2 years ago

I found it. Sorry. :-/

AlanDunaway commented 2 years ago

I found it. Sorry. :-/

No problem, man. Hope it helps you.

AlanDunaway commented 2 years ago

Just one thing. In: p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt; text-align: justify;} You can set text-indent to 0pt if you don't want any paragraph spacing(spacing between the border and paragraph start).

bertput commented 2 years ago

Wow... quite the process. :-)

Give me a day or two to digest it and see if I can make it work. I appreciate your help!

AlanDunaway commented 2 years ago

Wow... quite the process. :-)

Give me a day or two to digest it and see if I can make it work. I appreciate your help!

No problem. If you get it set in Calibre's Preferences(conversion for page break and Search and Replace), you can make the process permanent, as in, Calibre will do everything automatically as soon as you hit OK in the conversion window.

AlanDunaway commented 2 years ago

Added the Making it Permanent to the guide. Calibre is a beast when it comes to conversion of E-Books and source files.

bertput commented 2 years ago

Understood -- thank you! Since manuskript could call pandoc and generate PDF or EPUB directly, I kept looking at that functionality for the solution but it doesn't look like a one-step process.

It looks like you're generating an interim file from manuskript and then having calibre do the rest of the heavy lifting. I use calibre quite a bit but haven't really dug into the intricacies of conversion, so this is going to be a learning experience for me. Thank you for sharing! It's much appreciated.

Cheers, Bert

AlanDunaway commented 2 years ago

Understood -- thank you! Since manuskript could call pandoc and generate PDF or EPUB directly, I kept looking at that functionality for the solution but it doesn't look like a one-step process.

It looks like you're generating an interim file from manuskript and then having calibre do the rest of the heavy lifting. I use calibre quite a bit but haven't really dug into the intricacies of conversion, so this is going to be a learning experience for me. Thank you for sharing! It's much appreciated.

Cheers, Bert

Exactly. Exporting EPUB from Manuskript, then manipulating and converting it with Calibre. You can also edit files directly in Calibre, as it has a HTML editor(select a file and press T on your keyboard). You're welcome. There may be more ways to properly convert it and I may not know them, but this one is a solution that worked for me.

bertput commented 2 years ago

Hi @AlanDunaway

I may have found an easier solution using just pandoc. I'm going to keep fiddling with it for another day or so, and if it looks reliable maybe I can add a HOW-TO as an alternative to using calibre.

It involves doing a simple compile to markdown, then navigating to where ever you put your compiled MD output file, and then:

pandoc --shift-heading-level-by=-1 --top-level-division=chapter --toc -o manuscript.epub manuscript.md 

Again, let me fiddle with it for a bit longer to make sure it's reliable, but it seems to work so far.

Cheers, Bert

AlanDunaway commented 2 years ago

Hi @AlanDunaway

I may have found an easier solution using just pandoc. I'm going to keep fiddling with it for another day or so, and if it looks reliable maybe I can add a HOW-TO as an alternative to using calibre.

It involves doing a simple compile to markdown, then navigating to where ever you put your compiled MD output file, and then:

pandoc --shift-heading-level-by=-1 --top-level-division=chapter --toc -o manuscript.epub manuscript.md 
* The `--shift-level-heading-by=-1` argument converts the sections to chapters.

* The `--top-level-division=chapter` argument sets the top levels to chapters, not sections (which would be the defaullt).

Again, let me fiddle with it for a bit longer to make sure it's reliable, but it seems to work so far.

Cheers, Bert

Cool, man. Always good to have more than one method. Do some tests with it and report back if it works the way it should.

bertput commented 2 years ago

I added a HOWTO page as well that describes the technique I figured out. It needs only manuskript and pandoc. :-) Here's the link to the WIKI page here on github I hope it helps.

bertput commented 2 years ago

@TheJackiMonster Here is a sample project if you want it: you can link it to the HOWTO if you want. You'll need to remove the .zip extension. This is the project that I used to create the HOWTO.

howto-format-your-project-with-book-research-notes-folders-root-level.msk.zip

AlanDunaway commented 2 years ago

About notes, you can use the World menu too. And also, here is what I have: image Each folder is a different book. Inside each one, there are 20 chapter folders. I can add a folder below Sexy Tales for notes, for example. Your guide is good if you know how to mess around with command line.

bertput commented 2 years ago

That is cool. I tend to stick to one manuskript project = one book. I version control each book in its own git repository as well, otherwise it all gets too large and unwieldy.

AlanDunaway commented 2 years ago

That is cool. I tend to stick to one manuskript project = one book. I version control each book in its own git repository as well, otherwise it all gets too large and unwieldy.

Good tip. I plan to have some kind of version control for my own project. Looking into Personal Backup, as it seems to have that functionality. And yes, too many chapters can make a project grow big. But, for me, it's better, since I use the same universe for all those books in the project. Same characters, same world details, same everything. And, I'm still transitioning it from yWriter, still not done yet. Just finished transitioning the characters, now on to finish the first book(add all the chapters from the yWriter project) and start the second one. The last two folders are extra books(that don't interfere in the normal storyline). In that list, I have a level 3 folder(in some chapters) in case I need to add a movie being played by the characters or something else.

bertput commented 2 years ago

Nice! As a programmer, I tend to think of things from a programming perspective, so version control (using something like git) is second nature to me. I also like all my documentation to be plain text, human readable and understandable. Word documents, RTF, etc. just send chills down my spine. I have been using LaTeX for all of that, then I recently discovered markdown. I've been using markdown for basic documents, project notes, READMEs, etc. but now I'm exploring converting from markdown to LaTeX and EPUB, PDF... the sky is the limit,

And yeah, I'm very comfortable at command line :-)

I am curious: with so much text loaded into manuskript: any performance issues?

AlanDunaway commented 2 years ago

Nice! As a programmer, I tend to think of things from a programming perspective, so version control (using something like git) is second nature to me. I also like all my documentation to be plain text, human readable and understandable. Word documents, RTF, etc. just send chills down my spine. I have been using LaTeX for all of that, then I recently discovered markdown. I've been using markdown for basic documents, project notes, READMEs, etc. but now I'm exploring converting from markdown to LaTeX and EPUB, PDF... the sky is the limit,

And yeah, I'm very comfortable at command line :-)

I am curious: with so much text loaded into manuskript: any performance issues?

There are performance issues in the full screen mode and the whole chapter editor mode. CPU spikes to 32% and the program becomes slow as heck. Also, the more content, the slower it becomes. But, loading times all depend in how many text files you currently have in your project. Wordcount only starts being a hassle when opening the full chapter editor or the fullscreen editor. For me, I found that leaving the chapter folder in Index Cards mode was better, performance wise, as the cards seem to not be so heavy in processing power. And, my PC isn't a powerful one(the one I write in). My Specs:

Intel i5 2430 2.4GHz
RAM: 4GB
Video: Intel HD 3000 1GB

I'm not a programmer, so, Versioning isn't common with me. And I like to have a PDF or a EPUB file, along with a simpler editor to help. Moved to Manuskript because of the amount of features it provides(Of course, not multiple character set in text files, but that can be a minor issue.

bertput commented 2 years ago

My specs are similar but it's a new machine so I pretty much have more of everything: 8 cores, 16Gb memory, etc. etc. To help with performance I would definitely put in more memory and upgrade to an SSD if that's an option. You'll be surprised at the difference that makes.

AlanDunaway commented 2 years ago

My specs are similar but it's a new machine so I pretty much have more of everything: 8 cores, 16Gb memory, etc. etc. To help with performance I would definitely put in more memory and upgrade to an SSD if that's an option. You'll be surprised at the difference that makes.

Too bad RAM isn't easy to find for this one. It's a laptop from 2012.

bertput commented 2 years ago

Hi @AlanDunaway -- I've been thinking about your folder structure and I like it! It never occurred to be to have a folder per book in a series, and you can have any number of folders. Then you can put research notes in their own folder if you want.

My comment about one book == one git repo is certainly not a hard-and-fast rule, just a guideline. :-)

When you're ready to compile and print your book, you just select the one you want to print and go. I guess you would not typically compile and print your research notes folder but the flexibility is there if you want it.

Anyway, I guess we have about beat this subject to death. I'll let the admins decide when to close this thread, since there are some really useful comments in here :-)

Cheers, Bert