emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Possible buglet in latex export
@ 2009-08-17  3:51 Robert Goldman
  2009-08-17  5:18 ` Nick Dokos
  2009-08-17 10:39 ` Tim Burt
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Goldman @ 2009-08-17  3:51 UTC (permalink / raw)
  To: Org Mode

When I do a latex export, a simple URL in text, or a simple link url of
the form [[URL]] --- with no description --- gets emitted as

\href{URL}{URL}

which causes Latex to crash for me.

I believe that this is because it won't accept a URL as the second
argument to href.

Changing the \href command to \url fixes the latex problem.

So I wonder if we need to catch this special case of a description-less
URL and treat it specially in latex export for the benefit of latex's
hyperref package.

I'm not an expert on hyperref, by any means, nor do I know the innards
of latex export, so I could be missing something here.  However the
description of \url in the hyperref manual says the following:

  \url{URL}

Similar to \href{URL}{\nolinkurl{URL}}

...which suggests to me that using the URL without some kind of magical
protection (provided by \nolinkurl) may lead to bad things.

best,
r

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible buglet in latex export
  2009-08-17  3:51 Possible buglet in latex export Robert Goldman
@ 2009-08-17  5:18 ` Nick Dokos
  2009-08-17 10:39 ` Tim Burt
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2009-08-17  5:18 UTC (permalink / raw)
  To: Robert Goldman; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]

Robert Goldman <rpgoldman@sift.info> wrote:

> When I do a latex export, a simple URL in text, or a simple link url of
> the form [[URL]] --- with no description --- gets emitted as
> 
> \href{URL}{URL}
> 
> which causes Latex to crash for me.
> 
> I believe that this is because it won't accept a URL as the second
> argument to href.
> 
> Changing the \href command to \url fixes the latex problem.
> 
> So I wonder if we need to catch this special case of a description-less
> URL and treat it specially in latex export for the benefit of latex's
> hyperref package.
> 
> I'm not an expert on hyperref, by any means, nor do I know the innards
> of latex export, so I could be missing something here.  However the
> description of \url in the hyperref manual says the following:
> 
>   \url{URL}
> 
> Similar to \href{URL}{\nolinkurl{URL}}
> 
> ...which suggests to me that using the URL without some kind of magical
> protection (provided by \nolinkurl) may lead to bad things.
> 

I tried your scenario with the following org file and I cannot reproduce
the problem:


--8<---------------cut here---------------start------------->8---

