Open goyalyashpal opened 1 year ago
I'm sorry for your lack of time; probably this is a show-stopper. You can use some graphically oriented program, like for example XCircuit: http://opencircuitdesign.com/xcircuit/ (there is no https available, unfortunately).
If you still want to try with circuitikz: for the first problem (overlaying the circuit on the chip) I have an example that I can post (not now, I have no time --- but you can ask in https://tex.stackexchange.com/questions/tagged/circuitikz (be sure to read the rules and post a minimal example!).
For the second problem you can start from here: https://tex.stackexchange.com/questions/493239/alignment-of-dip-chips-in-circuitikz
I will close this issue now, because as stated in the README:
Please do not use the issue page for generic help on how to use the package. The manual has a (growing) set of examples; also the questions tagged circuitikz on https://tex.stackexchange.com/ are often answered promptly. You can also find help on matrix and on TopTeX.
I found the code, pasting here with no comments...
documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usepackage{mathpazo}
\usetikzlibrary{shapes.symbols, backgrounds, fit}
\usepackage{stackengine}
\DeclareSIUnit{\uF}{\micro\farad}
\DeclareSIUnit{\nF}{\nano\farad}
\ctikzsetstyle{romano}
\begin{document}
\begin{tikzpicture}[]
\draw (0,0) node[dipchip, rotate=90, anchor=pin 8, circuitikz/chips/scale=1.5,
no topmark, draw only pins={1,2,4,5,7,8}](AD835){}
(AD835.north) node[above, rotate=90]{\texttt{AD835ANZ}};
\begin{scope}[on background layer={color=gray}]
\node [mixer, circuitikz/blocks/scale=0.7](M) at([xshift=-0.3cm]AD835.center) {};
% 2.25 is 1.5*1.5 (chip scale * NL/2
\node [muxdemux, muxdemux def={Lh=2.25, NL=3, Rh=0.8, NR=1, w=0.8, NB=1},
external pins width=0, rotate=-90, anchor=blpin 3](DX)
at ([yshift=-3mm]AD835.bpin 8){};
\node [font=\tiny, below=-1mm] at (DX.blpin 3) {$+$};
\draw (DX.blpin 3) -- (AD835.bpin 8) (DX.blpin 1) -- (AD835.bpin 7);
\node [font=\tiny, below=-1mm] at (DX.blpin 1) {$-$};
\node [muxdemux, muxdemux def={Lh=2.25, NL=3, Rh=0.8, NR=1, w=0.8, NB=1},
external pins width=0, rotate=90, anchor=blpin 1](DY)
at ([yshift=3mm]AD835.bpin 1){};
\node [font=\tiny, above=-1mm] at (DY.blpin 1) {$+$};
\node [font=\tiny, above=-1mm] at (DY.blpin 3) {$-$};
\draw (DY.blpin 1) -- (AD835.bpin 1) (DY.blpin 3) -- (AD835.bpin 2);
\node [muxdemux, muxdemux def={Lh=3, NL=3, Rh=1, NR=1, w=1, NB=1}, external pins width=0](A)
at([xshift=0.7cm]AD835.center) {};
\draw (DX.brpin 1) -- ++(0,-0.2) -- (M) (DY.brpin 1) -- ++(0,0.2) -- (M) (M.e) -- (A.left)
(A.right) -| (AD835.bpin 5) (A.bbpin 1) -- ++(0,-0.2) -| (AD835.bpin 4);
\end{scope}
\end{tikzpicture}
\end{document}
I'll add the previous example to the manual, reopening as a documentation issue.
For the second problem you can start from here: https://tex.stackexchange.com/questions/493239/alignment-of-dip-chips-in-circuitikz
... for overlaying the circuit on the chip ... I found the code, pasting here with no comments...
I'll add the previous example to the manual, reopening as a documentation issue.
wow, thanks a lot for these. this issue was meant as a documentation issue in the first place :cute_wink:
but you can ask in https://tex.stackexchange.com/questions/tagged/circuitikz
dipchip
partContinued:
I am making some progress using the example u provided. thanks a lot for that.
do u mind me posting my investigations on that here?
scope
environment from \usetikzlibrary{backgrounds}
\foreach
simultaneous traversal of multiple variables over dedicated listsCurrent level of Abstraction: 4
Update: 2022.12.04 The further abstractions/cleanup/honing of the code are a bit more involving and mostly use concepts from Tikz, so, I will be mentioning those in a new comment: https://github.com/circuitikz/circuitikz/issues/665#issuecomment-1336343986
tikzlibrary
and scope
environment:\usetikzlibrary{shapes.symbols, backgrounds, fit} % Have not tried to minimize further
...
\begin{tikzpicture}
...
\begin{scope}[on background layer]
... <overlaying circuit content goes here>
\end{scope}
\end{tikzpicture}
Offsetting the pin labels to move them either outwards (preferably on the pin pads like in the IC manuals), or atleast off-centering
Like this?
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[]
\draw (0,0) node[dipchip, rotate=90, anchor=pin 8, circuitikz/chips/scale=1.5,
circuitikz/multipoles/external pins thickness=2,
circuitikz/multipoles/external pad fraction=4, hide numbers,
no topmark, ](AD835){}
(AD835.north) node[above, rotate=90]{\texttt{AD835ANZ}};
\foreach \i in {1,...,4} \node[font=\tiny\ttfamily, below] at(AD835.bpin \i){\i};
\foreach \i in {5,...,8} \node[font=\tiny\ttfamily, above] at(AD835.bpin \i){\i};
\begin{scope}[on background layer={color=gray}]
\node [mixer, circuitikz/blocks/scale=0.7](M) at([xshift=-0.3cm]AD835.center) {};
% 2.25 is 1.5*1.5 (chip scale * NL/2
\node [muxdemux, muxdemux def={Lh=2.25, NL=3, Rh=0.8, NR=1, w=0.8, NB=1},
external pins width=0, rotate=-90, anchor=blpin 3](DX)
at ([yshift=-3mm]AD835.bpin 8){};
\node [font=\tiny, below=-1mm] at (DX.blpin 3) {$+$};
\draw (DX.blpin 3) -- (AD835.bpin 8) (DX.blpin 1) -- (AD835.bpin 7);
\node [font=\tiny, below=-1mm] at (DX.blpin 1) {$-$};
\node [muxdemux, muxdemux def={Lh=2.25, NL=3, Rh=0.8, NR=1, w=0.8, NB=1},
external pins width=0, rotate=90, anchor=blpin 1](DY)
at ([yshift=3mm]AD835.bpin 1){};
\node [font=\tiny, above=-1mm] at (DY.blpin 1) {$+$};
\node [font=\tiny, above=-1mm] at (DY.blpin 3) {$-$};
\draw (DY.blpin 1) -- (AD835.bpin 1) (DY.blpin 3) -- (AD835.bpin 2);
\node [muxdemux, muxdemux def={Lh=3, NL=3, Rh=1, NR=1, w=1, NB=1}, external pins width=0](A)
at([xshift=0.7cm]AD835.center) {};
\draw (DX.brpin 1) -- ++(0,-0.2) -- (M) (DY.brpin 1) -- ++(0,0.2) -- (M) (M.e) -- (A.left)
(A.right) -| (AD835.bpin 5) (A.bbpin 1) -- ++(0,-0.2) -| (AD835.bpin 4);
\end{scope}
\end{tikzpicture}
\end{document}
(I reduced the dependencies, too).
any book recommendation for learning Tikz & CircuiTikz?
I learnt by perusing StackExchange and the TikZ manual. About circuitikz
, I am pretty sure that the only book existing is the manual (which I heavily authored, but it's not just mine).
Output | Reference |
---|---|
![]() |
![]() |
The image preview of output here is scaled down to save space, and deliberately made for ANDs. Comparing with the reference/target image, it's awesome.
Any suggestions (code, implementation, or graphic, or anything else) is welcome
In the previous attempt with parametrization,
\*expr
(numpexpr, dimexpr etc) are always shown invalid in horizontal environment lolPS:
I will get back to you with comments as soon as I finish the paper submission I'm in (for not having time, this is quite impressive 😉 on your side).
About the arithmetic, if you show me an example I can help. Often the problem is expandability... You can check \pgfmathsetmacro
and/or the new LaTeX3 \fpeval
, \inteval
...
for not having time, this is quite impressive 😉 on your side
haha, thanks :smiley:
for clarification, i meant that - i can not get enough relaxed time to calmly dig through stuff for solutions, and do experiments with their validity and applicability to my use.
Mental Bandwidth or mental processing power would have pro'lly been a better term there instead of just time - but i guess that sounds a bit showoff i guess :sweat_smile:
plus, i gotta say, the documentation of Tikz is sometimes a bit - umh - ambiguous or unclear, for example,
\foreach
at section "2.21 Adding Text", it felt a bit unclear. And lack of any redirects to the detailed one ("88 Repeating Things") made it worse.detailed citations/quotes in the hidden comment below:
self hiding this comment as off topic:
Quotes:
Tikz 2.15 Specifying Coordinates (pg 40): +(0cm,1cm) means “1cm upwards from the previous specified position” ++(2cm,0cm) means “2cm to the right of the previous specified position, making this the new specified position”
CircuiTikz 3.1.3 Relative coordinates (pg 32): the +(x,y)-style coordinates (which are supposed to set a temporary relative coordinate and then going back to the starting point).
Tkz 2.21 Adding Text (pg 46): ... two (or even more) variables separated by a slash as in \x / \xtext ... the elements in the set over which \foreach iterates must also be of the form ⟨first⟩/⟨second⟩. In each iteration, \x will be set to ⟨first⟩ and \xtext will be set to ⟨second⟩
\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}
.
Tikz 88 Repeating Things - Multiple variables (pg 1003):
\foreach \x / \y / \r in {0 / 0 / 2mm, 1 / 1 / 3mm, 2 / 0 / 1mm}
/-\
why minus in between?, /
used only at one place here? and that with one more command (which further confused me)? \I'd love to follow up more, but you got me in a crossfire of deadlines in my job....
Yes, the TikZ manual is somewhat cryptic sometimes, but lately development is quite active so you can PR suggestions.... Once you untangle the source format, that is.
About the PNG conversion: mine are just bitmap copy and paste from okular
(or screenshots from evince
, when the antialiasing of the first one become unbearable).
Definitely I'd like to add your example to the manual!
I'd love to follow up more, but you got me in a crossfire of deadlines in my job....
it's okay, take your time to participate in real life.
Definitely I'd like to add your example to the manual!
thanks. aweesome.
just for records, there's some more cleanup which i wish to do in this example
update: done - most notably, defining the sizes in some style so that this specification of sizes is optional, rather than being forced onto; so that this can be used flexibly with normal dipchips too
Definitely I'd like to add your example to the manual!
thanks. awesome.
...or if you want and you are in the mood, you can even do it as an "advanced tutorial". Whatever you prefer. I can just take the code (and attribution --- please tell me exactly how you'd like to be cited) and add to the examples, or wait for a PR on your side.
LaTeX3
\fpeval
,\inteval
- https://github.com/circuitikz/circuitikz/issues/665#issuecomment-1314950801
wow, they worked out of the box: \inteval{#1/2}
, i thought it would require some additional settings to use LaTeX3
Status tracking for further and more involved abstractions/cleanups per the remark mentioned at comment: https://github.com/circuitikz/circuitikz/issues/665#issuecomment-1314236121
node
or pic
rather than as a LaTeX \newcommand
. This will:
\newcommand
I have gathered quite a lot of good points on tackling a good amount of logic symbols.
'am very excited to put them in a tutorial. however, have exams at hand at the moment which will continue uptill 1 month at least. will do it thereafter.
just for records, i was thinking about TikZ styled tutorial - the walkthrough in a third person story type. it allows incorporating various "loose" tips and "reason behinds" as well.
but i was a bit unsure about how deep it will be, as i was thinking of starting from start, so before section 2.1 a current shunt (of Circuitikz tutorials), but its body will not touch much the contents of sections 2.1 to 2.3 transistor based amplifier, but then it will contain much more depth content than section 2.4 A logic circuit
the thing i am wondering about is how we will communicate regarding the order - ideation will require more commits, which will require cleanup. but i just know how to commit - that's pretty much all i know in git.
so, when we get to it, will you handle the commit cleanup part? the rebase / squash commit etc 😅 as i don't want to pollute the commit history...
anyways, that's enough rambling for now 😅 , i just wanted to put these thoughts out here
so, when we get to it, will you handle the commit cleanup part? the rebase / squash commit etc sweat_smile as i don't want to pollute the commit history...
Yes, I can help --- as long as you do the changes on you branch, you can even reorganize it and force push --- until the thing is merged, no harm is done (I force push quite a lot when I am developing, you can see that). I am not a git-uber-user too, I just do the basic things (the interactive rebase is the best tool ever), especially if you want to "follow" the development.
One suggestion: you can develop it in a separate file --- I do the same when preparing part of the manual. You can add a file in your clone with the following content:
documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usepackage{ctikzmanutils}
\makeatletter
\makeatother
\begin{document}
\section{Dummy sec}
\subsection{Dummy subsec}
\subsubsection{Dummy subsubsec}
\begin{groupdesc}
\circuitdesc*{bnc}{BNC connector}{}(left/135/0.6, right/45/0.6, center/-45/0.6, hot/0/0.6, zero/-135/0.6, shield/-90/0.4)
\circuitdescbip[cuteopenswitch]{cute open switch}{Cute open switch}{cosw}(out/45/0.2)[out.s/-90/0.2]
\end{groupdesc}
\geolrcoord{bnc}
\begin{lstlisting}[varwidth=true]
A one
B two
C three
\end{lstlisting}
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
\begin{circuitikz}[european]
\draw (0,3) node[nand port](A){}
(A.out) to[short, *-o] ++(0.5,0);
\end{circuitikz}
\end{LTXexample}
\end{document}
which load the same setup used in the manual, and then merge it when it is more or less finished in the main circuitikzmanual.tex
.
Anyway, I will help with git
if I am able to ;-)
Hi @goyalyashpal, @gro1m --- I was thinking about all this, especially after seeing #784. While I think that adding a background image to a generic chip (like I implemented for muxdemux
es) could be a nice thing¹ for specific circuits, I now think that the full-fledged breadboard thing is quite out-of-scope for the package.
On the other hand, a package that extends TikZ for that specific usage would be a great thing. I do not know how much of the internals of circuitikz
it would need (I hope very little), but I am willing to add interfaces where and when needed for the new package. Another advantage of a separate package is that, if the author(s) is(are) willing so, it can be made just LaTeX-specific, and so it could use the power of the latex3
programming layer, a thing that I can't do in circuitikz
because it must be usable also in ConTeXt
(or at least, it should).
Notes:
¹ really, it should be improved to be able to use generic, high-level tikz code for the drawings that can use the anchors of the component. Moreover, it should be added to chips. Again, I have little time on my hands now, and I am not sure on how to do it (tikzpictures
can't be nested...).
Current:
I want to be able to do:
Background:
I don't have any prior experience with Tikz or with CircuiTikz,
and I can't get enough time to like fully grasp the gist of things
* however i have read following things (click me)
i have read the instructions at following 2-3 times
i have read the instructions at following 1-2 times