Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The bidi package is loaded too early #232

Open
daamien opened this issue Mar 2, 2021 · 1 comment
Open

[Bug] The bidi package is loaded too early #232

daamien opened this issue Mar 2, 2021 · 1 comment
Labels

Comments

@daamien
Copy link
Contributor

daamien commented Mar 2, 2021

Hi !

Thanks for this template, it is a very impressive piece of work.

I'm currently trying to use it for a document written in Persian with Right-to-Left (RTL) writing. The original document is located here:

https://github.com/OWASP/owasp-masvs/tree/master/Document-fa

I created a minimal example document.md containing this :

---
mainfont: 'Nazli'
---
<div dir="rtl" markdown="1">

انقلاب‌های فناورانه می

</div>

Note that I don't speak or read Persian myself so my knowledge on this topic is limited.

I am able to build successfully a pdf artefact using the default pandoc latex template like this:

$ pandoc --pdf-engine=xelatex examples/language-persian/document.md -o examples/language-persian/document.pdf

However with eisvogel I get the following error:

$ pandoc --template=eisvogel --pdf-engine=xelatex examples/language-persian/document.md -o examples/language-persian/document.pdf      
Error producing PDF.                                                                                                                                                           
! Package bidi Error: Oops! you have loaded package caption after bidi package.                                                                                                
 Please load package caption before bidi package, and then try to run xelatex o                                                                                                
n your document again.                                                                                                                                                         
                                                                                                                                                                               
See the bidi package documentation for explanation.                                                                                                                            
Type  H <return>  for immediate help.                                                                                                                                          
 ...                                                                                                                                                                           
                                                                                                                                                                               
l.251 \begin{document}  

After looking into the template I have found 3 problems:

The template seems to work with the following modifications:

  • Move the caption and mdframed section before bidi
  • Comment the second polyglossia load

Here's my working version of eisvogel:

https://github.com/daamien/pandoc-latex-template/blob/bug_bidi_persian/eisvogel.tex

Thanks again for your time, let me know how I can help fixing this...

EDIT: fixed links

daamien added a commit to daamien/pandoc-latex-template that referenced this issue Mar 2, 2021
daamien added a commit to daamien/pandoc-latex-template that referenced this issue Mar 2, 2021
* move caption and mdframed packages before bidi
* comment the second load of polyglossia
* test case for the bidi (right-to-left) bug
daamien added a commit to daamien/pandoc-latex-template that referenced this issue Mar 2, 2021
* move caption and mdframed packages before bidi
* comment the second load of polyglossia
* test case for the bidi (right-to-left) bug
daamien added a commit to daamien/pandoc-latex-template that referenced this issue Mar 2, 2021
* move caption and mdframed packages before bidi
* comment the second load of polyglossia
* test case for the bidi (right-to-left) bug
@daamien
Copy link
Contributor Author

daamien commented Mar 2, 2021

See PR #231 with my changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants