
Write your book

How it all started
One evening, I found a letter in my mail, which by miracle was not sent to spam. The letter said that the English publisher was interested in my activity in the Open Source project and offered to write me a book (in English). Without thinking twice, I agreed.
As it turned out, publishers are trying to print new books as often as possible, there are even whole departments engaged in dialing. The position of such spammers sounds quite loud, “Author Relationship Executive”. The task of such an employee is to find a consonant to work, tell him about the conditions and redirect him to the next department.
Next up is the Commissioning Editor. Already with this person and his subordinates, work is underway to conclude a contract and write a book.
the contract

It’s scary to sign any Russian contract: a huge number of small fonts and asterisks, if anything, no one is to blame. All this is supplemented by an absolutely insane legal language. Fortunately, the agency turned out to be English, and the contract could be translated (with a dictionary) and understood that everything was fine: if the publisher suddenly did not like my work, they paid the advance payment and left the manuscript to me. I promised that I would work well and would not delay sending the chapters.
Fee
The contract stipulated that I would receive 16% of the net profit from the sale of each book . This means that the publisher will subtract from the cost of the book the price of supplies, taxes (and abroad they are often huge), the cost of advertising and maintaining servers. Next, he will take 16% of the amount received, forward it by bank payment to Russia ... where I will still have to pay taxes.
I began to be indignant even before I looked at the size of taxes in Russia. Commissioning Editor replied that I ask how much other publishers pay. The largest that was found was 12% of net profit, which somewhat reassured me.
Taxes in Russia
The tax legislation was not fully realized. Each reading resulted in different amounts of tax (43%, 33%, 13%). It was all complicated by the fact that in 2013 tax legislation changed dramatically. Now (sort of) you need to pay 13%, while you can get a tax deduction of 20% of book sales in the first month (I have not checked it myself). You need to find out more in the tax upon receipt of the first fee.
Banks
Foreign banks do not really favor Russian ones. The transfer often goes through 8+ banks, while it is lost somewhere in the middle. I still have not managed to get a single payment - bank managers understand the problem.
Getting started
Publishers suggest writing in the format of a recipe book (“Cookbook”). Each recipe consists of the following parts:
* description of the problem ("Introduction")
* necessary tools and knowledge to solve this problem ("Getting started")
* solution of the problem ("How to do it")
* explanation of the solution to the problem ("How it works ")
* Additional information (" There's more ")
* links (" See also ")
You need to start writing with a complete list of recipes that will be discussed in the book. The list may change slightly during writing, may (and will!) Change the names of recipes. Try to write recipes so that the name reflects its essence.

In addition to these requirements, I made one more rule for myself: try to write in a way that is interesting not only for beginners, but also for professionals .
In my case, this resulted in the following:
Parts of "Introduction", "Getting started", "How it works" are mainly focused on beginners. They describe problems that beginners might not have to think about, or don’t know the solution to. For professionals, there’s a “There's more” section. They described what was not covered in the official documentation: frequently asked questions on the Boost mailing lists, and how solutions from Boost correlate with the new C ++ standards (C ++ 11, C ++ 1y / C ++ 14).
I tried to write the “How to do it” section as simply as possible, while not forgetting to point out the solutions from other recipes of the book that are applicable in this situation. See Also included links to other chapters of the book, official documentation, drafts of standards (to include this solution in the next C ++ standard), and opinions of famous people about this.
Time for work
Please note that writing a book takes a fairly long time. On average, you need a pace of 2 pages per day . For me, this resulted in writing sketches on the way to / from work (one and a half hours * 2) and bringing them into proper form on the weekend (at least one and a half days, and forget about the May holidays).
Graphics
Publisher takes responsibility for drawing diagrams, pictures and block diagrams. You are the author, so you just need to provide outline drawings. I must say right away that the publishing house did not work well in the beginning and I had to forcefully knock out the correct drawings from them. See “Making demands / Downloading rights”.
Technical Reviewers
In addition to spellchecking, there are also technical reviewers ("technical reviewer"). These people make sure that you wrote everything correctly from a technical point of view. I received sensible comments about the support of some parts of the C ++ 11 standard by the GCC compiler and points to pieces of code that were potentially incomprehensible to the user.
If the topic of the book is quite complicated, the publisher may not have people with the proper qualifications or there will be few of them. One book requires three or more technical reviewers. Here the Boost community helped me out: the very first person I asked to check the book agreed. For this, he receives a copy of the book from the publisher and the opportunity to advertise his site in the book and on the publisher’s site.
Spelling
Proofreaders are part of the standard staff of the publisher, so all grammar and spelling will be checked at a later stage . But you should still use spell checking. At least so that proofreaders do not hate you.
Put forward requirements / Download rights

When working with a publisher, it’s better to say right away what is not comfortable, what is not like. However, if suddenly the negotiation process stalled, there is the possibility of additional pressure. The ideal time would be the moment when the whole book is almost ready and the date of sending for printing is approved.
For example, I really didn’t like the pictures that were sent three weeks before being sent to print. They were remade more than once - the publisher was not interested in the failure of the deadline.
Marketing
Advertising of the book is now in full swing, the publisher writes that a new book on C ++ and Boost has appeared on all the resources controlled by it. There is also a limited opportunity to get free copies . To do this, you must agree to leave a review about the book (did you think most reviews are left for another reason?).
Free chapters
Several chapters of the book are uploaded by the publisher to the public . These same chapters are allowed to be translated into other languages and freely spread translations, if there is a link to the original .
List of chapters for open access
- Chapter 11: Working with the System
- Introduction
- Listing files in a directory
- Erasing and creating files and directories
- Passing data quickly from one process to another
- Syncing interprocess communications
- Using pointers in shared memory
- The fastest way to read files
- Coroutines - saving the state and postponing the execution
- Chapter 12: Scratching the Tip of the Iceberg
- Introduction
- Visualizing graphs
- Using a true random number generator
- Using portable math functions
- Writing test cases
- Combining multiple test cases in one test module
- Manipulating images
In this regard, the survey:
Only registered users can participate in the survey. Please come in.
Do you want to translate free chapters into Russian?
- 79.4% Yes 594
- 20.5% No 154