Hi all,
I'm pretty familiar with LaTeX, I've been using it for about 2 years. I'm using windows 7 and MikTex 2.8 and I'm trying to use the install mcode package. I put it under C:\Program Files\MiKTeX 2.8\tex\latex\mcode (mcode is the file that contains mcode.sty)
I went to the MikTex Options program and refreshed the FNDB. I went to the windows command center and typed in the command texhash (both were successful, and I've done both multiple times). I restarted my computer too.
For some reason, mcode.sty is still not found. The frustrating thing is that it used to work, but I recently wiped my hard drive and have been putting LaTeX back on it. Did I forget something?
Thanks.
General ⇒ LaTeX error, .sty not found
-
- Posts: 3
- Joined: Tue Apr 27, 2010 6:34 am
LaTeX error, .sty not found
I don't know if this means anything, but the mcode package just comes with a .sty. There's no .inx or .dtx. This website: http://en.wikibooks.org/wiki/LaTeX/Pack ... a_Packages seemed to imply that just a .sty is obsolete?
Re: LaTeX error, .sty not found
Does it work if you put the .sty file in the same directory as the file you're processing?
(I'm not suggesting that as a long term solution, just a diagnostic.)
(I'm not suggesting that as a long term solution, just a diagnostic.)
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: LaTeX error, .sty not found
MiKTeX 2.8 splits things into "user" and "admin" modes. AS you've added you file to the main MiKTeX repository on your PC, you need to run the admin version of texhash. On the MiKTeX Start Menu Entry, use the version of MiKTeX Tools with (admin) after it and refresh the fndb from there.
(I should add that you really should put locally-installed files in a local root, not inside \Program Files.)
(I should add that you really should put locally-installed files in a local root, not inside \Program Files.)
Joseph Wright
-
- Posts: 3
- Joined: Tue Apr 27, 2010 6:34 am
Re: LaTeX error, .sty not found
Thanks, that worked! What does the non-admin FNDB refresh do?
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: LaTeX error, .sty not found
Refreshes the per-user FNDB. As I said, you really should install files for you (as opposed to those managed by MiKTeX) on a per-user basis.
Joseph Wright
LaTeX error, .sty not found
Hi,
I'm a student and I use latex for about 9 months now.
I'm trying to use the mcode package but no mater what I do I just won't work.
I've tried :
- put the mcode.sty in the same folder => didn't work.
- copy the mcode folder in "C:\Program Files (x86)\MiKTeX 2.8\tex\latex\mcode" then refresh the FNDB (using the admin right of course).
- reboot my laptop.
I'm on Win7Pro, I use MikTex 2.8 and TeXnicCenter 1.0.
Here's my header :
If I change \usepackage{mcode} by \usepackage{listings} it works but it doesn't look like matlab format.
The log dialogs box of TeXnicCenter does help much but it seams it can find mcode :
If someone have an idea how to solve this problem, I'll be gratefull, thanks.
Bye
I'm a student and I use latex for about 9 months now.
I'm trying to use the mcode package but no mater what I do I just won't work.
I've tried :
- put the mcode.sty in the same folder => didn't work.
- copy the mcode folder in "C:\Program Files (x86)\MiKTeX 2.8\tex\latex\mcode" then refresh the FNDB (using the admin right of course).
- reboot my laptop.
I'm on Win7Pro, I use MikTex 2.8 and TeXnicCenter 1.0.
Here's my header :
Code: Select all
%=== SET UP/HEADER ===============
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[english,francais]{babel}
\usepackage{graphicx}
\usepackage{mcode}
\usepackage{fancyhdr}
\usepackage[hmargin=2.5cm,vmargin=3cm]{geometry}
\author{XmH}
\title{title}
\date{13/10/2010}
\begin{document}
%=== COVER ===============
\maketitle
\thispagestyle{empty}
\newpage
\pagestyle{fancy}
\lhead{}
\chead{}
%\rhead{}
\lfoot{XmH}
\cfoot{\thepage}
\rfoot{XXX}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
%=== TABLE OF CONTENTS ===============
\tableofcontents
\newpage
%=== INTRO ================
[...]
%=== ANNEXES ===============
\appendix
\section{Annexes}
\subsection{Code Matlab - SEM Labo01 221}
\lstinputlisting{code/SEM_Labo01_221.m}
%=== EOF ===============
\end{document}
The log dialogs box of TeXnicCenter does help much but it seams it can find mcode :
Code: Select all
[...]
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\mcode\mcode.sty"
-- Package: `mcode' 1.9 <2010/05/04> --
Package: mcode 2010/05/04 1.9
- settings optimized for display (colour formating)
[...]
Bye
LaTeX error, .sty not found
This guy said here:http://danielbaggio.blogspot.com/2007/1 ... found.html, that "texhash" would work. However, it doesnot work on me(even in sudo mode). What I do is that when I encounter the sty not found problem, open another terminal window to locate that file. And then paste the directory to where it is needed. However, this configuration problem requires a clean solution.
LaTeX error, .sty not found
What would we do without people like you... Thanks a million!josephwright wrote:Refreshes the per-user FNDB. As I said, you really should install files for you (as opposed to those managed by MiKTeX) on a per-user basis.