dalibo / pandocker

🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
https://hub.docker.com/r/dalibo/pandocker/
BSD 3-Clause "New" or "Revised" License
145 stars 23 forks source link

Support for Persian #168

Closed commjoen closed 3 years ago

commjoen commented 4 years ago

Hi there, as you can see @ https://github.com/OWASP/owasp-masvs/blob/master/tools/docker/README.md we are happily using your awesome container! However, we are trying to built in Persian support as the standard is being translated into Persian. Do you have experience with that? If i add

RUN apt-get update \
    && apt-get install -y --no-install-recommends curl fonts-noto-cjk texlive-lang-arabic

at docker container level and then try to generate a mixed Persian/English document, I get

! 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.

What should i do to fix this?

commjoen commented 4 years ago

Now that I use xepersian, it seems better. But apparently there are issues (see https://github.com/OWASP/owasp-masvs/pull/401). In the output i get:

! Undefined control sequence.
\setlatintextfont code ..._fontspec_pass_args:nnn 
                                                  \__xepersian_setlatintextf...
l.878 ...{lmromanslant10-bold}]{lmroman10-regular}

 failed

Do you know what i might be doing wrong?

commjoen commented 4 years ago

Update: it seems it only works with the latest version of Xepersian.. (texlive-lang-arabic_2019.20200302-1_all.deb) But this gives the following issue:

dpkg: regarding texlive-lang-arabic_2019.20200302-1_all.deb containing texlive-lang-arabic:
 texlive-lang-arabic breaks texlive-base (<< 2019.20200218)
  texlive-base (version 2016.20170123-5) is present and installed.
daamien commented 4 years ago

Hi @commjoen !

Thanks for this message. We're currently discussing on the future of this project. In particular, we're considering switching to alpine and use tlmgr directly to install the latest version of the texlive packages...

We're also thinking about allowing multiple specific tags for special use cases. We have no plan to support persian lang in our documents toolchain but we could give you access to this repo and let you support your own dedicated image, for instance pandocker:latest-persian and let you support it directly if you're interested...

cc @bersace

commjoen commented 4 years ago

Good evening @daamien ! Well given the amount of love provided to https://github.com/OWASP/owasp-masvs/blob/master/tools/docker/Dockerfile and https://github.com/OWASP/owasp-masvs/blob/master/tools/docker/pandoc_makedocs.sh I will have a hard time maintaining the images in 2 places. When you switch to alpine and we can indeed get 2019.20200 running easily, that would be a major win! Of course, we will need to do some updating on our end as well, but it would be very helpful to our project.

daamien commented 4 years ago

@commjoen,

The alpine variant is now avaible with docker pull dalibo/pandocker:latest-alpine

(consider this as beta though)

You should be able to fetch the persian support directly from CTAN using tlmgr like this:

FROM dalibo/pandocker:latest-alpine

RUN tlmgr update --self && \
        tlmgr install \
                   alpha-persian \ 
                   bidi \
                   persian-bib \
                   etc.

More details here: https://github.com/dalibo/pandocker/blob/latest/alpine/Dockerfile