title: Plotting y=exp^(-x^2)

text: I am having difficulty plotting this graph using Tikz. I get Dimension Too Large error. The code I have generated via Geogebra is:               \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]          \draw[->,color=black] (-4.3,0.0) -- (7.3,0.0);          \foreach \x in {-4.0,-3.0,-2.0,-1.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0}          \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};          \draw[->,color=black] (0.0,-3.12) -- (0.0,6.3);          \foreach \y in {-3.0,-2.0,-1.0,1.0,2.0,3.0,4.0,5.0,6.0}          \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};          \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};          \clip(-4.3,-3.12) rectangle (7.3,6.3);          \draw[smooth,samples=100,domain=-4.3:7.3] plot(\x,{0.7*2.718281828^(-(\x)^(2.0))});          \begin{scriptsize}          \draw[color=black] (-4.140000000000001,-0.12000000000000002) node {$f$};     \end{scriptsize}     \end{tikzpicture}      Does anyone know why this is? It appears to be a problem specific to exponential as I have experimented with different functions and it works fine.


title: create a table with multicolumns for comparison between 2 sources of data

text: I wanted to create a table of three columns . the first has several rows and each of the second and third is divided into two columns. I do not know what could be wrong.               \document class{article}       \newcommand{\splitcell}\[1\]{%     \begin{tabular}{@{}c@{}}\strut#1\strut\end{tabular}%     }          \begin{document}          \begin{table}\[htp\]     \centering          \caption{A caption}          \begin{tabular}{         S\[table-format=2.0\] % Column 1         S\[table-format=1.0\] % Column 2         S\[table-format=1.6\] % Column 3         S\[table-format=1.4\] % Column 4         S\[table-format=1.3\] % Column 5     }          \toprule     {Metal type/ Metal thickness $t$(\si{\nano\meter})} & \multicolumn{2}{c}{Akbari} & \multicolumn{2}{c}{Naema} \\     \cmidrule{2-3} \cmidrule{4-5}      & & {$Re(n_{eff})$}  {\splitcell{\\$\alpha$\\(\si{dB/\mu m})}} &   {$Re(n_{eff})$}  {\splitcell{\\$\alpha$\\(\si{dB/\mu m})}}\\     \midrule     Al/100nm & 3.619 & 1.041 & 3.607517& 1.04979 \\     \midrule     Au/100nm & 3.772 & 1.228 &3.762532 & 1.29734 \\     \midrule     Al/20nm & 3.72 & 2 & 3.65266 & 2.00962\\     \midrule     Au/20nm & 4.2 & 5 & 4.001033 & 3.25059\\     \midrule     Al/10nm & 5.12 & 23.5 & 3.865893 & 5.12678\\     \midrule     Au/10nm &   NA & 33.5 & 4.809568 & 9.15694 \\          \bottomrule          \end{tabular}     \end{table}     \end{document}      The table is here


title: How to change date format to German?

text: I use the `\today` comment, then it produces `den 26th February`. However I want `den 26ten Februar`. How can I change that?


title: How can I insert two pictures on the first page in xelatex?

text: My document has one "figure" section, but I don't want to show the title in the section, so I define a new command "nosection" to do this.               \newcommand{\nosection}[1]{      \refstepcounter{section}%     \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}}      and I want to insert two pictures in each page exactly, and make each picture as big as possible, so I use the following code.               \nosection{Figures}     \begin{figure}[htb]         \centering         \hypertarget{figure1}{}                   \pdfbookmark[2]{Figure1}{figure1}         \includegraphics[height=0.45\textheight, width=0.95\textwidth, keepaspectratio]{1.eps}         \caption{}     \end{figure}          \begin{figure}[b]         \centering         \hypertarget{figure2}{}                   \pdfbookmark[2]{Figure2}{figure2}         \includegraphics[height=0.45\textheight, width=0.95\textwidth, keepaspectratio]{2.eps}         \caption{}     \end{figure}          \begin{figure}[htb]         \centering         \hypertarget{figure3}{}                   \pdfbookmark[2]{Figure3}{figure3}         \includegraphics[height=0.45\textheight, width=0.95\textwidth, keepaspectratio]{3.eps}         \caption{}     \end{figure}          \begin{figure}[htb]         \centering         \hypertarget{figure4}{}                   \pdfbookmark[2]{Figure4}{figure4}         \includegraphics[height=0.45\textheight, width=0.95\textwidth, keepaspectratio]{4.eps}         \caption{}     \end{figure}      But the first page of the "Figures" section only has one picture, I don't know why. All the pictures is small enouth to show 2 pictures in one page. PS. The last page has only 1 picture, how can I put the picture on the top of the page? I have tried to use "\begin{figure}[t]", but it didn't work.


title: Fonts issues in xelatex

text: I would like to know what is the right way to define all the text font as a specific size. I use `\documentclass[20pt]{article}` but it won't change the font size in xelatex. And these symbols (`"` and `'`) are not Times fonts and now matter how I changed the fonts , they look the same. Here is the min working code. I would like to know what is the right way to address font selection in xelatex. Can I get like this ?   ![enter image description here](http://i.stack.imgur.com/zeOVX.png) Instead of this ? ![enter image description here](http://i.stack.imgur.com/Cp1cr.png)                %!TEX TS-program = xelatex           \documentclass[20pt]{article}      \usepackage{geometry}      \usepackage{mathspec}      \usepackage{lipsum}      \setmainfont{Times}      \setmathsfont(Digits,Latin,Greek){Times}      \usepackage{titling}      \usepackage{titlesec}      \usepackage{setspace}      \usepackage[colorlinks,urlcolor=black]{hyperref}      \doublespacing      \titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}       \begin{document}      \section{"check"}     "just checking" this is a "check" and 'check'.       \end{document}


title: biblatex - year in parentheses for references with authoryear?

text: According to guidelines, besides printing the year in parentheses in the bibliography (which is working by default), I must have the year in parentheses for the references. Also, I have to use references in footnotes. Here is the mwe.


title: How may I use selnolig for a bilingual document?

text: The great package `selnolig` offers support for the English or the German language. Maybe I have overseen it, but is there a possibility to change the language-option inside the document? The best way would be to let it change by the macros of `polyglossia`. Please see my MWE and the two images!               % arara: lualatex          \documentclass{article}     \usepackage{polyglossia}     \usepackage{microtype}     \usepackage{fontspec}     \setmainfont{Linux Libertine O}     \setdefaultlanguage[%         ,babelshorthands=true         ]{german}     \setotherlanguage[%         ,variant = british         ]{english}     \usepackage[%         %,german         ,english         ]{selnolig}          \begin{document}     \noindent Auftakt, halftime\\     \begin{english}     Auftakt, halftime     \end{document}      `german`-option enabled: ![enter image description here](http://i.stack.imgur.com/EC05c.png) `english`-option enabled: ![enter image description here](http://i.stack.imgur.com/aSrlI.png) **Edit** It is possible to load both options and to get the correct result for my example. But I guess that there will be clashes between the rules (can't think of an example at the moment). Especially for the future version of `selnolig` which provides hyphenation rules as well. So my question could also be: Does `selnolig` recognize the current language when both local options are loaded? A `babel` solution would be fine, too, but I understand that I should use `polyglossia` with LuaLaTeX. **Edit 2** As can be seen in my new images, the answer to my last question is "no". The package searches for German/English words over the whole document ignoring the current language environment.


title: Raise text out of the paper plane (with shadows as well)

text: How would one achieve an "raised-text-box-effect (with added shadows)" like in the picture below for _`G(V, E)`_ (the `\raisebox` command apparently isn't meant for this task): ![raised text-box](http://i.stack.imgur.com/JqbR3.png)


title: How to put bibliography under appendix

text: I already have a reference put using `bibtex`. I need to put few of my references under appendix. I tried giving like this in my project report:                 \bibliography{biblio}         \bibliographystyle{ieeetr}         \appendix         \chapter{List of Publications}         \begin{thebibliography}{1}         \bibitem{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western         Learning in Early-Modern Japan} 1986: Harvard University Press.         \end{thebibliography}      But this put bibiliography separately under another page. And appendix is listed as List of Publications with a blank page and bibliography page comes just after that.


title: Is there another better way to have a region with gradient opacity?

text: My objective is to get a region with gradient opacity. In the following MWE, the region is a quarter of a disk on the top a bird. I made the gradient opacity by partitioning the sector into 45 _infinitesimal_ sub-sectors.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{multido,pst-fun}     \SpecialCoor     \begin{document}     \begin{pspicture}(5,5)         \psParrot{.75}         \psset{linestyle=none,linewidth=0,fillstyle=solid,fillcolor=green}         \multido{\i=0+2,\r=.00000+.01111}{45}{\pswedge[opacity=\r](0,0){5}{\i}{!\i\space 2 add}}     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/8So1C.png) My question: Is there another better way to get the same effect? For example without partitioning the region into several infinitesimal sub-regions? Any solution with PSTricks (preferred), Asymptote, TikZ, Metapost are welcome.


title: Problem with  inserting images on specific page

text: I am producing a pdf file using LaTeX. Now I want to insert some images on page 13 and page 14 of my LaTeX generated pdf document. That images are stored in some other pdf file. So I want to get that images and insert at the bottom of page 13 and page 14. I tried with `\includegrapics` and `\includepdfpages` but both are inserting images at the beginning of the document. I need to insert images at the bottom of page 13 and 14, can anyone help me how to insert images on that specific page. I tried like this.                \documentclass[a4paper,leqno,twoside]{article}      \usepackage[latin1]{inputenc}      \usepackage[english]{babel}      \usepackage{multirow}      \usepackage{graphicx}      \usepackage{pdfpages}           \begin{document}            \includegraphics[width=5in,height=5in,page=1]{apsi.pdf}        \includegraphics[width=5in,height=5in,page=1]{apsi.pdf}            [% FOREACH st IN Service %]       Name,Id: [% st.Id %], [% st.Name %]            des:[% st.Description %]            Customers:[% FOREACH softservice IN st.Customers %]                 [% FOREACH swid IN softservice.SW %]                 [% swid.Service %]                  [% FOREACH st IN Service %][% IF swid.Service == st.Id %]                 ([% st.Name %])                       [% END %] [% END %][% END %][% END %]       \newpage       [% END %]      \end{document}      I don't know how to insert a pdf image at a specific page number in the LaTeX generated pdf document. Anybody suggest me how to do this?


title: Controlling the orientation of a Tikz decoration markings arrow?

text: I thought that my woes in Decoration marking arrow style ignored in custom node shape? were temporarily solved, but alas: if I do a dimension line `(A) -- (B)`, then all is fine; but if I do `(B) -- (A)`, then one of the arrows gets inverted; the output of the MWE below is: ![test06a](http://i.stack.imgur.com/atN2a.png) Now, as I saw in How to draw just the arrow tip in TikZ, just the arrow tip can be reproduced with, say:               \draw[-latex] (0.4,0.4);      This is a line with length 0, starting at (0.4,0.4); interestingly, in the MWE, the result of this command is an arrow pointing _up_ (and the answer at previous link uses `node[rotate=90,inner sep=0pt] {\tikz\draw[-triangle 90](0,0) ;};` to rotate the arrow). My first question is: can the orientation of an arrow be changed for a zero length line, _without_ wrapping it in a context (like `\node`, or `{scope}` etc) that would rotate it wholesale? My second question is - can the dimension line code be somehow fixed, so the correct dimension line arrows are displayed, regardless if the line drawing goes in the `(A) -- (B)` or the opposite `(B) -- (A)` direction? The MWE:               \documentclass[varwidth,tightpage,border=1bp]{standalone}          \usepackage{tikz}     \usetikzlibrary{decorations}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{shapes}     \usetikzlibrary{calc}          \pagecolor{yellow!15} % ignored with preview, but not w/ varwidth          \begin{document}          Hello:          \begin{tikzpicture}          \makeatletter     % http://tex.stackexchange.com/questions/185444/     \gdef\tout{}\gdef\trfm{}     \gdef\typeoutMyInfoString#1{%       \pgfgettransform{\trfm}%       \edef\tout{#1 %         pgfgettransform: \trfm ; %         pgf@pt@aa, pgf@pt@ba, pgf@pt@ab, pgf@pt@bb: \pgf@pt@aa, \pgf@pt@ba, \pgf@pt@ab, \pgf@pt@bb %       }       \typeout{\tout} %     }     \makeatother          % http://tex.stackexchange.com/a/185454/2595     \tikzset{ %       declare function={multip(\a,\b)=\a*\b;}, % otherwise cannot use pgfmathparse here       tconarrC/.style n args={5}{         line width=#3,         draw=#5,         decoration={markings,           mark=at position 0 with {%             \typeoutMyInfoString{pos 0:}%             \pgftransformresetnontranslations %             \pgftransformscale{#4} %             \arrow[sloped,rotate=0,scale=1,fill=#5]{#1}; % (c3)           },           mark=at position 1 with {% 0.999999             \typeoutMyInfoString{pos 1:}%             \pgftransformscale{#4} %             \arrow[sloped,scale=1,fill=#5]{#2};           },         },         shorten >={multip(#4,#3)},         shorten <={multip(#4,#3)},         reset transform/.code={},         postaction={reset transform,decorate},       },       tconarrC/.default={latex}{latex}{3pt}{1.3}{black},       dimen/.style={|-|,         tconarrC={latex}{latex}{\pgflinewidth}{2.0}{gray},         every rectangle node/.style={midway,},       },       minbox/.style={shape=rectangle,inner sep=0pt,outer sep=0pt,minimum size=0pt},     } % end tikzset     \makeatletter     \pgfdeclareshape{myshape}{ %       \inheritsavedanchors[from={rectangle}] %       \inheritbackgroundpath[from={rectangle}] %       \inheritanchorborder[from={rectangle}] %       \foreach \x in {center,north,north east,north west,south,south east,south west,east,west}{ %         \inheritanchor[from={rectangle}]{\x} %       } %       \backgroundpath{ %         \edef\ename{\tikz@fig@name} %         \node[rectangle,minimum size=10pt,draw] (\ename-A) at (\ename.east) {};         \node[rectangle,minimum size=10pt,draw] (\ename-B) at (\ename.west) {};       }       \foregroundpath{ %         \draw[dimen]           (\ename-A.center) -- (\ename-B.center)           node[minbox,above=0pt] (\ename-L) {M$_1$}         ;         \draw[dimen]           ($(\ename-B.center)-(0,1em)$) -- ($(\ename-A.center)-(0,1em)$)           node[minbox,above=0pt] (\ename-L) {M$_2$}         ;       }     } % declareshape     \makeatother          \node[fill] (origin) at (0,0) {};     \draw[-latex] (0.4,0.4);          \node[myshape,minimum size=2cm,anchor=south west] (tshape) at (1,1) {};          \draw[dimen]       ($(tshape-A.center)-(0,3em)$) -- ($(tshape-B.center)-(0,3em)$)       node[above=-1pt] {A};     \draw[dimen]       ($(tshape-B.center)-(0,4em)$) -- ($(tshape-A.center)-(0,4em)$)       node[above=-1pt] {B};          \end{tikzpicture}     \end{document}


title: Problem with cases environment when used in a stack

text: I use the following code when I want to typeset math which was kindly written by Stephen B. Segletes but I have a problem when I try to use in it the `cases` environment. There is no problem with the `cases` code as when I use it outside the `\SS` it works. Why is that happenning? How can I fix it?               \documentclass[12pt]{article}     \usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}          \usepackage{multicol}          \setlength{\parindent}{0cm}          \usepackage{xltxtra}     \usepackage{xgreek}     \setmainfont[Mapping=tex-text]{GFSDidot.otf}     \setsansfont[Mapping=tex-text]{GFSDidot.otf}          \usepackage{amsmath}     \usepackage{unicode-math}          \everymath{\displaystyle}                    \usepackage[usestackEOL]{stackengine}     \stackMath     \def\stackalignment{l}     \setstackgap{S}{10pt}     \def\SS#1{\noindent\addstackgap[3pt]{\Shortstack{#1}}\vspace{2ex}\par\vfil}               \newcommand{\3}{\vspace{0.3cm}}          \title{}     \author{}     \date{}          \begin{document}          \SS{     \vec{H}_{1}=\vec{H}_{3}=0\Rightarrow \vec{B}_{1}=\vec{B}_{3}=0\\     \vec{H}_{2}=K_{0}\hat{x}\\     \vec{B}_{2}=\begin{cases}     \mu_{1}(z)\vec{H}=\mu_{1}(z)K_{0}\hat{x} & 0<z<h_{1}\\     \mu_{2}H=\mu_{2}K_{0}\hat{x} & h_{1}<z<h     \end{cases}     }          \end{document}


title: How to put a matrix of images?

text: I´m trying to put 4 images as a matrix 2 x 2 I´m having troublees with the firs row.... What am I doing bad? (I have read that subcaption(or similar name) package .... was a good packed)               \documentclass[12pt,a4paper]{article}     \usepackage{mwe}     \usepackage{graphicx}          \begin{document}     \begin{tabular}{|c|c|}           \hline           % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...           \includegraphics[width=60mm]{simu.jpg} & \includegraphics[width=60mm]{simu.jpg} \\           {\small ''iteraciones máximas de BT''=20} &  \\           {\small ''Periodo de Tenencia en Lista Tabú''=2}&  \\           \hline     \end{tabular}     \end{document}       What do you recommend me? What´s the best practise/way in these cases. The simu.jpg is a normal image SIMU.JPG * * * With These technic I obtained a months ago this ![example a row with 4 images](http://i.stack.imgur.com/dzg2M.jpg), without any problem.


title: How to put something at the top of the \longrightarrow?

text: I would like to put something at the top of the `\longrightarrow`, something like `\longrightarrow^{k\rightarrow\infty}`. However, instead of putting `k\rightarrow\infty` on the top right corner, I would like to put it in the middle on the top of `\longrightarrow`. Could someone help me?


title: How to adjust the alignment of a mathematical expression in a text section? e.g. argmax

text: I am using the following definition to generate the `argmax` operator:               \DeclareMathOperator*{\argmax}{\arg\!\max}      However the problem is when I use it in a part that some text exists because of the written argument under `argmin` the next line appears with a abnoraml distance in order to keep the distance from the argument under argmin. However when I use `\frac` for example, this time, the proportion adjusts itself to not to overlap with the next line. How can I change the above command to behave like the `frac`? Examples:               \documentclass{article}     \usepackage{amsmath}          \DeclareMathOperator*{\argmax}{\arg\!\max}          \begin{document}       This is a test. This is a test. $\argmax\limits_{x}{x^2}$ This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test.     \end{document}      With output ![enter image description here](http://i.stack.imgur.com/7QrCJ.png) As opposed to:               \documentclass{article}     \usepackage{amsmath}          \DeclareMathOperator*{\argmax}{\arg\!\max}          \begin{document}     This is a test. This is a test. $\frac{x}{x^2}$ This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test.     \end{document}      With output![enter image description here](http://i.stack.imgur.com/IZICt.png)


title: Equation over picture (overpic)

text: Is there a way to place a mathematical equation over a picture? I am using the `overpic` package and `\put` command, but it doesn't work (`\usemath`, `\begin{equation}...\end{equation}`).               \begin{figure}[h!]       \caption{Caption}       \centering        \begin{overpic}[width=\textwidth]{ipad-frame.jpg}         \put(150,140){          \color{black          \begin{equation}           \cos\alpha = \frac{u \times v}{|u| \times |v|}          \end{equation}          }         }        \end{overpic}     \end{figure}      Any way to solve this?


title: Preserving styles while changing axis y line in pgfplots

text: The code for the MWE generating this image is given below (click for full- size): ![test-sbs.png](http://i.stack.imgur.com/BaZZ8.png) Basically, I had some graphs like on the left, until I realized I need to shift the x axis - this also forces me to move `axis y line=middle` (left-hand plot) to `axis y line=left` (right-hand plot). My questions are:   * How do I get the xlabel ("t [ms]") and the ylabel ("D"), to be in the same position on the right-hand plot, as they are on the left-hand plot? (hopefully, with a single command to be used both places; that is, without having to use rotate in one, and not use rotate in the other)   * How do I get the zero to disappear as first y axis tick label on the right-hand plot, without entering labels manually?   * How do I get the zero to appear as first x axis tick label on the left-hand plot?   * I like the organization of one `tikzpicture` with two `scope`s inside; however the `xshift` of the right-hand plot is trial&error. What would be the recommended "automatic" way to get the two plots side by side, each taking up half of the page width, with this structure (that is, without introducing extra `minipage`)? And a side question: how do I get the axes tick label font to be the same as the rest of the document style (here `IEEEtran`)? Here is the code:               \documentclass[%       12pt,       journal,       twoside,       draftcls,       letterpaper,     ]{IEEEtran}          \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikz}               \begin{document}          \begin{tikzpicture}          \pgfplotstableread[col sep=&,row sep=\\]{       0.0159779999812599 & 0.00398599999607541 \\       0.0240009999834001 & 0.00802300000214018 \\       0.0240489999996498 & 4.80000162497163e-05 \\       0.0280280000006314 & 0.00397900000098161 \\     }\mytable          \begin{scope}     \begin{axis}[       title={\small my data},       title style={at={(0.5,0.9)},anchor=center},       clip=true,       axis x line=middle,       axis y line=middle,       xmin = 0,       xmax = 0.03,       ymin = 0,       ymax = 0.009,       xlabel={$t$\,[ms]},       xlabel style={at={(axis description cs:1.01,+0.0)},anchor=west},       ylabel={$D$},       ylabel style={at={(axis description cs:-0.02,1.01)},anchor=south},       %xtick=data,       scaled x ticks=base 10:3,       xtick scale label code/.code={},       x tick label style={         rotate=-45,         anchor=west,         /pgf/number format/fixed,         /pgf/number format/fixed zerofill,         /pgf/number format/precision=3,       },       ymajorticks=true,       yminorticks=false,       tick label style={font=\small,},       legend cell align=left,       legend pos=outer north east,     ]          \addplot table \mytable;          \end{axis}     \end{scope}          \begin{scope}[xshift=240]     \begin{axis}[       title={\small my data},       title style={at={(0.5,0.9)},anchor=center},       clip=true,       axis x line=bottom,       axis y line=left,       xmin = -0.005,       xmax = 0.025,       ymin = 0,       ymax = 0.009,       xlabel={$t$\,[ms]},       xlabel style={at={(axis description cs:1.01,+0.0)},anchor=west},       ylabel={$D$},       ylabel style={at={(axis description cs:-0.02,1.01)},anchor=south},       %xtick=data,       scaled x ticks=base 10:3,       xtick scale label code/.code={},       x tick label style={         rotate=-45,         anchor=west,         /pgf/number format/fixed,         /pgf/number format/fixed zerofill,         /pgf/number format/precision=3,       },       ymajorticks=true,       yminorticks=false,       tick label style={font=\small,},       legend cell align=left,       legend pos=outer north east,     ]          \addplot table \mytable;          \end{axis}     \end{scope}          \end{tikzpicture}     \end{document}          \end{document}


title: 'e+08' (don't suppress 0) notation in columns with S-specifier

text: for symmetry reasons in a large table I want the scientific format with 2 digits (i.e. e+08). By default it suppresses the 0. Here is what I do:                \documentclass[]{article}           \usepackage{siunitx}                \begin{document}           \begin{table}[htbp]      \begin{center}      \footnotesize      \def\fix#1{\sisetup{output-exponent-marker=\mathrm{e+}}#1}      \sisetup{output-exponent-marker = \mathrm{e},exponent-product = {},retain-explicit-plus,retain-zero-exponent,table-format=+1.4e+2}      \begin{tabular}{lSS}      Sample & {$\mu_1 [Pa]$} & {$\alpha_1 [-]$} \\ \hline      {Isotropic $10\%$ MREs} & 1.5030e+09 & \fix{4.2384e+00} \\       & 6.7175e+10 & 8.4376e-01 \\      & 6.7175e+08 & 8.4376e-01  \\ \hline       \end{tabular}      \end{center}      \caption[]{Scientific notation $e+9$, but for symmetry reasons I would like $e+09$}      \label{tab:example}      \end{table}           \end{document}      That is the output: ![enter image description here](http://i.stack.imgur.com/GkGzd.png) Many thanks for your help! Gerlind


title: Shared author footnotes in REVTeX

text: REVTeX automatically combines `\email` and `\thanks` macros into a single footnote, and uses the same footnote if multiple authors share the exact same set of macros. Is there any way to force the `\email` and `\thanks` macros to have their own footnotes so that two authors can share the `\thanks` note? e.g. I would like the author list to look like: > A. Author,a),b) B. Author,b) C. Author   >   >  a) Electronic address: a@example.com   >  b) These two authors contributed equally The Review of Scientific Instruments sample manuscript does this, however I cannot work out how to get this result in REVTeX.


title: Jumping to previous position in TeXshop

text: I would like to be able to "jump to the previous position" of the cursor in TeXshop. This is useful for scrolling up, checking the name of a label, and then jumping back to where you were editing. How can I do this?


title: Create command to inline an image in a question?

text: How to create a command to can insert the image in a line of text question? Since I have a lot of question types made True/False, Short Answer types, Multiple choice, etc. I want the command to be compatible or can be usable in each of the question types. How should i make it? here is an example output to pdf for multiple choice: ![multiple choice](http://i.stack.imgur.com/4ywRD.png) I am currently using my created class based from the exam.cls help please.. thank you.. # Code               \documentclass{exam}     \usepackage[{graphicx}     %\graphicspath{{/home/kayla/Desktop/activity/}}     %\DeclareGraphicsExtensions{.pdf,.jpg,.png}     \newcommand*{\Image}[1]{\includegraphics[width=1.0cm,height=1cm,valign=m]{#1}}%          \begin{document}     \begin{questions}     \question This look like a \Image{/home/kayla/Desktop/activity/ddd} but it          actually a \Image{/home/kayla/Desktop/activity/nest}      dodmodod     \end{questions}     \end{document}      I made to place the image where my .tex file is placed. It always provides me an error. the               \newcommand*{\Image}[1]{\includegraphics[width=1.0cm,height=!,valign=m]{#1}}%      is highlighted and it says               illegal parameter number in definition of \reserved@a


title: Error with dcases*

text: I'm using LaTeX to write up my math notes and have been fairly successful implementing most of the styles I'm trying to figure out. I seem to be having trouble with the environment `dcases*` though. Using the code               \item Let $g: \N \rightarrow \N$ be given by $n=$      \begin{dcases*}      $1$ & if $n=1$ \\      $n-1$ & if $n \not = 1$      \end{dcases*}      gives me an error saying that it can only be used in math mode. Then it gives me a bunch of errors surrounding missing deliminators, but there aren't any missing. The other weird thing is that it does display properly.


title: How to add new line character in the node

text: I wish to add the new line character in the node, however, I tried several ways, all cannot work.               \node[draw, minimum width = 2em, minimum height=1em] (a) {get \\ flight(gf)};


title: Total Height of Minipages and MDFramed Boxes

text: I want to use an arbitrary number of mdframed boxes in a multicol environment. Each column should have the same height, which means the ends of the last box in each column should match (see figure below). In my specific example, I want to put 5 mdframed boxes in a 3 column multicols environment. I tried to adjusted the heights of the boxes by using minipages as suggested here. Here is a complete code example:               \documentclass{article}     \usepackage[framemethod=TikZ]{mdframed}     \usepackage{multicol}          \newlength{\columnheight}     \setlength{\columnheight}{10cm}          \begin{document}     \centering     \begin{multicols}{3}     % First Column     \begin{minipage}[t][\columnheight][t]{0.9\linewidth}       \begin{mdframed}         \begin{minipage}[t][0.6\columnheight][t]{0.9\linewidth}           \begin{itemize}             \item Point 1                 \item Point 2             \item Point 3           \end{itemize}         \end{minipage}       \end{mdframed}       \vfill       \begin{mdframed}         \begin{minipage}[t][0.2\columnheight][t]{0.9\linewidth}           \begin{itemize}             \item Point 1           \end{itemize}         \end{minipage}       \end{mdframed}     \end{minipage}     \columnbreak     % Second Column     \begin{minipage}[t][\columnheight][t]{0.9\linewidth}       \begin{mdframed}         \begin{minipage}[t][0.4\columnheight][t]{0.9\linewidth}           \begin{itemize}             \item Point 1             \item Point 2           \end{itemize}         \end{minipage}       \end{mdframed}       \vfill       \begin{mdframed}         \begin{minipage}[t][0.4\columnheight][t]{0.9\linewidth}           \begin{itemize}             \item Point 1             \item Point 2           \end{itemize}         \end{minipage}       \end{mdframed}     \end{minipage}     \columnbreak     % Third Column     \begin{minipage}[t][\columnheight][t]{0.9\linewidth}       \begin{mdframed}         \begin{minipage}[t][\columnheight][t]{0.9\linewidth}           \begin{itemize}             \item Point 1           \end{itemize}         \end{minipage}       \end{mdframed}       \vfill     \end{minipage}     \columnbreak     \end{multicols}          \end{document}      The result looks as follows: ![Result](http://i.stack.imgur.com/YEw1v.png) As you can see in the picture, the right column is larger than the other ones. Is there a way to solve this automatically? Up till now, I use vspaces to adjust the margin between the boxes in the other two columns until the lengths match. Is there a more elegant way to do this? I already tried to adjust values such as skipbelow or skipabove of the boxes, but it doesn't help.


title: Padding/spacing with \cellcolor

text: I have a working table with cell colors:               \newcommand{\ye}{\cellcolor{yellow}}     \newcommand{\re}{\cellcolor{red}}     \begin{tabular}{l l l}             & A        & B\\     Test1   & \gr Good & \re Bad \\     test2   & \ye OK   & \re Bad \\     test3   & \gr Good & \re Good \\     \end{tabular}      However it would improve the readability a lot, if I there were some spacing between the colors, just like the examples on page two of The official guide. Based on section 4.3 and 4.1 in this guide I have tried both:               \newcommand{\gr}{\cellcolor{green}[0.5\tabcolsep][0.5\tabcolsep]}     \newcommand{\gr}{\cellcolor{green}[0.5\tabcolsep]}      Both of those throws these two errors (multiple times) when I compile.               ! Missing number, treated as zero.     ! Illegal unit of measure (pt inserted).      If i try any of               \newcommand{\gr}{\cellcolor{green}[0.5][0.5]}     \newcommand{\gr}{\cellcolor{green}[0.5]}      The text [0.5][0.5] is just inserted as normal text. So **my question** is: How to add padding/spacing to the \cellcolor command, so I achieve a small white border between the cells? Preferably I would be able to control vertical and horizontal padding sperately


title: Troubleshooting font problems with XeTeX

text: When using XeTeX, I sometimes get errors like this:               LaTeX Font Warning: Font shape `EU1/AdobeSongStd(0)/m/sc' undefined     (Font)              using `EU1/AdobeSongStd(0)/m/n' instead on input line 181.      As I am using CJK, the error does not seem to be telling me which character it cannot print. How do I specifically identify which character cannot be displayed?


title: How to obfuscate my LaTeX document?

text: My LaTeX document uncovers bugs in some LaTeX tools. Therefore I would like to provide the LaTeX sources to the tool author. My problem is that the document I am writing on has to be kept secret and is very large. Therefore I tried to create an "minimal example" demonstrating the bug. But that does not work because the bug is very difficult to reproduce and seems to depend on the combination of a number of used LaTeX features. Is there an easy way to obfuscate / replace all my text content (including all sections headers, captions, labels, itemize items, citations, ...) with "Lorem ipsum" or similar text garbage so that I could provide an example document demonstrating the bug?


title: Inconsistent line spacing

text: If I type something like this:               {\itshape\LARGE       Dunt venim dolorerosto do odit       ametum vulla conum dolore       conulput in vero od el       Dunt venim dolorerosto do odit       ametum vulla conum dolore       conulput in vero od el     }      it results in a block of 4 lines with narrow spacing between the 1st and 2nd line and between the 3rd and 4th line. Line spacing between the 2nd and 3rd line is normal. I can't fully explaing it to myself so I am looking for a short description for this behaviour. I know for example that with a `\par` at the end of the text (inside the group), the calculation would correct. But I have no idea why...


title: \setfontsize doesn't seem to set the baseline skip

text: For a custom title page I need to set the font size to a specific value not covered by any of the standard `\Large` etc. font sizes. Therefore, I use the `\fontsize` command. Reducing to a minimal example my code looks like this:               \documentclass[a4paper,10pt]{article}     \begin{document}          {\noindent\fontsize{24pt}{29pt}\selectfont     \bfseries This is a\\ long title that is split\\ over multiple lines}          \vspace{2cm}     This is normal text.     \end{document}      This does change the font size, however it doesn't seem to change the baseline skip resulting in ugly line spacing. See image below: ![enter image description here](http://i.stack.imgur.com/GSz0X.png) The following code seems to do the trick               \noindent\parbox{\textwidth}{\fontsize{24pt}{29pt}\selectfont     \bfseries This is a\\ long title that is split\\ over multiple lines}      However this seems to be a bit overcomplicated and I don't see why the first code doesn't work. What is the easiest/recommended way to set the font size in my case?


title: Unbalanced distribution

text: > **Possible Duplicate:**   >  Inconsistent line spacing Why is this text distribution unbalanced? As you can see, there is more space between the first line and the second, than between the second and the third.               \documentclass{memoir}     \usepackage{xltxtra}     \defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}     \setmainfont{Minion Pro}     \begin{document}       \hbox{}\vfill       {         \parindent=0pt         \LARGE\scshape              First Sentence\\              Second Sentence\\              Third Sentence\\       }       \vfill     \end{document}      ![enter image description here](http://i.stack.imgur.com/4kVWf.png)


title: Remove empty line after subesction

text: I would like to redefine subsections so that there is no empty line afterwards, only a new line, e.g.               Subsection name     bla bla bla      I have tried the               \makeatletter     \renewcommand{\subsection}{%      \@startsection{subsection}{2}%           {)mm}%           {\baselineskip}%           {afterskip values}%           {\normalfont\large\bf}}     \makeatother       with several values, but I only seem to be able to get either an empty line or no linebreak at all


