How to insert a table in TikzEdt? (Create Tikz diagrams with tables using a GUI) - tabular

I'm trying to find the easiest way to create Tikz diagrams mixed with tables.
Such as these:
or
https://tex.stackexchange.com/questions/400557/how-to-add-connected-graphs-to-a-table
Writing properly all this code can become quite complex and prone to error.
There are several tools to help you create TikZ diagrams, such as TikzEdt.
One could try to create TikZ diagrams with that tools and import them to your main tex document. But it will be difficult to make a complex diagram properly match the text, tables and other figures.
An alternative would be to create the tables with Lyx, and import it from TikzEdt to start drawing above it.
I've tried inserting the table code in the preample (TikzEdt) or in its main code window but I haven't been able to get it.
In its settings -> compiler options it has this code:
\documentclass{article}
\usepackage{tikz,amsmath, amssymb,bm,color}
\usepackage[margin=0cm,nohead]{geometry}
\usepackage[active,tightpage]{preview}
\usetikzlibrary{shapes,arrows}
% needed for BB
\usetikzlibrary{calc}
Imagine I want to add this table:
\documentclass{article}
\begin{document}
\begin{tabular}{ccc}
ID & Ord & Event\\
\hline
Ana & 1 & A\\
Tom & 1 & A\\
Tom & 2 & B\\
Tom & 3 & D\\
\end{tabular}
\end{document}
I've tried modyfing the code as:
\documentclass{article}
\usepackage{tikz,amsmath, amssymb,bm,color}
\usepackage[margin=0cm,nohead]{geometry}
\usepackage[active,tightpage]{preview}
\usetikzlibrary{shapes,arrows}
% needed for BB
\usetikzlibrary{calc}
\begin{document}
\begin{tabular}{ccc}
ID & Ord & Event\\
\hline
Ana & 1 & A\\
Tom & 1 & A\\
Tom & 2 & B\\
Tom & 3 & D\\
\end{tabular}
\end{document}
but it doesn't produce any result. I guess because it tries to add a begin{document} twice.
I've also tried leaving the preamble as is and adding the table on the main window.
\begin{tabular}{ccc}
ID & Ord & Event\\
\hline
Ana & 1 & A\\
Tom & 1 & A\\
Tom & 2 & B\\
Tom & 3 & D\\
\end{tabular}
\begin{tikzpicture}
\end{tikzpicture}
But again it doesn't work.
How can I do it?
Or what other GUI tool can I use able to draw TikZ arrows and simple symbols onto a preexistent document or able to create tables?

I was looking for a solution of the same problem and found this very useful link! It contains the following code:
\begin{tikzpicture}
\matrix[ampersand replacement=\&] {
\node (species1) [shape=rectangle,draw] {
\begin{tabular}{c c c}
\multicolumn{3}{c}{{Species 1}} \\
\colorbox{red}{G1t} & \colorbox{blue}{G2a} & \colorbox{green}{G3t} \\
\colorbox{blue}{G1b} & \colorbox{red}{G2b} &
\end{tabular}
};
\&
\node {b}; \\
\node {c}; \& \node {d}; \\
};
\end{tikzpicture}
I've just tried it myself, and it does what it says on the tin: it lets you use tabular inside a tikz node. No extra packages or other things to be included in the header. You could then move the node around and use it to make diagrams like you wanted.

Related

Table labeling and referencing in Rmarkdown

