Saturday, February 26, 2011

Latex halpz!!

Latex errors:
http://tug.org/errors.html

Has the the solution for the annoying hyperref problem



Single numbering for multi-line equation with braces :

\begin{equation}\label{xyzeq}
\left. \begin{aligned} LHS &= RHS \\
LHS &= RHS \\
LHS &= RHS
\end{aligned}
\right \}
\end{equation}



Brackets around fractions :

You need to tell LaTeX that those parentheses are around the fraction. One way is with the left and right macros:

\left(\frac{df}{dt}\right)

LaTeX Code: \\left(\\frac{df}{dt}\\right)


Blank Spaces in math mode :

  • \,  (thinspace)
  • \;  (thickspace)
  • \quad    (quadspace)
  • \qquad   (double quadspace)
  • \!  (negative thinspace)

Figure~\ref{toucan} shows a photograph of a toucan.
The tilde (~) in the above example is a special symbol within Latex. It represents a non-breaking space. It is useful here because it keeps 'Figure' and what ever number it \ref refers to as a single unit, and won't get split over lines or pages.


Thursday, February 24, 2011

Natbib

http://merkel.zoneo.net/Latex/natbib.php

The natbib package has two basic citation commands, \citet and \citep for textual and parenthetical citations, respectively. There also exist the starred versions \citet* and \citep* that print the full author list, and not just the abbreviated one. All of these may take one or two optional arguments to add some text before and after the citation.
\citet{jon90} --> Jones et al. (1990)
\citet[chap. 2]{jon90} --> Jones et al. (1990, chap. 2)
\citep{jon90} --> (Jones et al., 1990)
\citep[chap. 2]{jon90} --> (Jones et al., 1990, chap. 2)
\citep[see][]{jon90} --> (see Jones et al., 1990)
\citep[see][chap. 2]{jon90} --> (see Jones et al., 1990, chap. 2)
\citet*{jon90} --> Jones, Baker, and Williams (1990)
\citep*{jon90} --> (Jones, Baker, and Williams, 1990)

Multiple citations

Multiple citations may be made by including more than one citation key in the \cite command argument.
\citet{jon90,jam91} --> Jones et al. (1990); James et al. (1991)
\citep{jon90,jam91} --> (Jones et al., 1990; James et al. 1991)
\citep{jon90,jon91} --> (Jones et al., 1990, 1991)
\citep{jon90a,jon90b} --> (Jones et al., 1990a,b)

Numerical mode

These examples are for author-year citation mode. In numerical mode, the results are different.
\citet{jon90} --> Jones et al. [21]
\citet[chap. 2]{jon90} --> Jones et al. [21, chap. 2]
\citep{jon90} --> [21]
\citep[chap. 2]{jon90} --> [21, chap. 2]
\citep[see][]{jon90} --> [see 21]
\citep[see][chap. 2]{jon90} --> [see 21, chap. 2]
\citep{jon90a,jon90b} --> [21, 32]

Suppressed parentheses

As an alternative form of citation, \citealt is the same as \citet but without parentheses. Similarly, \citealp is \citep without parentheses. Multiple references, notes, and the starred variants also exist.
\citealt{jon90} --> Jones et al. 1990
\citealt*{jon90} --> Jones, Baker, and Williams 1990
\citealp{jon90} --> Jones et al., 1990
\citealp*{jon90} --> Jones, Baker, and Williams, 1990
\citealp{jon90,jam91} --> Jones et al., 1990; James et al., 1991
\citealp[pg. 32]{jon90} --> Jones et al., 1990, pg. 32
\citetext{priv. comm.} --> (priv. comm.)
The \citetext command allows arbitrary text to be placed in the current citation parentheses. This may be used in combination with \citealp.

Partial citations

In author-year schemes, it is sometimes desirable to be able to refer to the authors without the year, or vice versa. This is provided with the extra commands
\citeauthor{jon90} --> Jones et al.
\citeauthor*{jon90} --> Jones, Baker, and Williams
\citeyear{jon90} --> 1990
\citeyearpar{jon90} --> (1990)



Install amsmath support fof vim
https://tex.stackexchange.com/questions/416030/how-do-i-make-vim-highlight-math-properly-in-the-align-environment 

Thursday, February 17, 2011

Color tables and mysteries thereof : tv, tvcsl,bytscl

for 'x' window, for colors to activate :

device,retain=2,decompose=0,true_color=24

to reverse color table :
IDL> TVLCT,R,G,B,/GET ;Put the table into IDL variables
IDL> RR=REVERSE(R)
IDL> GG=REVERSE(G)
IDL> BB=REVERSE(B)
IDL> TVLCT,RR,GG,BB ;Load the reversed colors

Make individual entries
http://etcdipanjan.blogspot.com.au/search?q=color 

Saturday, February 5, 2011

Linestyles and Symbols

LINESTYLE

