[Tex/LaTex] how am I able to write different languages in one latex file

babellanguages

I'm on a Mac and I'm using the standard package that is available for Mac. I've tried to include babel and it doesn't work this way. what is the standard way of enabling a different language in LaTeX? If it is babel should I install something separate to get it to work?

\documentclass{report}
\usepackage[english,spanish]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

this is english and  español

\end{document}

Best Answer

There are very few clues in the question but if

\documentclass{report}
\usepackage[english,spanish]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

this is english and  español

\end{document}

is saved in UTF-8 and processed with pdflatex you get

enter image description here

If the same text is saved as latin-1 (ISO 8859-1) then you get a latex error due to the utf8 declaration so the terminal message is:

Runaway argument?
! Paragraph ended before \UTFviii@four@octets was complete.
<to be read again> 
                   \par 
l.8 

If you scroll past this error you get

enter image description here

so missing text but no question marks.

If you add \listfiles and save the file back in UTF-8 then latex will output a list of file versions to the terminal and log.

 *File List*
  report.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
   babel.sty    2016/04/23 3.9r The Babel package
 english.ldf    2017/01/24 v3.3q English support from the babel system
 spanish.ldf
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2017/01/28 v1.1t UTF-8 support for inputenc
   t1enc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
  ot1enc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
  omsenc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
 ***********