* some urls

  - [[http://www.google.com][google]]

  - [[http://www.google.com]]

--8<---------------cut here---------------end--------------->8---

The resulting LaTeX file (attached) compiles without error and produces
the expected output. 

HTH,
Nick

Version info: Org-mode version 6.29trans
              GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2009-08-09 on gamaville.dokosmarshall.org
              Linux gamaville.dokosmarshall.org 2.6.24-24-generic #1 SMP Fri Jul 24 22:46:06 UTC 2009 i686 GNU/Linux



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: LaTeX export of org file --]
[-- Type: text/x-tex, Size: 507 bytes --]

% Created 2009-08-17 Mon 01:13
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{hyperref}


\title{url}
\author{Nick Dokos}
\date{17 August 2009}

\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

\section{some urls}
\label{sec-1}


\begin{itemize}
\item \href{http://www.google.com}{google}
\item \href{http://www.google.com}{http://www.google.com}
\end{itemize}

\end{document}

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Possible buglet in latex export
  2009-08-17  3:51 Possible buglet in latex export Robert Goldman
  2009-08-17  5:18 ` Nick Dokos
@ 2009-08-17 10:39 ` Tim Burt
  2009-08-17 12:57   ` Robert Goldman
  1 sibling, 1 reply; 7+ messages in thread
From: Tim Burt @ 2009-08-17 10:39 UTC (permalink / raw)
  To: Robert Goldman; +Cc: Org Mode

Robert Goldman writes:
 > When I do a latex export, a simple URL in text, or a simple link url of
 > the form [[URL]] --- with no description --- gets emitted as
 > 
 > \href{URL}{URL}
 > 
 > which causes Latex to crash for me.
The first guess is that the string 'URL' in the post is not the actual
string that "causes Latex to crash".  The next guess is that 'URL' is
actually a string with one of LaTeX's 10 special characters, with a
popular one being underscore (_) in this context.

 > 
 > I believe that this is because it won't accept a URL as the second
 > argument to href.
The second argument to \href is simply a string that LaTeX can render,
so a URL is fine.

 > 
 > Changing the \href command to \url fixes the latex problem.
 > 
 > So I wonder if we need to catch this special case of a description-less
 > URL and treat it specially in latex export for the benefit of latex's
 > hyperref package.
 > 
 > I'm not an expert on hyperref, by any means, nor do I know the innards
 > of latex export, so I could be missing something here.  However the
 > description of \url in the hyperref manual says the following:
 > 
 >   \url{URL}
 > 
 > Similar to \href{URL}{\nolinkurl{URL}}
 > 
 > ...which suggests to me that using the URL without some kind of magical
 > protection (provided by \nolinkurl) may lead to bad things.
A URL can be used, but any special characters must be protected
somehow.  The \nolinkurl in the second argument provides such
protection, as does the \url solution mentioned above.

 > 
 > best,
 > r
 > 
 > 
 > _______________________________________________
 > Emacs-orgmode mailing list
 > Remember: use `Reply All' to send replies to the list.
 > Emacs-orgmode@gnu.org
 > http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Tim Burt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible buglet in latex export
  2009-08-17 10:39 ` Tim Burt
@ 2009-08-17 12:57   ` Robert Goldman
  2009-08-17 13:26     ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Goldman @ 2009-08-17 12:57 UTC (permalink / raw)
  To: tcburt; +Cc: Org Mode

Tim Burt wrote:
> Robert Goldman writes:
>  > When I do a latex export, a simple URL in text, or a simple link url of
>  > the form [[URL]] --- with no description --- gets emitted as
>  > 
>  > \href{URL}{URL}
>  > 
>  > which causes Latex to crash for me.
> The first guess is that the string 'URL' in the post is not the actual
> string that "causes Latex to crash".  The next guess is that 'URL' is
> actually a string with one of LaTeX's 10 special characters, with a
> popular one being underscore (_) in this context.
> 
>  > 
>  > I believe that this is because it won't accept a URL as the second
>  > argument to href.
> The second argument to \href is simply a string that LaTeX can render,
> so a URL is fine.
> 
>  > 
>  > Changing the \href command to \url fixes the latex problem.
>  > 
>  > So I wonder if we need to catch this special case of a description-less
>  > URL and treat it specially in latex export for the benefit of latex's
>  > hyperref package.
>  > 
>  > I'm not an expert on hyperref, by any means, nor do I know the innards
>  > of latex export, so I could be missing something here.  However the
>  > description of \url in the hyperref manual says the following:
>  > 
>  >   \url{URL}
>  > 
>  > Similar to \href{URL}{\nolinkurl{URL}}
>  > 
>  > ...which suggests to me that using the URL without some kind of magical
>  > protection (provided by \nolinkurl) may lead to bad things.
> A URL can be used, but any special characters must be protected
> somehow.  The \nolinkurl in the second argument provides such
> protection, as does the \url solution mentioned above.
> 

Thanks.  This suggests that replacing \href{URL}{URL} with
\href{URL}{\nolinkurl{URL}} might be a good strategy for Latex export.

I am not exactly sure why the un-protected URL causes problems for me
and not for Nick.  However, I am trying to generate latex for beamer,
which seems very tricky, and perhaps that's what's going wrong here ---
I'm getting beamer's internal state messed up.  I'm not sure; will
report if I can disentangle it.

Thanks for the help, both of you.

best,
R

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible buglet in latex export
  2009-08-17 12:57   ` Robert Goldman
@ 2009-08-17 13:26     ` Nick Dokos
  2009-08-18 11:07       ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2009-08-17 13:26 UTC (permalink / raw)
  To: Robert Goldman; +Cc: Org Mode

Robert Goldman <rpgoldman@sift.info> wrote:

> I am not exactly sure why the un-protected URL causes problems for me
> and not for Nick.  However, I am trying to generate latex for beamer,
> which seems very tricky, and perhaps that's what's going wrong here ---
> I'm getting beamer's internal state messed up.  I'm not sure; will
> report if I can disentangle it.
> 

Maybe it's the details of the URL that matter? I tried exporting the
little example that I posted to beamer and that also worked. If you have
not tried my example already, maybe you should: it may be that my
example is *too* simple - in which case, can you post a URL that is giving
you trouble?

Thanks,
Nick

PS. For the record, here's the version of hyperref I'm using:

Package: hyperref 2007/02/07 v6.75r Hypertext links for LaTeX

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible buglet in latex export
  2009-08-17 13:26     ` Nick Dokos
@ 2009-08-18 11:07       ` Carsten Dominik
  2009-08-18 12:19         ` Robert Goldman
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-08-18 11:07 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, Robert Goldman

Hi,

I just tried and cannot get it to crash.

Robert, it seems we need, instead of a bug description, a test file,  
with the actual URL you are using.

- Carsten

On Aug 17, 2009, at 2:26 PM, Nick Dokos wrote:

> Robert Goldman <rpgoldman@sift.info> wrote:
>
>> I am not exactly sure why the un-protected URL causes problems for me
>> and not for Nick.  However, I am trying to generate latex for beamer,
>> which seems very tricky, and perhaps that's what's going wrong here  
>> ---
>> I'm getting beamer's internal state messed up.  I'm not sure; will
>> report if I can disentangle it.
>>
>
> Maybe it's the details of the URL that matter? I tried exporting the
> little example that I posted to beamer and that also worked. If you  
> have
> not tried my example already, maybe you should: it may be that my
> example is *too* simple - in which case, can you post a URL that is  
> giving
> you trouble?
>
> Thanks,
> Nick
>
> PS. For the record, here's the version of hyperref I'm using:
>
> Package: hyperref 2007/02/07 v6.75r Hypertext links for LaTeX
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Possible buglet in latex export
  2009-08-18 11:07       ` Carsten Dominik
@ 2009-08-18 12:19         ` Robert Goldman
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Goldman @ 2009-08-18 12:19 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode

Carsten Dominik wrote:
> Hi,
> 
> I just tried and cannot get it to crash.
> 
> Robert, it seems we need, instead of a bug description, a test file,
> with the actual URL you are using.

Right.  I am working on this.  It is only happening to me in beamer,
though, which isn't really supported anyway, so it may not be worth
"fixing."

It may have been "fixed" already as a side effect of my tagging all the
frames in beamer as [fragile].

If I can identify what causes the crashing, I will submit a better test
case.

best,
Robert
> 
> - Carsten
> 
> On Aug 17, 2009, at 2:26 PM, Nick Dokos wrote:
> 
>> Robert Goldman <rpgoldman@sift.info> wrote:
>>
>>> I am not exactly sure why the un-protected URL causes problems for me
>>> and not for Nick.  However, I am trying to generate latex for beamer,
>>> which seems very tricky, and perhaps that's what's going wrong here ---
>>> I'm getting beamer's internal state messed up.  I'm not sure; will
>>> report if I can disentangle it.
>>>
>>
>> Maybe it's the details of the URL that matter? I tried exporting the
>> little example that I posted to beamer and that also worked. If you have
>> not tried my example already, maybe you should: it may be that my
>> example is *too* simple - in which case, can you post a URL that is
>> giving
>> you trouble?
>>
>> Thanks,
>> Nick
>>
>> PS. For the record, here's the version of hyperref I'm using:
>>
>> Package: hyperref 2007/02/07 v6.75r Hypertext links for LaTeX
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-18 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17  3:51 Possible buglet in latex export Robert Goldman
2009-08-17  5:18 ` Nick Dokos
2009-08-17 10:39 ` Tim Burt
2009-08-17 12:57   ` Robert Goldman
2009-08-17 13:26     ` Nick Dokos
2009-08-18 11:07       ` Carsten Dominik
2009-08-18 12:19         ` Robert Goldman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).