From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: LaTeX export: inline markup underscore problem Date: Mon, 11 Apr 2011 06:58:43 -1000 Message-ID: <15EA52A3-0CA5-4219-A22E-A29B4B1D38A3@tsdye.com> References: <1112.1302466080@alphaville.dokosmarshall.org> <63F0C433-3616-4517-A1CF-D758F3B88086@tsdye.com> <9082.1302486279@alphaville.dokosmarshall.org> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/alternative; boundary=Apple-Mail-1--36107269 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9Slc-0005ja-7g for emacs-orgmode@gnu.org; Mon, 11 Apr 2011 21:51:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9KRu-0002f7-U8 for emacs-orgmode@gnu.org; Mon, 11 Apr 2011 12:58:52 -0400 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:53904) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q9KRu-0002cM-KM for emacs-orgmode@gnu.org; Mon, 11 Apr 2011 12:58:50 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mauro Rovezzi Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org --Apple-Mail-1--36107269 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Aloha Mauro, On my system I define a citep link: > #+source: define-citep-link > #+begin_src emacs-lisp :results silent > (org-add-link-type > "citep" 'ebib > (lambda (path desc format) > (cond > ((eq format 'html) > (format "(%s)" path)) > ((eq format 'latex) > (if (or (not desc) (equal 0 (search "citep:" desc))) > (format "\\citep{%s}" path) > (format "\\citep[%s]{%s}" desc path) > ))))) > #+end_src then the following Org-mode source: > Hawaiian archaeology's response to the late Roger Green's call for an > investigation of diachronic settlement patterns > [[citep:green84:_settl_patter_studies_ocean]] has been slow and > difficult. exports as: > Hawaiian archaeology's response to the late Roger Green's call for an > investigation of diachronic settlement patterns > \citep{green84:_settl_patter_studies_ocean} has been slow and > difficult. Perhaps you could post a minimal example that doesn't work for you? Note that this solution doesn't depend on ebib. It is perfectly OK to enter the bibliography key by hand if you prefer. On your other observation: I don't use underscores in headlines, so hadn't run across the limitation in the cross references that you mention. I don't know if there is any way around this. If you do find a way, please feel free to add the solution to the LaTeX export tutorial. All the best, Tom On Apr 11, 2011, at 3:55 AM, Mauro Rovezzi wrote: > On Mon, Apr 11, 2011 at 3:44 AM, Nick Dokos > wrote: >> Thomas S. Dye wrote: >>> >>> The code the OP cited passes desc to \cite{}. The code I pointed to >>> passes path to \cite{}. It does this to get around the problem of >>> escaped underscores, if I remember correctly. In any case, I use >>> this >>> code with bibliography keys that include underscores, so it should >>> work for the OP. >>> >> >> I still don't quite understand, so obviously I'm missing something >> fundamental - but I'll read your tutorial completely first (great >> tutorial btw!) and try some things out. > > Thomas, I also do not understand your reply, sorry. I have tried to > implement your solution with ebib, but it is not working. Well, > personally I do not use ebib, so it would be more elegant for me do > not depend on it. Anyway, I think I have to invest more time to better > understand this ebib-oriented solution to underscore. > > In addition, I also find out that the cross-references > (http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-16) > do not work either when the reference has underscore in it. > > Thanks, > Mauro --Apple-Mail-1--36107269 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Aloha = Mauro,

On my system I define a citep = link:

#+source: = define-citep-link
#+begin_src emacs-lisp :results = silent
   =  (org-add-link-type 
     "citep" = 'ebib
     (lambda (path desc = format)
       = (cond
        ((eq format = 'html)
         (format = "(<cite>%s</cite>)" path))
       =  ((eq format 'latex)
       =   (if (or (not desc) (equal 0 (search "citep:" = desc)))
               = (format "\\citep{%s}" path)
       =         (format "\\citep[%s]{%s}" desc = path)
  )))))
#+end_src


then the following = Org-mode source:

Hawaiian archaeology's response to the late Roger = Green's call for an
investigation of diachronic settlement = patterns
[[citep:green84:_settl_patter_studies_ocean]] has been = slow and difficult.

exports as:

Hawaiian archaeology's response to the late Roger = Green's call for an
investigation of diachronic settlement = patterns
\citep{green84:_settl_patter_studies_ocean} has been = slow and difficult.

Perhaps you could p= ost a minimal example that doesn't work = ;for you?

Note that this solution doesn't = depend on ebib.  It is perfectly OK to enter the bibliography key = by hand if you prefer.

On your other observation: = I don't use underscores in headlines, so&nbs= p;hadn't run across the limitation in the&nb= sp;cross references that you mention.  I&nbs= p;don't know if there is any way around=  this.  If you do find a way, please feel free to add the = solution to the LaTeX export = tutorial.

All the best,
Tom
On Apr 11, 2011, at 3:55 AM, Mauro Rovezzi = wrote:

On Mon, Apr 11, 2011 at 3:44 AM, Nick Dokos <nicholas.dokos@hp.com> = wrote:
Thomas S. Dye <tsd@tsdye.com> = wrote:

The code the OP cited passes = desc to \cite{}.  The code I pointed = to
passes path to \cite{}.  It does this to get around = the problem of
escaped underscores, if I = remember correctly.  In any case, I use = this
code with bibliography keys that include underscores, so = it should
work for the = OP.


I still don't = quite understand, so obviously I'm missing = something
fundamental - but = I'll read your tutorial completely first = (great
tutorial btw!) and try = some things out.

Thomas, I also do not understand = your reply, sorry. I have tried to
implement your solution with ebib, = but it is not working. Well,
personally I do not use ebib, so it = would be more elegant for me do
not depend on it. Anyway, I think I = have to invest more time to better
understand this ebib-oriented = solution to underscore.

In addition, I also find out that the = cross-references
(http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-16)<= br>do not work either when the reference has underscore in = it.

Thanks,
Mauro

<= /html>= --Apple-Mail-1--36107269--