Tag Info

Hot answers tagged

24

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 ...


13

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 ...


13

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 ...


12

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 ...


12

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, ...


11

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: ...


11

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 ...


11

Like this? (c)!0.5!(d) means halfway between (c) and (d). \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows,calc} \begin{document} \pagestyle{empty} % Define block styles \tikzstyle{box} = [rectangle, draw] \tikzstyle{line} = [draw, -latex'] \begin{tikzpicture}[node distance = 3cm, auto] % Place nodes \node [box] (a) ...


10

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}, ...


10

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} % ... ...


10

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 ...


10

For straight lines (--) a special to path could be the solution. I have defined three to styles: a=<node text>: relative positioning a position=<pos amount> (default 1.1) aa=<node text>: absolute positioning aa distance=<length> (default 1ex) bb: absolute positioning but saves the coordinate and the angle for later use: ...


10

I provide three styles: the curve - style that produces a “horizontal” curve (the in and out direction are 0 and 180), the curve | style that produces a “vertical” curve (the in and out direction are 90 and 270), the underlying curve + style that, if used directly, decides on its own whether a “vertical” or “horizontal” curve shall be used. Code ...


9

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} ...


9

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.


9

A) With Jake's code (I hope to use correctly this code) Update version 1 (I added a cip on the all path to color the picture ) \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[remember picture,overlay] \tikzstyle{reverseclip}=[insert path={(current page.north east) -- (current page.south east) ...


9

Here's a solution that works on Unix systems and pdflatex -shell-escape: \makeatletter \def\fullpath{\begingroup\everyeof{\noexpand}\@sanitize \edef\x{\@@input|"find `pwd` -name \jobname.tex" }% \edef\x{\endgroup\noexpand\zap@space\x\noexpand\@empty}\x} \makeatother Then \fullpath will print the full path of the file you're typesetting. There's ...


9

The full path is written into the .fls file generated by the -recorder option with TeXLive (MikTeX should have a similar option, maybe --recorder). This files seems to be flushed every line while written, so that it is possible to read the paths of all files accessed so far in the current compiler run. I wrote the following code to search for a INPUT ...


9

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 ...


9

(Note: I'm working on a mac) There are two problems with the path you specify: 1- The space: simply enclose the path in double quotes (") 2- The ~. TeX won't treat it as a substitute for /Users/You. You might want to consider using relative paths: a) ./indicates the current working directory b) ../ moves one step up the directory tree. So if your ...


9

Since PGF 2.10, arguments modifying path style no longer work when you put them after the to keyword. They should be put directly after the \draw command. Like this: \begin{tikzpicture} \draw[->, line width=2mm] (0,0) to (3,1); \end{tikzpicture} All in all, this took me weeks to find out. For quite a while, I even downgraded to PGF 2.00 because ...


9

\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.


8

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.


8

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 ...


8

This is actually pretty easy using some math... If you want the lines at the right hand side to be 0.2 appart (as in your example) one 0.1 above and one 0.1 below a straight line to the right. Then the angles where they intersect the circle are asin(0.1) and 360-asin(0.1) respectively. So the following code generates the picture: \documentclass{article} ...


8

Ryan Reich's (thanks!) comment was the solution: multiple postactions. Note that every "decoration block" needs its own decorate postaction. \begin{tikzpicture} \draw plot[smooth, tension=.7] coordinates { (5*0.02109, 5*-0.12607)(5*0.2274, 5*-0.1806)(5*0.4037, 5*-0.02751)(5*0.536, 5*0.4091)(5*0.768, 5*0.2045)(5*0.7262, 5*-0.02055)(5*0.8538, 5*-0.1366) } ...


8

As explained in Strange arrow mark with TikZ edge and anchors., edge actually creates a new path, which is the one that gets decorated in this case. For drawing smooth curves, you don't need an edge, but the to operation. It also seems like pos=1 doesn't work with the decorations library, instead you should use something like pos=0.999: ...


7

You need to write the \ as / because (La)TeX follows the Unix style (which is also used for WWW addresses). Also the spaces in the filename are a problem. You can load the grffile package with the space option to make things easier as mentioned by Herbert in How to include graphics with spaces in their path?. If it wouldn't be for the \vs./ your question ...


7

You might want to take a look at the decorations.markings library. It allows you to execute arbitrary code at specified distances along a path: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture}[ decoration={ markings, mark=between positions 0.25 and 0.75 step 0.125 with {\node ...


7

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 ...



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