Answers.Body: <p><strong>First, create your desired structure in a text editor.</strong></p>
  
  <p>On the first line will be placed keyword <code>bookmarks</code> in round brackets as a root.</p>
  
  <p>Behind the chapter titles are located page numbers or page names (with a suffix <code>.djvu</code>). Before the number must be symbol sharp <code>#</code>. All parameters are enclosed in quotation marks <code>""</code>.</p>
  
  <p>Lower order chapters are created by embedding additional round brackets behind higher order chapter.</p>
  
  <p>Sample with page numbers:</p>
  
  <pre><code>(bookmarks
      ("TOC" "#3")
      ("Chapter 1 - Blabla" "#7"
          ("Subchapter 1.1 - Blabla" "#11")
      )
      ("Chapter 2 - Blabla" "#15"
          ("Subchapter 2.1 - Blabla" "#17"
              ("Subchapter 2.1.1 - Blabla" "#20")
          )
      )
      ("Chapter 3 - Blabla" "#25")
  )
  </code></pre>
  
  <p>Sample with page names (with a suffix <code>.djvu</code>):</p>
  
  <pre><code>(bookmarks
      ("TOC" "#page_0003.djvu")
      ("Chapter 1 - Blabla" "#page_0007.djvu"
          ("Subchapter 1.1 - Blabla" "#page_00011.djvu")
      )
      ("Chapter 2 - Blabla" "#page_00015.djvu"
          ("Subchapter 2.1 - Blabla" "#page_00017.djvu"
              ("Subchapter 2.1.1 - Blabla" "#page_00020.djvu")
          )
      )
      ("Chapter 3 - Blabla" "#page_00025.djvu")
  )
  </code></pre>
  
  <p>Caution: Save the file in <code>UTF-8</code>.</p>
  
  <p><strong>Second, paste the created outline text file into the selected DjVu file.</strong></p>
  
  <p>Install the <a href="http://djvu.sourceforge.net/" rel="nofollow noreferrer">DjVuLibre</a> library (if you do not already have it).<br>
  From the library we use <code>djvused</code> tool.</p>
  
  <p>At the command prompt, type:</p>
  
  <pre><code>path\djvused path\book.djvu -e "set-outline path\outline.txt" -s
  </code></pre>
  
  <p>Instead <code>path</code> parameter substitute your location on the disk.<br>
  Parameter <code>-e</code> is the exec (system call) of the <code>set-outline</code> command with the filename parameter.<br>
  Parameter <code>-s</code> is save command.</p>
  
  <p>Press Enter...</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T16:32:01.713Z
Answers.LastActivityDate: 2018-07-17T16:32:01.713Z
Answers.UserDisplayName: Stilgar Dragonclaw
Answers.Body: <p>Although the following method does not explicitly use the DjVuLibre library (it does implicitly), the following method might save some of your precious time...</p>
  
  <ul>
  <li>Use some tool to extract the contents from the djvu file. I recommend <a href="https://pypi.org/project/pdf-contents-extractor/" rel="nofollow noreferrer">pdf_contents_extractor</a> for python3 which can be easily installed with pip(pip3) (only tested on linux, but works for djvu too)</li>
  <li>Fine-tune the contents.txt or contents_ocr.txt file with your favorite text editor</li>
  <li>Use <a href="http://handyoutlinerfo.sourceforge.net/" rel="nofollow noreferrer">HandyOutliner</a> to insert the bookmarks in your djvu file</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-15T06:08:36.870Z
