MiKTeX and proTeXtMikTeX on Linux

Information and discussion about MikTeX distribution for Windows and the related proTeXt: Installing, updating, configuring
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

MikTeX on Linux

Post by frabjous »

I understand that migrating to tex-live and kile is the logical thing to do but I cannot compile my pdf with kile either for some reason, even though it works with miktex/texniccenter on windows.
I would try to find out what that reason is. Kile is IMHO a superior editor to TXC, and if the choice is between troubleshooting one problem, or troubleshooting another, it just seems to make more sense to stick with the linux-native software. Can you compile the document from the commandline? (E.g., with "pdflatex filename.tex" from a terminal?)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
cue
Posts: 6
Joined: Mon Jul 05, 2010 1:56 pm

Re: MikTeX on Linux

Post by cue »

I just tried to compile from the commandline it seems to complain about \SI which is from the siunitx package. Does kile/tex-live auto install packages? It also couldn't find any of my figures, maybe because I use graphicspath
\graphicspath{{Figures//}}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

MikTeX on Linux

Post by frabjous »

Does kile/tex-live auto install packages?
No. Did you only install the minimal TeXlive packages which are dependency for Kile? If so, then you'll probably need to install some more to get the packages you need.

If you're not hurting for disk space, then consider going ahead and installing a full TeXlive installation. Then you'll have a local repository containing all the TeXlive packages (or at least all those which existed when the Debian/Ubuntu packages were created in 2009):

Code: Select all

sudo apt-get install texlive-full
(Or go through the graphical Ubuntu package manager, whatever it's called these days.)

If you're hurting for diskspace, then you might just want to install the package bundles you need. siunitx is included in the texlive-science package:

Code: Select all

sudo apt-get install texlive-science
A list of the Ubuntu texlive packages (for maverick) can be found here. Some of them (like texlive-full) are meta-packages which include others.

If you'd rather go with an even more up to date TeXlive system (TeXlive 2010), with finer-grained control, it's possible to bypass Ubuntu's packages and install directly from CTAN/TUG. The trick then is satisfing the dependencies for installing Kile the usual way. There are some tips on that here, but the above might be easier if you don't mind your packages being a bit older.

As for the graphicspath problem, I don't really understand why you have it the way you do, but maybe try changing \graphicspath{{Figures//}} to simply \graphicspath{Figures/}.
cue
Posts: 6
Joined: Mon Jul 05, 2010 1:56 pm

Re: MikTeX on Linux

Post by cue »

Thank you frabjous, installing the texlive-full package solved most of the errors but there still seems to be a portability problem when using graphicspath.

With miktex/windows using graphicspath, with the double forwardslash.

\graphicspath{{Figures//}}

would search recursively the subdirectories of Figures for the figures used in \includegraphics. This does not seem to work with texlive/linux. Is there a way of changing this line to make my tex file compile in both miktex/windows and texlive/linux without specifying each subdirectory individually?

\graphicspath{Figures/}

does not work because it does not look in the subdirectories of Figures to find them.
Last edited by cue on Sat Dec 11, 2010 7:04 pm, edited 2 times in total.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

MikTeX on Linux

Post by frabjous »

I guess I don't have a lot of experience with the \graphicspath option. How many subfolders does it have? Can you list them individually?

Code: Select all

\graphicspath{{Figures/}{Figures/sub/}{Figures/sub2/}}
I can think of some more radical options, but I think it's best to start with this.

In any case, it doesn't seem as if MikTeX would do any better here.
cue
Posts: 6
Joined: Mon Jul 05, 2010 1:56 pm

Re: MikTeX on Linux

Post by cue »

There are several directories. I just found out that "~/Figures/" works recursively without the double forward slash under texlive/linux but when compiling through kile I have to use an absolute path rather than a path relative to my main tex file. Seems kind of strange that relative paths do not work. If I could find a way of doing this then my tex file would be portable.
Thanks again for your help frabjous.

P.S. are you the same frabjous from {TeX} SE?
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

MikTeX on Linux

Post by frabjous »

Does it hurt just to have both included? My guess is that it wouldn't hurt just to have both kinds of paths listed.

Code: Select all

\graphicspath{{Figures//}{~/Figures/}}
But I don't have access to MikTeX to test with. (And don't have kile installed right now, though I don't see why it should matter whether you're using kile or not.)

If it does, would using the ifplatform package help to set the \graphicspath conditionally?

Code: Select all

\usepackage{ifplatform}
\iflinux \graphicspath{{~/Figures/}} \fi
\ifwindows \graphicspath{{Figures//}} \fi
Then your document would be portable and you wouldn't need to fiddle with it each time. However, you'd have to compile with the --shell-escape option.

Finally, one radical solution you might consider would be to symlink your Figures directory into one your texmf directories. E.g., on Ubuntu I think this would work (from a terminal):

Code: Select all

mkdir -p ~/texmf/tex/generic/
ln -s ~/Figures ~/texmf/tex/generic/Figures
sudo texhash
With that, you wouldn't need the graphicspath command at all. A problem with that is that I think you'd need to run texhash any time you added new figures, but I'm not sure.
P.S. are you the same frabjous from {TEX} SE?
Yep, that's me. :)
Post Reply