Entering Code in LaTeX Documents

  • Topic: LaTeX 
  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Code Latex
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 3K views
Dustinsfl
Messages
2,217
Reaction score
5
How can I enter code in Latex documents?
 
Physics news on Phys.org
dwsmith said:
How can I enter code in Latex documents?

Hi dwsmith, :)

One way to do this is to surround your text with \verb|...| command. Examples,

\[\verb|$y=2x+1$|\]

\[\verb|\prod_{i=m}^{\infty}x_{i}=\lim_{n\to\infty}\prod_{i=m}^{n}x_{i}|\]

For larger portions of text use the \(\verb|\begin{verbatim}...\end{verbatim}|\) environment. Kind Regards,
Sudharaka.