2

I would like to change the font from Times New Roman to Courier New in the framed environment and it should have a font size of 10pt.

Here my current coding:

\begin{lstlisting}
define("USE_PCONNECT", false);
####### LOCAL CONFIGARATION  #######
define("SERVER","localhost");
define("USER","root");
define("PASSWORD","");
define("DB","learning");
\end{lstlisting}   

In my document file:

\usepackage{listings}
\lstset{
numberstyle=\small, 
numbersep=10pt, 
frame = single, 
language=PHP
}
2
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Sverre
    May 20, 2015 at 16:49
  • 1
    When you have new information, please edit your original question, don't post the information in a comment. Also, as stated in my initial comment, please add a MWE.
    – Sverre
    May 20, 2015 at 17:26

1 Answer 1

3

Besides the hints reg. how to ask questions, here a possible solution:

\documentclass[a4paper,10pt]{article}

\usepackage[T1]{fontenc}

\usepackage{listings}
\lstset{%
  basicstyle  = \fontfamily{pcr}\fontsize{10pt}{12pt}\selectfont ,
  numberstyle = \small , 
  numbersep   = 10pt   , 
  frame       = single , 
  language    = PHP
}

\begin{document}

\begin{lstlisting}
define("USE_PCONNECT", false);
####### LOCAL CONFIGARATION  #######
define("SERVER","localhost");
define("USER","root");
define("PASSWORD","");
define("DB","learning");
\end{lstlisting}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.