Search code examples
linuxlatexenvironment-variablesdollar-sign

Latex Dollar Sign \\ How do I signify Linux Environment Variables in latex?


I am aware to output dollar signs you escape it with \ such that:

\$          % prints '$' 

However, I can't print something like

\$ JAVA_HOME       % prints '$ JAVA_HOME'

The space in between the $ and JAVA_HOME is what's annoying. How can I make it so it's one word?


Solution

  • remove the space? \$JAVAHOME gives what I expect:

    $ grep JAVA test.tex 
    \$JAVAHOME
    
    $ ps2ascii test.ps
    $JAVAHOME