2

I am trying to apply my thesis to a TeX template. I have pdflatex installed on a Linux box (in my university), but cannot get it to work. When I point to my TeX file as below, it gives an error:

Enter file name: /users/ugrad/oconnorp/Downloads/CUEDThesisPSnPDF/thesis
! LaTeX Error: File `Classes/CUEDthesisPSnPDF.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)
user2152812
  • 31
  • 1
  • 1
  • 2
  • Welcome to TeX.sx!. are you using CUED zip file for your thesis writing. Do you have any LaTeX editor to open/edit/compile the thesis.tex file ? you have to build upon and type on the thesis.tex to get your thesis writing going. – texenthusiast Mar 11 '13 at 01:28
  • You're missing some files that were used to make the template. See here. Probably on the school website somewhere. – DJP Mar 11 '13 at 01:29
  • Thanks for the welcome! Yes. I have a text editor but no tex\latex editor(i checked the computer for one but they dont seem to have one installed- i tried installing one- but it said i am not in sudoers file- and this has been reported :-) )- im on ubuntu and it does have pdflatex on the command line, so i thought running the command and pointing to the folder would work! Maybe it could be a problem with the template? – user2152812 Mar 11 '13 at 01:30
  • @user2152812 can you see any latex editor in programming section ? if you have sudo rights to install see the latex editor and install from website/synaptic manager. the zip file template works fine. there is no error. check your folder Classes for CUEDthesisPSnPDF.cls, your are missing that in your compilation, hence the error. – texenthusiast Mar 11 '13 at 01:37
  • Yeah i do have it in the folder- so it seems that some other file is not pointing to it correctly. Unfortunately i cannot install any editors on this computer. I tried with the zip as opposed to the tar version. the error is more specific: Undefined control sequence. l.4 \documentclass [oneside,12pt]{Classes/CUEDthesisPSnPDF} – user2152812 Mar 11 '13 at 01:43
  • @user2152812 A latex editor might be already installed. Which version of Ubuntu are you using ? latex editor is just for comfort of user experience. One can always use any ascii text editor to type the thesis and save as .tex to run from command line terminal. to test, you can download the new template. In my view your changed the default template \documentclass[oneside,12pt]{Classes/CUEDthesisPSnPDF}. Download a 32bit linux portable version of TeXmaker binary which does not need installation, just doubleclick on executable. – texenthusiast Mar 11 '13 at 01:51
  • @user2152812 test whether your linux is 32 bit or 64 bit using uname -a at terminal. install 32(i386) or 64 bit(x86_64) as per ur response from terminal. – texenthusiast Mar 11 '13 at 01:56
  • thanks a lot i installed the 32 bit one(even though it is 64 bit- it appears to work fine). However, it seems there is an issue with the template,as it does not display in the pdf view – user2152812 Mar 11 '13 at 02:01
  • @user2152812 what's the error ? you can see the thesis.log for any errors/warnings. you cannot chat unless you have 20 rep. try with a simple example – texenthusiast Mar 11 '13 at 02:12
  • Have it working now- thank you so much!!! texenthusiast can you post in answer question and i will mark it as answered thanks. – user2152812 Mar 11 '13 at 02:12
  • How are you 'applying' your thesis to a template? This sounds confusing to me. Can you run any version of latex at all? For instance what happens when you try the following (in a folder you have write permissions): latex small2e (or pdflatex small2e)? – jon Mar 11 '13 at 02:12
  • @user2152812 great news. i will post my comment as answer in few min after food. – texenthusiast Mar 11 '13 at 02:16
  • @user2152812 after some time of struggle i could retrace the error your got and the reason for it. you did not change the directory to the cd /users/ugrad/oconnorp/Downloads/CUEDThesisPSnPDF before running pdflatex from the CUEDThesisPSnPDF directory. hence the .cls(class)/.sty(style) file location was not known to pdflatex engine. Instead you ran pdflatex from a different directory, but did not provide name of the .tex file and the location of .cls and .sty files. Moral: Run pdflatex thesis after the cd /users/ugrad/oconnorp/Downloads/CUEDThesisPSnPDF directory. – texenthusiast Mar 11 '13 at 02:36
  • @user2152812 Command line Terminal way of running pdflatex fileName.tex should work always. ideally there is no need for latex editor, its for GUI user experience and synctex/view pdf facilities. – texenthusiast Mar 11 '13 at 02:39

1 Answers1

6

Reason for the error:

  • There is no change in directory by cd /users/ugrad/oconnorp/Downloads/CUEDThesisPSnPDF before running pdflatex from the CUEDThesisPSnPDF directory.

  • cd should be done as CUEDthesisPSnPDF.cls (class file) is located in Classes/CUEDthesisPSnPDF where the pdflatex would be searching as it is mentioned in the argument of \documentclass[]{} as below.

      \documentclass[oneside,12pt]{Classes/CUEDthesisPSnPDF}
    
  • Hence the .cls(class)/.sty(style) file location was not known to pdflatex engine. Instead you ran pdflatex from a different directory, but did not provide name of the .tex file and the location of .cls and .sty files. Program was just exited by typing X.

Correct Approach

  • Run pdflatex thesis after the cd /users/ugrad/oconnorp/Downloads/CUEDThesisPSnPDF to satisfy the CUEDthesisPSnPDF.cls location at Classes/CUEDthesisPSnPDF

  • Command line/Terminal way of running pdflatex fileName.tex should work always and its the best verification test incase of errors from Editors. Ideally there is no need for latex editor, its for GUI user experience and synctex/view pdf facilities.

Verify a latex installation: Commandline/Terminal:

  • To verify/test a latex installation(TeXlive or MiKTeX) using commandline/terminal, one can use

latex small2e to get the small2e.dvi (or)

latex sample2e to get the sample2e.dvi

pdflatex small2e to get the small2e.pdf (or)

pdflatex sample2e to get the sample2e.pdf

pdflatex sample2e to get the sample2e.pdf

xetex opentype-info to get the opentype-info.pdf

Notice, there is no need for .tex extension

Mentioned by: jon in his comment

Portable LaTeX editor: Without sudo rights:

  • When one don't have a LaTeX editor installed on Ubuntu and also don't have sudo/admin rights. use portable version of TeXmaker LaTeX editor depending on the 32bit(i386) or 64 bit (x86_64) linux.

  • Test whether linux is 32 bit or 64 bit using uname -a at terminal. 32bit portable editor can run on both.