title: Missing $ error in math mode

text: I have the following LaTeX code (beginning from line 80):               \begin{definition}     $\hat{n}_{v}$ = \begin{cases}     $n_{v}$ & \text{ if } $v \in$ \text{connected component of size} $< \frac{2}{\epsilon}$      \\     $\frac{2}{\epsilon}$ & \text{ otherwise }     \end{cases}          \end{definition}      However, when I want to compile this code, I get the following error:               ./lect42.tex:80: Missing $ inserted.     <inserted text>                      $     l.80 $\hat{n}_{v}$ = \begin{cases}      I looked at the code carefully, but there are no missing $'s. Why I get this error?


title: glossaries special sorting for one glossary

text: In my document I use several glossaries, one of which is for the nomenclature. I have some special wishes for the sorting of this glossary. The easist way to achieve what I want is if I could give the `sort=def` option for only one glossary, but as fasr as I can tell this is only available as a package option. Therefore I think I might have to write my own rules. Since I have no experience with xindy what soever I would like to know if the following rules are a good starting point. What I want:   1. a term `X` prefixed with `#` comes right after `X`   2. if a term `X` is followed by an underline it comes right after `X` and before `#X` Example                X     #X      X_index     #X_index      Xindex     #Xindex      What I think might be reasonable rules after looking here:               (merge-rule "<startOfLine>\#"(.*)<endOfLine>" "\1~e")     (merge-rule "<startOfLine>(.*[^~e])<endOfLine>" "\1~b")     (merge-rule "_" "~b")      I am not sure how to force a match for the entire line with the first rule. I am not sure either how to formulate the `does not end with last character` bit in the second rule. The second rule aims to prevent `\\#X` ending up behind `Xa`. Furthermore I looked at `samplexdy.tex` from the glosaries package (`docfolder/samples`) and noted that the according xindy file looked _huge_ , so any pointers on where I insert my rules or what I actually need would be apreciated. And how do I teach `glossaries` that I want to use the modified xindy file only for one glossary out of several?


