Hot answers tagged

55

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


54

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


46

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


42

You can play with the looseness=<value> key: the bigger the number, the wider the curve gets. This example illustrates it, just replace the draw by this: Replacement: \foreach \x [evaluate=\x as \c using \x*30] in {0.2,0.4,...,3} {\draw[->,red!\c!blue] (J) to[out=30-20*\x,in=20*\x-30,looseness=\x] (B);} Effect: with increasing looseness (from 0....


39

A simpler solution would be... \includegraphics{{"../Current folder/1.This file"}.png} (For Windows users,) note that the slashes all need to be forward slashes.


27

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


27

Use \graphicspath in the preamble as in: \documentclass{article} \usepackage{graphicx} \graphicspath{{./img/}{./pictures/}} \begin{document} \includegraphics{one} %picture named one in directory img \includegraphics{two} %picture named two in directory img \includegraphics{three} %picture named three in directory pictures \end{document}


24

You can use TeX Live's user mode for that purpose. As you have already mentioned in the comments, you can create a new user tree (allowing multiple trees) using $ tlmgr init-usertree --usertree ~/test-tree To install a package in this tree you have to pass the user tree and the option --usermode $ tlmgr install --usertree ~/test-tree --usermode <...


23

You provide several interpretations of what various commands do. \makeatletter and \makeatother are just necessary for redefining macros or something. Not quite. By default, the character @ is not allowed to occur in the name of a TeX or LaTeX macro; instead, valid multi-character macro names must consist of uppercase and lowercase letters exclusively ...


22

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


21

The listings package provides a key called inputpath for specifying a path where \lstinputlisting should search for source files. Note that inputpath is only documented in the listings developer's guide, not in the user manual; if you haven't compiled the developer's guide, searching for "inputpath" in listings.dtx will lead you to the definition of the ...


20

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


20

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.


17

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


17

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 file seems to be flushed every line while it is being 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 ...


17

The paths to your LaTeX und PdfLaTeX are wrong. latexsym.sty is a package, which isn’t ever gonna compile anything, and pdfetex.exe is a compiler, but definitely not the one you’re looking for (see e.g. Glossary of TeX and LaTeX terms). If MiKTeX is in your PATH varible (which usually is the case if you installed it normally), you don’t need to specify the ...


17

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


17

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


17

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}] \node[...


16

\includegraphics{foo} would work if your home directory is in your TEXINPUTS path, or \includegraphics{\string~/foo} should work on most systems.


16

You can use the undocumented save path key that saves the whole path on a very low level in a macro. You can use this path again with the use path key defined as \makeatletter \tikzset{use path/.code=\tikz@addmode{\pgfsyssoftpath@setcurrentpath#1}} \makeatother Any path operators shouldn’t be used here. If you want to save part of a path and want to use ...


16

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


15

I have written my own package for this purpose. Now there is one important new command available: \inputpaths \inputpaths specifies the directories where \include and \input can look for the given file. By default \inputpaths is empty and therefore \include and \input have the same behavior as the normal commands. The redefined \include and \input use the ...


15

It turns out some of the work is already done, but an important macro \pgfdecoratedangletonextinputsegment is undocumented (and incorrectly defined - possibly why it is undocumented). Here's a not-very-well tested solution for straight lines only with no mid-path moveto commands. I think dealing with curveto and closepath segments will also prove extra-...


15

This should be a transient problem, and it has been reported to TeX Live upstream. TeX Live Utility uses update-tlmgr-latest.sh to perform the update, because of historical problems with tlmgr update --self. As TLU maintainer, I recommend that users just wait until it's fixed on the server, but you can run the update command in Terminal if you're desperate ...


14

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


14

Try %!TEX root = ../thesis.tex


14

You can use \pgfmathparse (or \pgfmathsetmacro as below) to recursively compute your function as you run through the pgf \foreach loop. of course, you need to "save" the previous value as you go. Your question seems to be using both the functions x(4-x) and x(4-x)/2, so I have stuck with the first one. It's very sensitive on the initial value of course: ...


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


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