title: asciidoc asciidoctor include adocs and their images
body: <p>I am building my asciidoc template to manage my development documentations.
  Therefor I want to be able to link existing ascii documents into a main / or a new document <strong>inclusive images</strong> and other resources. To link documents I use the <strong>include</strong> keyword that works to reference documents into a new one. </p>
  
  <h2>Problem</h2>
  
  <p><strong>My Problem is, that the images of the included / referenced document are not shown.</strong> I am aware that the path resolution for the image starts from the main document and does not match with the path from the included / referenced document images. The image paths in the included document are correct. The images are shown when generating only the included document.  Does anyone have a good solution to solve that?</p>
  
  <h2>Example of the not working document include with images</h2>
  
  <p><strong>1. Directory structure of the documents.</strong></p>
  
  <p>main.adoc includes Risikoanalyse_v2.adoc that contains the images</p>
  
  <ul>
  <li>./main.adoc </li>
  <li>./Risikoanalysen/Risikoanalyse_v2.adoc</li>
  <li>./Risikoanalysen/Risikodiagramm_1_v2.png</li>
  <li>./Risikoanalysen/Risikodiagramm_2_v2.png</li>
  </ul>
  
  <p><strong>2. Content of the main.adoc document</strong></p>
  
  <pre><code>== Content 1
  
  ratatata
  
  include::./Risikoanalysen/Risikoanalyse_v2.adoc[]
  </code></pre>
  
  <p><strong>3. Content of the Risikoanalyse_v2.adoc</strong></p>
  
  <pre><code>= Risikoanalyse 
  Inhaltsverzeichnis
  :doctype: book
  :toc: left
  :toclevels: 4
  :sectnums:
  
  :version: Version 2.0, 03.03.2019
  {version}
  
  &lt;&lt;&lt;
  == Risiken
  bachelor party
  
  image::Risikodiagramm_1_v2.png[Risikodiagramm,300,align="center"]       // image that is not resolved
  
  &lt;&lt;&lt;
  == preventive Gegenmassnahmen
  rooftop party
  
  image::Risikodiagramm_2_v2.png[Risikodiagramm,300,align="center"]       // image that is not resolved
  </code></pre>
  
  <p><strong>4. Command to generate the documents</strong></p>
  
  <ul>
  <li>asciidoctor main.doc* </li>
  <li>asciidoctor-pdf main.doc</li>
  </ul>