Forum Discussion

KevinBennett-f8's avatar
KevinBennett-f8
Community Member
12 months ago

Code Snippet Block

A copy to clip board button for the code snippet block is something that has been requested for over 5 years. I think this would be an easy addition and greatly help user that are creating education for advance technical industries. 

3 Replies

  • Loupetron's avatar
    Loupetron
    Community Member

    This is most definitely needed, and most developers just assume it should be there since every other code block out there on the web has that button. It should be in Rise 360 too!

  • joshh-AS's avatar
    joshh-AS
    Community Member

    I found a way to do it! You have to use the "Math Equation" tool and can just copy/paste in some LaTeX which I've provided below.

    Step 1

    Highlight some text and click on the "Math Equation" button

    Step 2

    Paste in one of the following LaTeX samples. 

    Option 1 — choose from the 16 default LaTeX colors: 

    \colorbox{black}{\textcolor{lime}{\texttt{hello world}}}

    Option 2 — choose your own RBG colors:

    \definecolor{mybg}{rgb}{0.95, 0.95, 0.95}
    \definecolor{mytext}{rgb}{0.1, 0.1, 0.6}
    
    \colorbox{mybg}{\textcolor{mytext}{\texttt{inline code here}}}

    Step 3

    This results look like this for each of the examples above.

     

    I hope this helps!