• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.
  • We hope the site problems here are now solved, however, if you still have any issues, please start a ticket in Contact Us

tikz issue (LaTeX based lab report)

TheReasoner

Atheist. Former Christian.
Mar 14, 2005
10,294
684
Norway
✟44,662.00
Country
Norway
Gender
Male
Faith
Atheist
Marital Status
Married
Hey guys.

For those who are not aware: tikz is a LaTeX package.

I've been working on learning some tikz today, in anticipation of my master's and I was working on creating a few simple representations related to a lab report I will need to write in a few weeks.

The representation giving me some grief is in three dimensions. It is of a GaAs unit cell, which I then intend to position relative another part of my figure, representing my substrate (consisting of GaAs)

I'll be making these parts as commands, because I will need to show a few of the relevant steps in the wafer processing I go through in the lab. So repeating a large amount of code by using only one line instead of repeating the entire code would be preferable.

Any tips?

Code:
\newcommand{\AtomOne}[1]{%
    \shade[ball color=green!20,fill opacity=0.5] (#1) circle (0.5);\draw (#1);
}
\newcommand{\AtomTwo}[1]{%
    \shade[ball color=blue!20,fill opacity=0.5] (#1) circle (0.5);\draw (#1);
}
\newcommand{\AtomThree}[1]{%
\shade[ball color=yellow!20,fill opacity=0.5] (#1) circle (1);\draw (#1);
}
\newcommand{\UnitCell}{%
\draw 	[color=gray!25](0,0,10)--(0,0,0)--(0,10,0)
		(0,0,0)--(10,0,0)--(10,10,0)--(10,10,10)--(10,0,10)--(10,0,0)%
		(10,10,10)--(0,10,10)--(0,10,0)
		(10,10,0)--(0,10,0) (10,0,10)--(0,0,10)--(0,10,10);

		\draw [red,very thick] 	(10,10,10)--(7.5,7.5,7.5)--(10,5,5)(5,5,10)--(7.5,7.5,7.5)--(5,10,5)
								(5,10,5)--(2.5,7.5,2.5)--(0,10,0)(5,5,0)--(2.5,7.5,2.5)--(0,5,5)
								(0,0,10)--(2.5,2.5,7.5)--(5,5,10)(5,0,5)--(2.5,2.5,7.5)--(0,5,5)
								(10,0,0)--(7.5,2.5,2.5)--(10,5,5)(5,0,5)--(7.5,2.5,2.5)--(10,5,5);		
				%\draw (10,0,0) node {X};
				%\draw (0,10,0) node {Y};
				%\draw (0,0,10) node {Z};

\AtomOne{0,10,0}
\AtomOne{0,10,10}
\AtomOne{0,0,0}
\AtomOne{0,0,10}
\AtomOne{0,5,5}
\AtomOne{5,5,0}
\AtomOne{5,0,5}
\AtomOne{10,0,0}
\AtomOne{10,0,10}
\AtomOne{10,10,10}
\AtomOne{10,10,0}
\AtomOne{10,5,5}
\AtomOne{5,10,5}
\AtomOne{5,5,10}

\AtomTwo{2.5,7.5,2.5}
\AtomTwo{2.5,2.5,7.5}
\AtomTwo{7.5,2.5,2.5}
\AtomTwo{7.5,7.5,7.5}
}


\begin{tikzpicture}[scale=.25]

\UnitCell{0,0,0}
\end{tikzpicture}
Here's the result
GaAs2.png

As you can see, rotating it a little bit will reveal more of the bonds
 
Last edited:

TheReasoner

Atheist. Former Christian.
Mar 14, 2005
10,294
684
Norway
✟44,662.00
Country
Norway
Gender
Male
Faith
Atheist
Marital Status
Married
Might wanna try a physics forum or somthing similar, i doubt many people acctually know what latex is and even for people like me who do, they probably just use MS word since the equation editor in 2007 came out :p

That equation editor doesn't cut it. LaTeX is far superior when the end result is to be considered. Not to mention versatility and compatibility. There are several compatibility issues with Word anyway. The equation editor does not yield results that are compatible across different versions of word, sometimes I have seen it fail even at displaying the equations correctly across the same version of Word - but across servicepacks.

Besides, don't get me started on table positioning in Word. Or the citation system. My one run-in with that was enough.

I rather like LaTeX. I get what I want, it looks extremely professional and there's none of that darn distracting GUI stuff Microsoft is so fond of. Besides, I've got it nailed down pretty well now as far as text and equations go. I've got my template down, I love it's cross platform compatibility, the versatility...

Still, you're probably right. Most people use Windows, too. Though I quit using it after working as a sysadmin for a few years. Not that I'm smug or anything, I just don't do what most people do.

Anyway, any forum suggestions?
 
Last edited:
Upvote 0

TheReasoner

Atheist. Former Christian.
Mar 14, 2005
10,294
684
Norway
✟44,662.00
Country
Norway
Gender
Male
Faith
Atheist
Marital Status
Married
Upvote 0