title: Is there a counterpart/antidote for \obeylines?

text: The `\obeylines` command tells TeX to preserve line endings, which is useful for poetry and various other things. I can limit the effect of `\obeylines` by wrapping it in a scope, like so:               {\obeylines         We obey, and end up on separate lines.         We obey.     }     We disobey, and end up on the same line.     We disobey.      This is practically always the way to go, or newlines breaking up formatting code will break up more than that. But, out of curiosity: is there also a command that resets TeX's handling of line endings? Googling for `\disobeylines` turned up some roll-your-own implementations, but I'm curious whether Donald Knuth wrote an antidote into Plain TeX itself, too.


title: Poster text positioning: Get width of \hfill

text: How can `0123456789` be aligned as shown in red: Same baseline as `abcdefghij`, aligned left with `ABCDEFGHIJKL`? `\vline`s are just for illustration. I am designing a poster where exact text positioning matters.               \documentclass{article}     \usepackage[absolute,overlay]{textpos}          \begin{document}     \begin{textblock*}{10cm}(5cm,5cm)     \noindent\vline     \hfill\begin{tabular}{l@{}}       ABCDEFGHIJ\\       ABCDEFGHIJKL\\       ABCDEFGH     \end{tabular}     \vline     \end{textblock*}          \begin{textblock*}{10cm}(5cm,10cm)       \hfill 0123456789       \vline     \end{textblock*}          \begin{textblock*}{10mm}(5cm,10cm)     \noindent\vline       abcdefghij\\       abcdefghijkl\\       abcdefgh     \end{textblock*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/A9XkL.png)


