Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with LaTeX

  1. Feb 8, 2008 #1
    I'm using texmaker, and i need to explain how to use some of the functions.

    Therefore i need to be able to write the codes in a way so that the reader can see the codes afterwards.

    Does anyone know how to do that? Because i can't find a way to do it.
     
  2. jcsd
  3. Feb 8, 2008 #2

    berkeman

    User Avatar

    Staff: Mentor

    Last edited: Feb 8, 2008
  4. Feb 8, 2008 #3
    thanks for the answer but it wasnt exactly what i needed.

    for example when I have to make a fraction like this:
    \frac{x}{y}
    I need to show the teacher how i made the fraction by showing him the code, in the .PDF document.
     
  5. Feb 8, 2008 #4

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If you type;

    \begin{verbatim}
    \frac{x}{y}
    \end{verbatim}

    LaTeX will render it as something of the form,

    Code (Text):
    \frac{x}{y}
    As opposed to,

    [tex]\frac{x}{y}[/tex]
     
  6. Feb 8, 2008 #5

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    You can type \verb|\frac{x}{y}| to get latex to show something that looks like the input text.

    Edit: Looks like I've been beaten to it.. feels like deja vu!
     
  7. Feb 8, 2008 #6

    kdv

    User Avatar

    I have used the verbatim environment but the code then shows up on a separate line. Is there a way to do this with the code appearing on a text line?
     
  8. Feb 8, 2008 #7
    I have tested both possibilities and both of them is working for me. Thank you =D
     
  9. Feb 8, 2008 #8

    Hootenanny

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    No problem :smile:
    cristo's suggestion produces inline verbatim text. Note that you can chose whichever characters you like (except "\" and "%") as your delimiter, in this case cristo has chosen "|", but you could equally well chose any other character, e.g. "£", "!", "/",... However, your delimiter cannot appear in your verbatim text as it will serve to close the verbatim environment.
     
    Last edited: Feb 8, 2008
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Help with LaTeX
  1. Help using latex (Replies: 3)

  2. Latex help (Replies: 1)

  3. LaTex advice/help (Replies: 3)

  4. Latex broken? (Replies: 2)

Loading...