<br>
Pandoc은 마크다운(Markdown)으로 작성한 파일을 .docx, .epub, .html 등의 다른 포맷 파일로 변환해주는 프로그램이다. 옵시디언에서는 [**Obsidian Pandoc**](https://github.com/OliverBalfour/obsidian-pandoc)이라는 플러그인이 있다.
<br>
## 문제점
팔레트 명령어(Command/Ctrl+P)로 Pandoc Plugin: Export as Word Document (docx)를 실행해서 마크다운 .md 노트를 .docx로 export 하면 아래와 같은 에러가 난다. 노트에 이미지가 링크되어 있는 경우에 발생한다. 이미지가 없으면 문제가 없다.
<font color="red">Pandoc export failed: pandoc: image path: OpenBinaryFile: does not exist (No such file or directory)</font>
![[Attachments/Publish_Image/Pandoc_Export_Error-image.jpg]]
<br>
## 원인
문제의 원인은 Pandoc 플러그인이 이미지의 상대 경로를 제대로 인식하지 못해서 발생한다. 이미지 파일의 위치를 찾지 못하는 것이다.
<br>
## 해결책
보통 노트에서 이미지는 \!\[[image.jpg]]와 같은 형태로 표시하면 된다. 하지만, Pandoc으로 MS 워드파일 확장자인 .docs로 이미지가 있는 노트를 변환하기 위해서는 아래와 같이 이미지 파일이 있는 위치를 Full Path로 지정해 주어야 한다.
<font color="blue">\!\[[Attachments/image.jpg]]</font>
<br>
# References
[[BUG] Pandoc cannot find image file unless full relative path is used · Issue #81 · OliverBalfour/obsidian-pandoc · GitHub](https://github.com/OliverBalfour/obsidian-pandoc/issues/81)
<br>
# Links
[[_MOC_1_Obsidian]]