I want to create a tutorial how to use TikZ now. Is there a listings configuration for TikZ as used in PGF/TikZ manual? For example, I want to make `\` as an integral part of `tikz` in `\tikz`, relevant macros must have consistent colors, no annoying line numbers, PDF copy-paste friendly, etc.


title: How to do a table with top corner removed

text: I want to do a table with some columns (9) but I want the first 2 columns on the first row to be empty. I can't seem to be able to close the top of my table the way I do it.               \begin{tabular}{|c|c||c|c|c||c|c|c||c|}     \multicolumn{2}{c||}{}&\multicolumn{3}{c||}{Dimensions finies}&\multicolumn{3}{|c||}{   Dimensions brutes}\\     \hline     Identification & Qté & Long.&Larg.& Épais.& Long.& Larg.& Épais. &PMP\\     \hline     Dessus & $1$ & $46$ & $28$ & $6/4$& & & & \\     \hline     Pattes & $4$ & $37\sfrac{1}{2}$ & $3$ & $2$& & & & \\     \hline     \end{tabular}


title: TikZ \foreach loop evaluate variable using pgfmath function

text: I have problem with defining a new variable within the `\foreach` loop using the `evaluate` option using a pgfmath function:               \documentclass{article}     \usepackage{tikz}     \begin{document}       \begin{tikzpicture}          \foreach \j [evaluate=\j as \jn using mod(\j,4)] in {5,6} {           \node[] at (\j,0) {$\jn$};         }       \end{tikzpicture}     \end{document}      This gives me the error:               ! Package pgfkeys Error: I do not know the key '/pgf/foreach/4)'      if I replace `mod` with, e.g., `int` or `exp`, (which take only one argument) it works fine.. For instance `exp(\j)` works fine..


title: Linear and non-linear functions inside \addplot to get a unique legend

text: I have functions which have two intervals, a linear and non-linear. I want to have these inside the command `\addplot` in **pgfplots** , to get only one legend. I tried it with them in a separated write, but the legend output recognise each one as different function. Basically, I have two functions to graph, and the legend have to depict that. Please, help me. I wrote in the preamble: `\usepackage{tikz}` and `\usepackage{pgfplots}`.               \begin{figure}[!h]     \centering     \caption{Espectro de pseudo-aceleraciones}     \begin{tikzpicture}[domain=0:5]     \begin{axis}[xlabel={Periodo $T$ (s)},ylabel={$S_a$ ($\times$g)}, xmin=0,xmax=5.5,ymin=0,ymax=2,extra y ticks={.3,1.8}]     \addplot[domain=.6:5.5,color=red,very thick]{.18/\x};     \addplot[domain=0:.6,color=red,very thick]{.3};     \addlegendentry{Espectro Inelástico}     \addlegendentry{}          \addplot[domain=.6:5.5,color=red,very thick,dashed]{1.08/\x};     \addplot[domain=0:.6,color=red,very thick,dashed]{1.8};     \addlegendentry{Espectro Elástico}          \end{axis}          \end{tikzpicture}     \end{figure}


title: Captions for Tikz drawings

text: I have a question concerning captions for Tikz drawings. Below, you see the source code for a binary tree I've drawn with Tikz. I want to place a caption beneath it but unfortunately, the caption does not appear directly below the center of the tree but far at the right side of the tree. Does anybody know how to place captions directly below of a tree?               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \begin{document}         \begin{figure}     \begin{tikzpicture}     [level distance=20mm, every node/.style={fill=red!60,circle, draw, inner sep=2pt},     level 1/.style={sibling distance=40mm,nodes={fill=red!45}},     level 2/.style={sibling distance=20mm,nodes={fill=red!30}},     level 3/.style={sibling distance=10mm,nodes={fill=red!25}}]     \node {A}        child {node {D}              child {node {3}                   child {node {X}}              child[missing]              }              child {node {9}}           }       child {node {V}              child {node {19}}              child {node {6}}        };     \end{tikzpicture}     \caption{A tree}     \end{figure}      \end{document}       By the way, does anybody know how to place annotations/comments by the side of nodes such as in this picture (the Höhe tags): ![http://s10.postimg.org/vjqvdsszt/Bildschirmfoto_2.png](http://i.stack.imgur.com/naXYO.png) Thanks so much for your help!


title: Workflow for managing references?

text: What is your workflow for managing references? How does this workflow scale? Do you use programs like `zotero`, `mendeley`, `jabref`? What are their pros and cons? Does it allow easy integration of BibLaTeX or it is BibTeX only?


title: How do I check whether the text will fit in one page?

text: I am trying to typeset a page that varies in length. Sometimes it's just shorter than A4, but sometimes it exceeds the length of A4.   My question is, how can I check whether the text will fit in one page and if it doesn't I want to fit as much as I can on one page, then add something like " _(shortened)_ " and hide the rest of the text so it doesn't appear on the second page?


I am not an expert in LaTeX, but I was writing a paper, everything was going fine, until it suddenly crashed giving me the error: > The fontspec package requires either XeTeX or LuaTeX to function.


title: How do you remove a bookmark from the LEd editor?

text: I have introduced a bookmark by mistake into the LEd editor but can't seem to remove it. I can of course add a bookmark by using Ctrl+B and reference the location by Ctrl+No., but there seems no obvious way of removing one. Any ideas?


title: Formatting text using `...` only in one specific environment

text: I would like to make the character ``` active in one environment so that ``some text`` will be formatted using black background and white for the text. This feature must be activated only inside the environment.


title: automatic enumerate numbering from a specified item number

text: Is there a way that I can start an enumerate numbering at, say 17, then have the succeeding item numbers automatically add 2 to the preceding one? Say, I want to typeset the answers to the odd-numbered exercises starting from 17, I want my list to show               17. answer 17     19. answer 19     21. answer 21     23. answer 23     .     .     .      I know that this can be done manually but after a while, typing the item numbers manually can become bothersome. **Edit** I put the list in the code environment to prevent automatic renumbering.


title: How do I reference the main .tex file when writing user-defined commands in TeXworks?

text: I am trying to create user-defined commands in TeXworks, but am having problems finding the syntax to reference the main .tex file. For instance, creating a .bat-file and then a new "typesetting tool" in TeXworks pointing to that .bat file works fine if the contents is the following line:               pdflatex "mylatexfile.tex"      "mylatexfile.tex" then compiles without problems, and the first line of the compiler output is               C:\mypath>pdflatex "mylatexfile.tex"      The following, however, doesn't work:               pdflatex "%1.tex"      The compiler then starts with the line               C:\mypath>pdflatex ".tex"      and ends with "...File ignored)...". Am I wrong to assume that "%1" references the main latex file? (That's what I understood from http://code.google.com/p/texworks/wiki/AdvancedTypesettingTools#tex_-%3E_dvips_-%3E_ps2pdf.) In the latex editor LEd, I've successfully created user-defined commands using .bat files. There, however "%2" is supposed to reference the main latex file. I've tried that in TeXworks but to no avail. I get the same result as using "%1". Any tips? I'm using MiKTeX 2.9 and Windows 7.


