title: How to remove PSTricks dictionary or library codes in an EPS file produced by dvips?

text: I have 2 mutually-exclusive methods to produce cropped PSTricks graphics in EPS format:   1. Using `latex input.tex` followed by `dvips input.dvi -E -o output.eps`.   2. Or using `latex input.tex` followed by `dvips input.dvi` followed by `ps2pdf input.ps` followed by `pdfcrop --hires input.pdf` followed by `pdftops -eps input-crop.pdf`. For the sake of illustration, I chose the following code snippet as an input file.               % gridon.tex     \documentclass{minimal}     \usepackage{pstricks}          \pagestyle{empty}     \begin{document}          \begin{pspicture}[showgrid=true](3,3)     \pscircle(1.5,1.5){1}     \rput[tr](3,3){3}     \end{pspicture}          \end{document}      ## First Methode I noticed the size of EPS files produced by the first method will be 4 times larger than ones produced by the second method. I opened the EPS produced by the first method and the contents look like below:               %!PS-Adobe-2.0 EPSF-2.0     %%BoundingBox: 85 626 184 729     %%HiResBoundingBox: 85.272 626.784 183.390 728.016     %%Creator: dvips(k) 5.99 Copyright 2010 Radical Eye Software     %%Title: gridon.dvi     %%CreationDate: Wed Jul 06 22:32:55 2011     %%DocumentFonts: CMR10     %%EndComments     %DVIPSWebPage: (www.radicaleye.com)     %DVIPSCommandLine: dvips gridon -E* -o gridon-crop.eps     %DVIPSParameters: dpi=600     %DVIPSSource:  TeX output 2011.07.06:2232     %%BeginProcSet: tex.pro 0 0     %!     /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S     N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72     mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0     0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{     landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize     mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[     matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round     exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{     statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]     N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin     /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array     /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2     array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N     df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A     definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get     }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}     B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr     1 add N}if}B/CharBuilder{save 3 1 roll S A/base get 2 index get S     /BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy     setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]{Ci}imagemask     restore}B/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn     /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put     }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{     bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A     mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{     SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{     userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X     1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4     index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N     /dir 0 def/dyy{/dir 0 def}B/dyt{/dir 1 def}B/dty{/dir 2 def}B/dtt{/dir 3     def}B/p{dir 2 eq{-90 rotate show 90 rotate}{dir 3 eq{-90 rotate show 90     rotate}{show}ifelse}ifelse}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0     N/Ry 0 N/V{}B/RV/v{/Ry X/Rx X V}B statusdict begin/product where{pop     false[(Display)(NeXT)(LaserWriter 16/600)]{A length product length le{A     length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}     forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{     BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat     {BDot}imagemask grestore}}ifelse B/QV{gsave newpath transform round exch     round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0     rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B     /M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}     B/g{0 M}B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p     -3 w}B/n{p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{     0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end          %%EndProcSet     %%BeginProcSet: pstricks.pro 0 0     % $Id: pstricks.pro 455 2011-01-30 11:19:19Z herbert $     %     %% PostScript prologue for pstricks.tex.     %% Version 1.07, 2009/04/30     %%     %% This program can be redistributed and/or modified under the terms     %% of the LaTeX Project Public License Distributed from CTAN archives     %% in directory macros/latex/base/lppl.txt.     %     %     % Define the follwing gs-functions if not known, eg when using distiller     %     systemdict /.setopacityalpha known not {/.setopacityalpha { pop } def } if     systemdict /.setblendmode known not {/.setblendmode { pop } def } if     systemdict /.setshapealpha known not {/.setshapealpha { pop } def } if     %     /tx@Dict 200 dict def               % the main PSTricks dictionary     tx@Dict begin     /ADict 25 dict def              % The arrow dictionaray     /CM { matrix currentmatrix } bind def     /SLW /setlinewidth load def     /CLW /currentlinewidth load def     /CP /currentpoint load def     /ED { exch def } bind def     /L /lineto load def     /T /translate load def     /TMatrix { } def     /RAngle { 0 } def     /Sqrt { dup 0 lt { pop 0 } { sqrt } ifelse } def  % return 0 for negative arguments      /Atan { /atan load stopped { pop pop 0 } if } def % return 0 if atan not known     /ATAN1 {neg -1 atan 180 sub } def       % atan(x) (only one parameter)     /Div { dup 0 eq { pop } { div } ifelse } def    % control the division     /tan { dup cos abs 1.e-10 lt        { pop 1.e10 }                 % return 1.e10 as infinit       { dup sin exch cos div } ifelse       % default sin/cos     } def     /Tan { dup sin exch cos Div } def       % sin(x)/cos(x) x in degrees     /Acos {dup dup mul neg 1 add dup 0 lt {     % arc cos, returns 0 when negative root       pop pop 0 }{ sqrt exch atan} ifelse } def     /NET { neg exch neg exch T } def            % change coordinate system to the negative one           /Pyth { dup mul exch dup mul add sqrt } def     % Pythagoras, expects 2 parameter     /Pyth2 {                    % Pythagoras, xA yA xB yB       3 -1 roll         % xA xB yB yA       sub           % xA xB yB-yA       3 1 roll      % yB-yA xA xB       sub           % yB-yA xA-xB       Pyth } def     /PtoC { 2 copy cos mul 3 1 roll sin mul } def   % Polar to Cartesian     /Rand { rand 4294967295 div } def       % a real random number     %----------------- hv added 20050516 ---------------     /PiDiv2 1.57079632680 def     /Pi 3.14159265359 def      /TwoPi 6.28318530718 def     /Euler 2.71828182846 def      %/e Euler bind def     %     /RadtoDeg { 180 mul Pi div } bind def       % convert from radian to degrees     /DegtoRad { Pi mul 180 div } bind def       % viceversa     %----------------- hv end---------------------------     /PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def     %     /PathLength {        flattenpath /z 0 def        { /y1 ED /x1 ED /y2 y1 def /x2 x1 def }       { /y ED /x ED PathLength@ }        {}        { /y y2 def /x x2 def PathLength@ }       /pathforall load stopped { pop pop pop pop } if        z      } def     %     /STP { .996264 dup scale } def          % BP/PT scaling     /STV { SDict begin normalscale end STP  } def   %      %     /DashLine {         dup 0 gt         { /a .5 def PathLength exch div }         { pop /a 1 def PathLength } ifelse         /b ED % pattern should fit evenly in b         dup /X ED % pattern array         0 get /y ED % length of first black segment         /z 0 X {add} forall def % length of the full pattern         %% Computation of the scaling factor as described by van Zandt:         b a .5 sub 2 mul y mul sub z Div round         z mul a .5 sub 2 mul y mul add b exch Div         %%%% scaling factor on stack.         /z ED %% now, z is the scaling factor         false % for the length test below         X { z mul } forall X astore %% modification TN 04-08-07         %%% Checking whether at least one dash in X has positive length:         {0 gt or} forall         { X 1 a sub y mul }         { [ 1 0 ] 0 }         ifelse         setdash stroke     } def     %     /DotLine {        /b PathLength def        /a ED /z ED /y CLW def        /z y z add def        a 0 gt {          /b b a div def        }{          a 0 eq {            /b b y sub def          }{ a -3 eq {            /b b y add def } if          } ifelse        } ifelse        [ 0 b b z Div round Div dup 0 le { pop 1 } if ]        a 0 gt { 0 }{ y 2 div a -2 gt { neg }if } ifelse        setdash 1 setlinecap stroke      } def     %     /SymbolLine {   % on stack [ x y x y ...       counttomark                   % number of elements       2 div cvi /n ED                   % n pairs       /YA ED /XA ED                 % the start point       n 1 sub {          /YB ED /XB ED         /XLength XB XA sub def         /YLength YB YA sub def         /PAngle YLength XLength Atan def         /XYLength XLength YLength Pyth def         /nSym XYLength SymStep div cvi def         /Shift Symbol stringwidth pop 2 div def          /deltaX XLength nSym div def         /deltaY YLength nSym div def         XA Shift sub YA Shift sub moveto          nSym {            gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if           Symbol show            grestore            deltaX deltaY rmoveto         } repeat         /YA YB def /XA XB def       } repeat        XA Shift sub YA Shift sub moveto        gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if       Symbol show grestore       pop               % delete the mark symbol     } def     %     /LineFill { % hv ------------ patch 7 -------------       gsave        abs /hatchWidthInc ED       abs /hatchSepInc ED       abs CLW add /a ED        a 0 dtransform round exch round exch       2 copy idtransform        exch Atan rotate        idtransform pop /a ED        .25 .25 itransform pathbbox        /y2 ED        a Div ceiling cvi /x2 ED /y1 ED        a Div cvi /x1 ED /y2 y2 y1 sub def        clip        newpath        2 setlinecap        systemdict       /setstrokeadjust known { true setstrokeadjust } if        x2 x1 sub 1 add {          x1 a mul y1 moveto 0 y2 rlineto stroke          /x1 x1 1 add            hatchWidthInc 0 gt { CLW add } if          def          hatchSepInc 0 gt hatchWidthInc 0 gt or {            /a a hatchSepInc add def           CLW hatchWidthInc add SLW          } if       } repeat        grestore        pop pop } def     %     /PenroseFill {%  on stack: scaling factor       dup dup scale       1 exch div round /penroseFactor ED        a 0 dtransform round exch round exch       2 copy idtransform        exch Atan rotate        idtransform pop /a ED        .25 .25 itransform pathbbox        /y2 ED        a Div ceiling cvi /x2 ED /y1 ED        a Div cvi /x1 ED /y2 y2 y1 sub def        clip        newpath        systemdict       /setstrokeadjust known { true setstrokeadjust } if        /I/S/L/W/G/+/Z/F/E/D[/def/exch/for{E D}/add{s E get mul}      { Z -36.2001 1 33 }{25 E S rlineto}{/q Z dup q G E q 1 + G}{Z 2 2}]{cvx def}forall       [0 72 1008 {dup sin E cos }F ]1 setlinejoin/s W{/a W{/b I 10{/i I 4{/m I moveto       i m +/j I 10{/l Z b m l + G a l G sub s m get div .2 + floor .3 + 25       mul j l + S rmoveto}F i L j L stroke }F}F}F}F        grestore        pop pop      } def     %     /TruchetFill { %     on stack: scaling factor       10 dict begin       dup dup scale       1 exch div round /penroseFactor ED        a 0 dtransform round exch round exch       2 copy idtransform        exch Atan rotate        idtransform pop /a ED        .25 .25 itransform pathbbox        /y2 ED        a Div ceiling cvi /x2 ED /y1 ED        a Div cvi /x1 ED /y2 y2 y1 sub def        clip        newpath        systemdict       /setstrokeadjust known { true setstrokeadjust } if        /ma a neg def       /ha a 2 div def        /mha ha neg def       /tile {          rand dup 2 idiv 2 mul eq { 90 rotate } if         mha mha moveto ha mha lineto         ha ha lineto mha ha lineto     %    closepath .1 setlinewidth stroke         contents       } def       /contents{          0 ha moveto ha 0 lineto         0 mha moveto mha 0 lineto     %    1 setlinewidth stroke       } def       /dotiling {         f ma mul a f a mul {            /i exch def           f ma mul a f a mul {              /j exch def             gsave i j translate             tile stroke grestore           } for         } for       } def     %       /f 3 def        5 srand dotiling        end % local user dict     } def     %     /BeginArrow {        ADict begin           % hold it local, for end see EndArrow       /@mtrx CM def        gsave        2 copy T        2 index sub neg exch        3 index sub exch Atan        rotate newpath      } def     %     /EndArrow { @mtrx setmatrix CP grestore end } def % end the ADict     %     /Arrow {        CLW mul add dup        2 div /w ED        mul dup /h ED        mul /a ED        { 0 h T 1 -1 scale } if        w neg h moveto        0 0 L w h L w neg a neg rlineto        gsave fill grestore      } def     %     /ArrowD { % the sides are drawn as curves (hv 20071211)       CLW mul add dup        2 div /w ED        mul dup /h ED        mul /Inset ED        { 0 h T 1 -1 scale } if % changes the direction     % we use y=w/h^2 * x^2 as equation for the control points     % for the coordinates the arrow is seen from top to bottom     % the bottom (tip) is (0;0)       w neg h moveto % lower left of >       w 9 div 4 mul neg h 3 div 2 mul       w 9 div neg       h 3 div         0 0 curveto    % tip of >       w 9 div        h 3 div         w 9 div 4 mul  h 3 div 2 mul       w h curveto % upper left of >       w neg Inset neg rlineto % move to x=0 and inset       gsave fill grestore      } def      %     /Tbar {        CLW mul add /z ED        z -2 div CLW 2 div moveto        z 0 rlineto stroke        0 CLW moveto      } def     %     /Bracket {        CLW mul add dup CLW sub 2 div        /x ED mul CLW add /y ED /z CLW 2 div def        x neg y moveto        x neg CLW 2 div L x CLW 2 div L x y L stroke        0 CLW moveto      } def     %     /RoundBracket {        CLW mul add dup 2 div        /x ED mul /y ED /mtrx CM def        0 CLW 2 div T x y mul 0 ne { x y scale } if        1 1 moveto        .85 .5 .35 0 0 0 curveto        -.35 0 -.85 .5 -1 1 curveto        mtrx setmatrix stroke 0 CLW moveto      } def     %     /SD { 0 360 arc fill } def     %     /EndDot { % DS is the dot size        { /z DS def } { /z 0 def } ifelse     % outer or inner dimen        /b ED                 % the color definition       0 z DS SD        b { 0 z DS CLW sub SD } if        0 DS z add CLW 4 div sub        moveto      } def     %     /Shadow { [ { /moveto load } { /lineto load } { /curveto load } {       /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto       load } if ] cvx newpath 3 1 roll T exec } def     %     /NArray { % holds the coordinates and on top of stack the showpoints boolean       /showpoints ED        counttomark 2 div dup cvi /n ED   % n 2 div on stack        n eq not { exch pop } if      % even numbers of points? delete one       showpoints          { ] aload /Points ED }          { n 2 mul 1 add -1 roll pop } ifelse    % delete the mark symbol      } def     %     /Line {        NArray n 0 eq not          { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def            n { Lineto } repeat            CP 4 2 roll ArrowB L pop pop          } if      } def     %     /LineToYAxis {       NArray            % all x-y pairs on stack       n { 2 copy moveto % go to current point         0 exch Lineto   % line to y-axis         pop             % delete old x-value       } repeat     } def     %     /LineToXAxis{       NArray        % all x-y pairs on stack       n 0 eq not         { n 1 eq { 0 0 /n 2 def } if           ArrowA           /n n 2 sub def           CP 2 copy moveto pop 0 Lineto           n { 2 copy moveto pop 0 Lineto } repeat           CP           4 2 roll           ArrowB           2 copy moveto pop 0           L           pop pop } if     } def     %     /Arcto {        /a [ 6 -2 roll ] cvx def        a r        /arcto load stopped { 5 } { 4 } ifelse { pop } repeat        a      } def     %     /CheckClosed {        dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq       and { pop pop /n n 1 sub def } if      } def     %     /Polygon {        NArray n 2 eq { 0 0 /n 3 def } if        n 3 lt          { n { pop pop } repeat }          { n 3 gt { CheckClosed } if            n 2 mul -2 roll            /y0 ED /x0 ED /y1 ED /x1 ED             x1 y1            /x1 x0 x1 add 2 div def            /y1 y0 y1 add 2 div def            x1 y1 moveto            /n n 2 sub def            n { Lineto } repeat            x1 y1 x0 y0 6 4 roll Lineto           Lineto pop pop closepath } ifelse      } def     %     /SymbolPolygon {   % on stack [ x y x y ...       counttomark                   % number of elements       2 add /m ED       2 copy m 2 roll               % copy last two       m 2 div cvi /n ED                 % n pairs       /YA ED /XA ED                 % the start point       n 1 sub {          /YB ED /XB ED         /XLength XB XA sub def         /YLength YB YA sub def         /PAngle YLength XLength Atan def         /XYLength XLength YLength Pyth def         /nSym XYLength SymStep Div cvi def         /Shift Symbol stringwidth pop 2 Div def          /deltaX XLength nSym Div def         /deltaY YLength nSym Div def         XA Shift sub YA Shift sub moveto          nSym {            gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if           Symbol show            grestore            deltaX deltaY rmoveto         } repeat     %    XB Shift sub YB Shift sub moveto Symbol show         /YA YB def /XA XB def       } repeat        pop   % delete the mark symbol     } def     %     /Diamond {        /mtrx CM def        T rotate        /h ED        /w ED        dup 0 eq { pop } { CLW mul neg          /d ED          /a w h Atan def          /h d a sin Div h add def          /w d a cos Div w add def } ifelse        mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div        /ArrowA { moveto } def        /ArrowB { } def        false Line        closepath mtrx setmatrix } def     %     /Triangle {        /mtrx CM def        translate        rotate /h ED 2 div /w ED        dup CLW mul /d ED        /h h d w h Atan sin Div sub def        /w w d h w Atan 2 div dup cos exch sin Div mul sub def        mark        0 d w neg d 0 h w d 0 d        /ArrowA { moveto } def        /ArrowB { } def        false        Line        closepath        mtrx     % DG/SR modification begin - Jun.  1, 1998 - Patch 3 (from Michael Vulis)     % setmatrix } def       setmatrix pop      } def     % DG/SR modification end     %     /CCA {        /y ED /x ED        2 copy y sub /dy1 ED        x sub /dx1 ED        /l1 dx1 dy1 Pyth def      } def     %     /CC {        /l0 l1 def        /x1 x dx sub def        /y1 y dy sub def        /dx0 dx1 def        /dy0 dy1 def        CCA        /dx dx0 l1 c exp mul dx1 l0 c exp mul add def        /dy dy0 l1 c exp mul dy1 l0 c exp mul add def        /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos abs b exp a mul dx dy Pyth Div 2 div def        /x2 x l0 dx mul m mul sub def       /y2 y l0 dy mul m mul sub def        /dx l1 dx mul m mul neg def        /dy l1 dy mul m mul neg def      } def     %     /IC {        /c c 1 add def        c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } ifelse        /a a 2 mul 3 div 45 cos b exp div def        CCA        /dx 0 def        /dy 0 def      } def     %     /BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def     /NC { CC x1 y1 x2 y2 x y curveto } def     /EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def     /BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def     /NAC { x2 y2 x y curveto CC x1 y1 } def     /EAC { x2 y2 x y ArrowB curveto pop pop } def     %     /OpenCurve {        NArray n 3 lt          { n { pop pop } repeat }          { BOC /n n 3 sub def n { NC } repeat EOC } ifelse      } def     %     /CurvePath {        flattenpath /z 0 def /z0 0 def       { /y1 ED /x1 ED /y2 y1 def /x2 x1 def          x1 Shift sub y1 Shift sub moveto          gsave          startAngle rotate Symbol show          grestore /z0 z def }       { /y ED /x ED PathLength@ z z0 sub SymStep ge {           x Shift sub y Shift sub moveto            gsave            rotateSymbol { y yOld sub x xOld sub Atan 180 sub CorrAngle sub rotate } if           Symbol show            grestore /z0 z def } if          /yOld y def /xOld x def }        {}        { /y y2 def /x x2 def PathLength@          x Shift sub y Shift sub moveto          gsave         rotateSymbol { y yOld sub x xOld sub Atan 180 sub CorrAngle sub rotate } if         Symbol show          grestore       }       pathforall        z      } def     %     /OpenSymbolCurve {        OpenCurve       0.1 setflat       /Shift Symbol stringwidth pop 2 div def        CurvePath      } def     %     /AltCurve {        { false NArray n 2 mul 2 roll          [ n 2 mul 3 sub 1 roll ] aload         /Points ED          n 2 mul -2 roll }        { false NArray } ifelse        n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse      } def     %     /AltOpenSymbolCurve {        AltCurve       0.1 setflat       /Shift Symbol stringwidth pop 2 div def        CurvePath      } def               % ----------- the remaining codes are trimmed for simplicity ------------------           ## Second Method The second method produces more compact EPS as follows:               %!PS-Adobe-3.0 EPSF-3.0     % Produced by xpdf/pdftops 3.02pl4     %%Creator: TeX     %%LanguageLevel: 2     %%DocumentSuppliedResources: (atend)     %%BoundingBox: 0 0 99 102     %%HiResBoundingBox: 0 0 98.118 101.232     %%EndComments     %%BeginProlog     %%BeginResource: procset xpdf 3.02pl4 0     %%Copyright: Copyright 1996-2007 Glyph & Cog, LLC     /xpdf 75 dict def xpdf begin     % PDF special state     /pdfDictSize 15 def     /pdfSetup {       3 1 roll 2 array astore       /setpagedevice where {         pop 3 dict begin           /PageSize exch def           /ImagingBBox null def           /Policies 1 dict dup begin /PageSize 3 def end def           { /Duplex true def } if         currentdict end setpagedevice       } {         pop pop       } ifelse     } def     /pdfStartPage {       pdfDictSize dict begin       /pdfFillCS [] def       /pdfFillXform {} def       /pdfStrokeCS [] def       /pdfStrokeXform {} def       /pdfFill [0] def       /pdfStroke [0] def       /pdfFillOP false def       /pdfStrokeOP false def       /pdfLastFill false def       /pdfLastStroke false def       /pdfTextMat [1 0 0 1 0 0] def       /pdfFontSize 0 def       /pdfCharSpacing 0 def       /pdfTextRender 0 def       /pdfTextRise 0 def       /pdfWordSpacing 0 def       /pdfHorizScaling 1 def       /pdfTextClipPath [] def     } def     /pdfEndPage { end } def     % PDF color state     /cs { /pdfFillXform exch def dup /pdfFillCS exch def           setcolorspace } def     /CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def           setcolorspace } def     /sc { pdfLastFill not { pdfFillCS setcolorspace } if           dup /pdfFill exch def aload pop pdfFillXform setcolor          /pdfLastFill true def /pdfLastStroke false def } def     /SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if           dup /pdfStroke exch def aload pop pdfStrokeXform setcolor          /pdfLastStroke true def /pdfLastFill false def } def     /op { /pdfFillOP exch def           pdfLastFill { pdfFillOP setoverprint } if } def     /OP { /pdfStrokeOP exch def           pdfLastStroke { pdfStrokeOP setoverprint } if } def     /fCol {       pdfLastFill not {         pdfFillCS setcolorspace         pdfFill aload pop pdfFillXform setcolor         pdfFillOP setoverprint         /pdfLastFill true def /pdfLastStroke false def       } if     } def     /sCol {       pdfLastStroke not {         pdfStrokeCS setcolorspace         pdfStroke aload pop pdfStrokeXform setcolor         pdfStrokeOP setoverprint         /pdfLastStroke true def /pdfLastFill false def       } if     } def     % build a font     /pdfMakeFont {       4 3 roll findfont       4 2 roll matrix scale makefont       dup length dict begin         { 1 index /FID ne { def } { pop pop } ifelse } forall         /Encoding exch def         currentdict       end       definefont pop     } def     /pdfMakeFont16 {       exch findfont       dup length dict begin         { 1 index /FID ne { def } { pop pop } ifelse } forall         /WMode exch def         currentdict       end       definefont pop     } def     % graphics state operators     /q { gsave pdfDictSize dict begin } def     /Q {       end grestore       /pdfLastFill where {         pop         pdfLastFill {           pdfFillOP setoverprint         } {           pdfStrokeOP setoverprint         } ifelse       } if     } def     /cm { concat } def     /d { setdash } def     /i { setflat } def     /j { setlinejoin } def     /J { setlinecap } def     /M { setmiterlimit } def     /w { setlinewidth } def     % path segment operators     /m { moveto } def     /l { lineto } def     /c { curveto } def     /re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto           neg 0 rlineto closepath } def     /h { closepath } def     % path painting operators     /S { sCol stroke } def     /Sf { fCol stroke } def     /f { fCol fill } def     /f* { fCol eofill } def     % clipping operators     /W { clip newpath } def     /W* { eoclip newpath } def     /Ws { strokepath clip newpath } def     % text state operators     /Tc { /pdfCharSpacing exch def } def     /Tf { dup /pdfFontSize exch def           dup pdfHorizScaling mul exch matrix scale           pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put           exch findfont exch makefont setfont } def     /Tr { /pdfTextRender exch def } def     /Ts { /pdfTextRise exch def } def     /Tw { /pdfWordSpacing exch def } def     /Tz { /pdfHorizScaling exch def } def     % text positioning operators     /Td { pdfTextMat transform moveto } def     /Tm { /pdfTextMat exch def } def     % text string operators     /cshow where {       pop       /cshow2 {         dup {           pop pop           1 string dup 0 3 index put 3 index exec         } exch cshow         pop pop       } def     }{       /cshow2 {         currentfont /FontType get 0 eq {           0 2 2 index length 1 sub {             2 copy get exch 1 add 2 index exch get             2 copy exch 256 mul add             2 string dup 0 6 5 roll put dup 1 5 4 roll put             3 index exec           } for         } {           dup {             1 string dup 0 3 index put 3 index exec           } forall         } ifelse         pop pop       } def     } ifelse     /awcp {       exch {         false charpath         5 index 5 index rmoveto         6 index eq { 7 index 7 index rmoveto } if       } exch cshow2       6 {pop} repeat     } def     /Tj {       fCol       1 index stringwidth pdfTextMat idtransform pop       sub 1 index length dup 0 ne { div } { pop pop 0 } ifelse       pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32       4 3 roll pdfCharSpacing pdfHorizScaling mul add 0       pdfTextMat dtransform       6 5 roll Tj1     } def     /Tj16 {       fCol       2 index stringwidth pdfTextMat idtransform pop       sub exch div       pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32       4 3 roll pdfCharSpacing pdfHorizScaling mul add 0       pdfTextMat dtransform       6 5 roll Tj1     } def     /Tj16V {       fCol       2 index stringwidth pdfTextMat idtransform exch pop       sub exch div       0 pdfWordSpacing pdfTextMat dtransform 32       4 3 roll pdfCharSpacing add 0 exch       pdfTextMat dtransform       6 5 roll Tj1     } def     /Tj1 {       0 pdfTextRise pdfTextMat dtransform rmoveto       currentpoint 8 2 roll       pdfTextRender 1 and 0 eq {         6 copy awidthshow       } if       pdfTextRender 3 and dup 1 eq exch 2 eq or {         7 index 7 index moveto         6 copy         currentfont /FontType get 3 eq { fCol } { sCol } ifelse         false awcp currentpoint stroke moveto       } if       pdfTextRender 4 and 0 ne {         8 6 roll moveto         false awcp         /pdfTextClipPath [ pdfTextClipPath aload pop           {/moveto cvx}           {/lineto cvx}           {/curveto cvx}           {/closepath cvx}         pathforall ] def         currentpoint newpath moveto       } {         8 {pop} repeat       } ifelse       0 pdfTextRise neg pdfTextMat dtransform rmoveto     } def     /TJm { pdfFontSize 0.001 mul mul neg 0            pdfTextMat dtransform rmoveto } def     /TJmV { pdfFontSize 0.001 mul mul neg 0 exch             pdfTextMat dtransform rmoveto } def     /Tclip { pdfTextClipPath cvx exec clip newpath              /pdfTextClipPath [] def } def     % Level 2 image operators     /pdfImBuf 100 string def     /pdfIm {       image       { currentfile pdfImBuf readline         not { pop exit } if         (%-EOD-) eq { exit } if } loop     } def     /pdfImM {       fCol imagemask       { currentfile pdfImBuf readline         not { pop exit } if         (%-EOD-) eq { exit } if } loop     } def     /pr { 2 index 2 index 3 2 roll putinterval 4 add } def     /pdfImClip {       gsave       0 2 4 index length 1 sub {         dup 4 index exch 2 copy         get 5 index div put         1 add 3 index exch 2 copy         get 3 index div put       } for       pop pop rectclip     } def     /pdfImClipEnd { grestore } def               % ----------- the remaining codes are trimmed for simplicity ------------------      ## Questions I think the EPS in the first method contains unnecessary PSTricks codes, i.e., PSTricks dictionary and library codes. How to remove them?


