emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* In-line code, italics, quotation marks, etc.
@ 2014-03-04 21:08 Peter Davis
  2014-03-04 21:32 ` John Hendy
  2014-03-05  3:39 ` Nick Dokos
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Davis @ 2014-03-04 21:08 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to create an org page that contains a list of instructions, some of this include code and/or URLs. I'm having a dickens of a time trying to get this to format correctly,
and the documentation isn't much help. For example:

 - I want to have a numbered list with some of the steps being or containing code, in monospaced text:

     7) =something "abc"=

   However, the second quote seems to prevent the =...= notation from being recognized.

 - I want a URL that does NOT get converted to a link, and in which I can place italics to indicate that parts of the sample URL should be replaced with other text:
   http://localhost:<port number>/path/to/file/file.html
   In this case, "port number" and probably "/path/to/file/" should be italicized.

 - Of course, combining these, I get situations like:
   =var str1 = "<replace me> some other text."=
   Embedded equal signs, quotation marks and emphasized text make this a nightmare.

Can this be done, or is this just more complicated than org was designed to handle? I can, of course, edit the exported files, but that's pretty limiting.

Thanks,
-pd


-- 
----
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com

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

* Re: In-line code, italics, quotation marks, etc.
  2014-03-04 21:08 In-line code, italics, quotation marks, etc Peter Davis
@ 2014-03-04 21:32 ` John Hendy
  2014-03-05  3:39 ` Nick Dokos
  1 sibling, 0 replies; 6+ messages in thread
From: John Hendy @ 2014-03-04 21:32 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

On Tue, Mar 4, 2014 at 3:08 PM, Peter Davis <pfd@pfdstudio.com> wrote:
> I'm trying to create an org page that contains a list of instructions, some of this include code and/or URLs. I'm having a dickens of a time trying to get this to format correctly,
> and the documentation isn't much help. For example:
>
>  - I want to have a numbered list with some of the steps being or containing code, in monospaced text:
>
>      7) =something "abc"=
>
>    However, the second quote seems to prevent the =...= notation from being recognized.