title: Typeset a solidus operator (free variable substitution)

text: I would like to typeset an operator like the one used to specify substitutions of variables with values in computer science. This is a sketch, just keep in mind that all this should span about on a single line, not two:               v /      / x          v1, v_2 /            / x1, x2      Obviously a simple `v/x` does not solve my problem, since `v` and `x` are written on the same exact line while I would like to have them smaller, with the `v` part aligned to the top of the `/` and the `x` aligned to the bottom. Can you help me solving my problem please?


title: Frame environment with fixed size given by numbers of characters and lines

text: I would like to make one framed environment with the following behavior.   1. Only the last 8 lines of the content must be displayed. If the content have more than 8 lines, a gentle warning must be produced by LaTeX.    2. The width of the frame is exactly equal to 16 letters.   3. A fixed width font must be used.   4. The content cannot contain formulas. If it is the case, an error must be sent. This is for imitate the screen of one calculator. The following solution nearly works except that I would like a better symetric spacing between the content and the box. ![enter image description here](http://i.stack.imgur.com/wrgcX.png) What are the changes to do ?               \documentclass{article}         \usepackage{adjustbox}         \usepackage{color}          % For tests         \usepackage{comment}                   \makeatletter             \catcode`\$=\active             \newenvironment{calculator}{%                 \ttfamily                 \let\(\calculator@error                 \let\[\calculator@error                 \let\array\calculator@error                 % etc.                 \catcode`\$=\active                 \let$\calculator@error                 \begin{lrbox}{\@tempboxa}%                 \minipage[b]{8em}%             }{%                 \endminipage                 \end{lrbox}%                 \par\smallskip                 % Measure height and clip if required                 \ifdim\ht\@tempboxa>8\baselineskip                     \PackageWarning{calculator}{%                         calculator environment to long%                     }%                     % clip to only show the 8 last lines:                     \fbox{\clipbox*{0pt {\depth} {\width} 7.5\baselineskip}{%                         \usebox\@tempboxa                     }}%                 \else                     \fbox{\usebox\@tempboxa}%                 \fi                 \smallskip             }             \catcode`\$=3                  \newcommand{\calculator@error}{%                 \PackageError{calculator}{%                     No math is allowed inside calculator environment%                 }{}%             }                  \newcommand{\tiFocus}[1]{%                 \hspace{-\fboxsep}%                 \colorbox{black}{\textcolor{white}{#1}}%                 \hspace{-\fboxsep}%             }         \makeatother               \begin{document}          \section*{8 lines}          \begin{calculator}     \tiFocus{1 3 5 7 9 B D F}     .2 4 6 8 A C E     1 3 5 7 9 B D F     .2 4 6 \tiFocus{8} A C E     1 3 5 7 9 B D F     .2 4 6 8 A C E     1 3 5 7 9 B D F     .2 4 6 8 A C E     \end{calculator}


title: Let title distinct in mainmatter and TOC and header

text: Title in mainmatter (long title): * * * **Sec.1 The introduction of TEX --- A powerful typsetting system** blabla... **Sec.2 installation** blabla... * * * Title in TOC (short title, line break before em dsah): * * *               Sec.1  TEX            --- A typsetting system ....................... 1          Sec.2  Installation .................................. 2      * * * Title in header (short title): * * * _Sec.1 TEX --- A typesetting system_ * * *


title: How do you create .+?

text: I would like to display `a = b .+ 1` But it is displayed as `a = b. + 1` (moves `.` next to b).


title: Algorithmic package in LaTeX

text: I want to write the following algorithm in LaTeX:                V <- AllUnigramsInTraining(D)      N <- NumberOfTweets(D)     **for** each c ∈ C do       Nc <- Number of tweets in Class c       prior(c) <- [...]        Tweetsc <- All Tweets in class c       **for** each term t ∈ V do         Tct <- No. of times term t appeared in Tweetsc       **end for**       **for** each term t ∈ V do         prob[t][c] <- [...]        **end for**     **end for**      I wrote the following code but it is not compiling properly. Can anybody help?               \begin{algorithmic}     \STATE $V\gets AllUnigramsInTraining(D)$ \\     \STATE $N\gets NumberOfTweets(D)$ \\      \FOR each $c \in C$ \DO \\       \STATE $N_c\gets Number of tweets in Class c$ \\       \begin{equation}         prior(c) = \frac{N_c}{N} \\        \end{equation}       \STATE $Tweets_c\gets = All Tweets in class c$ \\       \FOR each term $t \in V$ \DO \\         T_ct = No. of times term t appeared in Tweets_c \\       \END       \FOR each term $t \in V$ \DO \\         \begin{equation}          $prob[t][c] = \frac{T_ct}{\sum_^t'{T_ct'+ 1}} \\         \end{equation}       \END     \END     \end{algorithmic}


title: How to check if a section title (or any heading) is the first line of a new page?

text: I would like to be able to use an `\if` command to check if a `\section` appears on the **first line of a new page**. If a section heading is the first line of a new page, I would like to then adjust some of the spacing between the section heading and the header by modifying `\headsep`. Is there a simple way to do this? **More info (edit):** The issue arises whenever you don't forcibly add new pages to separate sections. If you were to write continuously, then, whenever TeX decides to insert a page break, the spacing arguments native to `\section` are suppressed **_iff_** the page break occurs right before a new section. Hence, if, for instance, you have long, ruled headers, the lack of spacing looks odd: ![Page breaks suppress spacing](http://i.stack.imgur.com/rSF9M.png) As far as I know, TeX doesn't have a built-in counter for line numbering that can be used to check if a heading appears on the first line of a new page. You don't know when a page break is likely to occur, either. Thus, although I have a specific purpose for finding a way to check if something is on the first (or _nth_ line) of a page, it might still help others with different purposes.


title: How to clean up .table and .gnuplot using latexmk

text: I'm using `latexmk` as my building assistance. I'm also trying to use it as the clean-up contractor... In `.latexmkrc` I added:               $pdf_previewer = "open -a /Applications/Skim.app";      $clean_ext = "rel paux lox pdfsync out bbl %R.run.xml %R.table %R.gnuplot";     $pdflatex = 'pdflatex -8bit -etex -shell-escape -file-line-error -halt-on-error -synctex=1 %O %S';     $new_viewer_always [0];     $pvc_view_file_via_temporary [1];      so it will remove the `tex_name.func_name.table` and `tex_name.func.gnuplot` file types in addition to the defaults. Unfortunately, it doesn't work. When I run `latexmk -c`, this is the first output's line (I don't know if it is related):               Useless use of array element in void context at (eval 12) line 5, <GEN0> chunk 1.      And these files stay in the directory. How can I make them gone? ## Edit: As @N.N. suggested I corrected the mistake in the last two code lines. As for the main issue of this question, I have to clarify the case. Compiling my document produces several files all having the following filename pattern: `tex_main_name.function_name.gnuplot` and similarly `tex_main_name.function_name.table`. I want `latexmk -c` to remove _all_ of them. Therefore, using `func_name.table` in the `latexmkrc` will only remove two files. I hope the problem is clearer now. ## Edit 2: As @N.N. asked, here's a WME:               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}       % Function       \begin{scope}[domain=0.9:5.5,samples=200]         \draw[<->,color=blue,line width=2pt] plot[id=func1]         function{(x*x+x+1)/(x*x)} node[right] {$f(x)$};       \end{scope}       \begin{scope}[domain=0.9:5.5,samples=200]        \draw[<->,color=blue,line width=2pt] plot[id=func2]        function{-(x*x+x+1)/(x*x)} node[right] {$f(x)$};      \end{scope}      \end{tikzpicture}     \end{document}      Compiling this code generates two files, namely `file_name.func1.table` and `file_name.func2.gnuplot`. I want that `latexmk -c` will remove these two files.


title: Suppress \abstract with the apa6 class?

text: I am currently working on a paper using the `apa6` class and I won't require an abstract, i.e. it will be worse if I have one. Would anybody happen to know of a clean way to suppress or deactivate the abstract in an `apa6` class document? I tried to work around it, but couldn't come up with anything working.


title: How can I make a bold horizontal rule under each section title?

text: I want to place a long bold `\hrule`-type line under the `\section` to make it more distinctive. How can I do that?


title: Missing labels with feynmf/feynmp?

text: I am using feynmp to generate Feynman diagrams with pdflatex. Everything seems to be working but my labels are not showing up. What is wrong?               \documentclass{minimal}     \usepackage{feynmp}          % Needed to interpret generated *.1, *.2 etc. as ps files.     \DeclareGraphicsRule{*}{mps}{*}{}           \begin{document}     Here is a vertex for a local potential in momentum space:     \begin{fmffile}{fgraphs}       \begin{fmfgraph}(40,30)          % Note that the size is given in normal parentheses instead of curly         % brackets in units of \unitlength (default 1pt).          \fmfleft{i1,i2} % Define external vertices from bottom to top          \fmfright{o1,o2}          \fmf{fermion}{i1,v1,o1}          \fmf{fermion}{i2,v2,o2}          \fmf{photon,tension=0.3}{v1,v2}              % These labels are missing!          \fmflabel{$\vec{p}$}{i1}         \fmflabel{$\vec{q}$}{i2}         \fmflabel{$\vec{p}+\vec{k}$}{o1}         \fmflabel{$\vec{p}-\vec{k}$}{o2}       \end{fmfgraph}     \end{fmffile}     \end{document}      Save this to `tst.tex` and compile with:               pdflatex tst     mpost fgraphs     pdflatex tst     pdflatex tst


title: How to find out the right citation style?

text: I am trying to find out which citation style fits my demands best for my bibliography. As I am writing for a german science institution and using many german sources, I intented using `jurabib` My bibliography should look like this:   * Harding, Leonhard. 1994. Einführung in das Studium der Afrikanischen Geschichte, 2.überarb. Aufl., Studien zur Afrikanischen Geschichte, Bd. 4. Münster u.a.: Lit.   * Deutsch, Jan-Georg und Albert Wirz (Hg.). 1997. Geschichte in Afrika. Einführung in Probleme und Debatten, Zentrum Moderner Orient Studien 7. Berlin: Das Arabische Buch. So far I end up with the following:   * Treichel, Dietmar/Mayer, Claude-Hélène: Lehrbuch Kultur: Lehr- und Lernmaterialien zur Vermittlung kultureller Kompetenzen. Waxmann, September 2011, ISBN 383092531X. What would be your advice for my specific case? And more generally: When having a set style of citation, how can I find the corresponding citation style for bibtex?


title: Unwanted symbol ă in tabular environment

text: I am trying to create a table using the tabular environment using this code snippet:               \documentclass{article}          \begin{document}     \begin{table}         \centering             \begin{tabular}{|l|l|}                     \hline                     \multicolumn{2}{|c|}{\textbf{Scenario}} \\ \hline                     This & 15 \\                      Is  & 10  \\                     Example & 100  \\                  Tabular  & 10 \\ \hline             \end{tabular}     \end{table}     \end{document}      This works fine for this MWE, but in my own document the result has strange added symbols in the table. All the symbols are the same: ăăăăă. Does anyone have a solution? I've been struggeling with this for quite some time and tried a few things myself without success. The MWE I has no issues, still I would like like to know if someone has expierenced the same issue before.


