Unable to get italic formatting after backslash in literal inline text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to get italic formatting after backslash in literal inline text

apnadkarni
Asciidoc newbie so first thanks for some great software.

I'm having one issue I cannot figure out. I want to format text as inline literal containing backslashes and italic text (this is actually to represent a Windows registry path). So the formatted text should look something like

\a\b\c\italics

I tried variations like "+\a\b\c\_italics_+", "+\a\b\c\\_italics_+" and even tried to use [subs] (probably not in the right manner) but cannot get the effect I want. The backslash causes next char to be a literal even if it itself is doubled.

What am I doing wrong?

Thanks

/Ashok
Reply | Threaded
Open this post in threaded view
|

Re: Unable to get italic formatting after backslash in literal inline text

mojavelinux
Administrator
Ashok,

This happens because Asciidoctor optimizes backslash processing in such a way that it leaves behind some corner cases. The best way to insert a symbol so that it doesn't affect formatting is to use an attribute. Here's how you might write your example:

....
\a\b\c{backslash}__italic__
....

NOTE: You need double underscores around the word italic since it's not separated from the other content (single underscores emphasis a whole word, double underscores emphasize a portion of a word).

If you don't to type out "backslash" in the attribute, you can abbreviate it using an attribute:

....
:bs: \

\a\b\c{bs}__italic__
....

I hope that helps!

-Dan


On Tue, Jul 1, 2014 at 12:28 AM, apnadkarni [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Asciidoc newbie so first thanks for some great software.

I'm having one issue I cannot figure out. I want to format text as inline literal containing backslashes and italic text (this is actually to represent a Windows registry path). So the formatted text should look something like

\a\b\c\italics

I tried variations like "+\a\b\c\_italics_+", "+\a\b\c\\_italics_+" and even tried to use [subs] (probably not in the right manner) but cannot get the effect I want. The backslash causes next char to be a literal even if it itself is doubled.

What am I doing wrong?

Thanks

/Ashok


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Unable-to-get-italic-formatting-after-backslash-in-literal-inline-text-tp1859.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Unable to get italic formatting after backslash in literal inline text

apnadkarni
That fixed it.

Thanks for the quick response. Great support!

/Ashok