Re: [SOLVED] Re: Render to word C++ as monospaced

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

Re: [SOLVED] Re: Render to word C++ as monospaced

mojavelinux
Administrator
You got it! The compat-mode attribute allows your existing documents to be interpreted just as they always have.

In the new syntax, + characters are now used for passthrough consistently and the backtick is for monospaced formatting only. The best way to write C++ in monospaced text now is:

----
[x-]`C++` and more [x-]`C++`
----

or

----
`pass:[C++]` and more `pass:[C++]`
----

----
:cpp: C++

`{cpp}` and more `{cpp}`
----

In the first case, the x- role applies compatible behavior locally to that instance.

You are right in that there is no way to escape the ++ in C++ using a backslash. Fortunately, there are many other ways to write it.

This is such a common use case, I'm thinking we should add cpp as an implicit attribute for C++.

I am curious, why are you writing C++ in monospace text? If you don't need monospace, the syntax is much simpler:

----
pass:[C++] and more pass:[C++]
----

or

----
:cpp:

{cpp} and more {cpp}
----

Cheers,

-Dan

p.s. I also think we should cover this example in the docs since it's so common. Some test cases for it might always be good. Feel free to open issues for both.


On Mon, Sep 8, 2014 at 11:38 AM, wimalopaan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Setting :compat-mode: solves this issue !



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Render-to-word-C-as-monospaced-tp2141p2147.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--