title: Place pseudocode inside tikz node

text: How can I place pseudocode, that is written by the `algpseudocode` package, inside a `tikz` node? (I don't want to just decorate the code, but use them inside a graph) ## MWE               \documentclass{article}          \usepackage{tikz}          \usepackage{algpseudocode}          \begin{document}         \begin{tikzpicture}             \node[draw, rounded corners] {%                  \begin{algorithmic}                 \If{$\mathrm{n}=\mathrm{np}$}                     \State Have fun                 \EndIf                 \end{algorithmic}%                 };         \end{tikzpicture}     \end{document}      ## Result Lot of errors like: > Something's wrong--perhaps a missing \item. ![Result](http://i.stack.imgur.com/OAAsW.png)


title: Sphinx in-line math equation alignment

text: As suggested by the answer to my question here, I am using the Sphinx tool in order to multi-target PDF and HTML output. For HTML, I'm using the pngmath extension. The vertical alignment of inline math in the HTML output is very bothersome. The math equations are positioned below where they should and this causes the entire rendered page to look bad because none of the equations are lined-up properly. Does anyone know how this can be fixed?


title: What exactly does \@doendpe do?

text: Quoting from the LaTeX2e sources: > [`\@endparenv`, `\@doendpe`] > > To suppress the paragraph indentation in text immediately following a > paragraph-making environment, `\everypar` is changed to remove the space, > and `\par` is redefined to restore `\everypar`. Instead of redefining `\par` > and `\everpar`, `\@endparenv` was changed to set the `@endpe` switch, > letting `\end` redefine `\par` and `\everypar`. > > This allows paragraph-making environments to work right when called by other > environments. (Changed 27 Oct 86) These are the relevant code lines (with line breaks added to improve readability):               \def\@endparenv{%       \addpenalty\@endparpenalty       \addvspace\@topsepadd       \@endpetrue     }     \def\@doendpe{%       \@endpetrue% <---?       \def\par{%         \@restorepar         \everypar{}%         \par         \@endpefalse% <---?       }%       \everypar{%         {\setbox\z@\lastbox}%         \everypar{}%         \@endpefalse% <---?       }%     }      While I roughly comprehend `\@doendpe` and its `\everypar` trickery, I'm lost with regard to two details (marked with `<\---?` in the above code):   * As the definition of `\begin` includes `\@endpefalse`, why is it necessary to set `\@endpefalse` at the end of `\@doendpe`'s `\par`/`\everypar` redefinitions?   * Why is setting `\@endpetrue` at the start of `\@doendpe` necessary? Isn't `\@doendpe` only called if the `@endpe` switch is set to `true`? I suspect that a possible answer involves the (to me) cryptical remark about _"paragraph-making environments [working] right when called by other environments"_ , but would be grateful for a full explanation. Bonus question: If I were to define a custom list environment that at its end would set `\@endpefalse` and instead (with the appropriate `\aftergroup`) call a carbon copy of `\@doendpe` (say `\@doendcustomenv`), would the code lines marked wih `<\---?` above be beneficial or superfluous in this copy?


title: \draw alignment when connecting nodes using tikz-qtree, getting line centered

text: Here is my code and I will post a picture showing what it generates. I will manually draw in red where I would like to draw a line from. I am producing a family tree and I need to connect lines from one person to another. Could anyone help me get this fixed? I want to draw a line from node (kid 1) to node (kid 2), but I want the line from node (kid 1) to originate from the bottom center, not from the right as it is doing. DESPITE **EXPLICITLY** GIVING SOUTH:8, the line starts from the east side (or right side) of the node. **NOTE** : Due to the vastness of these trees, I have to compartmentalize them, meaning there are going to be several different tikzpicture environments, hence the overlay lines in a separate tikzpicture environment. **REASONS** :   1. Adjust sibling distance   2. Adjust level distance   3. Move various trees (families) around (scope provides this functionality) The scope functionality is great for moving things around, but does not give me the flexibility to squeeze trees together when possible—as far as I know (ie some families are smaller than others, which means those respective nodes could be placed closer together). --thanks in advance!               \documentclass[12pt]{article}     \usepackage[landscape]{geometry}     \usepackage{fontspec}     \usepackage{tikz}     \usepackage{tikz-qtree}     \tikzset{font=\small,     every tree node/.style={align=center, anchor=north},text centered}     \begin{document}     \thispagestyle{empty}%suppress page number     \tikzstyle{every picture}+=[remember picture, overlay]               \begin{tikzpicture}[level distance=6cm,sibling distance=6cm,scale=1,]          \Tree     [.Parent          \node[](kid1){Kid 1};           \node[](kid2){Kid 2}; ]          %%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{scope}[xshift=9cm,yshift=-6cm]     \Tree     [.Parent         \node(kid3){Kid 3};           \node(kid4){Kid 4}; ]         \end{scope}     \end{tikzpicture}               \begin{tikzpicture}[overlay]         %\draw[->] (kid1.south)--(kid2.south);         \draw[->] (kid1) .. controls +(south:8cm) and +(south:3cm) ..(kid4);          \end{tikzpicture}               \end{document}      ![](http://i.stack.imgur.com/G7skH.png)


title: Debugging vertical space on top of page (section inside a custom biblatex cite command)?

text: Please consider the following MWE, compiled with `lualatex test.tex` (+ `bibtex test` + `lualatex test.tex`):               \documentclass[twoside,a4paper]{book}          \usepackage{lua-visual-debug}     \usepackage{lipsum}     \usepackage{biblatex}     \addbibresource{biblatex-examples.bib}               % note: here the behavior is the same,      % regardless if \thefield{title} (expandable)     % or \printfield{title} (non-expandable) is used:     %     \newbibmacro*{myCite}{%     \section*{The title: \thefield{title}} %     }          \DeclareCiteCommand{\myCite}%     {}%     {%     \usebibmacro{myCite}}%     {}%     {}%          \def\tracingboxes{\showboxbreadth = \maxdimen       \showboxdepth = \maxdimen}%               \begin{document}          \tracingpages=1 % pages     \tracingoutput=1 % boxes     \tracingboxes          \section*{Thesting one}          \lipsum[1]          \cleardoublepage          \myCite{vangennep}          \lipsum[2]          \end{document}      In it, I have a directly called `\section*` on top of the page - and a `\section*` on top of the page called via a custom cite command (`\myCite`, implemented through `biblatex` package functionality). (Both sections start with "Th", so I have a marker for debugging) The problem is that the two `\section*`s do not "align" - that is, do not start at the same vertical position (image produced via   `montage -density 150 -bordercolor LimeGreen -border 1 test.pdf[0] test.pdf[2] -geometry +2+2 -tile 2x1 out.png`): ![out.png](http://i.stack.imgur.com/EhbJP.png) In other words, the `\section*` called via `\myCite` has some extra vertical space on top of page. And since (apparently) one cannot just reset the page vertical space on top (especially not by calling internal “command codes”) - I'd like to know:   * where does this vertical space come from; and   * how to eliminate it? In particular, I'm interested in somehow tracking down (through a "debugging procedure") where does this space come from. I have already tried to get a "debug log" using \tracing commands, in this case `\tracingpages`, `\tracingoutput` and `\tracingboxes`. Then I use the following `awk` command ( _see alsohere_) to search through the log:               $ awk '     {nrp=sprintf("[%5d]",NR);}     NR<=p {print nrp " :" $0} /^%%/ {print nrp "::" $0; p=NR+4} ;     /\\hbox|\\vbox|\\glue| box/ {print nrp "  " $0} ;     /\\OT1\/cmr\/bx\/n\/14.4 [Th]/ {print nrp "  " $0}     ' test.log          [  283]::%% goal height=598.0, max depth=5.0     [  284] :% t=0.0 g=598.0 b=10000 p=0 c=100000#     [  285] :% t=43.90276 plus 1.86108 g=598.0 b=10000 p=0 c=100000#     [  286] :% t=55.90276 plus 1.86108 g=598.0 b=10000 p=0 c=100000#     [  287] :% t=67.90276 plus 1.86108 g=598.0 b=10000 p=100 c=100000#          [  298]  Completed box being shipped out [1]          [  299]  \vbox(676.36243+0.0)x373.0, direction TLT     [  302]  .\glue 23.0     [  303]  .\vbox(653.36243+0.0)x345.0, shifted 28.0, direction TLT     [  305]  ..\vbox(12.0+0.0)x345.0, glue set 5.55556fil, direction TLT     [  309]  ...\glue 0.0 plus 1.0fil     [  310]  ...\hbox(6.44444+0.0)x345.0, glue set 340.0fil, direction TLT     [  313]  ....\glue 0.0 plus 1.0fil     [  317]  ..\glue 18.06749     [  320]  ..\glue(\lineskip) 0.0     [**321]  ..\vbox(598.0+0.0)x345.0, glue set 434.09723fil, direction TLT     [**332]  ...\glue(\topskip) 0.00002     [**333]  ...\hbox(9.99998+2.79999)x345.0, glue set 253.16011fil, direction TLT     [  340]  ....\hbox(0.0+0.0)x0.0, direction TLT     [  343]  .....\glue 0.0     [  344]  ....\OT1/cmr/bx/n/14.4 T     [  345]  ....\OT1/cmr/bx/n/14.4 h     ...     [ 1703]::%% goal height=598.0, max depth=5.0     [ 1704] :% t=0.0 g=598.0 b=10000 p=0 c=100000#     [ 1705] :% t=10.0 g=598.0 b=10000 p=-10001 c=-10001#     [ 1706] :%% goal height=598.0, max depth=5.0     [ 1706]::%% goal height=598.0, max depth=5.0     [ 1707] :% t=0.0 g=598.0 b=10000 p=0 c=100000#     [ 1708] :% t=10.0 g=598.0 b=10000 p=0 c=100000#     [ 1709] :% t=10.0 plus 1.0fil g=598.0 b=0 p=-10000 c=-10000#     [ 1710] :          [ 1712]  Completed box being shipped out [2]          [ 1713]  \vbox(676.36243+0.0)x424.0, direction TLT     [ 1716]  .\glue 23.0     [ 1717]  .\vbox(653.36243+0.0)x345.0, shifted 79.0, direction TLT     [ 1719]  ..\vbox(12.0+0.0)x345.0, glue set 5.55556fil, direction TLT     [ 1723]  ...\glue 0.0 plus 1.0fil     [ 1724]  ...\hbox(6.44444+0.0)x345.0, glue set 340.0fil, direction TLT     [ 1728]  ....\glue 0.0 plus 1.0fil     [ 1731]  ..\glue 18.06749     [ 1734]  ..\glue(\lineskip) 0.0     [ 1735]  ..\vbox(598.0+0.0)x0.0, glue set 588.0fil, direction TLT     [ 1740]  ...\glue(\topskip) 10.0     [ 1741]  ...\hbox(0.0+0.0)x0.0, direction TLT     [ 1745]  ...\glue 0.0 plus 1.0fil     [ 1748]  ...\glue 0.0     [ 1751]  ..\glue(\baselineskip) 25.29494     [ 1752]  ..\hbox(0.0+0.0)x345.0, direction TLT     ...     [ 1756]::%% goal height=598.0, max depth=5.0     [ 1757] :% t=10.0 g=598.0 b=10000 p=-300 c=100000#     [ 1758] :% t=64.97215 plus 7.16663 minus 0.86108 g=598.0 b=10000 p=150 c=100000#     [ 1759] :% t=76.97215 plus 7.16663 minus 0.86108 g=598.0 b=10000 p=0 c=100000#     [ 1760] :% t=88.97215 plus 7.16663 minus 0.86108 g=598.0 b=10000 p=0 c=100000#          [ 1769]  Completed box being shipped out [3]          [ 1770]  \vbox(676.36243+0.0)x373.0, direction TLT     [ 1773]  .\glue 23.0     [ 1774]  .\vbox(653.36243+0.0)x345.0, shifted 28.0, direction TLT     [ 1776]  ..\vbox(12.0+0.0)x345.0, glue set 5.55556fil, direction TLT     [ 1780]  ...\glue 0.0 plus 1.0fil     [ 1781]  ...\hbox(6.44444+0.0)x345.0, glue set 340.0fil, direction TLT     [ 1784]  ....\glue 0.0 plus 1.0fil     [ 1788]  ..\glue 18.06749     [ 1791]  ..\glue(\lineskip) 0.0     [*1792]  ..\vbox(598.0+0.0)x345.0, glue set 459.0834fil, direction TLT     [*1796]  ...\glue(\topskip) 10.0     [*1797]  ...\hbox(0.0+0.0)x345.0, glue set 330.0fil, direction TLT     [*1804]  ....\hbox(0.0+0.0)x15.0, direction TLT     [*1809]  ....\glue(\parfillskip) 0.0 plus 1.0fil     [*1811]  ....\glue(\rightskip) 0.0     [*1816]  ...\glue 15.0694 plus 4.30554 minus 0.86108     [*1819]  ...\glue(\parskip) 0.0 plus 1.0     [*1822]  ...\glue(\baselineskip) 8.00002     [*1823]  ...\hbox(9.99998+2.79999)x345.0, glue set 132.72354fil, direction TLT     [ 1830]  ....\hbox(0.0+0.0)x0.0, direction TLT     [ 1833]  .....\glue 0.0     [ 1834]  ....\OT1/cmr/bx/n/14.4 T     [ 1835]  ....\OT1/cmr/bx/n/14.4 h      I've isolated relevant sections of the log above - and the lines that differ in the box construction, right before the first "Th" letters of each `\section*` start being typeset, are indicated with `*` before the line number (for that, I removed the leading line numbers, and compared the two snippets with `meld`). The `\tracingpages` log (as much as I can read it) tells me that:   * pg 1 starts at top 0.0, penalty 0 (`% t=0.0 g=598.0 b=10000 p=0 c=100000#`)   * pg 3 starts at top 10.0, penalty -300 (`% t=10.0 g=598.0 b=10000 p=-300 c=100000#`) ... yet, the `\tracingboxes` log shows that, in spite of this, the initial hierarchy of output boxes is the same for both cases, until this point is reached:   * pg 1: `..\vbox(598.0+0.0)x345.0, glue set 434.09723fil, direction TLT`   * pg 3: `..\vbox(598.0+0.0)x345.0, glue set 459.0834fil, direction TLT` ... and I cannot see how the top difference of 10.0-0.0 = 10.0 in the first case, would add up to 459.0834-434.09723 = 24.9862 (ignoring the fact that pg3 has additional boxes and glues) ?? In essence, it is clear that it is something in the path of the custom `biblatex` citation command that causes this vertical space on top - but how could the page/box building log be used, to find the exact command which is causing this? Or is a different debugging approach needed altogether?


title: How to change the word "Proof" in the proof environment?

text: I want to change the word "Proof" into "Solution". Of course the following works.               \begin{proof}[Solution] \end{proof}      But it's quite cumbersome to add this additional [Solution] every time. Is there a way to make it automatic? Edit: I'm using `amsthm`.               \documentclass{amsbook}     \usepackage{amsthm}     \begin{document}     \begin{proof}[Solution]     This is a solution.     \end{proof}     \end{document}


title: What makes showgrid=true or showgrid=top displace my clip to the right?

text: The following code is trivial but important to show the problem. When I activate the `showgrid` with `true` or `top` option, my graphics object gets shifted to right as shown in the following animation. ![enter image description here](http://i.stack.imgur.com/y8NzQ.gif)               \documentclass[pstricks,border=12pt]{standalone}          \def\Atom{\psframe(1,2)(2,3)}          \begin{document}          % NO problem WITHOUT showgrid or with showgrid=bottom     \begin{pspicture}[showgrid=bottom](2,4)         \begin{psclip}{\Atom}             \psframe*(2,4)         \end{psclip}     \end{pspicture}          % get shifted to the right with showgrid=true or showgrid=top     \begin{pspicture}[showgrid=true](2,4)         \begin{psclip}{\Atom}             \psframe*(2,4)         \end{psclip}     \end{pspicture}          \end{document}      Warning:   * `showgrid=true` is equal to `showgrid=top` rather than `showgrid=bottom`.   * The statement on page 4 of `pst-news12.pdf` might wrongly be typed. What makes this displacement?


title: \nocite-like macro for \footfullcite in beamer

text: Is there any macro similar to the behavior of `\nocite`?, in the sense of printing an entry of the bibliography, but for putting the citation verbatim in the footnote, similar to `\footfullcite` but without the footnote superscript somewhere in the slide, and that works on `beamer`. I want to show some reference in the bottom of a slide, but I don't want to put a reference number in particular in the slide. Instead, I want the reference to be just in the bottom of the slide (as a footnote). I went through the `biblatex` manual without luck. Any ideas or suggestions?


title: Turn enumerate into panel table of contents in pdfscreen

text: I'm trying to get the following:   I have several files (many) containing lists numbered from 1 to 25, each with A), B), C). Using the package `pdfscreen` I want to turn them into a presentation and would like the right panel to show the 25 items (in a 5x5 grid) but not how to add entries for each item to `pdfscreen` as the display panel in a 5x5 grid to the right. Here is an example:               \documentclass[12pt]{article}     \usepackage{enumitem}     \setenumerate{parsep=4pt,partopsep=4pt,topsep=4pt,labelsep=3pt, leftmargin=*,itemsep=2pt}     \setenumerate[1]{label=\arabic*.}     \setenumerate[2]{label=\Alph*)}     \usepackage[screen,panelright,code,paneltoc,sectionbreak]{pdfscreen}     \begin{screen}      \margins{.65in}{.65in}{.65in}{.65in}      \screensize{6.25in}{8in}      \changeoverlay     \end{screen}     \begin{document}     \addcontentsline{toc}{section}{Ejercicios 1 al 5}     \begin{enumerate}     \item Uno     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Dos     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Tres     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Cuatro     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Cinco     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \addcontentsline{toc}{section}{Ejercicios 6 al 10}     \item Seis     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Siete     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Ocho     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Nueve     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \addcontentsline{toc}{section}{Ejercicios 10 al 15}     \item Diez     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Once     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Doce     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Trece     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Catorce     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Quince     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \addcontentsline{toc}{section}{Ejercicios 16 al 20}     \item Diez y 6     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Diez y 7     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Diez y 8     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Diez y 9     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Veinte     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \addcontentsline{toc}{section}{Ejercicios 21 al 25}     \item Veinte y 1     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Veinte y 2     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Veinte y 3     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Veinte y 4     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \item Veinte y 5     \begin{enumerate}     \item 1     \item 2     \item 3     \end{enumerate}     \end{enumerate}     \end{document}      I want this in the right panel               1  6   11  16  21     2  7   12  17  22     3  8   13  18  23     4  9   14  19  24     5  10  15  20  25      if this is possible using `pdfscreen`.


title: Biblatex Citation Problem

text: I have my bibliography contained in my LaTeX document, as               \usepackage{biblatex}          Words... \cite{ref1}          \begin{thebibliography}{9}     \bibitem{ref1}     ...     \end{thebibliography}      I've done this many times in the past, but for some reason, my citations are not returning the reference number, but `\cite{ref1}` returns `[ref1]` instead. Anyone familiar with this issue?


title: Using "\ " instead of "{}" after a macro

text: Given a macro definition like `\newcommand{\answer}{\emph{42}}`, do               They realized that \answer{} is the answer to everything.      and               They realized that \answer\ is the answer to everything.      always produce the same output?


title: How can I get text and symbols to have the vertical alignment that I need?

text: I am trying to create a list of notations in which the symbols are on the left of the page but they have an alignment on the right while the meanings are on the right of the page but they have an alignment on the left. On the page there should be a nice rectangular block separating the symbols and the meanings when I am done. I have been using `\hskip`, `\vskip` and `\quad` but the alignments are not perfect. Is there a way to get neater alignments?


title: Configuring the looks of memoir's \paragraph

text: I need a lower heading level than subsubsection and hence I am turning towards `\paragraph`. I am happy with not having it numbered but I do want it to stand on a line of it's own and be italic. I have tried the following:               \documentclass{memoir}     \usepackage{lipsum}     \begin{document}          \setparaheadstyle{\itshape}     \let\origparagraph\paragraph     \renewcommand*{\paragraph}{%     \origparagraph{#1} \\      }          \paragraph{Lorem ipsum}     \lipsum[1-2]          \end{document}      which sadly gives me:               ! Illegal parameter number in definition of \paragraph.     <to be read again>                         1     l.9 }      So clearly I can't renew the `\paragraph` command quite in that way. How should I do it?


title: How to mitigate "same number of coordinates" error?

text: I have a rather complicated pgfplots graph mixing `const plot` with `ybar stacked` and it doesn't like the data sets I am importing due to coordinate mismatch. However the graphs are correct and exactly what I need. How can I either:   * increase the nonstop error limit of MikTeX?   * tell LaTeX to ignore this error?   * eliminate this error from the code below? (I have already logged a request to change the error to a warning with Christian.) Here follows a light example approximating my requirements, it also throws three typical errors:                   \documentclass[tikz,english]{article}         \usepackage{pgfplots}         \pgfplotsset{small, width=15cm, height=6cm,compat=1.7}              \begin{document}         \begin{tikzpicture}         \begin{axis}[ybar stacked]         \addlegendimage{line legend,thick,legend image code/.code={           \draw[#1] (0cm,0cm) --  (0.4cm,0cm);}};         \addlegendentry{target};         \addlegendimage{draw=black, fill=yellow}         \addlegendentry{S1};         \addlegendimage{draw=black, fill=red}         \addlegendentry{S2};              \addplot[const plot, thick] coordinates {         (1,1.8559703)         (2,2.8559703)         (3,3.5301677)         (4,4.3050655)         (5,4.3050655)         };         \addplot[const plot, draw=none, forget plot] coordinates {         (1,-1.8559703)         (2,-2.8559703)         (3,-3.5301677)         (4,-4.3050655)         (5,-4.3050655)};         \addplot [draw=black, fill=yellow] coordinates {         (1.5,2.8559703)         (2.5,2.8559703)         (3.5,2.5301677)         (4.5,1.3050655)};         \addplot[draw=black, fill=red] coordinates {         (1.5,1.8559703)         (2.5,2.8559703)         (3.5,2.5301677)         (4.5,2.3050655)};         \legend{target, s1,s2};              \end{axis}         \end{tikzpicture}         \end{document}


title: Animation for discrete-time convolution of two sequences?

text: How can I animate a convolution sum of two discrete-time sequences using LaTeX? It can be done? An example of how the convolution sum works can be seen here: Wolfram Demostration Project, Discrete-Time Convolution. The Discrete-Time convolution is defined as follows: ![enter image description here](http://i.stack.imgur.com/QB1OJ.png) Where the summation is called the convolution sum of the discrete-time sequences `x[n]` and `h[n]`. The main idea is view every step of the summation, what happens for each value of `k`, as in the Wolfram demonstration (but not necessarily equal).


title: how can I extend the width of item?

text: Please see the picture first. I want to keep the first width of item rectangle, meanwhile extend the second item rectangle, make it longer. I mean that I'd like to let the leftmargin & rightmargin much more smaller, so that **more contents can be displayed on one line**. How can I do that without define a new environment? I see many related pages, but I cannot solve the problem. Be grateful with any help!               \begin{frame}         \begin{columns}[t]%     \begin{column}[t]{0.45\textwidth}     \begin{itemize}          \item A.~~4          \item C.~~2       \end{itemize}         \end{column}      \begin{column}[t]{0.45\textwidth}%          \begin{itemize}         \item B.~~3         \item D.~~1       \end{itemize}     \end{column}     \end{columns}          \begin{itemize}[leftmargin=0cm]     \item $y=x^3$: $f(-x)=(-x)^3=-x^3, -f(x)=-x^3$. $\Rightarrow$ $f(-x)\neq -f(x)$\\     \item $y=2^x$: $f(-x)=2^(-x)=2^{-x},-f(x)=-2^x$.$\Rightarrow$ $f(-x)\neq -f(x)$\\     \end{itemize}     \end{frame}      ![enter image description here](http://i.stack.imgur.com/1i7if.png)


title: Plot Continuous Line With 2 Points

text: Is there any way to plot a continuous line with pgfplot/tikz using only 2 points (i.e. it will extend past those points on its own) within the domain I specify?


title: How can I do automatic 'environment' of command in 'Texmaker'?

text: I have knowledge about 'Kile' more or less. Now I am using 'Texmaker'. But there is a problem in it. In Kile when we write `\begin{env}` it automatically write `\end{env}` from the following : Settings => Configure Kile => LaTeX => Environments => making tick mark on "Automatically complete `\begin{env}` with `\end{env}`" we can set it. But in 'Texmaker' automatic environment is not working. How can I do so.


title: Same node distance between levels in a tikz tree?

text: I want to draw a tree using tikz, but I want the vertical distance between nodes in successive levels to be the same, regardless of the size of the node. For example:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[level distance=1cm]     \path node {a}           child {             node {b}             child {               node [align=center] {c \\ d}               child {                 node {e}               }             }           };     \end{tikzpicture}     \end{document}      I know this is a silly example of a tree, since it doesn't “branch”, but it shows better the problem I'm referring to. The actual tree that I have to produce _does_ eventually branch. But anyway, the produced output looks like: ![enter image description here](http://i.stack.imgur.com/CNcMg.png) where the edge between a—b is longer than the edge between b-cd. What I want is the distance between the bottom of a parent node and the top of its children nodes to remain constant throughout the tree, regardless of the (vertical) size of the nodes. In this example all edges should show up with the same size. Is there a way to easily accomplish this using tikz?


title: Recursive method to build a tree with tikz

text: I would like to translate the next example of a Bernoulli tree built with pst- tree with tikz but I don't know if it's possible :               \documentclass{article}     \usepackage{pstricks,pst-tree}          \makeatletter          \newcount\@Bernoudepth     \newcount\@Bernoumaxdepth          \newcommand\Bernoutree[8][treemode=R,nodesep=1ex,levelsep=12ex]{%       % #2 = depth of tree       % #3 = name for success       % #4 = name for miss       % #5 = probability of a success       % #6 = position of  #5       % #7 = probability of a miss        % #8 = position of #7       \begingroup       % initialize  parameters       \psset{treemode=R,nodesep=1ex,levelsep=12ex}%       \psset{#1}%       \@Bernoumaxdepth #2\relax       \def\@Reussite{#3}%       \def\@Echec{#4}%       \def\@probareussite{#5}%       \def\@Argreussite{#6}%       % if no parameter of position       % center position        \ifx\empty\@Argreussite         \def\@Argreussite{0.5}%       \fi       \def\@probaechec{#7}%       \def\@Argechec{#8}       \ifx\empty\@Argechec         \def\@Argechec{0.5}%       \fi       % First call  (empty root, level 1)       \pstree{\TR{}}{\@Bernoutree{1}}       \endgroup     }     \newcommand\@Bernoutree[1]{%       % #1 = recursive depth        % initialize the depth       \@Bernoudepth #1\relax       \ifnum\@Bernoudepth=\@Bernoumaxdepth         % if depth  max is reached         % we place the two final nodes         \TR{\@Reussite}\taput[tpos=\@Argreussite]{\@probareussite}         \TR{\@Echec}\tbput[tpos=\@Argechec]{\@probaechec}         % it's finished       \else         % else we build with a recursive method         % the two branches of higher level         \advance\@Bernoudepth \@ne         \pstree{\TR{\@Reussite}\taput[tpos=\@Argreussite]                {\@probareussite}}{\@Bernoutree{\the\@Bernoudepth}}         \pstree{\TR{\@Echec}\tbput[tpos=\@Argechec]                {\@probaechec}}{\@Bernoutree{\the\@Bernoudepth}}       \fi     }     \makeatother          \pagestyle{empty}          \begin{document}          \Bernoutree[levelsep=18ex,treenodesize=0pt]{4}{$R$}{$E$}{$p$}{}{$q$}{}          \end{document}        Actually I get the tree with the next method but it's not a recursive method.               \documentclass{scrartcl}     \usepackage{pgf,tikz}      \usetikzlibrary{trees,arrows}           \makeatletter     \newcount\tkz@Berndepth     \newdimen\tkz@BernLEN     \tkz@BernLEN=24em      \def\tkzBernTreeSet#{\pgfqkeys{/berntree}}           \pgfqkeys{/berntree}{%       success/.code      = \def\tkz@bern@success{#1},       miss/.code         = \def\tkz@bern@miss{#1},       p/.code            = \def\tkz@bern@pbsuccess{#1},       q/.code            = \def\tkz@bern@pbmiss{#1},       node success style/.style  = {inner sep=2pt,outer sep=3pt},       node miss style/.style     = {inner sep=2pt,outer sep=3pt},       edge style/.style  = {->,>=latex',shorten <= 6pt},       root style/.style  = {draw,circle},       success/.initial   = S,       miss/.initial      = E,        p/.initial         = $p$,       q/.initial         = $1-p$,       gap/.code          = \def\tkz@bern@gap{#1},       length/.code       = \def\tkz@bern@length{#1}      }           \def\tkz@brntree#1#2{%       \node[/berntree/root style] {};     \global\advance\tkz@Berndepth 1\relax     \begin{scope}[level distance=\tkz@bern@length,                   level 1/.style={sibling distance=#2}]          \node[] (root) at (#1) {}            [grow=right]       child[/berntree/edge style] {%         node[/berntree/node miss style](tkz@E\the\tkz@Berndepth) {\tkz@bern@miss}                  edge from parent node[fill=white] {\tkz@bern@pbmiss}}       child [/berntree/edge style] {%         node[/berntree/node success style] (tkz@S\the\tkz@Berndepth) {\tkz@bern@success}                  edge from parent node[fill=white] {\tkz@bern@pbsuccess}                  };     \end{scope}}%           \def\tkzBernTree{\pgfutil@ifnextchar[{\tkz@BernTree}{\tkz@BernTree[]}}     \def\tkz@BernTree[#1]#2{%     \begingroup       \pgfqkeys{/berntree}{%     success = S,     miss= E,     node success style/.style  = {inner sep=2pt,outer sep=3pt,draw,minimum width=1.5em,minimum height=1.5em},     node miss style/.style  = {inner sep=2pt,outer sep=3pt,circle,draw,minimum width=1.5em},     p=$p$,     q=$q$,     gap=8cm,     length=3cm}      \pgfqkeys{/berntree}{#1}       \tkz@BernLEN=\tkz@bern@gap\relax           \tkz@Berndepth 0\relax        \node (tkz@S0) at (0,0){};      \def\tkz@bn@level{#2}       \ifcase\tkz@bn@level%      \or%        \tkz@brntree{tkz@S0}{\tkz@BernLEN}       \or%         \tkz@brntree{tkz@S0}{\tkz@BernLEN}        \divide \tkz@BernLEN by 2 %      \foreach \nd in {1}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}      \or%        \tkz@brntree{tkz@S0}{\tkz@BernLEN}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {1}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {2,3}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}       \or%         \tkz@brntree{tkz@S0}{\tkz@BernLEN}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {1}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {2,3}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}        \divide \tkz@BernLEN by 2 %      \foreach \nd in {4,5,6,7}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}           \or%         \tkz@brntree{tkz@S0}{\tkz@BernLEN}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {1}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}          \divide \tkz@BernLEN by 2 %      \foreach \nd in {2,3}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}        \divide \tkz@BernLEN by 2 %      \foreach \nd in {4,...,7}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}         \divide \tkz@BernLEN by 2 %      \foreach \nd in {8,...,15}{           \tkz@brntree{tkz@S\nd}{\tkz@BernLEN}        \tkz@brntree{tkz@E\nd}{\tkz@BernLEN}}         \fi         \endgroup      }     \makeatother     \begin{document}           \begin{tikzpicture}[yscale=1.2]      \tkzBernTree[root style/.style  = {fill,circle,outer sep =1pt,inner sep=2pt}]{4}           \end{tikzpicture}           \end{document}


title: TikZ - drawing multiple lines from the origin to the edge of an *arc*

text: I am trying to produce a diagram showing wavefronts/rays spherically diverging from some origin, and being paraxially rectified when contacting a lens with some controlled radius. What I **want** is something **like** this: ![Spherically diverging wavefronts converted to rectilinear by a lens... etc.](http://i.stack.imgur.com/rPNKn.png) The sketch is a really rough one — I'm just trying to convey the idea, and not yet sure exactly the best way to do this... so I'm obviously open to suggestions! I have thoroughly read and experimented with the answers provided here which draws a line from a circle's origin to its perimeter, but I'm unsure how to adapt it to my needs. The closest I've come to a solution is based on this method of marking the centre of an arc and this method of marking a path with a node which I can use to mark various points (literally just punctuation marks) along a convex arc.               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{shapes.geometric,positioning}      \usetikzlibrary{calc}          \begin{document}          \begin{tikzpicture}[     % parametrise an arc     arcnode/.style 2 args={                             decoration={                         raise=0pt,                                      markings,                            mark=at position #1 with {                                      \node[inner sep=0] {#2};                         }             },             postaction={decorate}     }     ]          \foreach \frac in {0,0.1,...,1}       \draw[-, black, arcnode={\frac}{.}] [] (4cm,0) arc (-30:-150:2cm);          \end{tikzpicture}          \end{document}      Which draws the arc itself several times and is obviously not even close to working as I'd like it to. This is my first time using tikZ for anything even vaguely complicated, and I'm pretty stumped :( I'm stuck and running out of time for a submission, so I would **really** appreciate some help! EDIT: After some thought and after looking through Qrrbrbirlbel's suggested TikZ code, I have come up with the following _closer_ approximation to what I'd ultimately like to produce:               \documentclass[tikz]{standalone}     \usetikzlibrary{intersections,through}          \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[dot/.style={circle, fill, draw, inner sep=+0pt, minimum size=+3pt}]          \pgfmathsetmacro\nRays{4}     \pgfmathsetmacro\nAngle{33.367}          \pgfmathsetmacro\nAngleMin{90-\nAngle}     \pgfmathsetmacro\nAngleMax{90+\nAngle}     \pgfmathsetmacro\nAnglePP{floor((\nAngleMax-\nAngleMin)/(\nRays-1))}     \pgfmathsetmacro\nAngleInc{\nAngleMin+\nAnglePP}          \pgfmathsetmacro\lensRad{3.5}     \pgfmathsetmacro\lensDia{2*\lensRad}     \pgfmathsetmacro\lensH{1}     \pgfmathsetmacro\lensAbove{2.5}          \pgfmathsetmacro\pcleRad{1.5}          \pgfmathsetmacro\toptobottom{5}          \draw (left:\lensRad) to[out=90,  in=90,  looseness=.1]  ++(right:\lensDia)             -- ++(down:\lensH)                                      coordinate (s-1)                  to[out=-90, in=-90, looseness=.5]  ++(left:\lensDia) coordinate (s-2)             -- cycle [name path=shield];          \path (down:\toptobottom) coordinate (M) ++ (\nAngleMin:1) coordinate (M-1) ++ (\nAngleMin:.5) coordinate (M-2)       (up:\lensAbove)   coordinate (S3);          % \node[circle through=(M-1), draw, outer sep=+.5\pgflinewidth] (M1) at (M) {};     \node[dot, draw, outer sep=+.5\pgflinewidth] (M1) at (M) {};          \draw[dashed] (M-2) arc [radius=1.5, start angle=\nAngleMin, end angle=\nAngleMax]               (s-1) -- (s-2)               ([shift=(left:\lensRad*.2)] S3) -- ([shift=(right:\lensRad*.2)] S3);          \draw[dashed] (s-2) arc [radius=1.5, start angle=-\nAngleMin, end angle=-\nAngleMax];          \path[name path=rays] \foreach \a[count=\i] in {\nAngleMin, \nAngleInc, ..., \nAngleMax} {(M) -- node[dot, pos=.375] (d-\i) {} ++ (\a:4)};     \path[name intersections={of=rays and shield, name=down}, overlay, name path=up-rays]          \foreach \i in {1,...,\nRays} {([shift=(up:1)] down-\i) -- ++(up:3)};     \path[name intersections={of=up-rays and shield, name=up}] \foreach \i in {1,...,\nRays} {     node[dot] at (intersection of s-1--s-2 and down-\i--up-\i) {}     node[dot] (up'-\i) at ([xscale=.2] up-\i|-S3) {}                                };          \foreach \i in {1, ..., \nRays} \draw (M1) -- (down-\i) -- (up-\i) -- (up'-\i);          %Now draw some coordinate systems and annotations:              % Coordinates system  1         \draw[<->,line width=1pt] (1,0-\toptobottom) -|(0,1-\toptobottom);         % \draw(0,-0.15)node[below]{$y$};         \draw(-0.35,-0.25-\toptobottom)node[above]{$y_1$};         \draw(1.25,-0.25-\toptobottom) node[above]{$z_1$};         \draw(-0.35,0.8-\toptobottom) node[above]{$x_1$};              % $y$ axis         \filldraw[fill=white,line width=1pt](0,0-\toptobottom)circle(.12cm);         % \draw (0,0) circle[radius=2pt];         \fill (0,0-\toptobottom) circle[radius=1.5pt];              \pgfmathsetmacro\shift{4.5}              % Coordinates system 2         \draw[<->,line width=1pt] (1,0+\shift) -|(0,-1+\shift);         % \draw(0,-0.15)node[below]{$y$};         \draw(-0.35,-0.25+\shift)node[above]{$y_2$};         \draw(1.25,-0.25+\shift) node[above]{$z_2$};         \draw(-0.35,-1.25+\shift) node[above]{$x_2$};              % $y$ axis         \filldraw[fill=white,line width=1pt](0,0+\shift)circle(.12cm);         % \draw (0,0) circle[radius=2pt];         \fill (0,0+\shift) circle[radius=1.5pt];              % \fill[gray!10,rounded corners] (-3,-2) rectangle (4,0);         % \fill[gray!10] (-3,-2.5) rectangle (4,0);              % Interface pointer 1         \draw[-latex,thick](1.2,1.5-\toptobottom)node[right]{$W_{1}$}              to[out=180,in=90] (1,1-\toptobottom);              % Interface pointer 2         \draw[-latex,thick](1.2,-3.5+\shift)node[right]{$W_{2}$}              to[out=180,in=90] (1,-4.0+\shift);              % Interface pointer 3         \draw[-latex,thick](1.2,-1.5+\shift)node[right]{$W_{3}$}              to[out=180,in=90] (1,-2.0+\shift);          \end{tikzpicture}          \end{document}      This produces the following figure (I'm currently trying to figure out out to "mirror" the arc at the bottom of the figure onto the top area, after the lens): ![Still not what I want exactly, but closer!](http://i.stack.imgur.com/IBEXt.png) Which is much closer to what I ultimately want but not quite there yet. It seems like Qrrbrbirlbel's solution should be "easily" (for some folk!) adjusted to get my ideal figure. Obviously I've revised the features I'm looking for slightly — a better guide might have been the following: ![Pretty much exactly what I want](http://i.stack.imgur.com/QzroT.png) Which I can then annotate to indicate the various coordinate systems. EDIT: For additional clarification, I have annotated another sketch of what I'm trying to achieve: ![It's not pretty, but it is descriptive!](http://i.stack.imgur.com/4jUCD.png)


title: how to rotate .eps file

text: I have a problem with rotation of `.eps` files for my dissertation. Initially, I thought it was a problem during conversion of `.pdf` to `.eps`. I tried the conversion in several ways: using Adobe Acrobat 9 Pro in Windows, in Linux the following commands: `inkscape input.pdf --export-eps=output.eps` and `pdftops -eps file.pdf`. All methods give good .eps files, but when I try to rotate (90 degree rotation) them in Latex, nothing works. I used `\includegraphics[width=6.0 in,angle=90]`, also `\special{ps: gsave -90 rotate}\\......\special{ps: grestore }`, and some other methods but with no luck. Any solutions (Windows, Linux, Mac) will be appreciated.


title: Brackets in first column in table give "Missing number, treated as zero" error

text: > **Possible Duplicate:**   >  Error with table I'm writing a table with 4 columns and 1 row. The first column starts with a bracket. It compiles without issues:               \documentclass{article}     \begin{document}     \begin{tabular}{l l l l}     [k]bbb & `def' & [h]bbb & `def' \\     \end{tabular}     \end{document}      If I add another row like that, on the other hand, I receive an error message.               \documentclass{article}     \begin{document}     \begin{tabular}{l l l l}     [k]bbb & `def' & [h]bbb & `def' \\     [k]ccc & `def' & [h]ccc & `def' \\     \end{tabular}     \end{document}      `! Missing number, treated as zero.` I can avoid the issue by adding some curly braces to the first column, but I'm curious what's going on with LaTeX and brackets in tables here.


title: Don't have "tocbibind" package

text: I use the MiKTeX and LaTeX at my university and I wanted to include my bibliography in the contents page so I found out about the `\usepackage{tocbibind}` bit, but when I try and compile the file, it says I need to download the package and when I try, it doesn't let me. How can I overcome this?


title: Better transitive closure of labelled arrow

text: I think the answer will be easy, but I haven't found it yet: I use labelled arrows like `\xrightarrow\tau` a lot. Sometimes, I need the transitive closure of such relations, which I write `\xrightarrow\tau^*` but then, the star is way to high, quite above the `\tau`. How can I put the star at the same height as if I had written `\rightarrow^*`, even when I have a label? Figures: ![arrows](http://i.stack.imgur.com/tIfxf.png)


title: tkz-graph : inconsistency between edge and loop

text: I'm discovering the great package `tkz-graph` and I experience some trouble- shotting with the loop macro. There some inconsistency — in my opinion — between the loop macro and the edge macro. For exemples, in this MWE, the labels of the edges are note placed in the same way, the loop has an array and not the edge and the syntax `\\( \\)` for math-mode works only in the case of the loop.               \documentclass{minimal}     \usepackage{fixltx2e}     \usepackage{tkz-graph}     \begin{document}     \begin{tikzpicture}[scale=1]       \Vertex{A}       \Vertex[x=2,y=0]{B}       \Loop[dist=1.5cm,dir=WE,label=\(x\)](A)       \Edges[label=$y$](A,B)     \end{tikzpicture}     \end{document}      Moreover, the macro `\tikzset{EdgeStyle/.append style = …}`doesn't work for loops and I did not find a solution in the user manual. For exemple, `\tikzset{EdgeStyle/.append style ={->}}` doesn't use the same arrow tip for the edge and for the loop. Finally, the use of `style={->}` produces different results in the loop that in the edge (the path is thicker in the edge). Here is a picture off the exemple, with `\tikzset{EdgeStyle/.append style ={->}}` : ![enter image description here](http://i.stack.imgur.com/E6b6k.png)


title: Make the content in the item visible when clicking the screen and left-align formula?

text: I have two questions: 1) I can only let the items visible when clicking the screen, just adding up `<2->`. However, I don't know how the let the contents in the items do the same thing. It's not good to let them appear at the same time. 2) To make the formula be left. See my code, I have tried two methods but both of them fail. More details, please see the picture and my code. ![enter image description here](http://i.stack.imgur.com/qefIk.png)               \documentclass[CJK]{beamer}      \usepackage{beamerthemesplit}      \usepackage[english]{babel}     \setbeamercovered{transparent}     \usepackage{amsmath}     \begin{document}     \begin{frame}     \frametitle{16.Given$f(x)=\sqrt{2}\cos (x-\frac{\pi}{12})$,$x\in \mathbb{R}$.\\     1)$f(-\frac{\pi}{6})=?$;     2)If $\cos \theta=\frac{3}{5}$,$\theta \in(\frac{3\pi}{2},2\pi)$, $f(2\theta+\frac{\pi}{3})$=?.}     %\vspace{-1cm}%delete the gap     \begin{itemize} \parsep 10pt %\itemsep 10pt     \item<2-> $1)f(-\frac{\pi}{6})=\sqrt{2}\cos (-\frac{\pi}{6}-\frac{\pi}  {12})=\sqrt{2}\cos (-\frac{\pi}{4})=\sqrt{2}\times \frac{\sqrt{2}}{2}=1.$\\     \item<3-> 2) ∵$\cos \theta=\frac{3}{5},\frac{3\pi}{2}<\theta<2\pi$,     ∴$\sin \theta=-\sqrt{1-cos^2\theta}=-\sqrt{1-\frac{9}{25}}=-\frac{4}{5}$     ∴ $\sin 2\theta=2\sin \theta \cos\theta=-\frac{24}{25}\Rightarrow \cos     2\theta=\cos^2\theta \sin^2\theta=-\frac{7}{25}$      %\begin{flushleft} %fail to let the formula be left      %f(2\theta+\frac{\pi}{3})&=\sqrt{2}\cos (2\theta+\frac{\pi}{3}-\frac{\pi}{12})\\      %&=\sqrt{2}\cos (2\theta+\frac{\pi}{4})=\cos 2\theta-\sin2\theta\\      %&=-\frac{7}{25}-(\frac{24}{25})=\frac{17}{25}.      %\end{flushleft}      \begin{flalign*} % fail again      f(2\theta+\frac{\pi}{3})&=\sqrt{2}\cos (2\theta+\frac{\pi}{3}-\frac{\pi}{12})\\      &=\sqrt{2}\cos (2\theta+\frac{\pi}{4})=\cos 2\theta-\sin2\theta\\      &=-\frac{7}{25}-(\frac{24}{25})=\frac{17}{25}.      \end{flalign*}      \end{itemize}      \end{frame}      \end{document}


title: Choosing BibTex entry type for lecture notes and company catalogs

text: I have been struggling with choosing an appropriate entry type for my BibTex references when referring to for instance lecture notes from a university or a catalog with e.g. motor specs from a company. As for the lecture notes I have been considering `techreport`, `booklet` and `unpublished`. As for the catalog I have been considering `misc` and `other` (what is the difference between these two?), but also `manual`. It's probably not a big deal, but I'd like to be able to distinguish at least the difference between these various 'unusual' entry types such that I don't have to ponder about it next time. Also, the entry types `standard`, `electronic` and `periodical` are somewhat unclear to me. It'd be great if someone is able to enlighten me about these.


title: How do I use \ifcommandkey , or how do I check if a key was given?

text: I'm trying to create a keycommand with optional arguments, but I can't get it to work. I looked at Comparing an argument to a string when argument is a result of a command with etoolbox and although the example there works, I can't get it to work for use with keycommand, nor can I get `ifcommandkey` to work as expected. I recently upgraded from Tex Live 2009 to Tex Live 2011 and in 2009, `ifcommandkey` was working. In Tex Live 2011, how do I check whether a key was given or not? Below is an example where I try different things. None have the desired effect; in the third call, I want the result to be something like "No spam. No eggs. No paper. No Salt", but I get "Has spam" in every run. Why?               \documentclass{minimal}     \usepackage{keycommand}     \usepackage{etoolbox}     \begin{document}     \newcommand\myifstrempty{\expandafter\ifstrempty\expandafter}     \newkeycommand{\testkc}[spam,eggs,paper,salt][][0]{     \ifcommandkey{spam}{Spam: ``\commandkey{spam}''}{No spam}.     \ifcommandkey{eggs}{Eggs: ``\commandkey{eggs}''}{No eggs}.     \ifcommandkey{paper}{Paper: ``\commandkey{paper}''}{No paper}.     \ifcommandkey{salt}{Salt: ``\commandkey{salt}''}{No Salt}.     \ifcommandkey\expandafter{salt}{Salt: ``\commandkey{salt}''}{No Salt}.     \myifstrempty{\commandkey{spam}}{Not has spam}{Has spam}     \expandafter\ifstrempty{\expandafter{\commandkey{spam}}}{Not has spam}{Has spam}     }          \testkc[spam=bad, eggs=good, salt=horrid]          \testkc[paper=gold]          \testkc          \newcommand{\aORb}[1]{%             \expandafter\ifstrequal\expandafter{#1}{a}{"a" was given}{not a}, %             \expandafter\ifstrequal\expandafter{#1}{b}{"b" was given}{not b}%     }               \aORb{a}          \aORb{b}          \end{document}      The result looks like this: ![result](http://i.stack.imgur.com/5O4fQ.png)


title: Text and math versions of textual (non-numeric) footnote symbols

text: LaTeX generates the traditional textual footnote symbols (LaTeX uses the following sequence: ∗ † ‡ § ¶ ∥ ∗∗ †† ‡‡) as math symbols. Why? And why do all of these symbols have separate textual and math symbols variants?               \documentclass{article}          \renewcommand*{\thefootnote}{\fnsymbol{footnote}}               \begin{document}          Text.\footnote{Hi.} Text.\footnote{Hi.} Text.\footnote{Hi.} %     Text.\footnote{Hi.} Text.\footnote{Hi.} Text.\footnote{Hi.} %     Text.\footnote{Hi.} Text.\footnote{Hi.} Text.\footnote{Hi.}          \textasteriskcentered\textdagger\textdaggerdbl\textsection\textparagraph\textbardbl%       \textsuperscript{%         \textasteriskcentered\textdagger\textdaggerdbl\textsection\textparagraph\textbardbl}          \(*\dagger\ddagger\mathsection\mathparagraph\|%       ^{*\dagger\ddagger\mathsection\mathparagraph\|}\)          \end{document}      I can see a justification for the separation of `*` and `\textasteriskcentered`, but what about the other symbols? Here two thoughts:   * I suspect this might have to do with spacing. Spacing is important for "*" and "∥" in math, but I do not see why the other symbols cannot simply be textual glyphs: they are normally not used as mathematical symbols.   * Superscript placement in math mode can be variable. Some people will argue that footnote markers should not be used directly within mathematical material, but using math mode symbols means at least that anyone defining footnote-related macros needs to make sure that the vertical placement of these symbols is consistent and appropriate; intuitively it seems this should be easier to do with purely textual definitions, but it's best if someone else fills in the details and gives pros or cons.


title: TikZ snake braces using nodes from diferent 'tikzpicture's

text: Is it possible to have a brace defined (with the snakes library) using as reference points 2 nodes in 2 different tikzpictures?                   \begin{tikzpicture}[scale=.6]             \draw[draw=black, fill=black!20!white] (0,0) grid (4,3) rectangle (0,0);             \draw[fill=green](1.5,0.5) circle [radius=.3];             \draw[fill=blue] (0.5, 1.5) circle [radius=.3];             \draw[fill=purple](1.5, 2.5) circle [radius=.3];                  \node (Bone) at (4,3) {};         \end{tikzpicture}              \begin{tikzpicture}[scale=.6]             \draw[draw=black, fill=black!20!white] (0,0) grid (4,3) rectangle (0,0);             \draw[fill=blue](1.5,0.5) circle [radius=.3];             \draw[fill=green] (0.5, 1.5) circle [radius=.3];             \draw[fill=purple](1.5, 2.5) circle [radius=.3];                  \node (Btwo) at (4,0) {};         \end{tikzpicture}      I'd like to make a brace that started at 'Bone' and ended at 'Btwo'. **Remark:** I'm pretty new to TikZ, so even what I'm trying to do here (in my MWE) may have a much simpler way to do it. Any suggestion would be great :)


title: avoiding indentation in tabularx environment with proportionally defined columns

text: I'm using the `tabularx` environment (XeTeX, MiKTeX 2.8, TeXnicCenter) with four porportionally defined columns (see below). I cannot figure out how to prevent the resulting table from being slightly indented from the left margin. I also consulted David Carlisle's documentation from 1999. Thanks to Ulrike Fischer's answer to a question on the matter in 2007 (http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2007-01/msg00322.html), I've manged to do this in other, similar `tabularx` situations. The tables based on the next two set-ups do not indent (i.e., they do what I want in this respect):               \begin{tabularx}{\hsize}{@{}lX} ...      and               \begin{tabularx}{\linewidth}{@{}l@{\extracolsep{5mm}}X} ...      But I lack enough understanding of what I am doing to transfer this fix (adding `@{}`) into my current table. How can I prevent the slight indentation of my table in the following case?               \noindent     {\Large \textbf{Week Four -- Homework Sheet One} \normalsize}          \begin{tabularx}{\linewidth}{>{\setlength\hsize{.5\hsize}}X>{\setlength\hsize{.1\hsize}}X>{\RaggedRight\setlength\hsize{1.7\hsize}}X>{\setlength\hsize{1.7\hsize}}X}          \begin{tikzpicture} \draw (0,0) rectangle (0.5,0.5); \draw (1.25,.25) circle (.25cm); \end{tikzpicture}&1.&\multicolumn{2}{l}{First estimate and then add together: \begin{math}97,234 + 20,117 + 8,877\end{math}}\tabularnewline          &&Estimate:&Answer:\tabularnewline          %further rows of data          \end{tabularx}      Thank you!


title: Bar plot labels and grids

text: \documentclass[a4paper,11pt]{report}     \usepackage{tikz}     \usepackage{verbatim}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[     title = {Optimalization based upon co-occurences},     xbar,     width=10cm,     xtick={1,...,8},     xticklabels={%         atpB,         atpE,         atpF,         atpH,         atpA,         atpG,         atpD,             atpC},         grid=major,         ]     \draw [red, ultra thick] (axis cs:0,0) -- (axis cs:10,0);     \addplot[fill=blue,draw=black,ybar,error bars/.cd,y dir=both,y explicit]      coordinates     {(1,-0.279535)  +- (0.015982,0.015982)     (2,0.739360)    +- (0.031211,0.031211)     (3,-0.279302)   +- (0.017384,0.017384)     (4,-0.602794)   +- (0.022327,0.022327)     (5,0.487714)    +- (0.015970,0.015970)     (6,-0.294501)   +- (0.014923,0.014923)     (7,0.526527)    +- (0.016725,0.016725)     (8,-0.297469)   +- (0.021122,0.021122)     };     \end{axis}     \end{tikzpicture}     \end{document}


title: Installing packages on Tex Live 2011 (Mac)

text: I have Tex Live 2011, and I'd like to install the `longtable` package. But I have a few problems:   1. Where do I get the packages? Is there a database with all the packages, somewhere?   2. Is there a guide on how to install packages for Tex Live 2011?   3. I noticed many have the `texmf` folder, but I don't... Does this depends on my version being newer than the ones I read about?


title: Horizontal and vertical alignment of a picture in a table

text: I want to align a picture in a cell of a table. Following works as I want for the text in the top left cell and the picture is already vertically aligned, but not horizontally:               \begin{tabular}{m{0.04\textwidth}|m{0.325\textwidth}|m{0.6\textwidth}}      \toprule       \centering{a} & b & \includegraphics[draft]{test}\\ \midrule       d             & e & f\\      \bottomrule     \end{tabular}      However placing `\includegraphics{test}` into a `\centering{}` results in following error message:               ! Misplaced \noalign.     \midrule ->\noalign                      {\ifnum 0=`}\fi \@aboverulesep =\aboverulesep \global \@...     l.338 ...test}}\\ \midrule     ?      ! Extra alignment tab has been changed to \cr.     <recently read> \endtemplate           l.339   d &                 e & f\\


title: Text to the right of piecewise equation

text: I have the following piecewise functions:               \documentclass{article}     \usepackage{mathtools}     \begin{document}     \begin{align*}     K(u) &= \begin{cases}     \frac{1}{2} & -1 \leq u \leq 1  \\     0 & \text{sonst}     \end{cases} \\ \\     K(u) &= \begin{cases}     \frac{3}{4}(1-u^{2}) & -1 \leq u \leq 1 \\     0 & \text{sonst}     \end{cases} \\ \\     K(u) &= \frac{1}{\sqrt{2\pi}}\text{exp}\left(-\frac{1}{2}u^{2} \right) \\ \\     K(u)&= \begin{cases}     \frac{3}{8}(3-5t^{2}) & -1 \leq u \leq 1 \\     0 & \text{sonst}      \end{cases}     \end{align*}     \end{document}      ![enter image description here](http://i.stack.imgur.com/uFU6F.png) I would like to label each of these functions by placing text to the right of them, in between the two cases. However, so far I've only managed to put text on the same line as the cases. Thanks!


title: Get emacs to automatically insert \end{} commands after a \begin{} command

text: I've recently switched from Kile to Emacs/AUCTeX for LaTeX editing. I like AUCTeX a lot more in general, in part because I've put a lot of effort into learning Emacs really well. One feature I really miss from Kile is that it will automatically insert an `\end{environment}` whenever I enter a `begin{environment}`. Since I'm going into and out of equations a lot, this saves me a lot of typing. **Is there a way to get emacs to automatically insert`\end{}` whenever I type a `\begin{}`, the way kile does?**


title: Best practice regarding graphics size

text: Whenever I make graphs from R to be included in Latex, I find myself scuttling back and forth between R to specify the size of the output and Latex to play with the `\includegraphics[scale=??]`. It takes a lot of trial and error because:   1. I don't see the change interactively. I only know whether something works after compiling (which adds up time annoyingly).   2. Different R outputs, e.g. pdf, png, have different measurement units (pdf is in inch, png is in what unit? I'm not even sure). As someone who's only familiar with metric units, this adds to the confusion.   3. When the graphics appears on Latex, it also gets changed yet another time due to the border length of the document. Adding these three sources of unpredictability, it takes an inordinate amount of time to simply specify size. Ideally, I want to be making changes interactively only at one place instead of going back and forth. Is there any best practice I should follow?


title: Font installation in LaTeX: otftotfm mktexupd failed

text: I'm using `otftotfm` tools with a Windows/MiKTeX 2.8 installation, when I run something like               otftotfm -a --verbose -e ec  -fkern -fliga Ubuntu-R.ttf T1--Ubuntu--Regular      I receive an error message that the command `mktexupd` could not be found. It seems to be some dependency that's not present under MiKTeX. Is it possible to use the `otftotfm` tools with MiKTeX?


title: Draw nodes in ring form

text: I want to use this drawing of a neural network and extend it to a recurrent neural network. To do so I'd like to arrange the _hidden_ nodes to a ring and connect every hidden node with the other hidden nodes. This is a simple feed forward network I got from here. Could someone show me how I can accomplish what I need?               \documentclass{article}          \usepackage{tikz}     \begin{document}     \pagestyle{empty}          \def\layersep{2.5cm}          \begin{tikzpicture}[shorten >=1pt,->,draw=black!50, node distance=\layersep]         \tikzstyle{every pin edge}=[<-,shorten <=1pt]         \tikzstyle{neuron}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt]         \tikzstyle{input neuron}=[neuron, fill=green!50];         \tikzstyle{output neuron}=[neuron, fill=red!50];         \tikzstyle{hidden neuron}=[neuron, fill=blue!50];         \tikzstyle{annot} = [text width=4em, text centered]              % Draw the input layer nodes         \foreach \name / \y in {1,...,4}         % This is the same as writing \foreach \name / \y in {1/1,2/2,3/3,4/4}             \node[input neuron, pin=left:Input \#\y] (I-\name) at (0,-\y) {};              % Draw the hidden layer nodes         \foreach \name / \y in {1,...,5}             \path[yshift=0.5cm]                 node[hidden neuron] (H-\name) at (\layersep,-\y cm) {};              % Draw the output layer node         \node[output neuron,pin={[pin edge={->}]right:Output}, right of=H-3] (O) {};              % Connect every node in the input layer with every node in the         % hidden layer.         \foreach \source in {1,...,4}             \foreach \dest in {1,...,5}                 \path (I-\source) edge (H-\dest);              % Connect every node in the hidden layer with the output layer         \foreach \source in {1,...,5}             \path (H-\source) edge (O);              % Annotate the layers         \node[annot,above of=H-1, node distance=1cm] (hl) {Hidden layer};         \node[annot,left of=hl] {Input layer};         \node[annot,right of=hl] {Output layer};     \end{tikzpicture}     % End of code     \end{document}      ![enter image description here](http://i.stack.imgur.com/ynnOH.png) Best regards.


title: references in a smaller font

text: How can I tell LyX to display the bibliographic references in a smaller font? I use the standard "article" document class. When I open the "Settings" of the bibliography, I get a dialog box where I can choose from many styles, but, most of them cause errors when I select them, so I use "plain". I haven't found a way to change the font size.


title: How can I delete non-letter keywords (such as '<-')?

text: I am using the package to try and format my R code, and I don't like some of the things that are being treated as keywords (for the coloring scheme). However, when I specify `deletekeywords={*,<-}` in the `\lstset`, it refuses to remove them. Here is the code:                   \documentclass{scrartcl}         \usepackage{courier}         \usepackage{listings}         \usepackage{xcolor}              \xdefinecolor{gray}{rgb}{0.4,0.4,0.4}         \xdefinecolor{blue}{RGB}{58,95,205}% R's royalblue3; #3A5FCD                    \lstset{ %           language=R,                % the language of the code           basicstyle=\ttfamily\footnotesize,           % the size of the fonts that are used for the code           deletekeywords={*, <-},           numbers=left,                   % where to put the line-numbers           numberstyle=\tiny\color{gray},  % the style that is used for the line-numbers           stepnumber=2,                   % the step between two line-numbers. If it's 1, each line                                           % will be numbered           numbersep=5pt,                  % how far the line-numbers are from the code           backgroundcolor=\color{white},      % choose the background color. You must add         \usepackage{color}           showspaces=false,               % show spaces adding particular underscores           showstringspaces=false,         % underline spaces within strings           showtabs=false,                 % show tabs within strings adding particular underscores           frame=single,                   % adds a frame around the code           rulecolor=\color{black},        % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here))           tabsize=2,                      % sets default tabsize to 2 spaces           captionpos=b,                   % sets the caption-position to bottom           breaklines=true,                % sets automatic line breaking           breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace           title=\lstname,                   % show the filename of files included with         \lstinputlisting;                                   % also try caption instead of title           keywordstyle=\color{blue},          % keyword style           commentstyle=\color{gray},       % comment style           stringstyle=\color{gray},         % string literal style           escapeinside={},            % if you want to add a comment within your code          morekeywords={byrow}               % if you want to add more keywords to the set         }               \begin{document}              \begin{lstlisting}[caption={A first example}, label=list:ex]         x <- c(1, 2, 3, 4, 5, 6)         xmat <- matrix(x, byrow = TRUE, nrow = 3)         xmat %*% t(xmat)         \end{lstlisting}              \end{document}


title: Hyperref pointing is incorrect in the Table of Contents

text: I'm observing strange behavior with `hyperref` and the `\tableofcontents`. Clicking on `List of Tables` or `Synopsis` takes me to the `Preface` page. Perhaps it has something to do with `\chapter*` titles for these sections.               \documentclass{amsbook}     \usepackage[hypertexnames=false]{hyperref}          \begin{document}          \chapter*{Preface}          \tableofcontents     \listoftables          \chapter*{Synopsis}     \section{Section Title}          \begin{table}     \begin{tabular}{c}     stuff     \end{tabular}     \caption{stuff}     \end{table}          \end{document}


title: Multirow and tabularx

text: I'm trying to make a table that should be pretty straight forward. But somehow, the text in the two first cells seems to "forget" that it's using the `X`-alignment command in `tabularx`:               \documentclass[a4paper,11pt]{article}          \usepackage{tabularx,multirow,booktabs,parskip,setspace,amsmath,amssymb}      %This is a colaborate document, there are a shitload of packages, but I believe these     %are the packages relevant for the problem.          \newcommand{\cubes}{m\textsuperscript{3}}        \newcolumntype{C}{>{\centering\arraybackslash}X}     \newcolumntype{L}{>{\raggedright\arraybackslash}X}           \begin{document}          \begin{table}     \begin{minipage}[]{1\textwidth}     \centering     \caption{Expected energy consumption from desalination capacity \label{tab:energy-consumption}}     \begin{tabularx}{1\textwidth}{*{5}{C}}     \toprule     \multirow{2}{*}{Desalination method}&\multirow{2}{*}{Energy consumption [kW/\cubes]}    & \multicolumn{3}{c}{Energy consumption from plant capacity}        \\                         &           & 50,000 \cubes/d   & 100,000 \cubes/d  & 200,000 \cubes/d      \\     \midrule     RO                  & 18        & $900\cdot 10^3$   & $1800\cdot  10^3$         & $3600 \cdot 10^3$     \\     MSF                 & 18        & $900\cdot 10^3$   & $1800\cdot 10^3$      & $3600 \cdot 10^3$     \\     MED                 & 12.5  & $625\cdot 10^3$   & $1250\cdot 10^3$      & $2500 \cdot 10^3$     \\     \bottomrule     \end{tabularx}     \end{minipage}     \end{table}          \end{document}      As the picture clearly shows, the result is not very esthetic (or readable). I would love the table to split "`Desalination \\\ method`" and "`Energy \\\ consumption ...`". Why does not this happen? EDIT: The problem can be avoided by just skipping the `\multirow`-calls and adjusting some tekst in the first row and some in the second (check out a screen dump of the table: http://grab.by/d2KC). But I still find the initial problem intriguing. ![Screendump of produced table](http://i.stack.imgur.com/7EXgO.png)


title: TeX4HT Equation unchanged with newcommand or def command

text: I would like to convert all the inline-math and display-math should be `LaTeX` format only and not for image. I had referred tex4ht leaving equations unchanged and tex4ht leaving equations unchanged - including \[...\] and \(...\). But author defined macros are not converted to `HTML`. LaTeX MWO:               \documentclass{article}     \usepackage{amsmath,amssymb}     \newcommand{\La}{\Lambda}     \def\B{\beta}     \newcommand{\twosilt}{\mbox{\rm 2-silt}}     \begin{document}     In this section, we $\B$ recall some definitions and results.      Throughout $\alpha+\B$ this section, let ${\La}$ be a finite dimensional algebra.      \begin{equation*}     \Phi:\Lambda\longrightarrow\twosilt\Lambda,\ \ \ (X,P)\mapsto \Phi(X,P):=P_X\oplus P[1].     \end{equation*}     \end{document}      How do achieve this?


title: Fitting page size to a tikz figure

text: Sometimes I'm using `tikz` as a plotting tool, without embedding the figure in a document. In this case, I normally, want to include the resulting PDF in a different TeX file (yes I know I could include the TikZ code directly, but it is not helpful in this case). Therefore, I want the picture to fit exactly to the page, so I won't have white space around it. To this end, I'm using the `geometry` package and `clip` of TikZ. For example, here:               \documentclass{minimal}     \usepackage{tikz}     \usepackage[paperwidth=1cm,paperheight=1cm,hmargin=0cm,vmargin=0cm]{geometry}          \begin{document}     \begin{center}     \begin{tikzpicture}     \clip (0,0) rectangle (1,1);     \draw[red] (0,0) -- (1,1);     \draw[red] (1,0) -- (0,1);     \draw[blue] (0,0) rectangle (1,1);     \end{tikzpicture}     \end{center}     \end{document}      Is there a better/nicer/more elegant way to do it? **EDIT 1:** _For the sake of clarifying_ , I used `clip` because I thought it will make things simpler. Without it, things are actually more straightforward. **EDIT 2:** Unfortunately one can only accept one answer. In this case I could accept all. For me, I got to know three new tools, all are slightly different, to accomplish my goal. I choose the Martin's answer due to its standalone nature; no need of neither external tools nor post-proccessing. The other two options yielded more or less the same result.


title: How to implement a white or empty arrow into a circuit?

text: I've read the circuitikz documentation already and there is not such a symbol (not at least in the documentation) comparable with the white/empty arrow on the upper right corner of the circuit (marked as voltage V0). Is there a way of doing so? I am not looking for a current arrow. ![Impedance circuit](http://i.stack.imgur.com/GtuKA.png) ## EDIT: Here is the circuit code.               \usepackage{circuitikz}     \begin{center}     \begin{circuitikz}[american]     \draw (2,0)--(0,0) node[ground]{} to[sV, v=\textit{vi=4Vpp}] (0,2) to[R, l=\textit{r}$_0$\textit{=50$\Omega$}](2,2) to[open] (2,0)--(5.5,0);     \draw (2,2) to[short, *-] (2,1.3) to[short] (2.75,1.3) to[short] (2.75,1.65) to[short, i=$ $] (2.75,2);     \draw (2,2) to[R, l^=$10K\Omega$] (3.5,2) to[short] (4,2);     \draw (3.5,2) -- (4.5,2) to[short, *-*] (5.5,2) to[short] (5.8,2) to[short, i=$ $] (6,2);     \draw (4.5,2) to[R, l_=$10K\Omega$] (4.5,0);     \draw (5.5,2) to[R, l=$5K\Omega$] (5.5,0);     \draw (4.25,1.6) -- (4.25,2.2) to[short] (4.3,2.2) to[short, i=$Z_A$] (4.5,2.2);     \draw (4,2) to[short, -o] (4,2.3);     \draw (4.4,2.5)to[open, l=$A$] (4.4,2.7);     \end{circuitikz}     \captionof{figure}{\small Impedance circuit.}     \end{center}


title: Setting two math symbols directly above each other and vertically aligned

text: I am typesetting the Neyman Pearson decision rule and would like to set the greater than `>` and smaller than `<` symbols directly above each other. I tried `\overset` but that doesn't align the resulting two symbols vertically to the middle.


title: Changing the subfigure caption by removing brackets & font of the subcaption

text: Note that by using `\usepackage[bf]{subfigure}` I'm able to change the label of the subfigure to be boldface. However, the label appears with brackets, e.g., "(a)". How could I get a subfigure label that would look like "a)" Another issue is the font of the text that follows "(a)". What package and options should be put in the preamble to set text to italics?


title: Using \thesubsection in header references last instance - not first

text: I would like to include `\thesubsection` in my header, referring to the _first_ instance of subsection, and not the last as seems to be the default. The following MWE says it all:               \documentclass[a5paper]{article}          \usepackage{fancyhdr}     \usepackage{lipsum}     \usepackage[a5paper]{geometry}          \lhead{\thesubsection}          \pagestyle{fancy}          \begin{document}          \section{Section 1}     \subsection{Subsection 1}     \lipsum[1]     \section{Section 2}     \subsection{Subsection 1}     \lipsum[2]          \pagebreak          \subsection{Subsection 2}     \lipsum[3]     \subsection{Subsection 3}     \lipsum[4]          \section{Section 3}     \subsection{Subsection 1}     \lipsum[5]     \subsection{Subsection 2}     \lipsum[6]     \subsection{Subsection 3}     \lipsum[7]          \end{document}      **Results:**               Page      What I want    What I get     1         1.1            2.1     2         2.2            3.1     3         3.2            3.3


title: BibTeX .bst file: make author's last name uppercase, leave first name intact?

text: How do you set up your BibTeX style file (`.bst`) so that it makes author's surnames (last names) uppercase? Example of what I want: > SILVERMAN, David. _Interpreting qualitative data: methods for analysing > talk, text, and interaction._ 2nd ed. London [etc.]: Sage, 2002. 325 p. ISBN > 0-7619-6865-2. I've made a custom BibTeX `.bst` file for my needs. My current `format.names.author` is as follows: http://pastebin.com/efsgrwDR


title: Justification of captions in List of Figures when using endfloat package

text: I am using the endfloat package to place floats on separate pages at the end of the document, and using the caption package for control of caption formatting, but I cannot figure out how to change the justification of captions within the List of Figures created created using endfloat. I have set the caption justification to raggedright, but this does not alter justification in the LoF. Any simple solutions to altering the format in the LoF? I am calling the packages in the preamble with:               \usepackage[font=doublespacing,justification=raggedright]{caption}     \usepackage[nomarkers,tablesfirst]{endfloat}     \captionsetup{labelsep=none,textformat=empty}      The last declaration being used to suppress captions on the pages with the floats. Could this be solved using the package tocloft?


title: Prefix "Figure" and giving reference to figures

text: Is it possible to adjust the font size of the prefix Figure when captioning an included image? Furthermore, is it possible to refer to a picture in a meaningful way without using a caption; I tried but no number was attributed to the figure I get double ?? instead. I am using the package \hypcap by the way. Thanks MWE:               \documentclass{beamer}          \mode<presentation> {     }     \makeatletter     \let\insertsupervisor\relax     \newcommand\supervisortitle{Supervisor}     \mode<all>     {         \newcommand\supervisor[1]{\def\insertsupervisor{#1}}         \titlegraphic{}     }     \defbeamertemplate*{title page}{supdefault}[1][]     {         \vbox{}         \vfill         \begingroup         \centering         \begin{beamercolorbox}[sep=8pt,center,#1]{title}             \usebeamerfont{title}\inserttitle\par%             \ifx\insertsubtitle\@empty\relax%             \else%             \vskip0.25em%             {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%             \fi%              \end{beamercolorbox}%         \vskip1em\par         \begin{beamercolorbox}[sep=8pt,center,#1]{author}             \usebeamerfont{author}\insertauthor         \end{beamercolorbox}         \ifx\insertsupervisor\relax\relax\else         \begin{beamercolorbox}[sep=8pt,center,#1]{author}             \usebeamerfont{author}\supervisortitle:~\insertsupervisor         \end{beamercolorbox}\fi         \begin{beamercolorbox}[sep=8pt,center,#1]{institute}             \usebeamerfont{institute}\insertinstitute         \end{beamercolorbox}         \begin{beamercolorbox}[sep=8pt,center,#1]{date}             \usebeamerfont{date}\insertdate         \end{beamercolorbox}\vskip0.5em         {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}         \endgroup         \vfill     }     \setbeamertemplate{title page}[supdefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]\makeatother          \usepackage{graphicx} % Allows including images     \usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables     \usepackage[utf8]{inputenc}     \usepackage{color}     \usepackage{hyperref}     \usepackage{siunitx}     \usepackage{hypcap}     \usepackage{amsmath}     \usepackage{pgf}     \usepackage[font={scriptsize}]{caption}     \usetheme{CambridgeUS}     \usecolortheme{seagull}     \setbeamertemplate{bibliography item}[text]     \begin{document}     \begin{frame}         \frametitle{Cooling power measurements}         \begin{columns}[c]             \column{.5\textwidth}             \begin{figure}                 \vspace{-.5cm}                 \includegraphics[width=.9\linewidth]{fig5a.png}\label{fig:5a}             \end{figure}             \footnotesize             \begin{enumerate}                 \item He-Rb mixture with 200 bar He                 \item About 5 mW of cooling power             \end{enumerate}             \column{.5\textwidth}             \begin{figure}                 \vspace{-.5cm}                 \includegraphics[width=.9\linewidth]{fig5b.png}\label{fig:5b}             \end{figure}             \footnotesize             \begin{enumerate}                 \item Ar-Rb mixture with 230 bar Ar                 \item Order of magnitude larger CP             \end{enumerate}         \end{columns}         \footnotesize         \begin{itemize}             \centering             \item Expected cooling power red crosses             \item Observed deflection angle blue crosses         \end{itemize}     \end{frame}     \begin{frame}         \frametitle{Temperature Gradient}         \footnotesize         Using a heat transfer model \cite{24}, after a cooling time $t$, the expected temperature gradient profile is:         \begin{equation}             \frac{dT}{dr}=-\frac{P_{cool}}{2\pi \kappa}\frac{e^{-\alpha z}}{r}\left[ \exp\left(\frac{2r^2}{\omega^2}\right)-\exp\left(\frac{2r^2}{\omega^2-8Dt}\right)\right]         \end{equation}         \begin{description}             \item[Cooling]Probe beam deflected towards the cooling beam\ref{fig:5a}             \item[Heating]Probe beam deflected away from the cooling beam\ref{fig:5b}         \end{description}     \end{frame}     \end{document}


title: algorithm2e with 'ruled' but with caption underneath?

text: I would like to present an algorithm in my article. For that I am using the `algorithm2e` package (and I have used it for many years). I want to use the `ruled` option, i.e., I load the package like this:               \usepackage[ruled,noend,noline,slide]{algorithm2e}      Unfortunately, with the `ruled` option, the `algorithm2e` package puts the caption above the pseudo code. However, I want the caption to appear underneath the pseudo-code, just like any other caption in figures or tables. Does anybody know, what I need to change in the style file to make this possible? Or can I achieve it with the help of the `float` package? (Note that I still would like to have a kind of algorithmic environment like this               \begin{myalgorithm}[tb]     \If{...}     \caption{An algorithm}     \end{myalgorithm}      ) I am using the latest version, i.e., 4.01, of `algorithm2e.sty`.


title: Background overflows when using rounded corners for listings (package: `listings`)

text: I'm using `listings` to list code in my document, and I want the code to be displayed in a frame with rounded corners and a grey background color. But the background overflows the frame, as if the frame was square. Here's a minimal example:               \documentclass[a4paper, 11pt]{article}          \usepackage{color}     \usepackage{listings}          \begin{document}          \lstset{basicstyle=\footnotesize\ttfamily, xleftmargin=1em, xrightmargin=1em,       frame=single, framesep=1em, frameround=tttt,       backgroundcolor=\color[rgb]{0.85, 0.85, 0.85}, captionpos=b}     \begin{lstlisting}     bla bla bla     \end{lstlisting}          \end{document}      Result:   ![result](http://i.stack.imgur.com/MejoY.jpg) Any idea on how to fix this? # EDIT I got the example working now. The problem was due to old versions of required packages.


title: Acronyms sorted alphabetically in Index

text: I am using glossaries package with the acronym option `\usepackage[acronym,toc,shortcuts]{glossaries}`. When my Index is generated, the acronyms are not listed alphabetically but rather as a "Symbol" entry within the index (image below). I am writing a thesis and have a separate list of Acronyms so this "Symbol" entry in the Index is rather useless for me. Is there a way that the acronyms can be sorted alphabetically in the Index just like the rest of the entries? MWE:               \documentclass[11pt]{article}     \usepackage{makeidx}      \makeindex     \usepackage[acronym,toc,shortcuts]{glossaries}     \makeglossaries          \newacronym{cd}{CD}{compact disk}               \begin{document}     \noindent     First\index{first} use of \gls{cd}\\     subsequent\index{subsequent} use of \gls{cd}\index{\glsfirst{cd}}          \printglossaries     \printindex          \end{document}      ![Index](http://i.stack.imgur.com/I8qqN.png)


title: Is there a way to paste a matrix cell-by-cell in Lyx?

text: I would like to paste a matrix in Lyx, just like it was a table (edit->paste special, etc), except into a display math matrix. Any ideas? I can't get it to work, though pasting into tables works fine. Tx!


title: Title of listing is missing

text: I am using the `listings` package to mark-up C and Assembler code. Unfortunately the title of the listing is missing (the same with the `caption=...` command). In the document section I using my `clisting` statement for C code and `asmlisting` for Assembler (both the same problem). Here a MWE:               \documentclass[a4paper,10pt]{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[ngerman]{babel}     \usepackage{listings}     \usepackage{xcolor}     \usepackage{times}     \usepackage{graphicx}          \lstnewenvironment{asmlisting}{         \lstset{             language={[x86masm]Assembler},             basicstyle=\ttfamily\small,             breaklines=true,             prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=lines,             tabsize=2,             showtabs=false,             showspaces=false,             showstringspaces=false,             keywordstyle=\color{blue}\bfseries,             stringstyle=\color{green!50!black},             commentstyle=\color{green}\itshape,             numbers=none,             captionpos=t,             escapeinside={\%*}{*)},             extendedchars=true,         }     }{}          \newcommand{\clistingset}{             \lstset{             language=C,             basicstyle=\ttfamily\small,             breaklines=true,             prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=lines,             tabsize=2,             showtabs=false,             showspaces=false,             showstringspaces=false,             keywordstyle=\color{blue}\bfseries,             stringstyle=\color{green!50!black},             commentstyle=\color{green}\itshape,             numbers=none,             captionpos=t,             escapeinside={\%*}{*)},}     }                    \begin{document}          \section*{Kap. 1}          \subsection*{Aufgabe 1}          \begin{asmlisting}[title=hallo] % this title is not displayed in the comp. doc.      .INCLUDE "usb1287def.inc"      .ORG    0           start:         ldi r16, 4         clr r17           loop:         add r17, r16         cpi r17, 32         brne loop           end:         rjmp end     \end{asmlisting}          \cleardoublepage     \section*{Kap. 14}          \clistingset     % remarked to prevent compilation errors. This title is displayed in the comp. doc.     %\lstinputlisting[title=Aufg1.c]{Ueb14/Aufg1.c}          \end{document}      Does anyone have an idea what I'am doing wrong?


title: LaTeX symbol formatting

text: \int_{\mathbb R^D} \Delta S \cdot S \, dx       = -\int_{\mathbb R^D} \nabla S\cdot \nabla S\, dx        = \mean{(\nabla S)^2}      I want to write average symbol on `$(\nabla S)^2$` but it is not workig. How can I write? ![enter image description here](http://i.stack.imgur.com/XKbt1.jpg)


title: Some errors with a little document

text: I have some errors with my paper in LaTeX, and I don't understand how to fix the problems : The first is : > >     pdfTeX warning (ext4): destination with the sa >     me identifier (name{page.1}) has been already used, duplicate ignored >     <to be read again> >   On google, I found that I have to add the option `pdfpagelabels`, but I still get this error. Then I have an other error : > >     <to be read again> >                        \relax >     l.37 \chapter >                  {Introduction} [1] >   Just after the previous one. This one I have no idea how to fix the problem. I don't know why there is this eroor. And the last one is a warning : > >     Overfull \hbox (16.278pt too wide) in paragraph at lines 43--44 >     \T1/cmr/m/n/10 I did my in-tern-ship in a lab-o-ra-tory in Nantes called > [][] >   I use the package `acronym`, but unfortunately the acronym is too long, and so I have the warning that a paragraph is too wide. Can fix it, and how ? I give you the original document :               \documentclass[a4paper]{report}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[stable]{footmisc}                    \usepackage{algorithm}     \usepackage{acronym}     \usepackage{geometry}     \usepackage{graphicx}               %\usepackage{pdftex}     \usepackage[pdfpagelabels]{hyperref}     \hypersetup{%         pdfborder = {0 0 0}     }     \title{Prediction of Parallel Speed-ups for Las Vegas Algorithms}     \author{François Thiré}     \date{\today}          \pagestyle{headings}          %Acronyms     \acrodef{lina}[Laboratoire d'Informatique de Nantes Altantique]{LINA}     \begin{document}     \maketitle     \tableofcontents          \section*{Acknowledgement}     \chapter{Introduction}     \chapter{\acl{lina}}          I did my internship in a laboratory in Nantes calle \ac{lina}\footnote{Computer sciences laboratory of Nantes Atlantique}. The following           words will present this laboratory.      \begin{appendix}     \chapter{Bibliography}     \end{appendix}     \end{document}


title: How to make a transportation tableau

text: I am trying to make a transportation tableau in LaTeX. The tableau I wanted looks like the one below. ![enter image description here](http://i.stack.imgur.com/BaqR2.jpg)


title: Referencing using Misc

text: Surprisingly I can not find an answer to this question. Where does the author go in the following example:               @misc{Chen,     title = {{Chen. H} Basics of Probability Theory},       howpublished = {\url{http://www.math.ntu.edu.tw/~hchen/teaching/StatInference/notes/lecture2.pdf}},       note = {Accessed: 2013-15-4}     }      The problem that is occurring for me is the in the form I currently have it I am getting alphabetical ordering for web resources but the books are being involved.


title: Fool-proof paragraph skipping

text: I'm using XeLaTeX, and I need to have paragraphs that are only separated by vertical space, and with no indentation. However, no matter what I try, I always get indented paragraphs. This is my complete preamble (after it comes `\begin{document}` and normal text):               \documentclass[a4paper,10pt]{article}     \usepackage{listings}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{polyglossia}     \usepackage[pdfusetitle,bookmarks=true,       bookmarksnumbered=true,bookmarksopen=false,       breaklinks=false,pdfborder={0 0 0},backref=false,       colorlinks=false]{hyperref}     \usepackage{fontspec}     \usepackage{fancyvrb}     \usepackage{marginnote}     \usepackage[outer=4cm, heightrounded, marginparwidth=3cm,       marginparsep=0.5cm]{geometry}     \usepackage[parfill]{parskip}          % Bug in TexLive 2010     \DeclareUTFcharacter[\UTFencname]{x00A0}{\nobreakspace}          \setmainfont[Mapping=tex-text,Scale=MatchLowercase,Ligatures=Common]{Garamond Premier Pro}     \setsansfont[Mapping=tex-text,Scale=MatchLowercase,Ligatures=Common]{Myriad Pro}     \setmonofont[Scale=MatchLowercase,BoldFont={PragmataPro Bold},ItalicFont={PragmataPro Italic},BoldItalicFont={PragmataPro Bold Italic}]{PragmataPro}      I have also tried:               % Paragraphs     \setlength{\parskip}{\smallskipamount}     \setlength{\parindent}{0pt}     \setlength{\intextsep}{0pt}      Neither of these methods work. What am I doing wrong? * * * I am using:               XeTeX 3.1415926-2.4-0.9998 (TeX Live 2012/Arch Linux)     kpathsea version 6.1.0     Copyright 2012 SIL International and Jonathan Kew.     There is NO warranty.  Redistribution of this software is     covered by the terms of both the XeTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the XeTeX source.     Primary author of XeTeX: Jonathan Kew.     Compiled with ICU version 49.1 [with modifications for XeTeX]     Compiled with zlib version 1.2.7; using 1.2.7     Compiled with FreeType2 version 2.4.11; using 2.4.11     Compiled with fontconfig version 2.10.92; using 2.10.92     Compiled with libpng version 1.5.15; using 1.5.15     Compiled with poppler version 0.22.3      * * * Test document demonstrating the issue:               \documentclass[a4paper,10pt]{article}     \usepackage[pdfusetitle,bookmarks=true,      bookmarksnumbered=true,bookmarksopen=false,      breaklinks=false,pdfborder={0 0 0},backref=false,      colorlinks=false]{hyperref}     \usepackage[parfill]{parskip}          \title{Test}     \author{Me \and You}     \date{\today}          \begin{document}          \maketitle          \abstract{       Something something            Something something     }          \pagebreak          \tableofcontents          \pagebreak          \section{Introduction}          I don't want to change the prelude in case I mess something up. I     don't want to change the prelude in case I mess something up. I don't     want to change the prelude in case I mess something up. I don't want     to change the prelude in case I mess something up. I don't want to     change the prelude in case I mess something up.          So here is just normal text instead of lipsum. So here is just normal     text instead of lipsum. So here is just normal text instead of     lipsum. So here is just normal text instead of lipsum. So here is just     normal text instead of lipsum. So here is just normal text instead of     lipsum.          \end{document}


title: Multithread integral function executing picture

text: I need to make a picture that should look like ![image](http://i.stack.imgur.com/wD5qh.png) I saw a similar question here but the red function line appears neither when I use `\--shell-escape` nor when I use `\--enable-write18`. I use TeXstudio, by the way. TikZ and pgf packages are installed. UPD: Code which I used                   \documentclass[]{scrartcl}     \usepackage{tkz-fct}             \begin{document}     \begin{tikzpicture}[scale=1.25]     \tkzInit[xmax=8,ymax=4]     \tkzAxeXY[ticks=false]     \tkzGrid        \tkzFct[color = red, domain =0.125:8]{4./x}     \tkzDrawRiemannSumInf[fill=green!60,                          opacity=.2,                          color=green,                          line width=1pt,                          interval=1:8,                          number=7]       \foreach \x/\t in {1.5/$a_1$,2.5/$a_2$,3.5/$a_3$,7.5/$a_7$}      \node[green!50!black] at (\x,{4/(\x+1)-0.25}){\t};       \end{tikzpicture}        \end{document}       And maybe there are some good graphic editors to draw such things by hand?


title: Using \def in \psplot

text: For reasons I cannot explain `\def`'s don't seem to always work in/with `\psplot` as shown below               \documentclass[english, landscape, a4paper]{slides}          \usepackage{graphics}     \usepackage{graphicx}     \usepackage{babel}     \usepackage{fp}     \usepackage{pst-plot}     \usepackage{pstricks}          \usepackage[active,tightpage]{preview}     \PreviewBorder=4pt     \PreviewEnvironment{pspicture}          \begin{document}         \begin{center}             \begin{pspicture*}(-1.5,-1)(1.5,1.5)                 \def\tI{0.0}                 \psplot{0.0}{1.0}{x \tI sub}   % does not work                 % \psplot{0.0}{1.0}{x \tI sub} % works             \end{pspicture*}         \end{center}     \end{document}      I compile the above file with `xelatex file` and get the error               Error: /undefined in 0.0sub     Operand stack:        --nostringval--   0.0   0.0     Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %s       --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_     pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %error     ingval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nos     ...     ** WARNING ** Filtering file via command -->mgs.exe -q -dNOPAUSE -dBATCH -sPAPERSIZE=a0 -s     yLevel=1.3 -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorIm     /FlateEncode -dUseFlateCompression=t      Can someone please suggest a workaround for this problem?


title: How do I enlarge hyperref's reference link boxes to cover additional text around the actual reference counter in a numeric bibliography style?

text: I am using the `memoir` class with a numeric citation style that adds the letter "r" before a reference. A minimal example would be this:               \documentclass{memoir}     \usepackage[super]{natbib}     \usepackage{hyperref}          \setcitestyle{open={[r},close={]},citesep={; r}}          \begin{document}          Here is the document's body text. Dummy\citep{Erdos01,lamport94} text. Dummy text.          \begin{thebibliography}{9}     \bibitem{Erdos01} P. Erd\H os, \emph{A selection of problems and results in combinatorics}, Recent trends in combinatorics (Matrahaza, 1995), Cambridge Univ. Press, Cambridge, 2001, pp. 1--6.     \bibitem{lamport94}       Leslie Lamport, \emph{\LaTeX: A Document Preparation System}. Addison Wesley, Massachusetts, 2nd Edition, 1994.     \end{thebibliography}          \end{document}      The superscript citation style is achieved with `natbib`'s `super` option (and I'd like to maintain this setup), and the link boxes around the citation numbers are achieved through `hyperref`. The reference compiles to a superscript "[r1; r2]", as intended, but hyperref's link boxes cover only the numbers "1" and "2"; how do I make hyperref's boxes cover the entire "r1" and "r2"?


title: TikZ: naming paths in a \foreach and accessing them later

text: \documentclass[convert = false, tikz]{standalone}     \usetikzlibrary{calc}     \usetikzlibrary{intersections}          \begin{document}     \begin{tikzpicture}       \coordinate (P1) at (60:4cm);       \coordinate (P2) at (-20:4cm);            \def\rad{1}            \draw[name path global = line] (0, 0) -- (P1);            \foreach \pos/\i in {(P1)/1, (P2)/2}{         \draw[name path global = circ\i] \pos circle[radius = \rad];       }            \node[coordinate, name intersections = {of = line and circ1}] (P) at       ($(intersection-1)$) {};     \end{tikzpicture}     \end{document}      I am told that `LaTeX` doesn't know the name `\circ1` and perhaps I misspelled it. How can I access the named path for an intersection calculation?


title: Drawing a logo in LaTeX to be incorporated as header

text: Is it possible to draw this image using LaTeX so that it can be incorporated in letterhead as a logo: ![enter image description here](http://i.stack.imgur.com/sdJbm.png)


title: How to draw bent arrows going to a new line in long formulas (ex. chain complexes)

text: I have to write quite long chain complexes such as `0\rightarrow A \rightarrow B \rightarrow C \rightarrow` etc. with many terms in them, and I would like the arrows close to the side of the page to bend backwards and lead to a new line as you can see at page 31 of these notes (corollary 3.4.2). How do I do that?


title: List of equations in separate pdf

text: I am communication with my coauthors via email. This time, I am the author, so I send them the PDF file of the document, and they send me corrections. Then I'd like to implement these corrections. They are of the form: > In Equation (3.2) blah blah   >  In Theorem C blah blah So now, what I'd like to have is a list of equations in a separate window. I would click on the appropriate entry in the list, which would then take me to the equation in my document's PDF (using Okular, if that's important), and then I could make the appropriate changes in the `.tex` file. Presently, when I read "In Equation (3.2) change...", I need to scroll to Equation (3.2), make a small change then see the next error. And there are about a hundred small errors like this. To make the system perfect, it would be great if the list of equations would automatically update itself when I make a change in the `.tex` file and run `pdflatex`. Clearly, I'd like to have something similar for theorem-like environments.


title: Remove blank lines in minted

text: Is it possible to remove blank (empty) lines in `minted`, and gobble multiple blank lines to a specified amount, like the `emptylines` option in `listings`?               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{minted}     \usepackage{listings}     % I want something like the emptylines option     \lstset{language=[Visual]{C++},emptylines=1}     \begin{document}     \begin{minted}[frame=single]{cpp}     int i = 0;               i++;     \end{minted}     \begin{lstlisting}     int i = 0;               i++;     \end{lstlisting}     \end{document}