Answers.Text: I was not able to run HandyOutliner on Linux, and did not even find a [Mono] executable for Linux, even though the program's web page states that it is cross-platform. Would appreciate your help!
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-15T11:43:29.637Z
Answers.Text: @Maxim which linux distribution are you using?
Answers.UserDisplayName: dalanicolai
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-16T03:22:07.067Z
Answers.Text: Currently -- Mint, which is Debian-based
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-16T03:23:38.953Z
Answers.Text: I used djvusmooth by Jakub WIlk for years, really liked it, and even added a Wikipedia entry on it, I believe. But it is Python 2-based, with some obsolete/legacy dependencies...
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-16T13:52:37.763Z
Answers.Text: And mono is not included with Mint (try `sudo apt search mono`). Well otherwise, I guess at least it should be possible to install it from [here](https://www.mono-project.com/download/stable/#download-lin). B.t.w. if you are, or planning to become, a GNU/linux power user, then I would strongly recommend you to use [doc-toc](https://elpa.gnu.org/packages/doc-toc.html) for Emacs.
Answers.UserDisplayName: dalanicolai
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-17T10:54:17.307Z
Answers.Text: Thank you for your response! I had no difficulty installing Mono in Mint.
  
  The problem is that the HandyOutliner home page only provides a file named HandyOutliner.exe in their Downloads directory
  
  Running a `file` on it gives
  
  `./HandyOutliner.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows`, and running
  
  `$ mono ./HandyOutliner.exe`
  
  gives some long `[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException...`. I never studied Mono, and gave up...
  
  Thank you so much for your time!!!
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-17T10:56:22.483Z
Answers.Text: on doc-toc: that you for your suggestion!! -- I switched from emacs to Vim some 13 years ago; my hands could not handle the Escape-Meta-Alt-Control-Shift; I am sure you know this EMACS joke :))
Answers.UserDisplayName: Maxim
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-17T11:18:58.283Z
Answers.Text: Haha, I switched from Vim to Emacs about 3 years ago, and I completely understand the joke about the keybindings:) But I am just using Vim inside Emacs (it is called evil-mode). I started with using Spacemacs, which you could [take a look at](https://develop.spacemacs.org/doc/BEGINNERS_TUTORIAL.html) (I have created a [toc layer](https://github.com/dalanicolai/toc-layer) for it also). As a Vim user, you will be immediately able to use it, and see what Emacs all has to offer. Actually, the main reason I switched to Emacs is that Emacs made it ridiculously easy to create doc-toc.
Answers.UserDisplayName: dalanicolai
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-29T20:13:30.310Z
Answers.LastActivityDate: 2019-07-29T20:13:30.310Z
Answers.UserDisplayName: dalanicolai
Body: <p>How insert the outline (the bookmarks) into DjVu file for easier browsing in a document using the <a href="http://djvu.sourceforge.net/" rel="noreferrer">DjVuLibre</a> library?</p>
  
  <p>With such a structure:</p>
  
  <ul>
  <li>"TOC" <strong>level 1</strong> => link to <em>pageNumber</em></li>
  <li>"Chapter name" <strong>level 1</strong> => link to <em>pageNumber</em>
  
  <ul>
  <li>"Chapter name" <strong>level 2</strong> => link to <em>pageNumber</em></li>
  </ul></li>
  <li>"Chapter name" <strong>level 1</strong> => link to <em>pageNumber</em>
  
  <ul>
  <li>"Chapter name" <strong>level 2</strong> => link to <em>pageNumber</em>
  
  <ul>
  <li>"Chapter name" <strong>level 3</strong> => link to <em>pageNumber</em></li>
  </ul></li>
  </ul></li>
  <li>"Chapter name" <strong>level 1</strong> => link to <em>pageNumber</em><br>
  ...</li>
  </ul>
  
Tags: <djvu>
Title: How insert the outline (the bookmarks) into DjVu
UserDisplayName: Stilgar Dragonclaw
ThreadText: # How insert the outline (the bookmarks) into DjVu
  
  (Asked by: username_0 on 2018-07-17)
  
  How insert the outline (the bookmarks) into DjVu file for easier browsing in a document using the [DjVuLibre](http://djvu.sourceforge.net/) library?
  
  With such a structure:
  
  * "TOC" **level 1** => link to *pageNumber*
  * "Chapter name" **level 1** => link to *pageNumber*
    + "Chapter name" **level 2** => link to *pageNumber*
  * "Chapter name" **level 1** => link to *pageNumber*
    + "Chapter name" **level 2** => link to *pageNumber*
      - "Chapter name" **level 3** => link to *pageNumber*
  * "Chapter name" **level 1** => link to *pageNumber*  
    ...
  
  **Tags:** djvu
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-07-17. Score: 4
  
  First, create your desired structure in a text editor.
  On the first line will be placed keyword bookmarks in round brackets as a root.
  Behind the chapter titles are located page numbers or page names (with a suffix .djvu). Before the number must be symbol sharp #. All parameters are enclosed in quotation marks "".
  Lower order chapters are created by embedding additional round brackets behind higher order chapter.
  Sample with page numbers:
  (bookmarks
      ("TOC" "#3")
      ("Chapter 1 - Blabla" "#7"
          ("Subchapter 1.1 - Blabla" "#11")
      )
      ("Chapter 2 - Blabla" "#15"
          ("Subchapter 2.1 - Blabla" "#17"
              ("Subchapter 2.1.1 - Blabla" "#20")
          )
      )
      ("Chapter 3 - Blabla" "#25")
  )
  
  Sample with page names (with a suffix .djvu):
  (bookmarks
      ("TOC" "#page_0003.djvu")
      ("Chapter 1 - Blabla" "#page_0007.djvu"
          ("Subchapter 1.1 - Blabla" "#page_00011.djvu")
      )
      ("Chapter 2 - Blabla" "#page_00015.djvu"
          ("Subchapter 2.1 - Blabla" "#page_00017.djvu"
              ("Subchapter 2.1.1 - Blabla" "#page_00020.djvu")
          )
      )
      ("Chapter 3 - Blabla" "#page_00025.djvu")
  )
  
  Caution: Save the file in UTF-8.
  Second, paste the created outline text file into the selected DjVu file.
  Install the DjVuLibre library (if you do not already have it).
  From the library we use djvused tool.
  At the command prompt, type:
  path\djvused path\book.djvu -e "set-outline path\outline.txt" -s
  
  Instead path parameter substitute your location on the disk.
  Parameter -e is the exec (system call) of the set-outline command with the filename parameter.
  Parameter -s is save command.
  Press Enter...
  
  
  ---
  
  ### Answer by username_1 on 2019-07-29. Score: 0
  
  Although the following method does not explicitly use the DjVuLibre library (it does implicitly), the following method might save some of your precious time...
  
  * Use some tool to extract the contents from the djvu file. I recommend [pdf\_contents\_extractor](https://pypi.org/project/pdf-contents-extractor/) for python3 which can be easily installed with pip(pip3) (only tested on linux, but works for djvu too)
  * Fine-tune the contents.txt or contents\_ocr.txt file with your favorite text editor
  * Use [HandyOutliner](http://handyoutlinerfo.sourceforge.net/) to insert the bookmarks in your djvu file
  
  > **Comments:**
  > **username_2**: I was not able to run HandyOutliner on Linux, and did not even find a [Mono] executable for Linux, even though the program's web page states that it is cross-platform. Would appreciate your help!  
  > **username_1**: @username_2 which linux distribution are you using?  
  > **username_2**: Currently -- Mint, which is Debian-based  
  > **username_2**: I used djvusmooth by Jakub WIlk for years, really liked it, and even added a Wikipedia entry on it, I believe. But it is Python 2-based, with some obsolete/legacy dependencies...  
  > **username_1**: And mono is not included with Mint (try `sudo apt search mono`). Well otherwise, I guess at least it should be possible to install it from [here](https://www.mono-project.com/download/stable/#download-lin). B.t.w. if you are, or planning to become, a GNU/linux power user, then I would strongly recommend you to use [doc-toc](https://elpa.gnu.org/packages/doc-toc.html) for Emacs.  
  > **username_2**: Thank you for your response! I had no difficulty installing Mono in Mint.  The problem is that the HandyOutliner home page only provides a file named HandyOutliner.exe in their Downloads directory  Running a `file` on it gives  `./HandyOutliner.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows`, and running  `$ mono ./HandyOutliner.exe`  gives some long `[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException...`. I never studied Mono, and gave up...  Thank you so much for your time!!!  
  > **username_2**: on doc-toc: that you for your suggestion!! -- I switched from emacs to Vim some 13 years ago; my hands could not handle the Escape-Meta-Alt-Control-Shift; I am sure you know this EMACS joke :))  
  > **username_1**: Haha, I switched from Vim to Emacs about 3 years ago, and I completely understand the joke about the keybindings:) But I am just using Vim inside Emacs (it is called evil-mode). I started with using Spacemacs, which you could [take a look at](https://develop.spacemacs.org/doc/BEGINNERS_TUTORIAL.html) (I have created a [toc layer](https://github.com/username_1/toc-layer) for it also). As a Vim user, you will be immediately able to use it, and see what Emacs all has to offer. Actually, the main reason I switched to Emacs is that Emacs made it ridiculously easy to create doc-toc.  
  
  ---
  
  