Accepted by: DRAW_ROI, OPLOT, PLOT, PLOTS, SURFACE. System variable equivalent: !P.LINESTYLE.

This keyword indicates the line style used to draw lines; it indicates the line style of the lines used to connect the data points. This keyword should be set to the appropriate index for the desired linestyle as described in the following table.


Table B-22: IDL Linestyles
Index
Linestyle
0
Solid
1
Dotted
2
Dashed
3
Dash Dot
4
Dash Dot Dot
5
Long Dashes

PSYM

Accepted by: DRAW_ROI, OPLOT, PLOT, PLOTS. System variable equivalent: !P.PSYM.

The symbol used to mark each data point. Normally, PSYM is 0, data points are connected by lines, and no symbols are drawn to mark the points. Set this keyword, or the system variable !P.PSYM, to the symbol index as shown in the table below to mark data points with symbols. The keyword SYMSIZE is used to set the size of the symbols.

Table B-23: Values for the PSYM Keyword

Table B-23: Values for the PSYM Keyword
PSYM Value
Plotting Symbol
1
Plus sign (+)
2
Asterisk (*)
3
Period (.)
4
Diamond
5
Triangle
6
Square
7
X
8
User-defined. See USERSYM procedure.
9
Undefined
10
Histogram mode. Horizontal and vertical lines connect the plotted points, as opposed to the normal method of connecting points with straight lines. See Histogram Mode for an example.

Negative values of PSYM cause the symbol designated by PSYM to be plotted at each point with solid lines connecting the symbols. For example, a value of -5 plots triangles at each data point and connects the points with lines. Histogram mode is the exception to this rule; since the points are already connected when PSYM=10, specifying the value -10 is meaningless, and will result in an error.

SYMSIZE

Accepted by: DRAW_ROI, OPLOT, PLOT, PLOTS.

Specifies the size of the symbols drawn when PSYM is set. The default size of 1.0 produces symbols approximately the same size as a character.

Fonts : IDL


An integer that specifies the graphics text font system to use.

Set FONT equal to -1 to select the Hershey character fonts, which are drawn using vectors.

Set FONT equal to 0 (zero) to select the device font of the output device.

Set FONT equal to 1 (one) to select the TrueType font system. See Fonts for a complete description of IDL's font systems.


Using PostScript Fonts


To use a PostScript font in your Direct Graphics output, you must first specify that IDL use the device font system, then switch to the PS device, then choose a font using the SET_FONT keyword to the DEVICE procedure.

The following IDL commands choose the correct font system (0 designates the device font system), set the graphics device, select the font Palatino Roman, open a PostScript file to print to, plot a simple data set, and close the PostScript file:
!P.FONT = 0
SET_PLOT, 'PS'
DEVICE, SET_FONT='Palatino-Roman', FILE='testfile.ps'
PLOT, INDGEN(10), TITLE = 'My Palatino Title'
DEVICE, /CLOSE

Font types :


Table H-32: The Standard 35 PostScript Fonts

PostScript Font
SET_FONT Value

DEVICE Keywords

AvantGarde-Book

/AVANTGARDE, /BOOK

AvantGarde-BookOblique

/AVANTGARDE, /BOOK, /OBLIQUE

AvantGarde-Demi

/AVANTGARDE, /DEMI

AvantGarde-DemiOblique

/AVANTGARDE, /DEMI, /OBLIQUE

Bookman-Demi

/BKMAN, /DEMI

Bookman-DemiItalic

/BKMAN, /DEMI, /ITALIC

Bookman-Light

/BKMAN, /LIGHT

Bookman-LightItalic

/BKMAN, /LIGHT, /ITALIC

Courier

/COURIER

Courier-Bold

/COURIER, /BOLD

Courier-BoldOblique

/COURIER, /BOLD, /OBLIQUE

Courier-Oblique

/COURIER, /OBLIQUE

Helvetica

/HELVETICA

Helvetica-Bold

/HELVETICA, /BOLD

Helvetica-BoldOblique

/HELVETICA, /BOLD, /OBLIQUE

Helvetica-Narrow

/HELVETICA, /NARROW

Helvetica-Narrow-Bold

/HELVETICA, /NARROW, /BOLD

Helvetica-Narrow-BoldOblique

/HELVETICA, /NARROW, /BOLD, /OBLIQUE

Helvetica-Narrow-Oblique

/HELVETICA, /NARROW, /OBLIQUE

Helvetica-Oblique

/HELVETICA, /OBLIQUE

NewCenturySchlbk-Bold

/SCHOOLBOOK, /BOLD

NewCenturySchlbk-BoldItalic

/SCHOOLBOOK, /BOLD, /ITALIC

NewCenturySchlbk-Italic

/SCHOOLBOOK, /ITALIC

NewCenturySchlbk-Roman

/SCHOOLBOOK