I'm using markdown to render in PDF format.
I am able to cross-reference plot, but when I build a table in LaTeX, I can't do it somehow. An example:
We plot in Figure \#ref(fig:plotseries) the three Index series and their log return series. In Table \#ref(tab:summindex_stargazer) the main characteristics...
while the table has been coded as follow:
\begin{table}[!htbp] \centering
\caption[Summary statistics for token indexes under study.]{Summary statistics for large cap (L.MWI), medium cap (M.MWI), and small cap (S.MWI) indexes log return series. \label{tab:summindex_stargazer}}
\footnotesize
\begin{tabular}{#{\extracolsep{5pt}} cccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& L.MWI Returns & M.MWI Returns & S.MWI Returns \\
\hline \\[-1.8ex]
nobs & $1,524$ & $1,380$ & $1,362$ \\
NAs & $0$ & $0$ & $0$ \\
Minimum & $-0.351$ & $-0.549$ & $-0.933$ \\
Maximum & $0.464$ & $0.699$ & $1.010$ \\
1. Quartile & $-0.031$ & $-0.034$ & $-0.052$ \\
3. Quartile & $0.036$ & $0.039$ & $0.050$ \\
Mean & $0.003$ & $0.004$ & $0.002$ \\
Median & $0.002$ & $0.004$ & $-0.003$ \\
Sum & $4.144$ & $5.333$ & $2.863$ \\
SE Mean & $0.002$ & $0.002$ & $0.004$ \\
LCL Mean & $-0.001$ & $0.000$ & $-0.005$ \\
UCL Mean & $0.006$ & $0.008$ & $0.009$ \\
Variance & $0.004$ & $0.005$ & $0.017$ \\
Stdev & $0.066$ & $0.073$ & $0.130$ \\
Skewness & $0.236$ & $0.214$ & $1.000$ \\
Kurtosis & $4.355$ & $11.602$ & $13.393$ \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}
This is the result.
Found out the solution. Basically you are not allowed to use “underscore”(_) in table labels.
It was so simple but also so incredibly hard to find out (I personally know many people who’d encountered this error and were not able to solve it). I hope it will help.
Adding to what is written here, underscores are one of 10 special characters in LaTeX.
For underscores to be permitted in table labels they need to be escaped.
This should work:
\#ref(tab:summindex\_stargazer)
But not this:
\#ref(tab:summindex_stargazer)
See this discussion for an excellent reference on special characters.

LaTeX table positioning at specific point in code

I try to keep the following table at the same position as it appears in my LaTeX code.
\begin{table*}[h]
\makebox[\linewidth]{
\begin{tabular}{| c | c | c |}
\hline
Datum & [Tage] & [Tage]\\
\hline
01.03.2010 & 1 nach \fullmoon & 5 bis \leftmoon\\
15.03.2010 & \multicolumn{2}{c|}{\newmoon}\\
10.12.2009 & 1 nach \leftmoon & 6 vor \newmoon\\
09.03.2009 & 5 nach \rightmoon & 2 vor \fullmoon\\
07.01.2010 & \multicolumn{2}{c|}{\leftmoon}\\
14.12.2010 & 1 nach \rightmoon & 7 vor \fullmoon\\
02.04.2009 & \multicolumn{2}{c|}{\rightmoon}\\
\hline
\end{tabular}
}
\caption{Niedrigste relative Intensität. \fullmoon Vollmond, \newmoon Neumond, \rightmoon{} zunehmender Halbmond, \leftmoon abnehmender Halbmond}
\label{table10}
\end{table*}
So I tried it with [H], but this lets the table disappear. Also trying something from another thread
\usepackage{float}
\restylefloat{table}
does not work. Any advice ?
If there's enough space at that point of the output page to accommodate that table, then this couple of tweaks should probably do:
change {table*} to {table}
change [h] to [h!]
The \makebox{...} environment should also be done away with to avoid complications.
If LaTeX isn't able to place the table at that point, it gives a warning, but the table should never disappear, then.

currency conversion:number to words excel

