Open nm46nm opened 6 years ago
能给个简单的复原问题的代码看看么? hzzmail 邮箱:hzzmail@sjtu.org 签名由 网易邮箱大师 定制 在2018年05月07日 18:42,nm46nm 写道: 用的一个模板,用原模板的bib style正常,当把style换成gb7714-2015时,编译到\printbibliography时就出错:) [7] [8] ! Extra \else. \CJK@XXX ...}\expandafter \CJK@ignorespaces \else \csname u8:\string #1\stri... l.100 \printbibliography[heading = bibliography] ?
无论后边加不加参数、加什么参数,都会出错,只有把\printbibliography注释掉,就正常。 这是为什么?我的bib文件中中英文文献都有,难道不支持中文? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
你升级到新版了么?升级一下试试。从你有限的信息看可能是参考文献中带有一些特殊信息导致中英文判断出问题。
你给个简化示例看一下吧
@hushidong 感谢您的回复。bib大概是这样:
@article{test-en,
author = {Author},
title = {Title},
type = {J},
journal = {Journal},
date = {2014-04-01},
language = {english},
}
@article{test-zh,
author = {作者},
title = {标题},
type = {J},
journal = {期刊},
date = {2014-04-01},
language = {chinese},
}
@article{fanqj,
author = {樊琼剑 and 杨忠 and 方挺 and others},
title = {多无人机协同编队飞行控制的研究现状},
type = {J},
journal = {航空学报},
date = {2009},
volume = {30(4)},
pagess = {683-691},
language = {chinese},
}
我是刚在这里下载的四个文件贴在我的编译目录,而且我的texlive也是刚装的我找了也有gb7714. 不知道您还需要哪些信息,抱歉新手并不是很了解latex也没时间去细学。
没有问题呀,你更新一下biblatex-gb7714-2015,使用tlmgr或者简单的将gb7714-*.BBX/cbx覆盖你安装的texlive中的同名文件即可。
测试代码如下eg.TEX:
··· \documentclass[twoside]{article} \usepackage{ctex} \usepackage{xcolor} \usepackage{hyperref} \usepackage[backend=biber,style=gb7714-2015]{biblatex}%align=gb7714-2015 \usepackage{filecontents}
%注意: %这里因为不需要用language来判断中英文,所以去掉了。language = {english}, 这样的信息 %另外其中一个pages写成了个pagess,取消了多余的s \begin{filecontents}{\jobname.bib} @article{test-en, author = {Author}, title = {Title}, type = {J}, journal = {Journal}, date = {2014-04-01}, }
@article{test-zh, author = {作者}, title = {标题}, type = {J}, journal = {期刊}, date = {2014-04-01}, }
@article{fanqj, author = {樊琼剑 and 杨忠 and 方挺 and others}, title = {多无人机协同编队飞行控制的研究现状}, type = {J}, journal = {航空学报}, date = {2009}, volume = {30(4)}, pages = {683-691}, } \end{filecontents} \addbibresource{\jobname.bib}
\begin{document} 编译信息:biblatex v\versionofbiblatex;gb7714-2015. version number \versionofgbtstyle.
\section{文献表} 文献\cite{test-en,test-zh,fanqj}.
文献\parencite{test-en,test-zh,fanqj}.
\printbibliography[title=【参考文献】] \end{document} ···
结果为:
编译命令知道的吧,三遍编译,中间一遍用biber: ··· xelatex eg.TEX biber eg xelatex eg.TEX ···
@hushidong 您好,我试了,还是一样的错误,我给您发邮件附上我的poj,拜托您给看一下。
ok hzzmail 邮箱:hzzmail@sjtu.org 签名由 网易邮箱大师 定制 在2018年05月07日 22:31,nm46nm 写道: @hushidong 您好,我试了,还是一样的错误,我给您发邮件附上我的poj,拜托您给看一下。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
这个问题已经解决,没有新的情况先关闭了。
I am new to this site & latex technology. I am also facing same issue.Can Anyone suggest me solution ?
@amolpatil07091988
你的具体是什么错误?
你用的什么编译环境?
最好给个出错的例子
你看一下如下这样的举例方式。
Hi ,
Please reply in english if possible bcoz I dont understand chinese. I am trying to implement chinese with latex using ctex package. The latex file also content below code but below whole code gets failed when we add chinese text in replacement of Text1 ,text2
otherwise it works fine.
I am also receiving similar issue like ! Extra \else. \CJK@XXX ...}\expandafter \CJK@ignorespaces \else \csname u8:\string #1\stri...
I am using latex ..and executing by MiKTeX tool
can you give a complete example?I don't know what package provding the commands in your code.
\cbFinding \ChoiceMenu defined in which package ?
\ChoiceMenu is part of hyperref package... \cbFinding is custom %-------------- % Below is simple example i have created to replicate this issue. % If we replace chinese text defined with app.alert by english text then its starts working.
\documentclass{article} \usepackage[UTF8]{ctex} \usepackage[utf8]{inputenc} \usepackage{amstext} \usepackage{hyperref} \renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document} \begin{Form} 飞到我的窗前唱歌 \ChoiceMenu[print,combo,default=Box 1,name=box1,onblur={app.alert("飞到我的窗前唱歌");}]{}{Item 1,Item 2, Item 3, Item 4, Item 5} \quad % adds a bit of space \ChoiceMenu[print,combo,default=Box 2,name=box2]{}{Item 1,Item 2, Item 3, Item 4, Item 5} \end{Form} \end{document}
%------------------
Please guide me to solve this issue.
why don't you use the xelatex compiler? it works fine.
\documentclass{article}
\usepackage[UTF8]{ctex}
%\usepackage[utf8]{inputenc}
%\usepackage{amstext}
\usepackage{hyperref}
\renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document}
\begin{Form}
飞到我的窗前唱歌
\ChoiceMenu[print,combo,default=Box 1,name=box1,onblur={app.alert("窗前唱歌");}] {}{Item 1,Item 2, Item 3, Item 4, Item 5}
\quad % adds a bit of space
\ChoiceMenu[print,combo,default=Box 2,name=box2]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\end{Form}
\end{document}
use the xelatex, it raise no errors!
because when using xelatex, the ctex package utilize the xeCJK to deal chinese, while using pdflatex/latex, ctex package utilize the CJK method. I really do not know why use CJK it does not work, but in general when we type chinese, we usually use xelatex.
Hi,
I just tried with xelatex but its giving me unknown characters like 飞勰拂çı—窊囓åfl±æŁ when I used dropdown . kindly suggest me.please check attached pdf output. newt.pdf
\documentclass{article}
%\usepackage[UTF8]{ctex}
%\usepackage[utf8]{inputenc}
%\usepackage{amstext}
\usepackage{hyperref}
\usepackage{xeCJK}
\RequirePackage{xcolor}
\newlength{\Bwidth}
\setlength{\Bwidth}{48mm}
\renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document}
\begin{Form}
飞到我的窗前唱歌
\newcommand{\tfFinding}[1]{%
\TextField[name=tfFinding#1,%
% bordercolor=white,charsize=9pt,width=\Bwidth,readonly=true]%
bordercolor=red,backgroundcolor=yellow,%
charsize=9pt,width=\Bwidth,readonly=true]%
{\strut\ignorespaces}%
}
\tfFinding{test}%
\ChoiceMenu[print,combo,default=Box 1,name=box1,onblur={
this.getField("tfFindingtest").value="飞到我的窗前唱歌";
}]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\quad % adds a bit of space
\ChoiceMenu[print,combo,default=Box 2,name=box2]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\end{Form}
\end{document}
you need to set a chinese font, like:
\setCJKmainfont{SourceHanSerifSC-Regular.otf}
and you should download the font before you use it, here is address
https://github.com/adobe-fonts/source-han-serif
Hi,
Thanks hushidong for your suggestion !.
I just tried with \setCJKmainfont{SourceHanSerifSC-Regular.otf} & \setCJKmainfont{SourceHanSerifCN-Regular.otf}
This otf files i got from below link.I have sucessfully installed it.but still my issue persist.
pdf screen shot as below
https://github.com/dyweb/SJTUThesis/blob/master/fonts/source-han-serif/SourceHanSerifSC-Regular.otf
https://github.com/adobe-fonts/source-han-serif/raw/release/SubsetOTF/SourceHanSerifCN.zip
Font release mentioned at below link is of 2GB. https://github.com/adobe-fonts/source-han-serif/tree/release
Kindly suggest me ..
i cant download your pdf and image, can you paste a pic it directly in the reply?
when i get home this evening , i will test your above example
Thanks Hushidong, I will be happy if you could help me to resolve this issue. I am new to this github site. Please check attached pdf .I hope you are able to download.
there is no error in the above example,
for the below code
\documentclass{article}
\usepackage[UTF8]{ctex}
%\usepackage[utf8]{inputenc}
%\usepackage{amstext}
\usepackage{hyperref}
%\usepackage{xeCJK}
\RequirePackage{xcolor}
\newlength{\Bwidth}
\setlength{\Bwidth}{48mm}
\renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document}
\begin{Form}
飞到我的窗前唱歌
\newcommand{\tfFinding}[1]{%
\TextField[name=tfFinding#1,%
% bordercolor=white,charsize=9pt,width=\Bwidth,readonly=true]%
bordercolor=red,backgroundcolor=yellow,%
charsize=9pt,width=\Bwidth,readonly=true]%
{\strut\ignorespaces}%
}
\tfFinding{test}%
\ChoiceMenu[print,combo,default=Box 1,name=box1,onblur={
this.getField("tfFindingtest").value="飞到我的窗前唱歌";
}]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\quad % adds a bit of space
\ChoiceMenu[print,combo,default=Box 2,name=box2]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\end{Form}
\end{document}
I get :
for the below code:
\documentclass{article}
%\usepackage[UTF8]{ctex}
\usepackage{xeCJK}
\setCJKmainfont{SourceHanSerifSC-Regular.otf}
\usepackage{hyperref}
\RequirePackage{xcolor}
\newlength{\Bwidth}
\setlength{\Bwidth}{48mm}
\renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document}
\begin{Form}
飞到我的窗前唱歌
\newcommand{\tfFinding}[1]{%
\TextField[name=tfFinding#1,%
% bordercolor=white,charsize=9pt,width=\Bwidth,readonly=true]%
bordercolor=red,backgroundcolor=yellow,%
charsize=9pt,width=\Bwidth,readonly=true]%
{\strut\ignorespaces}%
}
\tfFinding{test}%
\ChoiceMenu[print,combo,default=Box 1,name=box1,onblur={
this.getField("tfFindingtest").value="飞到我的窗前唱歌";
}]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\quad % adds a bit of space
\ChoiceMenu[print,combo,default=Box 2,name=box2]{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\end{Form}
\end{document}
I get :
they are same。
the above pics are the results with the foxit pdf reader to open the pdf files,but when I use the sumatra pdf,I get:
so,it clearly shows that the appearance of the forms are relative to the pdf reader。
what pdf reader are you use?
and the pdf newt (1).pdf you give above,I opened it with foxit pdfreader,it shows right:
there is no unknown characters, different with your pic, as far as i know you problem may caused by the operation system,your system Probably not support east asia language。
so try to install the font,and install the language support of east asia for the OS,have a try?
and what tex environment do you use? I use the texlive 2019 and the tex file compiled with xelatex
I am using "Adobe Acrobat reader 2017" .In PDF Box1 &Box2 are dropdownlist and yello field is Text field.PDF compilation & ouptut shows no error but When we select value in dropdownlist then the event triggers and chinese output text should appear in Text field.
Here acrobat javascript supporting English but not chienese text .
I am using Tex file which is been compiled by xelatex This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7140 64-bit)
kindly suggest.
this problem may be caused by hyperref or javascipt,I think the chinese code
onblur={this.getField("tfFindingtest").value="欢迎";}
will be read by tex with unicode ,and saveed to \Fld@onblur@code
and when generate pdf,it use the following code
14781 \ifx\Fld@onblur@code\@empty
14782 \else
14783 /Bl<</S/JavaScript/JS(\Hy@escapestring{\Fld@onblur@code})>>%
14784 \fi
and pdf reader use this code to show the string,but Javascipt can not get the right encoding,so some unknown character be appeared.
may be if we add encoding set like charset="unicode"
in the /Bl<</S/JavaScript/JS(\Hy@escapestring{\Fld@onblur@code})>>%
may solve this problem,but i am not familiar with hyperref,and javascipt。
so I have to change the method, we need to show chinese,it can also be encoded from the unicode code,so may be we can use some transfer function,i searched this page http://www.imooc.com/wenda/detail/494568 found the String.fromCharCode function,and tried it,and it works fine, problem solved。
use the following code
\documentclass{article}
\usepackage[UTF8]{ctex}
\usepackage{hyperref}
\RequirePackage{xcolor}
\newlength{\Bwidth}
\setlength{\Bwidth}{48mm}
\renewcommand*{\DefaultHeightofChoiceMenu}{20ex}
\begin{document}
\begin{Form}
飞到我的窗前唱歌
\newcommand{\tfFinding}[1]{%
\TextField[name=tfFinding#1,%
bordercolor=red,backgroundcolor=yellow,%
charsize=9pt,width=\Bwidth,readonly=true]%
{\strut\ignorespaces}%
}
\tfFinding{test}%
\ChoiceMenu[print,combo,default=Box 1,name=box1,
onblur={this.getField("tfFindingtest").value=
String.fromCharCode('0x98de',
'0x5230',
'0x6211',
'0x7684',
'0x7a97',
'0x524d',
'0x5531',
'0x6b4c');}
]
{}{Item 1,Item 2, Item 3, Item 4, Item 5}
\par
english hello
\tfFinding{testa}%
\ChoiceMenu[print,combo,default=Box 2,name=box2,onblur={
this.getField("tfFindingtesta").value="fly to my window and sing a song";
}]{}{Item 1}
\end{Form}
\end{document}
I get :
so, it works fine
and the string's unocode, i get it with python code
a=[]
for chars in "飞到我的窗前唱歌":
a.append(hex(ord(chars)))
a
and the line \usepackage[UTF8]{ctex}
in tex file can be replaced by:
\usepackage{xeCJK}
\setCJKmainfont{SourceHanSerifSC-Regular.otf}
and now I use the adobe acrobat reader DC to open pdf file.
Excellent Hushidong, Thank you so much for your efforts to solve this issue. This solution also works with \usepackage[UTF8]{ctex}
用的一个模板,用原模板的bib style正常,当把style换成gb7714-2015时,编译到\printbibliography时就出错:
无论后边加不加参数、加什么参数,都会出错,只有把\printbibliography注释掉,就正常。 这是为什么?我的bib文件中中英文文献都有,难道不支持中文?