Palatino-Bold

/PALATINO, /BOLD

Palatino-BoldItalic

/PALATINO, /BOLD, /ITALIC

Palatino-Italic

/PALATINO, /ITALIC

Palatino-Roman

/PALATINO

Symbol

/SYMBOL

Times-Bold

/TIMES, /BOLD

Times-BoldItalic

/TIMES, /ITALIC, /BOLD

Times-Italic

/TIMES, /ITALIC

Times-Roman

/TIMES

ZapfChancery-MediumItalic

/ZAPFCHANCERY, /MEDIUM, /ITALIC

ZapfDingats

/ZAPFDINGBATS








Change Font type within string

http://www.exelisvis.com/docs/embedded_formatting_comm.html#fonts_2203613354_1050246
Command
Hershey Vector Font
TrueType Font
PostScript Font
!3
Simplex Roman (default)
Helvetica
Helvetica
!4
Simplex Greek
Helvetica Bold
Helvetica Bold
!5
Duplex Roman
Helvetica Italic
Helvetica Narrow
!6
Complex Roman
Helvetica Bold Italic
Helvetica Narrow Bold Oblique
!7
Complex Greek
Times
Times Roman
!8
Complex Italic
Times Italic
Times Bold Italic
!9
Math/special characters
Symbol
Symbol
!M
Math/special characters
Symbol
Symbol
!10
Special characters
DejaVu Sans
Zapf Dingbats
!11 or !G
Gothic English
Courier
Courier
!12 or !W
Simplex Script
Courier Italic
Courier Oblique
!13
Complex Script
Courier Bold
Palatino
!14
Gothic Italian
Courier Bold Italic
Palatino Italic
!15
Gothic German
Times Bold
Palatino Bold
!16
Cyrillic
Times Bold Italic
Palatino Bold Italic
!17
Triplex Roman
Helvetica *
Avant Garde Book
!18
Triplex Italic
Helvetica *
New Century Schoolbook
!19

Helvetica *
New Century Schoolbook Bold
!20
Miscellaneous
Helvetica *
Undefined User Font
!X
Revert to the entry font
Revert to the entry font
Revert to the entry font
* The font assigned to this index may be replaced in a future release of IDL.

!A
Shift above the division line.
!B
Shift below the division line.
!C
“Carriage return,” begins a new line of text. Shift back to the starting position and down one line. This command also performs an implicit “!N” command, returning to the normal level and character size at the beginning of the new line.
!D
Shift down to the first level subscript and decrease the character size by a factor of 0.62.
!E
Shift up to the exponent level and decrease the character size by a factor of 0.44.
!I
Shift down to the index level and decrease the character size by a factor of 0.44.
!L
Shift down to the second level subscript. Decrease the character size by a factor of 0.62.
!M
Switch to the math/symbol font for one character, then switch back.
!N
Shift back to the normal level and original character size.
!R
Restore position. The current position is set from the top of the saved positions stack.
!S
Save position. The current position is saved on the top of the saved positions stack.
!U
Shift to upper subscript level. Decrease the character size by a factor of 0.62.
!X
Return to the entry font.
!Z(u0,u1,...,un)
Display one or more character glyphs according to their Unicode value. Each ui within the parentheses will be interpreted as a 16-bit hexadecimal Unicode value. If more than one Unicode value is to be included, the values should be separated by commas.
!!
Display the ! symbol.

Friday, February 4, 2011

set ps plot


http://nstx.pppl.gov/nstx/Software/IDL/idl_intro.html#GOTCHAS

IDL> set_plot,'PS'
IDL> device, filename='your_filename.ps'
IDL> ...
IDL> ... plot some stuff ...
IDL> ...
IDL> device, /close
IDL> set_plot,'X'



Why do my graphics get erased?

window,0,retain=2,xsize=500,ysize=500


When a window gets covered, then uncovered, someone has to keep a copy of the obscured part of the image. You may or may not want to have all the images saved when they are obscured, by reasons of speed and memory.

In any case, this topic is called "backing store". It can be done by IDL, done by the windowing system, or not done. By default, the X window system does not have backing store turned on.

In IDL, there is a keyword RETAIN, for specifying which kind of backing store to use.

This may be done on a per window basis, e.g., window,0,retain=2,xsize=500,ysize=500

Backing store will now be maintained for this window by IDL

ANimation.

; File: making_waves.pro - Author: Erik Brisson
pro making_waves
a = fltarr(256,3,63)
for i=0,255 do for j=0,2 do for k=0,62 do $
a(i,j,k) = sin(float(i-k)/10.)/exp((float(i)/200.))
frames=bytarr(400,300,63)
window,retain=2,/free,title='making waves',xsize=400,ysize=300
for k=0,62 do begin $
shade_surf, a(*,*,k) & $
frames(0,0,k) = tvrd() & $
end
movie, frames, order=0
end