title: Make align* number the last equation

text: I am using the align* environment to write equations expanding several lines. I would like to define a command sequence in the preamble, such that the last equation of this block will always be numbered (while the others remain unnumbered). For example, the block               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}     x & =2+2\\      & =3+1\\      & =4     \end{align*}     \end{document}      will visually look like:               x = 2+2       = 3+1       = 4     (1)


title: Aligning complex numbers in centre of table with siunitx

text: I'm trying to align complex numbers in the middle of a table column using the `siunitx` package for nicer alignment, but the numbers are centring based on where the decimal point would be on the real parts. Here's my MWE:               \documentclass[a4paper]{article}          \usepackage{booktabs}     \usepackage{array}     \usepackage{siunitx}     \sisetup{         output-complex-root = \ensuremath{\mathrm{j}},         complex-root-position = before-number     }     \begin{document}     \begin{table}[h!]         \caption{Bus Loads}         \label{fig:figurename}         \centering             \begin{tabular}{l|S[]}             \toprule             \textbf{Bus} & \multicolumn{1}{c}{\textbf{Bus Load (MVA)}} \\             \midrule                 b1 & 50 + j30.99 \\                 b2 & 170 + j105.35\\                 b3 & 200 + j123.94 \\                 b4 & 150 + j49.58 \\             \bottomrule             \end{tabular}     \end{table}     \end{document}      And here's the output: ![MWE output](http://i.stack.imgur.com/qpFBJ.png) I'd like the complex numbers to be more aligned in the centre of the column. Any idea how to do this? I've tried passing the option `table-number-alignment=left` to the column, but then the imaginary part disappears: ![MWE output with table-number- alignment=left](http://i.stack.imgur.com/FMxfU.png)


title: Unsqueeze the fraction

