# Tag Info

38

Use package grffile: \usepackage{graphicx} \usepackage[space]{grffile} [ ... ] \includegraphics[...]{A file with spaces}

30

I'm fuzzy on the details, but the import package should do what you want. Off the top of my head, I think the syntax is \usepackage{import} ... \subimport{code/doc/latex/}{refman.tex} Update: Thanks Willie for pointing out \subimport which seems to be the better command to use here over \import. The commands \import{full_path}{file} and ...

29

The arrow is curving to the left, but you are bending it to the right: \documentclass[border=5pt]{article} \usepackage{tikz} \begin{document} \centering \begin{tikzpicture} \draw [thick, -latex] (0,0) to (0,3); \end{tikzpicture} \begin{tikzpicture}[trim left=0pt, trim right=0pt] \draw [thick, -latex] (0,0) to [bend right] (0,3); \draw [line width=5pt, ...

17

There should be no need to put any tests in your documents, just use \includegraphics{file} and arrange that your dropbox folder is in your TEXINPUTS environment variable or (better) texmf.cnf setting on your two machines and it should all just work.

16

Try: \usepackage{etoolbox} \makeatletter \patchcmd{\Ginclude@eps}{"#1"}{#1}{}{} \makeatother ... \includegraphics{"file name.eps"} The macro \Ginclude@eps is defined in the file dvips.def. It uses \special{PSfile="#1"\space ... which causes problems if additional "" are used. I patched this, such that it behaves like it was written PSfile=#1 and it worked ...

16

A few weeks back, I was attending a course on polymers, so I threw together a quick package to draw randomwalks. For a path that looks like the one you describe, the parameters below should be ok: \documentclass{article} \usepackage{randomwalk} \begin{document} \framebox{\RandomWalk {number = 300, length = 2pt, angles = {0,10,20,50,-10,-20,-50}, ...

15

This is what has been working great for me for about two years now. create a .sty file containing your universal preamble. A .sty file, basically, is a regular TeX file starting with \ProvidesPackage{mystyle}, ending with \endinput, and everything else inbetween.*) in your Dropbox (or similar), create a directory named texmf-local, and a subdirectory such ...

14

I suggest to use named circle nodes. If the red one is called hdm you can use something like \draw[red,looseness=1.5] (hdm.west) to[out=70,in =110] (hdm.center) to [out=-70,in=-110](hdm.east); to get Code: \documentclass[tikz,margin=5mm]{standalone} \begin{document} \begin{tikzpicture}[mycircle/.style={draw,circle,minimum size=.8cm}] ...

14

You can do this the following ways: Use the \graphicspath macro: \graphicspath{{path/to/image/}{other/path/}} Define the environment variable TEXINPUTS to contain the path: TEXINPUTS=".:path/to/image:other/path:" Note the leading '.' (current dir) and the trailing empty field (default texmf tree). Put your graphics in an own local texmf tree, so ...

14

MacOS X has an additional mechanism to add to the path. If you read /etc/profile you will find the lines if [ -x /usr/libexec/path_helper ]; then eval /usr/libexec/path_helper -s fi The path_helper program uses the directory /etc/paths.d to add items to the path. Inside /etc/paths.d, each file should be a list of items to add to the path. So ...

14

Here's an extended version of the complete sines decoration, which can now be controlled using start up/start down and end up/end down. \documentclass[a4paper,12pt]{article} \usepackage{tikz} \usetikzlibrary{decorations} \begin{document} \newif\ifstartcompletesineup \newif\ifendcompletesineup \pgfkeys{ /pgf/decoration/.cd, start up/.is ...

13

This could be automated even further, and it would be nice if the hyperlinks were the same size as the nodes, but it shows - I think - the main idea. \documentclass{article} %\url{http://tex.stackexchange.com/q/61020/86} \usepackage{tikz} \usetikzlibrary{positioning} \tikzset{box1/.style={draw=black, thick, rectangle,rounded corners, minimum height=2cm, ...

13

write into your document \graphicspath{{c:/Windows/images/User/}{/home/me/images/}} and then use only the filename of the image. You have to use slashes for directories in Linux and Windows.

13

If you just want the text rotated and sloped along the path, you can use the sloped option to the node, and don't need to use a decoration. Code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node at (0,0) (nodeA) {A}; \node at (2,2) (nodeB) {B}; \draw (nodeA) -- (nodeB); \draw (nodeA) -- (nodeB) node ...

13

If those are to be straight line segments, it couldn't get any simpler. It gets interesting with curves. Enclosed are a few examples, and I agree - it's too complicated. Clipping is the most accurate way to tell where the solid part should stop, but it requires its own scope. Fading is good for smooth transition but probably would only give headache if the ...

13

You can use the random function, which generates a pseudo-random number between 0 and 1, and use it to define the direction and distance of line segments (or any other parameter of your drawing). The seed can be set using \pgfmathsetseed. You can achieve something quite akin to the drawing you linked to using the [round corners] style in the \draw command: ...

12

So I had one answer (which is preserved below for posterity) but I think I understand the question a little better now. What you want is to write \input{foo} and have LaTeX know where to search for foo. Martin's answer offers one way to do this. Here are some others. One way is to make a directory in your local texmf tree and put files you want to use in ...

12

You can define the internal macro \input@path to hold a list of base directories: \makeatletter \def\input@path{{/path/to/folder}} %or: \def\input@path{{/path/to/folder}{/path/to/other/folder}} \makeatother Then you can use \input{fileinthatfolder} everywhere. It also works for \includegraphics IIRC. But I don't think this is supported by the mentioned ...

12

This is an example taken directly from the pgf manual: \pgfmathsetseed{1} \foreach \col in {black,red,green,blue} { \begin{tikzpicture}[x=10pt,y=10pt,ultra thick,baseline,line cap=round] \coordinate (current point) at (0,0); \coordinate (old velocity) at (0,0); \coordinate (new velocity) at (rand,rand); \foreach \i in {0,1,...,100} ...

12

ok, sorry for the delay- i wasn't allowed to post a self-answer earlier. Indeed Emacs.app was operating in a different environment than the terminal. M-x getenv for PATH showed that /usr/texbin was missing, which explains why LaTex was not working inside the Emacs.app shell. following @Alan Munn's idea to stay away from editing a .plist I found some ...

12

\graphicspath comes from LaTeX's \input@path, just using the paths for graphics files. \input@path can be set independently, e.g.: \makeatletter \def\input@path{{path1/}{path2/}} \makeatother Internally package graphics stores its path of \graphicspath in \Ginput@path and locally sets \input@path to \Ginput@path, if it looks for files via \IfFileExists.

11

One can refer to the parent folder by ../ both on Unix systems and in Windows; therefore \bibliography{../1} will work for the bibliography file 1.bib that resides in the parent folder. Note that paths on Windows are expressed with \, but for TeX related programs the slash / works in its place and is of course preferable.

11

About the tilde: Apparently the ~ is taken in its usually meaning, not as literal ~. I get a Package pdfpages Error: Cannot find file test\nobreakspace {}it' error for a test~it file. Taking the filename verbatim should help. This can be done by \Verbdef from the newverbs package: \usepackage{newverbs} % ... ...

11

Martin suggested me to write a LuaTeX version, so here it is. :) Run with lualatex: \documentclass{article} \usepackage{luacode} \usepackage[T1]{fontenc} \begin{luacode} -- we need the LuaFileSystem -- library require 'lfs' -- builds path according to the system -- path separator, as I used in this answer: -- http://tex.stackexchange.com/a/48241/3094 ...

11

You could use \space within the file name, which works for me with \include on Windows: \include{"Configuring\space Security"} It works with paths and with file names. An .aux files with blanks in the file name would be produced, \includeonly works as well if \space is used too.

11

The best thing is to put the style files in the directory ~/texmf/tex/latex/mystyles/ where LaTeX will always look for packages, without the need to specify relative paths. Use ~/Library/texmf/tex/latex/mystyles/ if you're running MacTeX on Mac OS X. Create the directory structure if necessary. You can also decide to put symbolic links in that special ...

11

The argument of \usepackage is a name not a file path. The fact that it sometimes works at all when passed a relative file path is just due to lack of error checking by the system. If the package does declare itself using \ProvidesPackage the use of such paths will generate a warning that the name is incorrect. The fact that the primitve \input works ...

10

\usepackage{<file>} can take a full path, but requires you to drop the file extension. That is, it assumes \usepackage{<path>/file} will include file.sty located in <path>, self-appending the extension (known as \@pkgextension). So, drop the .sty. The following MWE reproduces the problem: \documentclass{article} \usepackage{graphicx.sty} ...

10

Instead of using a full path, it is a much better practice to put your file in an appropriate place where TeX will find it. It seems you are a *NIX user, so you may try \$ less kpsewhich texmf.cnf` to know which places are these. There is a lot of comments in this file, they will help you. Alternatively, you can use the TEXMFHOME or the TEXINPUTS ...

10

Like this? I used \clip inside a scope \documentclass[a4paper]{article} \usepackage[marginparsep=3pt, top=2cm, bottom=1.5cm, left=3cm, right=1.5cm]{geometry} \usepackage{tikz} \usetikzlibrary{calc,intersections} \tikzset{small dot/.style={fill=black,circle,scale=0.3},} \begin{document} \begin{tikzpicture} % drawed just for explanation ...

Only top voted, non community-wiki answers of a minimum length are eligible