I would like to convert the the Kuwait currency which has three decimal places into words in an Excel Document.The formula i used is as follows:
=if(or(isBlank($E$89),not(isNumber($E$89)),$E$89>=power(10,15)),ifError(1/0),trim(arrayFormula(concatenate(if(trunc(mod($E$89,power(10,15,12,9,6,3}))/power(10,{12,9,6,3,0}))<100,"",switch(int(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0}))/100),1," one",2," two",3," three",4," four",5," five",6," six",7," seven",8," eight",9," nine") & " hundred") & if(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0})),100)<>0,if(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0}))>100," and",if($E$89>power(10,{15,12,9,6,3}),switch({1,2,3,4,5},5," and"),"")),"") & if(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,12,9,6,3,0})),100)=0,"",if(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0})),100)<20,IFERROR(switch(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0})),100),1," one",2," two",3," three",4," four",5," five",6," six",7," seven",8," eight",9," nine",10," ten",11," eleven",12," twelve",13," thirteen",14," fourteen",15," fifteen",16," sixteen",17," seventeen",18," eighteen",19," nineteen")),IFERROR(switch(int(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0})),100)/10),2," twenty",3," thirty",4," forty",5," fifty",6," sixty",7," seventy",8," eighty",9," ninety")) & if(mod(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,12,9,6,3,0})),100),10)=0,"","-" & IFERROR(switch(mod(mod(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0})),100),10),1,"one",2,"two",3,"three",4,"four",5,"five",6,"six",7,"seven",8,"eight",9,"nine"))))) & if(trunc(mod($E$89,power(10,{15,12,9,6,3}))/power(10,{12,9,6,3,0}))=0,"",IFERROR(switch({1,2,3,4,5},1," trillion",2," billion",3," million",4," thousand"))))) & if($E$89>=2," Dinar only",if($E$89>=1," Dinar only","")) & if((round($E$89-trunc($E$89),3)*1000=0)+($E$89<1),""," and") & switch(trunc(round($E$89-trunc($E$89),3)*1000,-2)/100,1," one-hundred",2," two",3,-hundred" three-hundred",4," four-hundred",5," five-hundred",6," six-hundred",7," seven-hundred",8," eight-hundred",9," nine-hundred"& if(round($E$89-trunc($E$89),3)*1000-trunc(round($E$89-trunc($E$89),3)*1000,-2)<20,switch(round($E$89-trunc($E$89),3)*1000-trunc(round($E$89-trunc($E$89),3)*1000,-1),0,"",1," one",2," two",3," three",4," four",5," five",6," six",7," seven",8," eight",9," nine",10," ten",11," eleven",12," twelve",13," thirteen",14," fourteen",15," fifteen",16," sixteen",17," seventeen",18," eighteen",19," nineteen"),switch((round($E$89-trunc($E$89),3)*1000-trunc(round($E$89-trunc($E$89),3)*1000,-2))/10,2," twenty",3," thirty",4," forty",5," fifty",6," sixty",7," seventy",8," eighty",9," ninety") & if(mod(round($E$89-trunc($E$89),3)*1000,10)=0,"","-" & switch(round($E$89-trunc($E$89),3)*1000-trunc(round($E$89-trunc($E$89),3)*1000,-1),0"",1,"one",2,"two",3,"three",4,"four",5,"five",6,"six",7,"seven",8,"eight",9,"nine"))) & " fils only")))
The error shown is
Formula parse error
For a given input:
111.250
i would expect to get the output as :
One hundred and eleven Dinar and two hundred fifty fils only.
Try looking for JavaScript solutions to use then as custom function.
I've found is this code, provided by #Vilas Shetkar:
https://stackoverflow.com/a/37409158/5372400
I've tested this code and it works in sheets, so you may adopt this or other similar solutions to your needs.

How do you split long lines of code in verilog?

I've just started using Verilog to code FIFO's and other complex logic. I was wondering how to split a long line of code in verilog (similar to say the \ in some languages like C?)
I have the following line of code which is incredibly long -
pushinl = (read_allow&(~pushinl))|(pushinl&read_allow&(~(stopout_a0&stopout_a1&stopout_a2))|(pushinl&read_allow&(stopout_a0&stopout_a1&stopout_a2));
I wasn't able to find any answers online that help with this problem in verilog. Is there a character used in verilog to split the above line?
I am using vi as my main editor. When I write this line of code as it is, I get the following syntax error:
Error-[SE] Syntax error
Following verilog source has syntax error :
"fpam2.v", 150: token is ';'
|(pushinl&rctrl&(sout_a0&sout_a1&sout_a2));
^
1 error
CPU time: .065 seconds to compile
You can just give new line to OR(SOP) operator or AND(POS) operator, this gives you more readability and handy debugging.
pushinl = (read_allow & (~pushinl))
| (pushinl & read_allow & (~(stopout_a0 & stopout_a1 & stopout_a2))
| (pushinl & read_allow & (stopout_a0 & stopout_a1 & stopout_a2));
There is no special character of symbol like '\' is used in verilog.
Try this,
pushinl = (read_allow & (~pushinl))
| (pushinl & read_allow & (~(stopout_a0 & stopout_a1 & stopout_a2)))
| (pushinl & read_allow & (stopout_a0 & stopout_a1 & stopout_a2));
In second line there is missing of bracket.

Query by the string containing &

I have got a string containing "&" like "Coke & Cola" How to use this string on Queries with & Please Help me.
I must Query by this sign &
Have you tried using
amp;
or
\&
?
I'm making the assumption that you're using Sharepoint given the tag - I found an article here that might be relevant to your problem:
http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomizationlegacy/thread/90479143-e26e-45cc-ae56-16574056d6d4
[general SQL] There are many answers take a look at source link:
SET ESCAPE ON
SET ESCAPE ""
SELECT 'You & me' FROM DUAL;
source
[CAML SharePoint] answer:
replace & with &
& must be changed to &
Also <must be changed to < and >must be changed to >

Resources