0

I'm using the "epigraph" package for epigraphs at the beginning of my chapters. Every time I try to compile it always says

LaTeX Error: File "epigraph.sty" not found.

Then it prompts me to put a file name. I put "epigraph.sty" and it worked!

I tried to use the

$ texhash

command in the directory where my tex files are located. It says my directory is not writable. So seems like it will always raise this error and I have to manually enter the file name every time...which is certainly less desirable.

  • are you sure there is not an error in the filename as typed in the file (an invisible control character for example would produce the effect you describe. as always if you post a small sample document that produces the error it is much easier to debug – David Carlisle Mar 24 '17 at 18:46
  • What directory is it in? What OS are you using? Does root own your distribution? If so you might have to use sudo texhash and give your admin password. – Herb Schulz Mar 24 '17 at 19:12
1

I can reproduce the effect described as follows

\documentclass{article}

\usepackage{epigraph​}

\begin{document}

\end{document}

produces the terminal output:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./ww775.tex
LaTeX2e <2017-05-01>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/home/davidc/texmf/tex/latex/base/size10.clo))

! LaTeX Error: File `epigraph​.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

If you enter epigraph.sty it completes as

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./ww775.tex
LaTeX2e <2017-05-01>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/home/davidc/texmf/tex/latex/base/size10.clo))

! LaTeX Error: File `epigraph​.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: epigraph.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/epigraph/epigraph.sty

LaTeX Warning: You have requested package `epigraph​',
               but the package provides `epigraph'.

) (./ww775.aux) (./ww775.aux) )
No pages of output.

The reason here is a control character in the file:

the line

\usepackage{epigraph​}

is

  U+005c REVERSE SOLIDUS     &bsol; \backslash \textbackslash
  U+0075 LATIN SMALL LETTER U     u
  U+0073 LATIN SMALL LETTER S     s
  U+0065 LATIN SMALL LETTER E     e
  U+0070 LATIN SMALL LETTER P     p
  U+0061 LATIN SMALL LETTER A     a
  U+0063 LATIN SMALL LETTER C     c
  U+006b LATIN SMALL LETTER K     k
  U+0061 LATIN SMALL LETTER A     a
  U+0067 LATIN SMALL LETTER G     g
  U+0065 LATIN SMALL LETTER E     e
  U+007b LEFT CURLY BRACKET     &lcub; &lbrace; \lbrace
  U+0065 LATIN SMALL LETTER E     e
  U+0070 LATIN SMALL LETTER P     p
  U+0069 LATIN SMALL LETTER I     i
  U+0067 LATIN SMALL LETTER G     g
  U+0072 LATIN SMALL LETTER R     r
  U+0061 LATIN SMALL LETTER A     a
  U+0070 LATIN SMALL LETTER P     p
  U+0068 LATIN SMALL LETTER H     h
  U+200b ZERO WIDTH SPACE     &ZeroWidthSpace; &NegativeVeryThinSpace; &NegativeThinSpace; &NegativeMediumSpace; &NegativeThickSpace;
  U+007d RIGHT CURLY BRACKET     &rcub; &rbrace; \rbrace

with a spurious U+200B zero width character, such a character can not be seen but makes the file name not match, so requiring you to enter a "clean" version. Just deleting the line and retyping it with just the visible ascii characters produces

\documentclass{article}

\usepackage{epigraph}

\begin{document}

\end{document}

which runs without error

$ pdflatex ww775
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./ww775.tex
LaTeX2e <2017-05-01>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/home/davidc/texmf/tex/latex/base/size10.clo))
(/usr/local/texlive/2016/texmf-dist/tex/latex/epigraph/epigraph.sty)
(./ww775.aux) (./ww775.aux) )
No pages of output.
Transcript written on ww775.log.
  • In the same vein: A non-breaking hyphen or soft hyphen looks exactly the same as an ordinary hyphen, but it is a different Unicode point. – user103221 Mar 24 '17 at 22:21
  • Wow! Quick questions: I'm not quite sure (1) how to find the file that you spot the zero width character (2) what does "deleting the line and retyping it with just the visible ascii characters" entails (what exactly do I replace the line with)? I'm very new to these so thanks so much for the help! – nekodesu Mar 24 '17 at 23:42

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.