text: For the LaTeX code below,                \begin{equation}     Fitness(\CS)=     \begin{cases}         0.5 + 0.5 \cdot G(\CS)                        & if\ V(\CS)=0 \\         0.5\cdot G(\CS)-\frac{V(\CS)}{V_{Tot}(\CS)}   & otherwise.     \end{cases}~\label{eq:fitness}     \end{equation}      I get the output ![enter image description here](http://i.stack.imgur.com/jgprZ.png) It looks like the fraction `\frac{V(\CS)}{V_{Tot}(\CS)}` is a bit squeezed here,I would prefer ![enter image description here](http://i.stack.imgur.com/gajaa.png) which looks less squeezed. How could I do that?


title: pgfplots - Show both absolute and relative value

text: In my plot I am trying to show the relative value next to the absolute values. For instance, for the rightmost column, I would like it to say 110 right below 9.02*10^6. Another option would be an axis to the right with "speedup" that goes from 1 to 110. Also, how can i move the plot down so that the bars start right at the x axis line?               \begin{tikzpicture}     \begin{axis}[         ybar,             scale=0.9,             axis x line= bottom,             axis y line = left,             x post scale = 1.5,             enlargelimits=0.15,             anchor=west,             ylabel=Rays/second,             symbolic x coords={Original, Linear Traverser, MT Linear Traverser, CPU kd-tree, GPU kd-tree},             xtick=data,             nodes near coords,              nodes near coords align={vertical},             x tick label style={rotate=45,anchor=east, xshift=-0.1em, yshift=-0.01em},     ]     \addplot coordinates {(Original, 81685) (Linear Traverser, 506326) (MT Linear Traverser, 1754330)         (CPU kd-tree, 1873746) (GPU kd-tree, 9023256)};     \end{axis}     \end{tikzpicture}      ![Example image](http://i.stack.imgur.com/gp4o3.png)


title: Tikz randomly placed groups of objects

text: I would like to place several groups of three objects (two circle paths and one node) in a triangular area. I came up with the following code, which is based on a subdivision of the triangle in horizontal slices and a random positioning within the slice. (used inside a `tikzpicture` environment in `beamer`, and with all the related tikz libs [`calc, decorations, decorations.text, decorations.pathmorphing, shapes.callouts, shapes.symbols`] loaded and working):               \documentclass{beamer}     \usepackage{tikz}     \usetikzlibrary{calc, decorations,decorations.text,decorations.pathmorphing,shapes.callouts,shapes.symbols}          \begin{document}     \begin{frame}{MWE}     \centering     \begin{tikzpicture}     \foreach \l in {1,2,...,10}           {               \coordinate (mycenterpoint) at (${(.5*\l+.1)*rand}*(1,0)+{rnd-\l-1}*(0,1)$);               \coordinate (myangle) at (rand*180:1.4pt);               %\node[starburst,fill=cyan,fill opacity=0.3] at (mycenterpoint) {};               \fill[red] (mycenterpoint) ++(myangle) circle (2pt);               \fill[green] (mycenterpoint) ++($-1*(myangle)$) circle (2pt);           }     \end{tikzpicture}     \end{frame}     \end{document}      which places as I expected the red and green circles, namely in a random position in the respective triangle slice. Unfortunately, if i uncomment the starburst line, something in the rand is jeopardized, and all the circles and nodes are placed on a "line" just as the rand and rnd in the first coordinate definition were set to -1 and 0 respectively. does anyone have hints on how and where the rand function gets spoiled?


title: Stealth arrow in math?

text: Is there an easy way to produce `stealth` style arrows in normal `math mode`? By "`stealth`" I'm thinking of `TikZ` `stealth` arrowhead. Something like `\rightarrowstealth`? The question originates from a limit I'm writing. I find the arrowhead of `\rightarrow` (and the rest of the arrows, honestly) being somewhat less esthetic compared to the `TikZ` `stealth` arrowhead. I checked @Qrrbrbirlbel's comment, and I don't believe the arrowhead I'm looking for is listed. ![enter image description here](http://i.stack.imgur.com/xyvf9.png) Stevens comment fixes my problem, though! `mathabx`'s `\rightarrow` arrowhead is indeed close enough to `TikZ`'s `stealth` arrowheads for my purposes.


title: Using \selectlanguage with csquotes

text: As per this question, I am using `csquotes` to convert quotationmarks to typographical-quotes. However, when changing language through `\selectlanguage` the quotationmarks no longer gets converted. (I need an English abstract and Danish content. Instead of renaming the abstract I find it “prettier” to change language before and after the abstract, though it’s more cumbersome.) MWE:               \documentclass[article,12pt,a4paper,openany,oneside]{memoir}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english,danish]{babel}     \usepackage[danish=quotes]{csquotes}     \MakeOuterQuote{"}         \usepackage{lmodern}     \begin{document}          \selectlanguage{danish}     Quote: "Morbi dolor risus."     \end{document}      ![](http://i.stack.imgur.com/eevi6.png)


title: Subfigure with caption within an itemize list not indenting correctly

text: To make it short, I have exactly the same problem as described here Figure with caption within an itemize list not indenting correctly except, the fact that I am using the subfig package and the corresponding subfloat environment within the figure. Is there a way to get a correct indent?


title: How to typeset large numbers

text: I need to typeset some very large numbers that span a number of lines, is there a way in LaTeX to do this?


title: How to typeset long numbers in LaTeX

text: > **Possible Duplicate:**   >  How to typeset large numbers I saw the posts on how to typeset long _formulas_ into LaTeX, but I just want to output a really long number into LaTeX. `2011^2011` is long, and I want to demonstrate that its last 3 digits are actually 611. However, it outputs onto one line and doesn't fit. So: How do I force it to break?


title: Table not wider than text, same columns' width, decimal alignment

text: I'd like to   * get the same width of columns labeled 1-10 (all except the first one ~ Name of X)   * be able to adjust the position of "name of Y" (have it centered or on the left. Right now, it's affecting the width of the second column)   * have decimal-aligned numbers   * (decrease table's size by _x_ percent? To view its miniature which is set by %?) ![enter image description here](http://i.stack.imgur.com/J42vg.jpg)               \documentclass{article}          \usepackage{booktabs}   % this package promotes good tabular style     \usepackage{caption}    % for customising caption style     \usepackage{siunitx}    % for decimal alignment          \begin{document}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor      incididunt ut labore.          \begin{table}[!ht]     \setlength{\tabcolsep}{4pt} %length between columns; default = 6     \footnotesize     \centering     \captionsetup{singlelinecheck = on, justification = centering, labelfont = bf}             \caption{Aaaaaaaaaaaaaaaaa}             \begin{tabular}{c*{10}{c}}                 \toprule                 & {Name of Y} \\                 \cmidrule(lr){2-11}                {Name of X} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\                  \midrule     2000    & 123 & 45617 & 1415 & 1111 & 11111 & 55555 & 55555 & 66666 & 777.7 & 88888 \\     2000    & 123 & 45617 & 1415 & 11 & 11111 & 55555 & 55555 & 66666 & 7777.7 & 88888 \\                 \bottomrule             \end{tabular}          \end{table}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor      incididunt ut labore.          \end{document}


title: How to cross-reference several objects simultaneously

text: I want to define a macro for referencing equations in an article. I want the equation to be referenced as: " Eq. (3) " So I defined a command "\eref{}" as: `\def\eref#1{Eq.~\ref{#1}}` But I also have instances where I want to refer to multiple equations like: "Eq. (3,4,5)" and when I try to use: `\eref{label1,label2,label3}` I simply find " Eq. ?? " in the pdf. Can anyone kindly help me declare a macro which can take as input a list and simply call another function with that list (like how `\ref{}` command of latex does). I tried to replace "#1" in the definition by "##", it didn't work. I wish to have similar macros for referring to Lemmas, Theorems, etc, which too have similar problems.


title: bigfoot: only break footnotes across double-page spread

text: The `bigfoot` handles the breaking of footnotes across pages quite well, but personally I don't like it if I have to turn the page to read a complete footnote. Therefore my question: Is it possible to make `bigfoot` only break footnotes if the its second part will be on the opposite side of a double-page spread? Another footnote-related question: There doesn't seem to be widow control when it comes to footnotes. I occasionally have broken footnotes where there are only a few words on the new side. This looks, of course, quite ugly – can this be avoided?


title: Missing number, treated as zero. in eqnarray

text: this is my code:               \begin{eqnarray}     [A,C]\mid_{dom(x)} = -x^1x^2\frac{\partial}{\partial x^1} + (2(x^1)^2 - (x^2)^2 +2)\frac{\partial}{\partial x^2}  \\     [B,C]\mid_{dom(x)} = ((x^1)^2 - 2) \frac{\partial}{\partial x^1} -5x^1x^2 \frac{\partial}{\partial x^2}      \end{eqnarray}      and this the error:               54     Missing number, treated as zero.     <to be read again>                         B     l.54 [B,C]               \mid_{dom(x)} = ((x^1)^2 - 2) \frac{\partial}{\partial x^1} -5x^1x...      I would be glad if you help me, I cannot figure out the problem and solve it. I am a new Tex learner :/ I could not write the comment, anyway I like to thank you, these advices of yours solved my little problem!


title: Creating resources for a currently unsupported language

text: > I want to add support for a new language to TeX and friends. What do I need > to do to achieve this? We have had questions about Lao, Asturian, Cyrillic and Tajik, but this CW question is supposed to be _general_ non-specific advice about adding language support.


title: Large gaps between paragaphs VS avoiding widows / orphans

text: How to avoid widow and orphan lines, while also avoiding too large gaps appearing between the paragraphs on the previous page? I figure that to strongly discourage widows and orphans, one would use a high but not infinite `\widowpenalty` and `\clubpenalty` value, such as               \clubpenalty=9996     \widowpenalty=8500      This in turn makes TeX to stretch the spaces between the paragraphs on the previous page, and one tries to strike the balance with penalties, so that the extra paragraph gaps are usually not noticeable. However sometimes the difference on facing pages is really noticeable, are there other techniques or internals penalties to avoid this? What are the manual correction techniques apart from `\raggedbottom` and `\enlargethispage`?


title: after end axis messes up pgfplots axis position

text: Latex and Tikz are going to get the life out of me... I saw Need to do some changes to pgfplots axis #39099, and that example was working fine for me; so I modified it a bit, and came up with the following MWE:               \documentclass[10pt,a4paper]{article}     \usepackage[hmargin=3cm,vmargin=2cm]{geometry}     \usepackage{floatrow}     \usepackage{tikz}     \usepackage{pgfplots}     % \usepackage{lua-visual-debug}          \begin{document}     \begin{figure}[H]%[h!tbp]     \centering     \begin{tikzpicture}     \begin{scope}       \begin{axis}[         clip=true,         axis x line=middle,         axis y line=middle,         xmin = 2.5e-3,         xmax = 4.2e-3,         ymin = 0,         ymax = 710,         xlabel={},%{$t$\,[ms]},         xlabel style={at={(axis description cs:1.01,+0.0)},anchor=west},         ylabel={}, %{$U$\,[V]},         ylabel style={at={(axis description cs:-0.02,1.01)},anchor=south},         xtick=data,         scaled x ticks=base 10:3,         xtick scale label code/.code={}, % this to not show extra scale label         x tick label style={           rotate=-45,           anchor=west,           /pgf/number format/fixed,           /pgf/number format/fixed zerofill,           /pgf/number format/precision=3,         },         tick label style={font=\small,},         legend cell align=left,         legend pos=outer north east,         % this for "the 0 is missing from the labels";         after end axis/.code={           \path (axis cs:0,0)             node [anchor=north west,yshift=-0.075cm,xshift=-0.4em] {0}             node [anchor=east,xshift=-0.075cm] {0};         }       ]     \addplot[mark=*] coordinates {(2.9e-3,400)};     \end{axis}     \end{scope}     \end{tikzpicture}     \end{figure}     \end{document}      Why is it then, that this MWE results with this: ![test01a.png](http://i.stack.imgur.com/Kdnw6.png) ... that is, the 0,0 stick to left of the margin, plot itself is to the right, overflowing the margin - all that while `\centering` being issued? And if you comment out the `after end axis/.code={...}` part - then everything works as expected?! What am I missing here?


title: tick mark/range problem on graph generated using TikZ

text: I'm having a little difficulty getting a tick mark on a graph generated using TikZ to appear correctly. The code is below and the problem can be seen in the vertical axis of the second graph (b). How could I fix this little problem?               \begin{figure}         \centering         \subfigure[hard limiter]{             \begin{tikzpicture}[font=\scriptsize]                 \begin{axis}[                     xtick=\empty,                     ytick={-1, 0, 1},                     xlabel=${x}$,                     ylabel=${f_{h}\left(x\right)}$,                     width=150 pt]                     \addplot+[mark=none, black]                         coordinates{                             (-1, -1)                             (0, -1)                             (0, 1)                             (1, 1)                         };                 \end{axis}             \end{tikzpicture}             \label{figure:hard_limiter_1}         }         \\         \subfigure[threshold logic]{             \begin{tikzpicture}[font=\scriptsize]                 \begin{axis}[                     ymin=-1,                     xtick=\empty,                     ytick={-1, 0, 1},                     xlabel=${x}$,                     ylabel=${f_{t}\left(x\right)}$,                     width=150 pt]                     \addplot+[mark=none, black]                         coordinates{                             (-1, 0)                             (0, 0)                             (1, 1)                         };                 \end{axis}             \end{tikzpicture}             \label{figure:threshold_logic_1}         }         \subfigure[sigmoid]{             \begin{tikzpicture}[font=\scriptsize]                 \begin{axis}                     [                         xtick=\empty,                         ytick={-1, 0, 1},                         xlabel=${x}$,                         ylabel=${f_{s}\left(x\right)}$,                         width=150 pt                     ]                     \addplot+[mark=none, smooth, black] {2/(1+e^(-x))-1};                 \end{axis}             \end{tikzpicture}             \label{figure:sigmoid_1}         }         \caption{three representative nonlinearities}         \label{figure:three_representative_nonlinearities_1}     \end{figure}


title: Scientific Word converter?

text: **Are there any converters that can take a Scientific Word code and make it pure LaTeX code?** Don't read what follows: Below this line is some nonsense I had to write in order to be able to ask the question.


title: Converting MS Word .doc to LaTeX by command line

text: There are many guides to convert `.doc` to `.tex` with text editor softwares (mostly under Windows); and this popularity has made it hard to search for command-based converting methods. I am looking for a command line to convert MS Word to LaTeX. This will be part of a PHP script running on Linux server. I mean a shell command to be executed by PHP.


title: Converting Doc file with wsW2LTX 1.1 GUI

text: > **Possible Duplicate:**   >  Converting MS Word .doc to LaTeX by command line I want convert a word file to .tex (XeTeX) with wsW2LTX 1.1 GUI But converted file is full of unknown numerical code like [24542] for non-latin alphabit. Is ther any solution? Is there any better library for converting .doc to tex? outbut sample:               \begin{itemize}          \item          \textbf{[62d][631][648][641] }\textbf{}          \end{itemize}          [627][6cc][646] [62e][637] [627][632] 27 [62d][631][641] [62a][634][6a9][6cc][644] [645][6cc][200c][634][648][62f].               \begin{longtable}{*{5}{p{20.46\wvtextpercent}}}     \hline


title: Prevent longtable to split cells while using \hline

text: although the question seems to be trivial and to be answered several times, I have not found a solution yet :-( I'm using a `longtable` to describe a set of computer benchmarks. Each benchmark entry consists of rows, a "headline" (name, references), and a "description". Now I do not want `longtable` to split the headline row and the description row, but print them on the same page. This can be done using `\\\\*`. Now the problem is that I want to have a `\hline` between the headline and the description, but both potential options do not work:   * `\\\\\hline *` : Latex compile error   * `\\\\*\hline` : The headline and the description are split Is there a way to achieve this? Thank you!


title: How do I make my pdf Page1 correspond to my Latex Page 1

text: In my pdf, I have my initial pages for the intro and TOC in roman numerals, and the pages for the main content in arabic numbers, and I'd like for page 1 of the PDF as shown in Acrobat to correspond to Page 1 of the arabic numbers in the pdf in my tex document. Is there a way to accomplish this? Thanks EDIT: Ok, invalid question. It works as expected in Acrobat. It doesn't work in Okular on linux, which is why I was misguided.


title: Align Image in LyX

text: I am writing my CV on LyX and I would like to insert my mugshot next to my personal details, which are aligned in the top center of the document. How can I do that without disturbing the text? I realise this might be a novice question but I am new to LyX. Thank you.


title: Problem with xepersian ver 2.8

text: when I update `xepersian` package to ver 2.8, and use XeLaTeX compiler for the following code:               \documentclass[11pt,b5paper]{book}     \usepackage{xepersian}     \begin{document}     $m$     \end{document}      then I see the error:               ! Undefined control sequence.     \SetMathCode #1#2#3#4->       \Umathcode #1="\mathchar@type #2 \csname sym#3\endcsn... l.6 {$m $}       is this a package bug? can I fined older version of `xepersian`? My log file starts               This is XeTeX, Version 3.1415926-2.4-0.9998 (MiKTeX 2.9) (preloaded format=xelatex 2013.5.24)


title: Fancy slides latex

text: I am using fancy slides for a presentation. The problem is that I want to be able to specify some colors with xcolor. When I try to do the usual                 \usepackage[usenames,dvipsnames]{color}      I get an error:                   ! LaTeX Error: Option clash for package color.      Did anyway encounter this before? Thank you! Edit: I am using the `fancyslides` class.


title: \bm package versus \boldsymbol

text: I'm typing a bold vector small x with a tilde sign above it. Now when I want to write its derivative, I'm putting a dot on top of everything. This is giving me problems and I found one solution:               \overset{\mathrm{\textbf .}}{\boldsymbol{\mathrm{\tilde{x}}}}      after I read this post: http://tex.stackexchange.com/questions/1874/how-to- make-a-larger-dot . This post has a solution for a similar problem: `\overset{\bm .}{a}` To write bold mathematical symbols, such as vectors is `\boldsymbol` better or do you recommend using the `\bm` package? I have always been using `\boldsymbol`. Thanks a lot...


title: Automatic positioning of cite index

text: Is there a way to make LaTeX automatically move all my numbered (superscript) citations to after the periods, commas and semicolons? e.g. I like to type (and so often accidentally type)               Sentence here \cite{paper}.      and want it to always produce the same output as               Sentence here. \cite{paper}      Superscript cites are part of the jasatex class that I wish to use for submission to the Journal of the Acoustical Society of America (unfortunately the class doesn't enforce this index positioning, nor is it actively maintained). It uses Natbib. I can see from another post that the class for Phys. Rev. allows this option e.g. the argument `citeautoscript` in `\usepackage[aps,prb,citeautoscript]{revtex4-1}`, but I don't know how to do this with my class.


title: Table of contents problems

text: I am writing my thesis and I am having a few problems with my format. My thesis structure is as follows: > I Introduction > > II Part 1 > >   * chapter 1 >   * chapter 2 > > > III Part 2 > >   * chapter 3 >   * chapter 4 > > > Appendices > > Bibliography My problem is this: In my table of contents, this appears like this: > I Introduction > > II Part 1 > >   * chapter 1 >   * chapter 2 > > > III Part 2 > >   * chapter 3 >   * chapter 4 > > > IV Appendices > >   * bibliography > So two questions:   1. How do I remove the part number for the Appendices   2. How do I bump up the bibliography to the `{part}` level in the table of contents (this entry is automatically generated by the `\bibliography` at the moment) I really appreciate any help!!


title: Spreading an associative table over several columns

text: In a paper, I'm using a large amount of associative tables. Tables with a key and value. Since both the keys and values are quite short, this is quite space inefficient. One could repeat the column headers and thus make more use of a row. For example               H1 H2     A  1     B  2     C  3     D  4      to               H1 H2 H1 H2     A  1  C  3     B  2  D  4      Is their a package to handle such transformations automatically. Doing this manually is quite cumbersome (because the tables are generated by programs) and if it is not always straight forward how much repeats fit on one page...


title: Wrong TikZ filepaths when included used input

text: I'm using TikZ for my thesis but have run into a small problem. In order to maintain some overview of the main tex file I have split all images into separate TikZ files (This also allows me to edit them with KtikZ which is nice). All images are put into a separate directory, say `/images`, which contains the TikZ files as well as any data file they include for plots (these are drawn with the `\draw plot file{<filename>};` command). Now, my problem is that when I import an image (`\import` inside an `figure` environment) all the file paths inside the TikZ file become wrong. So, is there any way of changing the evaluation directory inside the scope or to provide the TikZ file with an relative path or something? All ideas are welcome!


title: Color in pstricks not showing

text: I'm compiling this MWE with xelatex, I don't get any compilation errors, but the texts are all big black regular ones without any style applied. I'm using TexLive 2013 by the way. How should the file be compiled?


title: Including Arrows on lines in a Multiple Path

text: I'm drawing a `tikzpicture` and trying to make it flexible. There is a group of symbols that I want to be able to move around while maintaining their relative positions. So far I've tried concatenating commands inside one `\draw' and using`+(x,y)' coordinates to keep things relative. In the following diagram I want to be able to move what's inside the circle around as a group. ![MWE Output](http://i.stack.imgur.com/pSKHo.gif) I've made some progress but a side effect of the way I've done it is that I can't get this thing to include arrows on the ends of the lines between my S nodes. If I type `->' instead of '--' for example, it just ignores it. I'm drowning in the manual as usual. Perhaps there is a better approach altogether that I'm missing. Any tips that might help? **MWE**               \documentclass[border=6mm]{standalone}          \usepackage{tikz}          \begin{document}     %     \begin{tikzpicture}[>=latex]         \draw (1.5,1.5) circle (1.5cm);         \draw (0.5,1.8) node {$S_1$}             +(2,0) node {$S_2$}              +(1,-1) node {$S_3$}             +(0.4,0) -- +(1.6,0)             +(1.8,-0.20) -- +(1.2,-0.8)             +(0.2,-0.2) -- +(0.8,-0.8);     \end{tikzpicture}     %     \end{document}      Another type of element that I can't figure out how to get arrows on inside a group is an arc. This is shown in the following picture. I know how to do this with the arcs as separate elements but I can't make it work inside the group. ![enter image description here](http://i.stack.imgur.com/Bn3Lz.gif) **Extra MWE**               \documentclass[border=6mm]{standalone}          \usepackage{tikz}          \begin{document}     %     \begin{tikzpicture}[>=latex]         \draw (1.5,1.5) circle (2.0cm);         \draw (0.5,1.8) node {$S_1$}             +(2,0) node {$S_2$}             +(1,-1) node {$S_3$}             +(0.4,0) edge[<->] +(1.6,0)             +(1.8,-0.20) edge[<->] +(1.2,-0.8)             +(0.2,-0.2) edge[<->] +(0.8,-0.8);         \draw[<->] (0.5,2.05) arc (0:270:0.3cm);         \draw[<->] (2.8,1.75) arc (-90:180:0.3cm);         \draw[<->] (1.3,0.65) arc (-225:45:0.3cm);     \end{tikzpicture}     %     \end{document}


title: Interpunction and tikz diagrams

text: I am using tikz for creating commutative diagram in a mathematical text. However, diagrams are part of text/sentences, hence I sometimes would like to end them with a comma or full stop. A standard layout I use would look like this:               \documentclass[a4paper, reqno, 14pt]{amsart}     \usepackage{amsthm,amsfonts,amssymb,amsmath}     %\tikz     \usepackage{tikz}     %%%<     \usepackage{verbatim}     \usepackage[active,tightpage]{preview}     \setlength\PreviewBorder{5pt}%     \usetikzlibrary{arrows,chains,matrix,positioning,scopes}     \makeatletter     \tikzset{join/.code=\tikzset{after node path={%     \ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)%     edge[every join]#1(\tikzchaincurrent)\fi}}}     \makeatother     \tikzset{>=stealth',every on chain/.append style={join},              every join/.style={->}}     \tikzstyle{labeled}=[execute at begin node=$\scriptstyle,        execute at end node=$]     %------------------------------------------------------     \begin{document}         \noindent\hspace*{\fill}     \begin{tikzpicture}      \matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]         { 0 & M  & M  & M/fM  & 0 \\           0 & M_B & M_B & (M/fM)_B & 0 \\ };       { [start chain] \chainin (m-1-1);         \chainin (m-1-2);         { [start branch=A] \chainin (m-2-2)             [join={node[right,labeled] {}}];}         \chainin (m-1-3) [join={node[above,labeled] {\cdot f}}];         { [start branch=B] \chainin (m-2-3)             [join={node[right,labeled] {}}];}         \chainin (m-1-4) [join={node[above,labeled] {}}];         { [start branch=C] \chainin (m-2-4)             [join={node[right,labeled] {}}];}         \chainin (m-1-5); }       { [start chain] \chainin (m-2-1);         \chainin (m-2-2);         \chainin (m-2-3) [join={node[above,labeled] {\cdot f \otimes \operatorname{id}}}];         \chainin (m-2-4) [join={node[above,labeled] {}}];         \chainin (m-2-5); }              \end{tikzpicture}              \hspace{\fill} \\     \end{document}      If I just write (in the example above) "0." for the last entry of the second row, the last arrow of the second row will be shorter - which looks horribly. What is the intended way to end this diagram with a full stop?


title: How to register a callback in ConTeXt

text: In ConTeXt mkiv, how do I register a callback? `callback.register()` does nothing (and IIRC most callbacks are frozen anyway) and somewhere I found `tasks.appendaction`, but this gives me an error that `tasks` is not defined (nil). I'd like to add something to the `post_linebreak_filter` callback. * * * Edit: thanks to Khaled's answer and help from the Mailing list, I've got a solution now. The key is to create my own namespace:               moduledata.mystuff={}      and add my function:               moduledata.mystuff.show_hyph = show_hyph      and to register the function to the "finalizers" callbacks, which are the `post_linebreak_filter` equivalent in ConTeXt.               nodes.tasks.appendaction("finalizers","after","moduledata.mystuff.show_hyph")      See my answer for a complete example


title: Combining shading and transparency in TikZ

text: With this code:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \fill[shading=radial] (0,5) circle (2);     \fill[top color=black] (5,3) rectangle (9,7);     \fill[shading=radial, ultra nearly transparent] (0,0) circle (2);     \fill[top color=black, ultra nearly transparent] (5,-2) rectangle (9,2);     \end{tikzpicture}     \end{document}      I get (pdf both with mac preview and Adobe Reader) : ![transparent shading](http://i.stack.imgur.com/HglfJ.png) Why does the transparent option almost(but not completely) remove the shading? Where does the ultra thin perimeter line come from in a pure `\fill` (no `\draw` or `\filldraw`)?


title: Alignment in align environment

text: I would like to align the first "+" in the third and fourth lines of the following code. In the third line, I have "= 3 + [a mess]" and in the fourth line, I have "+ [another mess]" - I don't have the "3" in the fourth line. I used the \hphantom command to account for the horizontal space of the "= 3" in the third line, but there is a small space, the space that surrounds either side of a binary operator - in this case a plus sign - that needs to be inserted. (I am using 10pt font in amsart.) Here is the code :               \begin{align*}     &\vert xy + xz + yz \vert^{2} \\     &\qquad = [\cos(a + b) + \cos(a + c) + \cos(b + c)]^{2}     + [\sin(a + b) + \sin(a + c) + \sin(b + c)]^{2} \\     &\qquad = 3 + [2\cos(a + b)\cos(a + c)     + 2\cos(a + b)\cos(b + c)     + 2\cos(a + c)\cos(b + c)] \\     &\qquad \hphantom{= 3} + [2\sin(a + b)\sin(a + c)     + 2\sin(a + b)\sin(b + c)     + 2\sin(a + c)\sin(b + c)] .     \end{align*}      I tried using a `\phantom` command with a `\mathbin{+}` command, but that added the horizontal space of the plus sign to the fourth line. I tried to put another align environment within the given align environment.


title: Enlarge a single page

text: How may I enlarge a single page in LaTeX? I need this for the summary of a thesis that has to fit on a single page without respect to an eyecandy design. In order to move the lower border, I was successful using `\enlargethispage{10\baselineskip}`, but I'd like to move the upper and right/left margins as well.


title: Interaction of hyperref, capt-of and redefinition of @makecaption

text: > **Possible Duplicate:**   >  Remove colon in the caption of a figure without using caption package This is a very tough question and I have posted minimum example below.   1. Because I don't want my figures to float I use **center** environment and **capt-of** package.   2. I have tweaked **@makecaption** in a way that there is only figure name (no colon) displayed when figure name is empty.   3. I also use **hyperref** package. When working **all three together** , I get bunch of " **Extra \else.** " errors. Can you find the problem? Maybe I have redefined **@makecaption** badly? Regards.               \documentclass{article}     \usepackage{capt-of}          \usepackage{hyperref}          \makeatletter     % tweaked article.cls @makecaption: no caption text no ":"      \newcommand*{\captionlabeldelim}{}     \long\def\@makecaption#1#2{%       \ifx #2\ignorespaces         \renewcommand*{\captionlabeldelim}{}       \else        \renewcommand*{\captionlabeldelim}{:\ }       \fi       \vskip\abovecaptionskip       \sbox\@tempboxa{#1\captionlabeldelim #2}%       \ifdim \wd\@tempboxa >\hsize         #1\captionlabeldelim #2\par       \else         \global \@minipagefalse         \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%       \fi       \vskip\belowcaptionskip}     \makeatother          \begin{document}          \begin{center}     \includegraphics[clip]{bla.eps}     \captionof{figure}{x}     \end{center}%          \begin{center}     \includegraphics[clip]{bla.eps}     \captionof{figure}{}     \end{center}%          \end{document}


title: How to use a non-ASCII character, such as a Greek letter, in bibtex?

text: This is the title of the journal article: Verification of a sliding window protocol in µCRL and PVS. This is the bibtex file for the same:               @article{journals/fac/BadbanFGPP05,       added-at = {2005-11-15T00:00:00.000+0100},       author = {Badban, Bahareh and Fokkink, Wan and Groote, Jan Friso and Pang, Jun and van de Pol, Jaco},       biburl = {http://www.bibsonomy.org/bibtex/2788fbd81863c8e397b18da96324b4860/dblp},       date = {2005-11-15},       description = {dblp},       ee = {http://dx.doi.org/10.1007/s00165-005-0070-0},       interhash = {2d68692f33c41a23a91f6237b2a0e572},       intrahash = {788fbd81863c8e397b18da96324b4860},       journal = {Formal Asp. Comput.},       keywords = {dblp},       number = 3,       pages = {342-388},       timestamp = {2005-11-15T00:00:00.000+0100},       title = {Verification of a sliding window protocol in µCRL and PVS.},       url = {http://dblp.uni-trier.de/db/journals/fac/fac17.html#BadbanFGPP05},       volume = 17,       year = 2005     }      But in PDF, µ symbol is missing. This is output: ![enter image description here](http://i.stack.imgur.com/0s4Hm.png) At dblp, i got the following source:               @article{DBLP:journals/fac/BadbanFGPP05,       author    = {Bahareh Badban and                    Wan Fokkink and                    Jan Friso Groote and                    Jun Pang and                    Jaco van de Pol},       title     = {Verification of a sliding window protocol in \^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}\^{\i}},       journal   = {Formal Asp. Comput.},       volume    = {17},       number    = {3},       year      = {2005},       pages     = {342-388},       ee        = {http://dx.doi.org/10.1007/s00165-005-0070-0},       bibsource = {DBLP, http://dblp.uni-trier.de}     }      This doesn't work either. What should I do?