title: \floatstyle{boxed} paragraph style

text: I'm using `\floatstyle{boxed}` for the first time. I want numbered, boxed floats with the same paragraph style as my main document. The boxing and numbering works fine, but the line-spacing inside the box is single-spaced (not my document default) and new paragraphs are not indented and not preceeded by a blank line. This makes my boxes messy to read. Why? I'm doing this:                   %preamble         \usepackage{float}  % enables user to define custom floats         \floatstyle{boxed}  % affects the next call to \newfloat (and all subsequent ones until \floatstyle is called again)         \newfloat{BoxFloat}{tbh}{bx}[chapter]         \floatname{BoxFloat}{Box}   % set prefix for captions on instances of BoxFloat to 'Box'         %body of document         \begin{BoxFloat}         \label{BoxFloat:subsumption}         \caption{Clarke's subsumption problem}         My first paragraph.              My second paragraph.         \end{BoxFloat}      Any ideas what I'm doing wrong?


title: Author name/year cited inline (According to Aaaaa (2013)...)

text: How can I cite author (e.g. John Doe) with year _inline_ following this format: > According to Doe (2013) LaTeX is very powerful... I am using `biblatex` with `style=authoryear` & `backend=biber`. After trying some commands and google search it did not worked. But to make citations in the end of text citations I am using `\parencite{Doe2013}` and it works as I need > .....(Doe, 2013)


title: Dependency graph with TikZ

text: I would like to make a TikZ diagram to show the detailed dependency structure of the theorems in my thesis with nodes and subnodes. Ex:               Theorem 4               (A)        coding theorem       (A1)            proof techniques (A1a)         converse             (A2)          Theorem 5               (B)      and then indicate that there is a dependency               (A1a) --> (B)      which is more precise than saying that Theorem 5 depends on Theorem 4. More specifically, this is what I am trying to draw: ![enter image description here](http://i.stack.imgur.com/4F5Me.jpg) Is there a TikZ package for that? Or for drawing .deb dependency graphs? I found one package/framework for course prerequisites: http://www.texample.net/tikz/examples/prerequisite-chart/ but the underlying format is very low level so you are meant to edit with a program. All advice / example / recommendations will be much appreciated!


title: Abbreviate own name

text: I am using `\usepackage[backend=biber, style=authoryear]{biblatex}` but I would like my name to appear as a dash or even better would be the first initial of my surname. That is I would like to see `(-, Leibniz and Newton 1661)` or `(C., Leibniz and Newton 1661)` inline. I am happy to have the full version in the references section at the end. Is there a way to do this?


title: Artistic Calendar layouts with pictures?

text: I am looking for references to layouts of calendars. I am not sure yet which kind of calendar I want to have, the picture may be a background picture or a side picture or anything like that. I have pictures which I want to use to the calendar to make it more than just white or a single colour. I found some layouts here but more references needed. Google fails with the search like `"related:http://idisk.me.com/velnz/Public/site/LaTeX/"`. Please, add the label `"reference-request"`. I am looking for material such as books or proper websites that would explain and teach how to do this kind of things.


title: Datamodel in biblatex, hashname and biber

text: I'm trying to create my own biblatex datamodel to describe medieval manuscripts. My .dbx file is actually               \DeclareDatamodelEntrytypes{manuscript}     \DeclareDatamodelEntryfields[manuscript]{Datation}      My bib file has this content:               @manuscript{P1470,         Library={BNF},         Address={Paris},         Datation={\textsc{viii}\textsuperscript{e} s.}     }      I have no author or like field, because my manuscript is anonymous. And I call it by               \documentclass{article}     \usepackage{fontspec,xunicode}     \usepackage[datamodel=manuscript,bibstyle=verbose,citestyle=verbose]{biblatex}     \bibliography{titi.bib}     \begin{document}     \nocite{*}          \printbibliography     \end{document}      The xelatex runs perfectly. But in my first run of biber (and only at my first run), I obtained these warning. Use of uninitialized value in hash element at               /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 61.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 62.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 61.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 62.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 60.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 61.     Use of uninitialized value in hash element at /var/folders/0g/vh5y8yv93js6v76gmjpnt4mr0000gr/T/par-6d616965756c/cache-1ea1c894d061cba85b64a1b380f6c297de02c7c4/inc/lib/Biber/DataModel.pm line 62.      Is it normal ?


title: Texmaker vs TeXstudio (comparison)

text: I would like to use either **Texmaker** or **TeXstudio** in **Ubuntu 14.04 LTS**. I want to use the latest version available via some PPA (not something installed "by hand" or even compiled!). I would like to use it with texlive- extra version 2014 (also installed via some PPA). The purpose would be to write a bachelor thesis in computer science. I would start writing it by the end of august. The question is which one is more suitable to do the job? I demand a **stable and virtually bug-free** program. I am not that much interested in the features (except for Slovak characters support). I want to use either **IEEE** or **ČSN ISO 690** citation style. I want to use this LaTeX **style**. A year ago I had some problems using this style with Texmaker (mostly with the logo of my university) but they might have resolved already or might have been caused by the older Texlive. According to the comparison both have mostly the same features and are fairly up-to-date.


title: Connect three floating tables with arrows

text: In a word document I have three tables connected by arrows, as in the figure below, that I would like to reproduce with Latex. My question is 1) how to create these three tables so I can position them more or less as in the figure and 2) how to draw arrows connecting cells of different tables. ![image](http://i.stack.imgur.com/shqFk.jpg)


title: How do you install packages from the web directory in CTAN?

text: I wanted to install the package `noweb` so as usual I tried with `tlmgr install noweb` but tlmgr returned a: > package noweb not present in package repository Later I noticed that the `noweb` package is in a separate CTAN directory called `web` and that all the packages in this directory cannot be installed with the standard `tlmgr` command. So, how do I install `noweb` and other `web` packages?


title: Prevent page break without removing vertical space

text: I have a single sentence paragraph that introduces a list, and LaTeX is trying to insert a page break between the paragraph and its list, which I find unacceptable. I can prevent that page break with `\@nobreaktrue`, but then I lose the vertical space between the paragraph and its list. How can I prevent a page break between the paragraph and its list without losing the normal vertical space I'd expect there? MWE:               \documentclass{article}          \makeatletter     \newcommand{\reallynopagebreak}{\par\@nobreaktrue\nopagebreak}     \makeatother          \begin{document}          Paragraph introducing list:\reallynopagebreak{}          \begin{itemize}     \item list     \end{itemize}          \end{document}      Unwanted result, no space between paragraph and list: ![enter image description here](http://i.stack.imgur.com/Fnd0c.png) For now I've just done `\vspace{\baselineskip}` at the end of the paragraph, but surely that's not the best way?


title: Create and set the bibliography

text: I would like to know which package and style would you suggest in order to create the bibliography. I need a bibliography in alphabetic order, that I can edit. I mean, I want the title of the section as "REFERENCES" in Times New Roman 12pt instead of "References" - which is an automatic heading. The bibliography itself has to be in Times New Roman 11pt. Thank you for your attention. Nicolo' p.s. this is what I am using, but I don't know how to change font, sizes etc. \usepackage[round]{natbib} \bibliography{biblio} \bibliographystyle{plainnat}


title: Sublime Text 2: Building Parameter with LaTeX

text: How can I perform a build process of a certain tex file, different from the current one I'm editing with the Sublime Text 2 Editor? I use the Sublime Text 2 Editor with MikTex and Sumatra PDF. My latex work is built out of a main.tex file and separate chapter tex files which are included in the main. My intention is to start a new build process of the main.tex file independent of the current active tex file I'm editing.


title: boxed text between pages in arabic, rightmargin with tikz

text: First, I want to thank the members of the discussion of the message Boxed text between pages which was very interesting for my use, so I got a macro in arabic for my examples (which is right-to-left language), strongly induced from the "2nd version: exercise box with mdframed." (I am finishing a book of probability in arabic...) With some transformations, what you can see in my file-example (where I put two cpies of the same frame, mixing of arabic and english, for watching you some beauty of Latex and tools, what I hope that you see, even if you don't understand the arabic...\RL means right-to-left, and \LR the inverse), I got a good macro and all seems good... else the commands leftmargin=, rightmargin=, which have absolutely no effect in my file, you can put all the values that you want it does not change anything, and you can see on he example that the result is very bad. Someone knows the reason of that and the way to make it as usual? Many thanks. Faouzi Here's my file-example               \documentclass[14pt,a4paper]{extbook}%{article}%     \usepackage{amsmath,amssymb}     \usepackage[framemethod=TikZ]{mdframed}                              %\usepackage[dvips]{graphicx}     \usepackage{boxedminipage}     \usepackage{slashbox} % PROBLEME     %%\usepackage{diagbox} %% POUR REMPLACER SLASHBOX ?          \usepackage{titlesec}     \usepackage{xcolor}     \usepackage[framemethod=TikZ]{mdframed}          %\usepackage{amssymb}     %\usepackage{amsmath}     \usepackage{enumitem}          \usepackage{minitoc}           \usepackage{rotating}          \usepackage{fmultico}     \setlength{\columnseprule}{0.1pt}          \usepackage{fancyhdr}     \pagestyle{fancy}                         \usepackage{polyglossia}     \setmainlanguage[numerals=maghrib]{arabic}     \setotherlanguage{english}          \newfontfamily\arabicfont[Script=Arabic, AutoFakeSlant=-0.02]{Amiri}     %%\let\arabicfonttt\ttfamily     \setsansfont[Script=Arabic,Scale=1.5]{Amiri}                    \tikzstyle{titlered} =         [draw=black, thick, scale=.7, fill=white,%              line width=0.1pt, text=black, rectangle,               left, minimum height=.5cm]               \newcounter{example}     \renewcommand*\theexample{\RL{مثال~\arabic{section}\alph{example}}}               \makeatletter     \mdfdefinestyle{examplestyle}{%         outerlinewidth=1em,%         outerlinecolor=white,%         leftmargin=-1em,%         rightmargin=-1em,%         middlelinewidth=1.2pt,%     %    roundcorner=5pt,%         linecolor=gray!20,%         backgroundcolor=white,%         innertopmargin=1.2\baselineskip,     %    skipabove={\dimexpr0.5\baselineskip+\topskip\relax},         skipabove={\dimexpr1\baselineskip\relax},         skipbelow={0em},         needspace=3\baselineskip,         frametitlefont=\sffamily\bfseries,         settings={\global\stepcounter{example}},         firstextra={%                 \node[titlered,xshift=-1cm] at (P-|P) %                         {\RL{~{\mdf@frametitlefont{\theexample}}~}};},%         singleextra={%     %        \node[titlered,xshift=1cm] at (P-|O) %              \node[titlered,xshift=-1cm] at (P-|P) %                 {\RL{~{\mdf@frametitlefont{\theexample}}~}};}     }     \makeatother                    \newenvironment{example}%     {\begin{mdframed}[style=examplestyle]}{\end{mdframed}}                              \newcommand{\SomeText}{%         To calculate the horizontal position the kinematic differential         equations are needed:             \begin{align}                 \dot{n} &= u\cos\psi -v\sin\psi \\                 \dot{e} &= u\sin\psi + v\cos\psi             \end{align}         For small angles the following approximation can be used:             \begin{align}                 \dot{n} &= u -v\delta_\psi \\                 \dot{e} &= u\delta_\psi + v             \end{align}     }          \newcommand{\SomeOtherText}{%         To calculate the horizontal position the kinematic differential         equations are needed:             \begin{align*}                 \dot{n} &= u\cos\psi -v\sin\psi \\                 \dot{e} &= u\sin\psi + v\cos\psi             \end{align*}         For small angles the following approximation can be used:             \begin{align*}                 \dot{n} &= u -v\delta_\psi \\                 \dot{e} &= u\delta_\psi + v             \end{align*}     }                    \begin{document}              \begin{example}         \SomeText          تحديد ما إذا كان الفريق قد تعامل بصفة جيدة مع كل المباريات، تلك التي من المرجح أن     يفوز بها، و المباريات الأخرى. يمكن التعمق في هذه المسألة عبر حساب عدد سلسلات النجاح ثم التثبت مما إذا كانت هذه النتيجة محتملة أم لا، عندما كل ال      $(n + m)!/(n! \ m!)$      ترتيبات ل      $n$       نجاح و       $m$       خسارة، متساوية الاحتمالات...          المتغيرات العشوائية، التي قيمها تنتمي إلى مجموعة      \textit{على الأكثر قابلة للعد (أو  تعدادية)}       (أي تعدادية أو منتهية)، تسمى المتغيرات العشوائية المنفصلة، أو المتقطعة. لمتغير عشوائي منفصل       $X$،       نعرف ب\textit{دالة الأوزان الاحتمالية}       ل $X$       $p(a)$ ،     \begin{equation*}     p (a) = P \{X = a\}     \end{equation*}     دالة الأوزان الاحتمالية       $p(a)$       هي دالة موجبة لقيم        $a$،       على الأكثر تعدادية.        أي أن، إذا         $X$         يأخذ واحدة من القيم          $x_{1}, x_{2}, \dots$،          فإن       \begin{alignat*}{4}     &p(x_{i}) \geq 0 &&\quad \ i = 1, 2, \ldots\\     &p(x) = 0 &&\quad\mbox{\RL{ لكل القيم الأخرى ل          $x$ } }     \end{alignat*}          \LR{\SomeOtherText}                   \end{example}              \begin{example}         \SomeText          تحديد ما إذا كان الفريق قد تعامل بصفة جيدة مع كل المباريات، تلك التي من المرجح أن     يفوز بها، و المباريات الأخرى. يمكن التعمق في هذه المسألة عبر حساب عدد سلسلات النجاح ثم التثبت مما إذا كانت هذه النتيجة محتملة أم لا، عندما كل ال      $(n + m)!/(n! \ m!)$      ترتيبات ل      $n$       نجاح و       $m$       خسارة، متساوية الاحتمالات...          المتغيرات العشوائية، التي قيمها تنتمي إلى مجموعة \textit{على الأكثر قابلة للعد (أو  تعدادية)}       (أي تعدادية أو منتهية)، تسمى المتغيرات العشوائية المنفصلة، أو المتقطعة. لمتغير عشوائي منفصل       $X$،       نعرف ب\textit{دالة الأوزان الاحتمالية}       ل $X$       $p(a)$ ،     \begin{equation*}     p (a) = P \{X = a\}     \end{equation*}     دالة الأوزان الاحتمالية       $p(a)$       هي دالة موجبة لقيم        $a$،       على الأكثر تعدادية.        أي أن، إذا         $X$         يأخذ واحدة من القيم          $x_{1}, x_{2}, \dots$،          فإن       \begin{alignat*}{4}     &p(x_{i}) \geq 0 &&\quad \ i = 1, 2, \ldots\\     &p(x) = 0 &&\quad\mbox{\RL{ لكل القيم الأخرى ل          $x$ } }     \end{alignat*}          \LR{\SomeOtherText}                   \end{example}        \end{document}


title: Follow up to underline subsections - incompatibility between lineno, sectsty, and ulem

text: In answering the question Underline subsections, I provided an answer which relied on the `sectsty` package (as compared to @GonzaloMedina's answer, which used the `titlesec` package). Ultimately, @GonzaloMedina's answer was more helpful, as the OP was also using `lineno` to number lines and it seems that there is no incompatibility between this package and `titlesec` and `ulem`, whereas there **is** an apparent joint incompatibility between `sectsty`, `lineno`, and `ulem`. Specifically, it seems that, at least when you use any of the commands made available by `sectsty` to modify the appearance of sections ( _e.g._ , `\allsectionsfont{}`, `\sectionfont{}`, `\subsectionfont{}`, _etc._ ) **in combination with** `ulem` and `\underline`, an issue arises that prevents the compilation of the document. I have not been able to figure out why this is so, let alone whether there is any workaround. I'm mostly curious why it is happening (for the sake of learning), though if you can provide a workaround as well, that would be awesome. Here's an MWE that will crash:               \documentclass[11pt]{article}     \usepackage[normalem]{ulem}     \usepackage{sectsty}     \subsectionfont{\normalfont\large\itshape\underline} % document compiles fine without this line and/or without the \underline command in this line          \usepackage{lineno}     \linenumbers % or without this line; both lines, however, cause the compilation to crash          \begin{document}     \section*{Materials and Methods}     \subsection*{Sampling}     \subsection*{A very long sectional heading title that will probably have to be split over two lines}     Lorem ipsum     \end{document}      And the error message: > ./test-sectsty.tex:11: Improper \prevdepth. \prevdepth > > l.11 \subsection*{Sampling} > > ? ./test-sectsty.tex:11: Emergency stop. \prevdepth > > l.11 \subsection*{Sampling} The documentation for `sectsty` does say the following (p. 16): > The `sectsty` package works by blindly re-defining the various sectioning > commands, so any package that requires that LaTeX's sectioning commands are > precisely as they are defined in the standard classes will have trouble > working with `sectsty`. > > The `fncychap` package, for example, re-defines the code that produces > chapter headings. If you use `fncychap` with `sectsty`, you will have to > load `fncychap` after `sectsty`: >   >   >     \usepackage{sectsty} >     \usepackage{fncychap} >   So, my suspicion is that this particular functionality of `sectsty`, somehow in conjunction with the way that the underlining works, is the culprit. However, changing the order in which `lineno` (and `\linenumbers`) are loaded/issued relative to loading `sectsty` and issuing one of the section font commands made available by `sectsty` and containing `\underline` doesn't change anything; the code still crashes. Is my suspicion correct? If not, what's going on? If it is correct, can you provide a more detailed explanation of the incompatibility between these packages? And, if you're feeling adventurous (and if it's even possible), what is a workaround to the incompatibility?


title: Beamer: allowframebreaks collides with columns?

text: I'm doing a scientific presentation with the beamer package and have two columns (the left one with text, the right one with several images) that are too long for one frame. I want to use `[allowframebreaks]` . The code does compile, but in the resulting pdf, the text and images just disappear under the bottom of the frame and no new frame is made. Here's an example code:               \documentclass[18p]{beamer}          \newcommand{\graph}[2]{     \begin{figure}[H]       \begin{center}       \includegraphics[scale=#2]{#1} % #1= Name, #2=Size     \end{center}      \end{figure} }          \begin{frame}[allowframebreaks]{Analysis}     \begin{columns}       \column{0.5\textwidth}         \begin{itemize}           \item Once upon a time           \item in the magical land           \item of Equestria,           \item there were two regal sisters           \item who ruled together           \item and created harmony for all the land.           \item To do this,           \item the elder used her           \item unicorn powers           \item to raise the sun at dawn.           \item The younger           \item brought out the moon           \item to begin the night.          \end{itemize}       \column{0.5\textwidth}         \graph{rainbowdash.jpeg}{0.5}         \graph{20percentcooler.jpeg}{0.2}         \graph{molestia_hot_plot}{0.3}         \graph{cupcakes.jpeg}{0.6}     \end{columns}     \end{frame}          \end{document}      Is there any possibility to use [allowframebreaks] and columns at the same time? Thanks! dervonnebenaan


title: Is it good/bad style to use \label in preamble or package/class file?

text: I would like to use `\label`s to organize a package file that has become too long to be navigated by simple scrolling. It seems that this doesn't cause any errors, but I'm not sure if that's good coding style. After all, I can't reference the preamble/package/class, isn't it? So, is this good style, or bad style? Are there any other/better ways to organize a style file so that my editor can aid me navigating it?


title: biblatex-apa: Multiple citations in the same parentheses with the same first author, but different co-authors get condensed

text: @MISC{john_big_1991,       author = {John, Oliver P. and Donahue, E. M. and Kentle, R. L.},       title = {The Big Five Inventory--Versions 4a and 54},       date = {1991},       langid = {american},       publisher = {Berkeley, {CA:} University of California, Berkeley, Institute of         Personality and Social Research}     }          @INCOLLECTION{john_paradigm_2008,       author = {John, Oliver P. and Naumann, Laura P. and Soto, Christopher J.},       editor = {John, Oliver P. and Robins, Richard W. and Pervin, Lawrence A.},       title = {Paradigm Shift to the Integrative Big Five Trait Taxonomy: History,         Measurement, and Conceptual Issues},       booktitle = {Handbook of personality: theory and research},       date = {2008},       edition = {3},       publisher = {Guilford Press},       location = {New York},       isbn = {9781593858360},       pages = {114-158},       langid = {american}     }      These two BibLaTeX entries cited within the same parentheses with...               \parencite{john_big_1991, john_paradigm_2008}      ...lead to the following citation output: > (John, Donahue & Kentle, 1991, 2008) As the co-authors clearly aren't the same although the first author is, I guess this shouldn't happen. My Babel and BibLaTeX settings are as follows:               \usepackage[american,ngerman]{babel}     \usepackage[         style=apa,         sortcites=true,         sorting=nyt,         backend=biber,         autolang=other         ]{biblatex}     \DeclareLanguageMapping{ngerman}{ngerman-apa} % for language switching     \DeclareLanguageMapping{american}{american-apa} % for language switching      I also suppress some fields like url and redefine some bibliography strings, but I assume that this shouldn't be the root of the reported problem. Also, if I inverse the citation...               \parencite{john_paradigm_2008, john_big_1991}      ...and deactivate sorting, my output will be: > (John, Naumann & Soto, 2008, 1991) Is there any BibLaTeX setting I've missed that fixes this problem or is this the expected behavior? * * * **EDIT:** I'd expect the first multiple citation to look like this: > (John, Donahue & Kentle, 1991; John, Naumann & Soto, 2008) I really got no idea of how potential subsequent multiple citations with the same references should look like. The following would at least seem odd, as stated by moewe in his answer below: > (John et al., 1991; John et al., 2008)


title: Tocloft customizations not working for algorithm's list

text: I have been fighting with tocloft to get it to apply some customizations across all the listings, but it seems that they only work for the default ones like "tocs", "lofs" and "lots". For the ones defined by me or the ones like algorithms with its own "loa" it does not work:               \documentclass{book}         \usepackage{tocloft}         \usepackage{algorithm2e}         \usepackage{lmodern}         \usepackage[T1]{fontenc}         \usepackage{xcolor}         \definecolor{red}{RGB}{180,40,50}              \makeatletter         \begingroup           \let\newcounter\@gobble           \let\setcounter\@gobbletwo           \globaldefs\@ne           \let\c@loadepth\@ne           \newlistof{algorithmt}{loa}{\listalgorithmcfname}         \endgroup         \let\l@algorithm\l@algorithms         \makeatother              \renewcommand\cftdotsep{0}         \renewcommand\cftdot{\color{red}\_}              \renewcommand\cftalgorithmtdotsep{0}         \renewcommand\cftalgorithmtleader{\color{red}\_}                   \begin{document}                  \tableofcontents             \listofalgorithms             \addcontentsline{toc}{chapter}{List of Algorithms}             \listoftables             \addcontentsline{toc}{chapter}{List of Tables}                  \chapter{chapter one}                 \section{section one}                     \begin{table}                     \centering A                     \caption{test table}                     \end{table}                          \begin{algorithm}                     \centering A                     \caption{test algorithm}                     \end{algorithm}                  \chapter{chapter two}                 \section{section one}                     \begin{table}                     \centering A                     \caption{another test table}                     \end{table}                          \begin{algorithm}                     \centering A                     \caption{another test algorithm}                     \end{algorithm}              \end{document}      ![enter image description here](http://i.stack.imgur.com/c4vCB.png)


title: How to change the text font without changing the font for equations

text: How to change the text font in a document to "Times" and keep the font for equations unchanged (i.e Computer Modern)?


title: TeX Live unable to call inkscape (SVG Package)

text: I am working with a fresh install (from source) of TeX Live on Ubuntu Server 13.10. I would like to use the svg package to allow SVG files to be directly included. In the background, the svg package calls inkscape to generate pdf_tex files at runtime. inkscape was installed using the package manager (after Tex Live was installed), and is in the PATH. inkscape can be called from the shell, without any issues. On Windows (MikTeX), simply having inkscape in the path is sufficient. However, it appears that pdflatex is unable to call inkscape. I am calling inkscape with `pdflatex -synctex=1 -interaction=nonstopmode "document".tex --shell-escape` MWE:               \documentclass{article}     \usepackage{svg}     \begin{document}         I am a document         \includesvg{Figure}     \end{document}      (With Figure.svg in the same folder) Output:               runsystem(inkscape -z -C -f./Figure.svg -A./Figure.pdf --export-latex)...disabl     ed (restricted).                    ! LaTeX Error: File `./Figure' not found.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.6     \includesvg{Figure}          I could not locate the file with any of these extensions:     .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.               ! LaTeX Error: File `./Figure' not found.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.6     \includesvg{Figure}          I could not locate the file with any of these extensions:     .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.               ! LaTeX Error: File `Figure.pdf_tex' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: pdf_tex)          Enter file name:     ! Emergency stop.     <read *>          l.6     \includesvg{Figure}                             ^^M     *** (cannot \read from terminal in nonstop modes)      The `runsystem()...disabled (restricted).` error is what troubles me.


title: Left aligned multi line equations and \newenvironment

text: I'm building a table of integrals, for my own use. I need simple things: equations must be left aligned, sometimes I need alignment on the equal symbol and to save space sometimes I need 2 equations on the same line.               \begin{fleqn}[0pt]     \setlength{\jot}{6pt}     \begin{align*}         &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\         &\int f(x) \ldots \mbox{long expression here} \ldots dx = F(x) + C \\         &\int f(x) dx = F(x) + C &&\int f(x) dx = F(x) + C \\         &\int f(x) \ldots \mbox{long expression here} \ldots dx = F_1(x) + C =  \\         &\qquad\qquad = F_1(x) + C \\     \end{align*}     \end{fleqn}      First I'm not satisfied, I can't set the point of alignment with 2 equations in one line and I can't align the equations on the equal sign. Most environment (`tabular`, `tabbed`, `split`,...) do only one job and when I try to mix them I always get some errors. Second I would like to create a new environment with               \newenvironment{mathtable}     { \begin{fleqn}[0pt] \setlength{\jot}{6pt} \begin{align*} }     { \end{align*} \end{fleqn} }      But it show me an error, it seems I can't use `align` inside `newenvironment`. Did a lot of research, used the environ package, used `\csname` and so on, but I don't know how to build this environment.


title: hyperref Warning: Draft mode on

text: I'm trying to get `hyperref` to work with `pdflatex`, but I'm getting the error `hyperref Warning: Draft mode on` and since all hyperrefs are disabled in draft mode, there are no links being created. I tried doing the following: `\usepackage[final]{hyperref}` but still no success. I'm using document class `book`: `\documentclass{book}` so nowhere do I say that I want draft enabled. Tried compiling on two different machines with `TexnicCenter` using `pdflatex`(LaTeX=>PDF). Any suggestions?


title: How to highlight a path using TikZ?

text: Say I have an arrow leading pointing from one node to another node under TikZ. Is there a way to highlight this arrow? I'm looking for a result that looks (more or less) as though I've printed a diagram and used a highlighter marker to accentuation an arrow. Preferably, only the arrow would be highlighted.


title: Standard command for "acid free paper" symbol?

text: As I complete the masthead for a book, I see that the publisher has sent me a `.png` for the new (to me) "printed on acid free paper" symbol — there's a version of it on Wikipedia, ![enter image description here](http://i.stack.imgur.com/lKPco.png) but after a quick and lazy search I haven't found any discussion about the history or status of the symbol. I also don't find "acid" in the Unicode character index (accessed 20120919), so I'm guessing this thing hasn't made it into Unicode yet. Is there a standard LaTeX command to generate it? Or shall I make do with `\includegraphics`? * * * **Edit** : The forms I've seen look like the Arabic numeral 8 rotated counterclockwise 90° and placed in a circle. I wonder if an infinity sign is not actually what is intended, rather than an eight. But I'm not sure who to ask. **Edit 2** : Actually, the publisher has identified it as U+267E, so that gives me another way to enter it. In the several fonts where OS 10.8 finds it present, it is indeed an infinity-sign inside.


title: How to write something underneath \min?

text: How to type this expression, where has `\min` on top and `\forall` at the bottom? ![](http://i.stack.imgur.com/359cV.gif)


title: is there an option in latexdiff to ignore whole environments?

text: I need to highlight the difference between two rather complex math tex-files and get a lot of errors. The files are complex in the math equations, fair enough to get errors, but what if I would like `latexdiff` to only compare the text OUTSIDE the `\begin{align}` ... `\end{align}` environment? Can one specify to exclude/ignore certain environments?


title: Caption won't stick to table - gets centered

text: I'm trying to create a table with a caption on top of it, with the caption centered to the table. I have this code:               \documentclass[a4paper]{article}          \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage[colorinlistoftodos]{todonotes}     \usepackage{float}          \title{Your Paper}     \author{You}          \begin{document}     \maketitle          \begin{table}[H]     \caption{This is a caption}     \begin{tabular}{|c|c|}     \hline     a & 1\\ \hline     b & 2\\ \hline     c & 3\\ \hline     d & 4\\ \hline     \end{tabular}     \end{table}          \end{document}      What this does is create a table to the left of the paper (where I want it), but the caption appears in the center of the page, far from the table. I can center the table, of course, all looks fine, but I do need the table on the left of the page. I searched around for similar problems, but what mostly found were people wanting to center tables, and I want quite the opposite, to uncenter the caption. Anyway, I did not find a solution to this problem so, if you can help, I appreciate it. _Also: I am working in writelatex.com, if this helps_


title: limiting expansion in marks

text: I'm trying to pass something complex (e.g. `tabular`) to output procedure through `marks`. Is there any natural way to protect from expansion everything that should be protected (presumably because of not-long definitions)? Example that does not work without `\noexpand`'s               \documentclass{book}          \usepackage{mdwtab}     \begin{document}          \leavevmode          \markright{\noexpand\begin{tabular}{|p{2cm}<{\noexpand\centering}|}\noexpand\hlx{hv} Row 1 \\ Row 2\\\noexpand\hlx{vh}\noexpand\end{tabular}}          \end{document}


title: Inverting a colormap in pgfplots

text: I am trying to obtain an inverted version of a given colormap to use in the colorbar of a plot. The code below achieves this specifically for the blackwhite colormap. However, I was looking for a more general method which would only require the name of the colormap to be inverted.               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \begin{axis}[colorbar, colormap={}{ gray(0cm)=(1); gray(1cm)=(0);}]     \addplot[mesh,thick] {x^2};     \end{axis}     \end{tikzpicture}          \begin{tikzpicture}     \begin{axis}[colorbar, colormap={}{ gray(0cm)=(0); gray(1cm)=(1);}]     \addplot[mesh,thick] {x^2};     \end{axis}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/6T9Rm.png)


title: Problem with cross referencing using gather environment

text: I am using gather environment to write bunch of equations. When I try to cross-reference those equations, the equation number doesn't show up. Here is my code               \documentclass[12 pt]{article}     \usepackage{fullpage}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{subfigure}     \usepackage{float}     \usepackage{setspace}     \usepackage{longtable}     \usepackage{lscape}     \usepackage{color}     \usepackage{tabularx}     \usepackage{multirow}     \usepackage{caption}     \usepackage{array}     \makeatletter     \newcommand*{\compress}{\@minipagetrue}     \makeatother     \doublespacing          \begin{document}          \begin{gather}\label{eq:1}         a=1  \nonumber \\         b=1     \end{gather}     Equation \ref{eq:1}     \end{document}      The equation number is supposed to show up after "Equation" but its missing. What could be the problem? If I remove `\nonumber` then thing seems to work fine but I need `\nonumber`.


title: Amsart with 14pt possible?

text: If I try `\documentclass[14pt,reqno,a4paper]{amsart}` I just get the default which is less than 12pt. I tried to switch to the _memoir class_ but there were so many changes I had to do that I gave up on switching the class. Is there any way to get 14pt for the amsart class?


title: To have L^{p} in Bibtex?

text: One article has words `$L^{p}$` boundedness in the title. **How can you have such an operator in Bibtex?**


title: Define a New Macro via a Macro Using xparse Syntax

text: I am trying to set up a macro that defines a macro that is to be executed only once. With what I learned from Define a Macro via Macro if Given Macro is not defined I can do that via the `\expandafter\newcommand` syntax. And indeed the MWE as below works and produces the desired output: ![enter image description here](http://i.stack.imgur.com/OfF3G.png) where the subsequent `\HelloWorld` and `\HelloDude` are ignored. What I would like to do, is to learn how to use `\NewDocumentCommand` (instead of `\newcommand`) to define this new macro via a macro. My attempt (requires you to _uncomment_ the `\def` at the top of the file) fails with > Illegal parameter number in definition of \reserved@a Furthermore, am wondering if there is a way to define repeated parameters. That is instead of `{m m}` can I use something similar to with `tabular` where one can say `\begin{tabular}{r*{3}{l}r}` which is the identical to `\begin{tabular}{rlllr}`. This would save me from having to use `\IfEqCase`for each possible number of parameters. I personally only need up to 3 so am ok with the slight duplication of code below, but though I'd ask in case there was some other syntax that I am not aware of. ## Notes:   * You need to _uncomment_ the `\def` at the top to get the MWE below to fail. ## Refernces   * Define a Macro via Macro if Given Macro is not defined   * Defining Extensible macros ## Code:               %% Uncomment the following \def to get the failing test case.     %\def\UseXparseForDefiningMacro{}% Works if commented out (in which case \newcommand{}{} is used to define macro)     \documentclass{article}     \usepackage{etoolbox}     \usepackage{xstring}     \usepackage{xparse}     \usepackage{xcolor}          \makeatletter     \NewDocumentCommand{\DefineMeAMacroThatExecutesOnlyOnce}{m m m}{%         % #1 = csname to use         % #2 = number of parameters         % #3 = code to execute         \newtoggle{AlreadyIssued#1}%         \togglefalse{AlreadyIssued#1}%         \ifdefined\UseXparseForDefiningMacro             \IfEqCase{#2}{%                 {0}{\expandafter\NewDocumentCommand\csname#1\endcsname{     }{% No paramater version                         \iftoggle{AlreadyIssued#1}{}{%                             #3%                           Never executed this macro so go ahead an execute it,                             \toggletrue{AlreadyIssued#1}% and remember that we did (so we don't do it again).                         }%                     }}%                 {1}{\expandafter\NewDocumentCommand\csname#1\endcsname{  m  }{% 1 paramater version                         \iftoggle{AlreadyIssued#1}{}{%                             #3%                           Never executed this macro so go ahead an execute it,                             \toggletrue{AlreadyIssued#1}% and remember that we did (so we don't do it again).                         }%                     }}%                 {2}{\expandafter\NewDocumentCommand\csname#1\endcsname{ m m }{% 2 paramater version                         \iftoggle{AlreadyIssued#1}{}{%                             #3%                           Never executed this macro so go ahead an execute it,                             \toggletrue{AlreadyIssued#1}% and remember that we did (so we don't do it again).                         }%                     }}%             }%         \else% ---------------------------------------------  This works!!             \expandafter\newcommand\csname#1\endcsname[#2]{%                 \iftoggle{AlreadyIssued#1}{}{%                     #3%                           Never executed this macro so go ahead an execute it,                     \toggletrue{AlreadyIssued#1}% and remember that we did (so we don't do it again).                 }%             }%         \fi     }     \makeatother          \DefineMeAMacroThatExecutesOnlyOnce{HelloWorld}{0}{% Does not take any parameters         Hello World!%     }          \DefineMeAMacroThatExecutesOnlyOnce{HelloDude}{1}{% Take 1 parameter         Hello \textcolor{red}{#1}.%     }          \begin{document}          %% Section 1: Works if \UseXparseForDefiningMacro is NOT defined     \HelloWorld     \HelloWorld          %% Section 2: Works if \UseXparseForDefiningMacro is NOT defined     \HelloDude{Peter}     \HelloDude{John}          \end{document}


title: Tikz Nodes Order and Shapes with a General Number of Nodes

text: This is part 2 of Tikz Nodes Positions and Shapes with a General Number of Nodes, a question I was asked to split. Please refer to the code below. In the table below I'd like to: **Control the direction in which the numbers are running** At this time, the numbers go something like this: 81 82 83 84 85 86 87 88 89 90 But I'd be interested in experimenting with: 81 82 83 84 85 90 89 88 87 86 An already existing example or a sketch would be more than enough. Ultimately it would be fun to design winding paths, like in kids' board games. A board game is actually what I'm working towards, at a snail's pace.               \RequirePackage[svgnames,x11names]{xcolor}     \documentclass[tikz,convert=false,margin=0pt]{standalone}%     \usepackage{rotating}% sideways environment          \begin{document}%     \begin{tikzpicture}[%       every node/.style = {         align = center         , scale = 2         , anchor = base         , font = \fontfamily{pzc}\selectfont% common font         , text = black       }     ]%     %       % Set Grid Dimensions        \newcommand{\xa}{1}       \newcommand{\xb}{5}       \newcommand{\ya}{1}       \newcommand{\yb}{5}       \pgfmathsetmacro{\yc}{\yb-1}% \yb minus one     %        % Change styles of numbers according to set membership       \foreach \x in {\xa,...,\xb}         \foreach \y in {\ya,...,\yb}             {\pgfmathtruncatemacro{\label}{\x - \xb * (\y - \yb) }              \node (\x\y) at (1.5*\x, -1.5*\y) {\label};}        \foreach \x in {\xa,...,\xb}         \foreach \y [count = \yi] in {\ya,...,\yc}           \draw (\x\y)(\x\yi) (\y\x)(\yi\x) ;     \end{tikzpicture}%     \end{document}%      ![enter image description here](http://i.stack.imgur.com/5WUqr.png)


title: How to add columns optionally per section

text: How would I add optional columns under a section. e.g. (fyi image from a random online resume): ![](http://i.imgur.com/OAb43MB.png) So if I decide to remove any of the years listed, the text should not shift.


title: How to split a long table into pages with multicolumn in each page?

text: I have a very long table (64 rows) with 14 columns. I split it with lontable package, but it keeps error for multicolumn syntax. Any suggestion please? part of the table is here: And I couldn't figure out how to put "continued from the previous page" in between?               \documentclass{article}          \usepackage{longtable}     \usepackage{pdflscape}     \usepackage{graphicx}           \begin{document}          \begin{longtable}{ccccccc|ccccccc}     \caption{\textbf{State Table for the proposed network}}\\      \label{table: state table proposed net.}           \multicolumn{14}{c}{n=0} \\     \hline                e & f & o & h & c & g & r & E & F & O & H & C & G & R  \\      \hline         0 & 0 & 0 & 0 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 0 & 0 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 0 & 0 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 0 & 0 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%1         0 & 0 & 0 & 0 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 0 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 0 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 0 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%2         0 & 0 & 0 & 1 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%%3         0 & 0 & 0 & 1 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 0 & 0 & 1 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%4         0 & 0 & 1 & 0 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           %%%%%%5         0 & 0 & 1 & 0 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 0 & 1 & 0 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           %%%%%%6         0 & 0 & 1 & 1 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          %%%%%%7         0 & 0 & 1 & 1 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 0 & 1 & 1 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          %%%%%%% 8          0 & 1 & 0 & 0 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 0 & 0 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 0 & 0 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 0 & 0 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%%9         0 & 1 & 0 & 0 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 0 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 0 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 0 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%10         0 & 1 & 0 & 1 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%11         0 & 1 & 0 & 1 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         0 & 1 & 0 & 1 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\         %%%%%%%12         0 & 1 & 1 & 0 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           %%%%%%%13         0 & 1 & 1 & 0 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           0 & 1 & 1 & 0 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\           %%%%%%14         0 & 1 & 1 & 1 & 0 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 0 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 0 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 0 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          %%%%%%%15         0 & 1 & 1 & 1 & 1 & 0 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 1 & 0 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 1 & 1 & 0 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\          0 & 1 & 1 & 1 & 1 & 1 & 1 &  $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ & $K_{e}$ \\            %%%%%%%16     \end{longtable}          \end{document}


title: x86-64 assembler language dialect for the listings package

text: I'm writing a paper with a lot of x86-64 code listings in it. Unfortunately, the _listings_ package itself does not have support for x86-64 instructions and register names (which are just named different than the 32 bit counterparts). Does anyone have the code to configure the package to support that?


title: Consistent Pgfplot Labels Positions with/without Gnuplot

text: I like that I can place a node at the end of plot and the node appears relative to the last point on the graph. When the domain is specified in **increasing** order `\DomainMin:\DomainMax`, the label gets placed exactly where I want it -- both with, and without `gnuplot` (see Graphs 1 and 2): ![enter image description here](http://i.stack.imgur.com/b8be2.png) However, when the domain is specified in **decreasing** order `DomainMax:\DomainMin`, I get the label where I want it if I use PGF to compute the coordinates (See Graph 3), but it is in the wrong place when I use `gnuplot` (See Graph 4). I suspect this is because `gnuplot` ignores the order the start and end of the domain are specified and computes coordinates in increasing x order. ![enter image description here](http://i.stack.imgur.com/BPSNV.png) I tried to use `pos=0` thinking that it would place the label at the point I want, but this not quite the case -- it appears quite a bit lower, but don't know why. ![enter image description here](http://i.stack.imgur.com/2ju9U.png) So, is there a way I can use `gnuplots` place the label the same place that `pgfplots` places it when I specify the domain in decreasing order? Here is the code that produces the above 5 graphs:               \documentclass[border=5pt]{standalone}     \usepackage{pgfplots}          \newcommand*{\XAxisMin}{-1.0}     \newcommand*{\XAxisMax}{3.0}     \newcommand*{\YAxisMin}{-2.0}     \newcommand*{\YAxisMax}{10}          \newcommand*{\DomainMinF}{\XAxisMin}     \newcommand*{\DomainMaxF}{2.2}     \newcommand*{\PlotLabel}{$y=x^3$}%               \pgfkeys{/pgfplots/Axis Style/.style={         clip=false,% so that we can see labels placed outside         xmin=\XAxisMin, xmax=\XAxisMax,         ymin=\YAxisMin, ymax=\YAxisMax,          width=6.5cm     }}          % Gnuplot options here  have no effect if not using GnuPlot     \pgfkeys{/pgfplots/Plot Style/.style={         translate gnuplot=true,% can use ‘^’ instead of ‘**’         id=foo,         mark=none,%         domain=\DomainMinF:\DomainMaxF,%         samples=50,%         ultra thick,     }}          \newcommand*{\AddLabel}[1]{\node [align = center] at (axis cs: 0.4,5) {#1};}%          \begin{document}     With increasing domain=$\DomainMinF:\DomainMaxF$, we get label at the end of the graph as desired:          \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, blue, domain=\DomainMinF:\DomainMaxF]             {(x)^3} node [right] {\PlotLabel};%         \AddLabel{1. without \\ Gnuplot}     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, red, domain=\DomainMinF:\DomainMaxF]             gnuplot% Use Gnuplot for Graph 2             {(x)^3} node [right] {\PlotLabel};%         \AddLabel{2. with \\ Gnuplot}     \end{axis}     \end{tikzpicture}          \bigskip     But, with decreasing domain=$\DomainMaxF:\DomainMinF$, we get the label in the wrong spot with Gnuplot:          \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, blue, domain=\DomainMaxF:\DomainMinF]             {(x)^3} node [right] {\PlotLabel};%         \AddLabel{3. without \\ Gnuplot}     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, red, domain=\DomainMaxF:\DomainMinF]             gnuplot% Use Gnuplot for Graph 4             {(x)^3} node [right] {\PlotLabel};% adding pos=0.0 does not work         \AddLabel{4. with \\ Gnuplot}     \end{axis}     \end{tikzpicture}          \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, red, domain=\DomainMaxF:\DomainMinF]             gnuplot% Use Gnuplot for Graph 5             {(x)^3} node [right, pos=0.0] {\PlotLabel};         \AddLabel{5. with \\ Gnuplot (pos=0.0)}     \end{axis}     \end{tikzpicture}     \end{document}


title: Show/hide the sections, subsections and subsections that I want from the navigation sidebar (beamer, Berkeley)

text: I am using the theme `Berkeley`, I have lot of sections and subsections, I want to hide certain sections, subsections and subsubsections from the navigation bar, but not from the table of contents. If I use `\usetheme[hideothersubsections]{Berkeley}`, then it will hide all the subsections from the navigation bar. I need to hide the the section, subsection, the subsubsection I want. How could I do that?


title: Superscript page numbers with natbib

text: I'm with an annoying problem with `natbib`. When the `super` parameter is used, the citation happily goes superscript but the page or chapter number doesn't.               \documentclass{article}     \usepackage[numbers, square, super]{natbib}     \begin{document}         Some information.\cite[p.~56]{who09}              \begin{thebibliography}{0}             \bibitem{who09} Who J F. Nice Book. 2009.         \end{thebibliography}     \end{document}      The above example shows the page number into normal text instead of superscript. Removing `super` the page goes into brackets.


title: How to place minitoc in right place where some chapters are with star?

text: I have a `main.tex` file. There is a part called front matter. Part of the code is, 1.               \frontmatter     \selectlanguage{english}     \include{title}     \include{dedication}     \include{acknowledgements}     \include{abstract}       And I have files called `title.txt` ... `abstract.txt` 2. The acknowledgement file looks like,               \chapter*{Acknowledgements}\addcontentsline{toc}{chapter}{Acknowledgements}      My text here..      3. The abstract file looks like               \chapter*{abstract}\addcontentsline{toc}{chapter}{Abstract}      My text here..      Main body, or main matter looks like,               \mainmatter     \include{ch1}      \include{ch2}     \include{ch3}       ch1, ch2 and ch3 has minitoc.               \chapter{This is title of chapter 1}     \minitoc       Now, for example, after I have added this `\include{abstract}` and `\include{ack...}` in the `main.tex` The minitoc disappeared from chapter 1 and chapter 2. But in chapter 3, first minitoc appeared but, this minitoc was about chapter 1. May be this is something to do with the chapter command with the start.               \chapter*{Acknowledgements}\addcontentsline{toc}{chapter}{Acknowledgements}       But how can I fix it? [How can I have minitoc of chapter 1, in right place?]


title: An old italian translation of The TeXbook

text: DEK once said (TUGboat Volume 13 (1992), No. 4, page 423): > _The TeXbook_ has been translated not only into Japanese, but also into > Italian (though not yet published in Italian). The people who did the > translation are actually prisoners, political prisoners thrown into jail in > the '70's because they were liberal activists. But they're in a minimum > security prison, so they're supposed to work for their living. > > This one group decided that their job was going to be to typeset mathematics > with TeX for the Italian Mathematical Society; so they did this. They sent > me a letter explaining how they're prisoners, and they enclosed a laser- > printed copy of the entire _TeXbook_ translated into Italian, 500 pages of > it, a beautiful job. They claim they are enjoying their prison life because > of TeX. What could be nicer? Is there someone who knows something more about this translation? Is there any web link?


title: Tocloft + KOMA, get rid of numberings in table of content, but keep them in the content and in other lists such as list of figures

text: I am using the documentclass scrbook (KOMA) with tocloft and would like to get rid of all the numberings of the chapters, sections and subsections in the table of content, but not in the content and as well not in the other lists I will have (such as list of figures, list of terms, list of mentioned authors etc.) themselves. There is already a similar question posed here, but now I would like to get a solution for this specific case. Here is a solutions, which disables all numberings in all lists by lockstep. But as mentioned above I need one, where I could specify it for each category of lists (list of figures, list of xxxx. etc.).               \documentclass{scrbook}          \usepackage{tocloft}          \usepackage{lipsum}          \makeatletter          % Without number and indentation     \renewcommand*{\numberline}[1]{}          \makeatother          \begin{document}          \tableofcontents


title: Unexpected displaymath in math environment with \underbrace

text: I would like to stay in math mode by using $ delimiters. But when I use this code:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \begin{document}          $\big(\sum_{j=1}^n\delta_{j,k}x_k\big)_{1\leq k\leq n}     =\big(\underbrace{\sum_{j=1}^n\delta_{j,k}}_{1_A}x_k\big)_{1\leq k\leq n}$          \end{document}      I get this: ![enter image description here](http://i.stack.imgur.com/2DJDy.jpg) On the right, it looks as if I was in displaymath. Why? Should I use `\textstyle` whenever I use `\underbrace`?


title: Key Value option in package

text: I trying to write a package, and I'd like to specify whether there should be colour or not.   I'd like to do:               \usepackage[color=false]{foo}      and have this set               \RequirePackage[color=false]{hyperref}      or true as the case may be. What's the best way to do this?


title: urldate in BibTeX gets ignored

text: I cite online ressources like this in my `.bib` file:               @misc{JavaCross,       author = {Sun},       title = {Java Sun: Definition Cross Plattform},       note = {\url{http://java.sun.com/products/jlf/ed1/dg/higq.htm}},       lastvisited = {2012-03-20},     }      the `lastvisited` doesnt work. It just gets ignored. I also tryed `lastchecked` and `urldate`, which I find on google. Any help greatly appreciated.


title: Formatting floats differently based on placement

text: I'm interested in changing how floats are formatted depending on whether they are placed at the top, bottom, or middle of a page, or on a float page. One package I am aware of that does something like this is tufte-latex, which places hanging captions in the margin below full-width figures if the figures are at the top or middle, but above if the figures are at the bottom. Looking at the code for tufte-latex, though, this is a pretty rudimentary check (as near as I can tell, the caption is placed on top exactly when the only placement specifier is "b"). And when the floats are put on a float page, the hanging captions don't look right. Ideally, I'd like to be able to tell where a float has actually been placed and do something like               \if \finalfloatplacement t%       % hang caption in margin below float     \fi     \if \finalfloatplacement h%       % same as 't'; hang caption in margin below float     \fi     \if \finalfloatplacement b%       % hang caption in margin above float     \fi     \if \finalfloatplacement p%       % center caption below float     \fi      Presumably this would take a couple of LaTeX runs to iron out the positions.


title: How to crop my page to the size of tikz graph

text: I want to crop the page to exactly fit the tikz graph in it. When i used `standalone` document class, all the page content became on one line. Here is my code               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{arrows}     \tikzstyle{myarrow}=[draw=black,-triangle 45]     \begin{document}     $X^2$ = $\frac{c}{b}$ \\          \begin{tikzpicture}         \draw [myarrow] (0,0) -- (13,0) node [at end, below] {$\lambda$};         \draw (0,2.2) -- (12,2.2);         \draw[ultra thick, black] (0,0) sin (3,2);         \draw[ultra thick, red] (3,2) cos (6,0);         \draw[ultra thick, black] (6,0) sin (9,-2);         \draw[ultra thick, red] (9,-2) cos (12,0);     \end{tikzpicture}\\          $A$  \hspace{1cm}Hello \\          C               \hspace{1.3cm}hello  \\          B        \hspace{1cm}hello \\          d               \hspace{1.4cm}hello  \\     \end{document}      **I want the result to be like this** ![enter image description here](http://i.stack.imgur.com/eX1NC.png) **But here is what i got** ![enter image description here](http://i.stack.imgur.com/Q0KrS.png) I also tried `preview` but it didn't work Got the ideas from here