Graphics, Figures & Tablesmixing packages

Information and discussion about graphics, figures & tables in LaTeX documents.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

mixing packages

Post by ghostanime2001 »

Is it possible to combine commands from pstricks, chemfig, and tikz in the same document? (generic question, no MWE needed)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: mixing packages

Post by localghost »

Why don't you just test?


Thorsten
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: mixing packages

Post by ghostanime2001 »

I get confused how to mix rput or rnode (among others) inside tikz or chemfig commands. Can you maybe give a few examples ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

mixing packages

Post by localghost »

It goes without saying that you can't use PSTricks commands inside environments provided by PGF/tikZ (and vice versa) without any special trick.

Regarding your example, why should this be necessary? PGF/tikZ has its own equivalent commands for nodes. And how am I supposed to give an example without you showing what you are after? m(

I suggest to read the respective manuals to learn how to translate your ideas into code.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: mixing packages

Post by ghostanime2001 »

pstricks's node commands allow to set which angle the node connections should connect between 2 nodes and it's rput or uput or rnode and Rnode commands can be set inside pieces of text. I don't think any node commands can be set in a text body with tikz.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

mixing packages

Post by localghost »

ghostanime2001 wrote:[…] I don't think any node commands can be set in a text body with tikz.
Mistaken. See Section 16.13 of the PGF/tikZ manual.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

mixing packages

Post by ghostanime2001 »

For example I am trying to include a node that looks like normal text but want to connect it with something later. However something happens to the node when I use it with tikz

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
\pagestyle{empty}
\begin{document}
The quick brown \tikz \node {cat}; jumps over the lazy fox \\
The quick brown cat jumps over the lazy fox
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

mixing packages

Post by localghost »

You have to do some adjustments. Try something like this.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\newcommand{\textnode}[1]{\tikz[baseline=(W.base)]\node[inner sep=0pt] (W) {#1};}

\begin{document}
  The quick brown \textnode{fox} jumps over the lazy dog. The quick brown fox jumps over the lazy fog.
\end{document}
Further reading:
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: mixing packages

Post by ghostanime2001 »

pstricks seems like a better option for something like this
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

mixing packages

Post by localghost »

ghostanime2001 wrote:pstricks seems like a better option for something like this
That is in the eye of the beholder. PSTricks has other pitfalls instead. I see no problem in doing such things PGF/tikZ.
Post Reply