How solve the display problem when document contains both Chinese and English

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How solve the display problem when document contains both Chinese and English

zera
I want display in pdf as below:


but it display as below:(The English word dispaly abnormal, Occupy a line)
Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

mojavelinux
Administrator
The problem you are facing is that the default Asciidoctor PDF theme uses justified text by default. But justified text doesn't make sense for Chinese (or a document with mixed languages).

One way to solve the issue is to use the CJK add-on for Asciidoctor PDF, which provides a special theme just for this case.


The other solution, which is more involved, is to create your own theme and disable the following line:

base:
  align: justify

You can start by copying the default theme and just tweaking it. See:


Cheers,

-Dan

On Tue, Aug 1, 2017 at 3:04 AM, zera [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I want display in pdf as below:


but it display as below:(The English word dispaly abnormal, Occupy a line)



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-solve-the-display-problem-when-document-contains-both-Chinese-and-English-tp5778.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

zera
Thank you, I will try as your advise.

Best Regards!
Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

zera
In reply to this post by mojavelinux
Hi  Dan,
I have modify my theme as your advise, modify the align:left instend of align: justify.
but the problem still exist:
the below is my source text:

persistence.xml文件是JPA标准配置文件,位于模块的“/src/main/resources/META-INF/”目录下。该文件必须定义一个持久化单元,该持久化单元的名称在当前类加载器中要求唯一;必须配置供应商属性,供应商属性指定了JPA EntityManager的底层实现,在JBoss应用服务器,JPA默认提供者就是Hibernate。

and the below is my promising result:


but the actual result is


you can see the wrap after "JPA" and "Manager", is the space???



Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

mojavelinux
Administrator
Are you using the cjk gem? My understanding that gem adds the necessary break characters that allow wrapping to work in Chinese text.


I want to get this into Asciidoctor PDF, but haven't had a chance yet.

-Dan

On Thu, Aug 3, 2017 at 9:50 PM, zera [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi  Dan,
I have modify my theme as your advise, modify the align:left instend of align: justify.
but the problem still exist:
the below is my source text:

persistence.xml文件是JPA标准配置文件,位于模块的“/src/main/resources/META-INF/”目录下。该文件必须定义一个持久化单元,该持久化单元的名称在当前类加载器中要求唯一;必须配置供应商属性,供应商属性指定了JPA EntityManager的底层实现,在JBoss应用服务器,JPA默认提供者就是Hibernate。

and the below is my promising result:


but the actual result is


you can see the wrap after "JPA" and "Manager", is the space???






To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

abelsromero
In reply to this post by zera
You did not mention how you are building the doc, but if you are using Maven we have a example that may help you https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoctor-pdf-cjk-example.

Even, if you are not using Maven, I can help to set up the parameters.

Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

zera
In reply to this post by mojavelinux
Thank you for your replay, I am trying to define it
Reply | Threaded
Open this post in threaded view
|

Re: How solve the display problem when document contains both Chinese and English

zera
In reply to this post by abelsromero
Not Maven, just one is Brackets preview and another is the pdf view