Christian Wittern writes: > Dear John, > > Thanks for your answer. > > On 01/11/2017 10:33 PM, John Kitchin wrote: >> >> There is not a way to hook or define a format for this that I know of. >> For helm-bibtex, you might be able to redefine or advise >> bibtex-completion-apa-format-authors to handle that.
Here is a lightly tested way to modify the authors. It basically works by bypassing bibtex-completion-apa-format-authors to do what you want. I adapted it from the bibtex-completion-apa-format-authors code. #+BEGIN_SRC emacs-lisp (defun format--cjk-authors (orig-fun &rest args) "Format authors my way." (cl-loop for a in (s-split " and " value t) collect (let ((fields (mapcar (lambda (x) (let* ((f (split-string x "=")) (prop (s-trim (nth 0 f))) (val (s-trim (nth 1 f)))) (cons prop val))) (s-split "," a t)))) (s-format "${given} ${family} (${cjk})" 'aget fields)) into authors finally return (let ((l (length authors))) (cond ((= l 1) (car authors)) ((= l 2) (s-join " & " authors)) ((< l 8) (concat (s-join ", " (-butlast authors)) ", & " (-last-item authors))) (t (concat (s-join ", " authors) ", ...")))))) (advice-add 'bibtex-completion-apa-format-authors :around #'format--cjk-authors) ; remove advice like this. ;(advice-remove 'bibtex-completion-apa-format-authors #'format--cjk-authors) #+END_SRC That generates Ailong Fang (方愛龍) & Another Fang (方愛龍), Super interesting report, J. Interesting Reports, 1(), (2007). for the tooltips and messages. for this entry @article{fang-2007-super, title = {Super interesting report}, author = {family=Fang, given=Ailong, cjk=方愛龍 and family=Fang, given=Another, cjk=方愛龍}, journal = {J. Interesting Reports}, keywords = {test, word}, volume = 1, year = 2007, } It is not very robust, e.g. it assumes there will be family, given and cjk for all authors, that authors are split by and, and prop=val is split by commas, etc... > > Well, thanks, I'll investigate that. Is that what is also used for the > display as popup and in the echo area that org-ref is providing? yes, I think so. > >> >> You can turn off the full display like this: >> >> #+BEGIN_SRC emacs-lisp >> (loop for cite in org-ref-cite-types >> do >> (org-link-set-parameters cite :display nil)) >> #+END_SRC >> > > OK, that is what I wanted to know, all I want to do is hide the citekey in > this case. > > All the best, and thanks for given us the present of org-ref, > > Christian -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu