https://stacky.net/wiki/api.php?action=feedcontributions&user=152.3.43.176&feedformat=atomstacky wiki - User contributions [en]2024-03-29T05:39:38ZUser contributionsMediaWiki 1.40.1https://stacky.net/wiki/index.php?title=TeXnical_notes&diff=1257TeXnical notes2013-06-10T15:52:44Z<p>152.3.43.176: fixed link to aaron lauda</p>
<hr />
<div>Sometimes I find a solution to a TeXnical problem, and I think everybody should know about it. Some of these things are totally obvious, but (as far as I know) non-standard.<br />
<br />
You may also want to check out my [[advice on real-time TeXing]].<br />
<br />
==BibTeX without a separate .bib file==<br />
<br />
[http://stacky.net/files/selfcontainedBibTeX.dvi dvi] [http://stacky.net/files/selfcontainedBibTeX.tex tex]<br />
<br />
$Bib\TeX$ has the nice feature that it makes your bibliography<br />
nicely; the entries are all formatted the same way, and it is<br />
easy to change that format. However, it is annoying that you<br />
have to have a separate <code>.bib</code> file to contain all your<br />
bibliography entries. Fortunately, it is not too hard to build<br />
the <code>.bib</code> file into the <code>.tex</code> file. To illustrate,<br />
the source of [Ant06] is (sorta) included below.<br />
Note that you have to run $\LaTeX$, $Bib\TeX$, $\LaTeX$, $\LaTeX$, as<br />
usual when you use $Bib\TeX$.<br />
<br />
<pre><br />
\documentclass{article}<br />
\usepackage{verbatim}<br />
\begin{document}<br />
Bib\TeX\ has the nice feature that it makes your bibliography<br />
nicely; the entries are all formatted the same way, and it is<br />
easy to change that format. However, it is annoying that you<br />
have to have a separate \verb|.bib| file to contain all your<br />
bibliography entries. Fortunately, it is not too hard to build<br />
the \verb|.bib| file into the \verb|.tex| file. To illustrate,<br />
the source of \cite{this_file} is (sorta) included below.<br />
Note that you have to run \LaTeX, Bib\TeX, \LaTeX, \LaTeX, as<br />
usual when you use Bib\TeX.<br />
<br />
%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />
%%% main text goes here %%%<br />
%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />
<br />
\bibliography{\jobname}<br />
\bibliographystyle{alpha}<br />
<br />
\openout0= \jobname.bib<br />
\write0{<br />
@book {this_file,<br />
AUTHOR = {Anton},<br />
TITLE = {This document},<br />
YEAR = {2006},<br />
}<br />
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />
%%% more bib entries go here %%%<br />
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />
}<br />
\end{document}<br />
</pre><br />
<br />
'''References'''<br><br />
[Ant06] Anton. [http://stacky.net/files/selfcontainedBibTeX.tex ''This document.''] 2006.<br />
<br />
==How to draw the Fox-Artin wild arc with pstricks==<br />
<br />
<code><pre><br />
\documentclass{article}<br />
\usepackage{pstricks}<br />
\usepackage{multido}<br />
\begin{document}<br />
\[\begin{pspicture}(-7.6,-.5)(7.32,2.5)<br />
\newdimen\totaljump % This measures where the orgin is<br />
\newdimen\jumpinterval % This measures how much the origin moves each time<br />
%%%%% First we draw the left hand side. Because we are utilizing borders, we have %%%%%<br />
%%%%% to draw from left to right, so compute by hand what the unit should be. %%%%%<br />
\psset{unit=0.17293822569mm,border=.05,linewidth=.03}<br />
\totaljump=-75mm<br />
\jumpinterval=0.17293822569mm<br />
\multido{}{20}{<br />
% Move the origin to the appropriate place %%%%<br />
\psset{origin={\totaljump,0}, unit= 1.25, border=.05, linewidth=.03}<br />
% Draw a piece of the curve<br />
\pscurve(-.1,.1)(-.2,.3)(0,1.5)(1,.7)(2.3,.3)(2,-.05)(1.1,-.2)(1,-.1)<br />
% Scale the jumpinterval by .8 and increment totaljump<br />
\multiply\jumpinterval by 5 \divide\jumpinterval by 4<br />
\advance\totaljump by \jumpinterval<br />
}<br />
%%%% Now we draw one piece of the curve in the middle %%%%<br />
%%%% to get the two ends to match up nicely. %%%%<br />
\psset{unit=1.5cm,border=.05,linewidth=.03}<br />
\pscurve(-.15,.12)(-.2,.3)(0,1.7)(1,.7)(1.8,.3)(1.6,-.05)(1.1,-.2)(.95,-.15)<br />
%%%% Now draw the right hand side %%%%<br />
\psset{origin={12mm,0}}<br />
\totaljump=12mm<br />
\jumpinterval=12mm<br />
\multido{}{20}{<br />
\advance\totaljump by \jumpinterval<br />
\multiply\jumpinterval by 4 \divide\jumpinterval by 5<br />
\pscurve(-.1,.1)(-.2,.3)(0,1.5)(1,.7)(1.6,.3)(1.4,-.05)(1.1,-.2)(.9,-.1)<br />
\psset{origin={\totaljump,0}, unit= .8, border=.05, linewidth=.03}<br />
}<br />
\end{pspicture}\]<br />
\end{document}<br />
</pre></code><br />
[[File:Fox-artin.png]]<br />
<br />
==Placing labels on arrows in XY-pic==<br />
(I learned this trick from [http://www-bcf.usc.edu/~lauda/Aaron_Laudas_Page/Home.html Aaron Lauda]; I haven't seen it documented anywhere)<br />
\xymatrix{asdfasdf \ar[r]^{f} & a }<br />
produces the label "f" in a stupid place, half-way between the centers of the two entries, instead of where you'd like it to be, half-way along the arrow. One way to handle this is to do something like <code>\ar[r]^(.7){f}</code> but that is fairly unsatisfying because you have to calibrate the (.7) by eye. There is another way, which is to use<br />
\ar[r]^-{f}<br />
which will automatically place the label "f" half-way along the arrow. If you want the label .7 of the way ''along the arrow'', you can do <code>\ar[r]^-(.7){f}</code>.<br />
<br />
== {{todo|should really add some stuff about \show here}} ==</div>152.3.43.176