Perhaps annoying, but 0 width spaces have been used in the past (found
by googling "verbatim quotes orgmode"
- http://lists.gnu.org/archive/html/emacs-orgmode/2010-04/msg00332.html

Not sure if those still work, as null characters were suggested here
as well, but then cited to possibly break export?
- http://comments.gmane.org/gmane.emacs.orgmode/52575

What's the export backend? Sometimes I just deal with manually
inserting \(\verbatim{someting "abc"}\) (or not using \(\) if you have
tex:t latex:t in #+options).

>
>  - I want a URL that does NOT get converted to a link, and in which I can place italics to indicate that parts of the sample URL should be replaced with other text:
>    http://localhost:<port number>/path/to/file/file.html
>    In this case, "port number" and probably "/path/to/file/" should be italicized.
>

Not sure what others will say, but I typically rely on raw backend
syntax for situations like these. Seems too hard to escape the parsing
while also imparting your own markup, but I could be wrong!

>  - Of course, combining these, I get situations like:
>    =var str1 = "<replace me> some other text."=
>    Embedded equal signs, quotation marks and emphasized text make this a nightmare.

Same suggestion. Hopefully you don't have an insane number of these or
aren't using a bunch of export engines. If it's limited to one and you
have, say, a handful of them... hopefully just going raw export
language could work?

>
> Can this be done, or is this just more complicated than org was designed to handle? I can, of course, edit the exported files, but that's pretty limiting.
>

Nicolas could explain much better, but from my perusing Google results
for you, it didn't seem promising. There are instances of folks
tweaking their parsing string:
- http://thread.gmane.org/gmane.emacs.orgmode/20915/focus=20922
- http://stackoverflow.com/questions/16443386/how-to-escape-double-quote


John


> Thanks,
> -pd
>
>
> --
> ----
> Peter Davis
> The Tech Curmudgeon
> www.techcurmudgeon.com
>

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

* Re: In-line code, italics, quotation marks, etc.
  2014-03-04 21:08 In-line code, italics, quotation marks, etc Peter Davis
  2014-03-04 21:32 ` John Hendy
@ 2014-03-05  3:39 ` Nick Dokos
  2014-03-05  8:14   ` Alan Schmitt
  2014-03-05  9:50   ` Michael Brand
  1 sibling, 2 replies; 6+ messages in thread
From: Nick Dokos @ 2014-03-05  3:39 UTC (permalink / raw)
  To: emacs-orgmode

Peter Davis <pfd@pfdstudio.com> writes:

> I'm trying to create an org page that contains a list of instructions,
> some of this include code and/or URLs. I'm having a dickens of a time
> trying to get this to format correctly, and the documentation isn't
> much help. For example:
>
>  - I want to have a numbered list with some of the steps being or
>  containing code, in monospaced text:
>
>      7) =something "abc"=
>
>    However, the second quote seems to prevent the =...= notation from
>    being recognized.
>
>  - I want a URL that does NOT get converted to a link, and in which I
>  can place italics to indicate that parts of the sample URL should be
>  replaced with other text:
>
>   http://localhost:<port number>/path/to/file/file.html
>
> In this case, "port number" and probably "/path/to/file/" should be
> italicized.
>
>  - Of course, combining these, I get situations like: =var str1 =
>  "<replace me> some other text."= Embedded equal signs, quotation
>  marks and emphasized text make this a nightmare.
>
> Can this be done, or is this just more complicated than org was
> designed to handle? I can, of course, edit the exported files, but
> that's pretty limiting.
>

Some of it can be done by modifying org-emphasis-regexp-components -
the default value prohibits quotes from appearing in the "border"
(right after the initial = or right before the final one) -
see

        http://thread.gmane.org/gmane.emacs.orgmode/82300
and
        http://thread.gmane.org/gmane.emacs.orgmode/82571

for more. In particular, Oleh shared his method of modifying this
variable - see

        http://thread.gmane.org/gmane.emacs.orgmode/82571/focus=82669

A slight modification of his method:

  (setf (nth 2 org-emphasis-regexp-components) " \t\r\n,")
  (custom-set-variables `(org-emphasis-alist ',org-emphasis-alist))

allows both single and double quotes in the border.

Since this is the third time in as many weeks that somebody brings this
exact problem up, this probably qualifies as a FAQ. But before going
there, is there *any* reason to forbid quotes in the border? IOW, maybe
it's a better idea to change the default value of
org-emphasis-regexp-components instead.

AFAIK, you cannot have nested emphasis, so getting emphasized text
within verbatim text will require the more backend-specific methods that
John describes.
-- 
Nick

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

* Re: In-line code, italics, quotation marks, etc.
  2014-03-05  3:39 ` Nick Dokos
@ 2014-03-05  8:14   ` Alan Schmitt
  2014-03-05  9:50   ` Michael Brand
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Schmitt @ 2014-03-05  8:14 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hi Nick,

Nick Dokos <ndokos@gmail.com> writes:

> Since this is the third time in as many weeks that somebody brings this
> exact problem up, this probably qualifies as a FAQ. But before going
> there, is there *any* reason to forbid quotes in the border? IOW, maybe
> it's a better idea to change the default value of
> org-emphasis-regexp-components instead.

I would guess it is to allow writing things like:

  if you enter the tilde character '~' then things are fine, but don't
  forget the '~'.

However, I use double and single quotes as code/verbatim much more often
than I need to write such examples, so I'm all for changing the default.

Alan

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

* Re: In-line code, italics, quotation marks, etc.
  2014-03-05  3:39 ` Nick Dokos
  2014-03-05  8:14   ` Alan Schmitt
@ 2014-03-05  9:50   ` Michael Brand
  2014-03-05 12:12     ` Nick Dokos
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Brand @ 2014-03-05  9:50 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Org Mode

Hi Nick

On Wed, Mar 5, 2014 at 4:39 AM, Nick Dokos <ndokos@gmail.com> wrote:
> Since this is the third time in as many weeks that somebody brings this
> exact problem up, this probably qualifies as a FAQ. But before going
> there, is there *any* reason to forbid quotes in the border? IOW, maybe
> it's a better idea to change the default value of
> org-emphasis-regexp-components instead.

Did you see this thread?:
http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&sort=date:late&query=%2Bsubject:%22[RFC]+Emphasis+regexp%22

There I provided also the history of org-emphasis-regexp-components.

Michael

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

* Re: In-line code, italics, quotation marks, etc.
  2014-03-05  9:50   ` Michael Brand
@ 2014-03-05 12:12     ` Nick Dokos
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2014-03-05 12:12 UTC (permalink / raw)
  To: emacs-orgmode

Michael Brand <michael.ch.brand@gmail.com> writes:

> On Wed, Mar 5, 2014 at 4:39 AM, Nick Dokos <ndokos@gmail.com> wrote:
>> Since this is the third time in as many weeks that somebody brings this
>> exact problem up, this probably qualifies as a FAQ. But before going
>> there, is there *any* reason to forbid quotes in the border? IOW, maybe
>> it's a better idea to change the default value of
>> org-emphasis-regexp-components instead.
>
> Did you see this thread?:
> http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&sort=date:late&query=%2Bsubject:%22[RFC]+Emphasis+regexp%22
>
> There I provided also the history of org-emphasis-regexp-components.
>

No, I missed that: no time to read it now, but I'll take a look.

Thanks!
-- 
Nick

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

end of thread, other threads:[~2014-03-05 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-04 21:08 In-line code, italics, quotation marks, etc Peter Davis
2014-03-04 21:32 ` John Hendy
2014-03-05  3:39 ` Nick Dokos
2014-03-05  8:14   ` Alan Schmitt
2014-03-05  9:50   ` Michael Brand
2014-03-05 12:12     ` Nick Dokos

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).