Добавьте/Найдите файлы Стиля в/к латексе

Вопрос 1

Я получаю следующую ошибку в Латексе:

! LaTeX Error: File `fancybox.sty' not found.

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

Enter file name: 

Однако файл fancybox.sty на самом деле расположен в папке от того, куда я выполняю команду pdflatex. Почему не в состоянии найти его?

Я просто установил Латекс на Ubuntu с помощью команды

apt-get install texlive-latex-base

и pdflatex управляют работами.

Вопрос 2

Я хочу установить этот texments от CTAN. Я могу сделать, это через Кв. - добирается? Есть ли другой Простой способ?

Спасибо, Ajay G.

15
задан user855 16 December 2009 в 01:33
поделиться

3 ответа

Пакет fancybox LaTeX включен в пакет texlive-latex-extra для Ubuntu. Если вы устанавливаете пакет texlive-latex-extra с помощью Synaptic или apt-get , ваш документ должен скомпилироваться:

$ sudo apt-get install texlive-latex-extra

Еще пара вещей, которые могут помочь вам в будущем:

  1. Установка TeXLive в Ubuntu в настоящее время является версией 2007 года. Недавно была выпущена версия TeXLive 2009 г. (см. веб-сайт TeXLive для загрузки ). Версия 2007 года будет работать большую часть времени, но выпуск 2009 года содержит последнюю версию пакетов с исправлениями ошибок. Просто предупреждаю.

  2. Я бы рекомендовал установить полный набор пакета TeXLive под Ubuntu, чтобы вам не приходилось рыться в репозитории и устанавливать новые файлы каждый раз, когда вы хотите добавить новый \ usepackage в ваш файл .tex . Если вы установите пакет texlive-full , он покроет все основы:

     $ sudo apt-get install texlive-full
    

    Обратите внимание, однако, что полный набор пакетов TeXLive является большой загрузкой, и для ее установки потребуется некоторое время.

27
ответ дан 1 December 2019 в 01:17
поделиться

Have you tried manually as it says in the official Ubuntu documentation?

https://help.ubuntu.com/community/LaTeX

If a package you desire is not in Ubuntu's repositories, you may look on CTAN's web site or TeX Catalogue Online to see if they have the package. If they do, download the archive containing the files. In this example, we'll install example package foo, contained in foo.tar.gz.

Once foo.tar.gz has finished downloading, we unzip it somewhere in our home directory:

tar xvf foo.tar.gz

This expands to folder foo/. We cd into foo/ and see foo.ins. We now run LaTeX on the file:

latex foo.ins

This will generate foo.sty. We now have to copy this file into the correct location. For the purposes of this example, we will copy this into our personal texmf tree. The advantages of this solution are that if we migrate our files to a new computer, we will remember to take our texmf tree with us, resulting in keeping the same packages we had. The disadvantages are that if multiple users want to use the same packages, the tree will have to be copied to each user's home folder.

We'll first create the necessary directory structure:

cd ~
mkdir -p texmf/tex/latex/foo

Notice that the final directory created is labeled foo. It is a good idea to name directories after the packages they contain. The -p attribute to mkdir tells it to create all the necessary directories, since they don't exist. Now, using either the terminal, or the file manager, copy foo.sty into the directory labeled foo.

Now, we must make LaTeX recognize the new package:

texhash ~/texmf

The new package should now be installed. To use it in your LaTeX document, merely insert \usepackage{foo} in the preamble.

2
ответ дан 1 December 2019 в 01:17
поделиться

Он должен работать с файлом стилей в директории, из которой выполнялась команда pdflatex, но решение этой проблемы простое:

sudo cp *.sty  /usr/share/texmf-texlive/tex/latex/base/
sudo mktexlsr
2
ответ дан 1 December 2019 в 01:17
поделиться
Другие вопросы по тегам:

Похожие вопросы: