title: Line number error using "Require" and "Ensure" in package{algorithmicx}

text: I’m using the packages `algorithmicx` and `algpseudocode` to write algorithms in my paper. It’s more convenient and beautiful to specify comments than with the `algorithmic`. But I encounter an error while using “Require and Ensure.” The line's number is always wrong. ## MWE               \documentclass{article}     \usepackage{amsmath}     \usepackage{algorithm}     \usepackage{algpseudocode}     \begin{document}          \begin{algorithm}[ht]     \caption{My first algorithm}     \label{alg:algorithm1}          \begin{algorithmic}[1]     \Require~~\\      If there are multiple lines here, line's number will be wrong.\\      This error doesn't happen in package\{algorithmic\}     \Ensure~~\\      If I write $\setminus\setminus$ here, line's number will be wrong too.     \Statex     \If{$i = 1 \to n$} \Comment{This line's number should be 1}       \State ${\textit{HU}}_{i} \gets {\textit{NGU}}_{i} + {HU}_{i}$ \Comment{Comment}     \EndIf          \end{algorithmic}     \end{algorithm}     \end{document}      ## Output ![Pdf image is here](http://i.stack.imgur.com/4vTK9.png) ## Question I need to write two lines in item “Require.” How can I tackle this line number problem?


title: subfigure numbering parentheses flipped with babel + right-to-left language + subfig

text: Eyal's babel incompatibility of the week... this time a question due to H.R. on the IVRITEX mailing list. The `babel` is incompatible with the `subfig` package. If you add a subfig with a caption:               \documentclass[english,hebrew]{article}     \usepackage{babel}     \usepackage{subfig}               \begin{document}        \begin{figure}[tbph]           \subfloat[\L{A sub-figure}]{\L{The subfigure}}           \caption{\L{A figure caption}}        \end{figure}          \end{document}      The sub-figure is numbered; the numbering uses Hebrew letters (Aleph, Bet, Gimel; in this case, Aleph - א). The numbering is enclosed in parentheses, but due to direction issues, the parentheses are in the opposite directions of where they should be: ![rendering](http://i.stack.imgur.com/h2plM.png) Is there a workaround for this problem? A minimal workaround with no additional package dependencies is preferred. Note: You don't see this problem with Arabic instead of Hebrew (and the \L's removed) since when it's Arabic, you get a left-to-right float and Latin enumeration. Maybe it manifests in some other way with Arabic.


title: apa-good.bst question

text: I'm very unfamiliar with `.bst` files. I'm not using BibLatex yet, just standard BibTex. If I want the `apa-good.bst` to work with my thesis, do I have to also have the `apa.cls` in the same directory? I apologize up front for the newbie question.


title: Scholarly debates and arguments with TikZ

text: I was wondering if there is a TikZ library to diagram scholarly debates. For example, dark grey nodes constitute an argument for thesis (7), while light grey nodes are reasons to resist that argument. ![enter image description here](http://4.bp.blogspot.com/-_RjYxQWGtIY/Te88tfOXyeI/AAAAAAAAA6Y/9UTnEWAqyUA/s1600/The+Giftedness+Argument.256.png)


title: Journal abbreviation mapping mystery

text: Here is my tex document:               \documentclass{report}          \usepackage[bibstyle=authoryear-icomp,     citestyle=authoryear-icomp,     uniquename=false,     uniquelist=false,      firstinits=true,      maxbibnames=5,     minbibnames=5,      maxcitenames=2,     mincitenames=1,      sorting=ynt,      url=false,      isbn=false,      eprint=false,      doi=false,      dashed=false,      natbib=true,     ibidtracker=false,     backend=biber]{biblatex}     \addbibresource{example.bib}          \begin{filecontents}{example.bib}     @ARTICLE{Rehfeldt2006a,       author = {Rehfeldt, Gerald E. and Crookston, Nicholas L. and Warwell, Marcus         V. and Evans, Jeffrey S.},       title = {Empirical analyses of plant climate relationships for the western         United States},       journal = {International Journal of Plant Sciences},       year = {2006},       volume = {167},       pages = {1123--1150},       number = {6},       url = {http://www.jstor.org/stable/10.1086/507711}     }     \end{filecontents}          \begin{document}     \citet{Rehfeldt2006a} demonstrated how to calculate certain environmental variables.          \printbibliography     \end{document}      The mapping file is `~/.biber.conf`               <?xml version="1.0" encoding="UTF-8"?>      <config>       <sourcemap>        <maps datatype="bibtex">               <map map_overwrite="1">           <map_step map_field_source="journal"            map_match = "International Journal of Plant Sciences"            map_replace = "Int. J. Plant Sci."/>          </map>                  </maps>       </sourcemap>      </config>      When bibliography is printed, the journal name does not get abbreviated. It is also printed in a strange fashion as follows:               International Journal of Plant Science.s      instead of `Int. J. Plant Sci.` I have 60-65 other name mapping which work perfectly fine, except for this one. I have spent more than an hour looking closely if I made any mistake anywhere, but I can't seem to find anything. Any help is much appreciated.


title: Indent description

text: I'm having problems with indenting the label of a description. Tried to define a new environment, and set leftmargin to whatever, but the label stays put. How can I achieve what I want? This is what Ive done:               \newenvironment{owndesc}     {\begin{description}     \setlength{\leftmargin}{3cm}     \setlength{\labelsep}{5cm}}     {\end{description}}      I'm quite new to LaTeX, and any help is appreciated, thanks!


title: Fault tree using TikZ : draw subtree at multiple levels

text: On lines of the Fault Tree in the TiKZ example (http://www.texample.net/tikz/examples/fault-tree/), I made the following Fault tree                \node (g1) [event] {Project fails \\ E0}                 child {node (e1) {No legal permit \\(E1)}                     child {node (e11) {No legal permit A \\ (E11)}}                     child {node (e12) {No legal permit B \\ (E12)}}                     child {node (e13) {No legal permit C \\ (E13)}}                 }             child {node (e2) {No financing \\(E2)}                 child {node (e21) {No financing A \\ (E21)}}                 child {node (e22) {No financing B \\ (E22)}}                 child {node (e23) {No financing C \\ (E23)}}             }             child {node (e3) {No collaboration}                 child {node (e31) {Low incentive}}                 child {node (e32) {Low trust}}             };      However the nodes of the tree overlap each other. I tried reducing the distance between nodes, but that doesn't look as elegant in this case. Is there a way that the E2 subtree could be at a level lower than that of the E1 subtree? ![enter image description here](http://i.stack.imgur.com/633aI.png)


title: how to add annotation to ybar pgfplots with symbolic x coords

text: I would like to add an annotation, or better, an arrow to a particular ybar in a plot, but I am struggling with the symbolic x data. I've used \pgfplotsinvokeforeach to read in variable data, and so haven't explicitly defined the x values. Whenever I try to specify the coordinates with eg \node[coordinate,pin=right:{Tasmania entry to NEM}] at (axis cs:2004/5,190) {}; I get an error (not a floating point value), so I have had to use the numeric value of 0 which places my comment roughly in the right place. The question is - how to specify the correct node so that it will be placed at the top of the desired bar? The working example is below - but I would like to place the comment at the top and left of the 2005/6 y bar.               \documentclass{article}     \usepackage{pgfplotstable}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \begin{document}     \pgfplotsset{         select row/.style={             x filter/.code={\ifnum\coordindex=#1\else\def\pgfmathresult{}\fi}         }     }     \pgfplotstableread[col sep=comma,header=false]{     1999/00,167.1     2000/1,172.5     2001/2,175     2002/3,179.3     2003/4,184.4     2004/5,188     2005/6,201.7     2006/7,208.3     2007/8,210.2     2008/9,210.5     2009/10,209.8     2010/11,207.5     2011/12,203.4     2012/13,198.2     %2013/14(YTD),97     }\datatable     \begin{tikzpicture}[scale=0.8]       \begin{axis}[         %title=Australia's Primary Energy Consumption by sector - 2012,             ybar, bar shift=0pt,             enlarge y limits=0.1,             %xmin=0,             xtick={0,...,13},             xticklabels from table={\datatable}{0},             ymajorgrids = true,             bar width=3mm,              width=12cm, height=9cm,              xlabel={year},         ylabel={TWh},             x tick label style={font=\footnotesize,rotate=45, anchor=east},              nodes near coords align={horizontal},       ]     \pgfplotsinvokeforeach{0,...,13}{         \addplot table [x expr=\coordindex, select row=#1] {\datatable};     }     \node[coordinate,pin=right:{Tasmania entry to NEM}] at (axis cs:0,190) {};          \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/mdIFu.png)


title: Numbering theorems as subsubsections

text: I am working on a large, multi-chapter document using the `memoir` class. I have sections, subsections, and subsubsections within each chapter, and within the subsubsections are theorems, lemmas, propositions, etc. I have all of the theorems, propositions, etc sharing a single counter, which is subordinate to the subsection. So currently things look like this: > Chapter 1 > > Section 1.1 > > Subsection 1.1.1 > > Subsubsection 1.1.1.1 > > Theorem 1.1.1.1 > > Subsubsection 1.1.1.2 > > Definition 1.1.1.2 > > Remark 1.1.1.3 > > Subsubsection 1.1.1.3 I want the numbering of theorems, propositions, etc to use the same counter as the subsubsections, so that things would look like this instead: > Chapter 1 > > Section 1.1 > > Subsection 1.1.1 > > Subsubsection 1.1.1.1 > > Theorem 1.1.1.2 > > Subsubsection 1.1.1.3 > > Definition 1.1.1.4 > > Remark 1.1.1.5 > > Subsubsection 1.1.1.6 I would prefer to use `amsthm`, but I'm open to using other packages if necessary. Bonus points: how to get the equation numbering to use the same counter?


title: TikZ setting the edge of a path to horizontal rather than in=0 out=180 or vice versa

text: \path[->] (A) edge [out=180, in=0] (B);      This path is written quite often in my document. Sometimes I find myself changing it to:               \path[->] (B) edge [out=0, in=180] (A);      I do not want to touch the `->` property for consistance sake. But I would love to write something like:               \path[->] (B) edge [inout = horizontal] (A);      How can I achieve the implied effect? * * * **EDIT:** Clarification: I want those two paths to be the same path without manually changing the input output angles.               \path[-] (B) edge [inout = horizontal] (A);     \path[-] (A) edge [inout = horizontal] (B);      Here is a miniexample that illustrates the question better:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}         \node (A) at (0,0) {A};         \node (B) at (3,2) {B};              \node (C) at (3,0) {C};         \node (D) at (6,2) {D};              \path[-] (B) edge [out=0, in=180] (A); %not desired - longer path         \path[-] (A) edge [out=0, in=180] (B); %desired path - shorter path              %\path[-] (C) edge [inout = automagic] (D); %desired path - shorter path         %\path[-] (D) edge [inout = automagic] (C); %desired path - shorter path          \path[-, ultra thick, red] (C) edge [out=0, in=180] (D); %desired result of [inout = automagic]     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/F5fzf.png)


title: Draw edge on arc

text: I would like to draw an edge between two nodes which lies on a clip of an circle. For small angles I was able to get some more or less realistic appearance by using bend left and bend right, but for large distances, for example to connect a node which lies at 90° with an node at 225°, this is getting ugly. However, drawing an arc alone does not draw arrows and does not end at the "borders" of the nodes, but at their center. So is there any solution, e.g. an argument for "edge" while building a path, where I can specify an arc on which it should lie? Here is an example: ![enter image description here](http://i.stack.imgur.com/LtOAz.png)               \documentclass{scrartcl}     \usepackage{tikz}     \begin{document}          \begin{tikzpicture}     \node (V1) at (0,8) {$\o{v}_1$};     \node (V3) at (4,4) {$\o{v}_2$};     \node (V5) at (0,0) {$\o{v}_3$};     \node (V6) at (-2.83,1.17) {$\o{v}_4$};          \node at (0,4) {$\o{C}$};          \path   (V1) edge[bend left=45] node[above right] {$\o{g}_1(x)$} (V3)             (V5) edge[bend right=45] node[below right] {$\o{g}_2(x)$} (V3)             (V5) edge[bend left=15] node[below] {$\o{g}_3(x)$} (V6)             (V1) edge[bend right=70] node[above left] {$\o{g}_4(x)$} (V6);     \end{tikzpicture}     \end{document}      While the first three edges of the path look more or less as if the would lie on a circle, the fourth one makes the circle a potato.


title: How to increase the size of a curly bracket size without \left and \right

text: I would like to ask how to increase the dimension of the curly bracket in the second item of the following list:               \begin{enumerate}     \item Draw $\tilde{\theta}$ from $j$     \item Calculate $\nu = \min \{ {\frac{p(\theta^{k}+\tilde{\theta})}{p(\theta^{k})},1} \}$     \item With probability of $\nu$, put $\theta^{k+1}=\theta^{k}+\tilde{\theta}$, otherwise put $\theta^{k+1}= \theta$     \end{enumerate}      I tried by adding `\left{` and `\right}` as follows               \item Calculate $\nu = \min \left{ {\frac{p(\theta^{k}+\tilde{\theta})}{p(\theta^{k})},1} \right}$      but I still receive an error message. I would be very grateful if someone could provide me with suggestions in this respect.


title: Highlighting part of an image

text: I want to highlight part of an image in beamer by drawing a box around it and setting the rest of the image to a dim setting. I do not know how to decrease the brightness of the rest of the picture. Below is my partial attempt, which almost does the job. But I am unable to decrease the brightness of the remaining picture outside the small red rectangle at the left bottom. Any help would be greatly appreciated.               \documentclass{beamer}     \usetheme{Copenhagen}     \usecolortheme{whale}     \useinnertheme{rounded}          \usepackage{tikz}          \newcounter{boxes}          \newcommand\ordbox[2]{%       \stepcounter{boxes}       \tikz[remember picture,overlay]{       \node[rectangle,rounded corners,line width=2pt,draw=red,fill=pink,text height=10pt,text depth=3pt,align=left,draw opacity = 0.75, fill opacity=.75,text opacity=1] (box-\theboxes) at #2 {#1};}     }          \newcommand\tikzmark[1]{%       \tikz[remember picture,overlay] \node (#1) {};}          \begin{document}     \begin{frame}     \begin{tikzpicture}     \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[scale=0.2]{../images/H1D_level_5.pdf}};     \end{tikzpicture}     \end{frame}     \begin{frame}     \begin{tikzpicture}     \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[scale=0.2]{../images/H1D_level_5.pdf}};     \draw[red,ultra thick] (0,0) rectangle (0.5,0.5);     \end{tikzpicture}     \end{frame}          \end{document}      The code above produces the outputs below. ![enter image description here](http://i.stack.imgur.com/XfIyU.png) ![enter image description here](http://i.stack.imgur.com/PhSBP.png)


title: How to set italics and bold shortcuts like *bold* or _italic_

text: I remember seeing a possible solution here, but can't find it. Is there any way to simplify bold and italics so that instead of \textbf{bold text} and \textit{italics text} I use simple marks like (such as in Word) _bold text_               *bold text*       and _italics_               _italics_      for the whole document?


title: bibliography: problem with counting entries

text: I have a problem with my bibliography. I use natbib. I have literatur from the same author in the same year. I have a own Function "DateWithBrackets", see below. And my bibliography looks like this:               author, (2013)a,...          author, (2013)b,...      but it should looks like this               author, (2013a),...          author, (2013b),...      this is the function I use:               FUNCTION {format.dateWithBrackets}     { year duplicate$ empty$         { "empty year in " cite$ * warning$            pop$ "" }         'skip$       if$       month empty$         'skip$         { month           " " * swap$ *         }       if$                                          duplicate$ empty$ 'skip$              %% added       { "(" swap$ * ")" *}                  %% added       if$       extra.label *     }


title: Endnotes do not be superscript and add a space

text: See my picture. ![enter image description here](http://i.stack.imgur.com/tIbQ3.png) **Also I want to add a space between the number and note**. Besides writing `\endnote{ hello}`, are there any formal way? This is my source code.               \documentclass{article}     \usepackage{endnotes}     \renewcommand{\notesname}{References}     \renewcommand{\theendnote}{[\arabic{endnote}]}          \begin{document}     \section{Introduction}     As traffic in Macao is a problem\endnote{ hello}, we want to do the project to find out the relationship of traffic among different sites\endnote{world}.          \theendnotes     other references...          \end{document}


title: \tableofcontents does not appear

text: A table of contents does not appear in my beamer document. How do I make it appear? I have the following code (for linebreak I wanted to add 2 spaces at end of `\part[square]{round}` but that didn't work so the code block is a tad dense, any comments on this are welcome too):               \documentclass{beamer}     \begin{document}       \frame{\titlepage}     \frame{\tableofcontents}     \part[square]{round}       \begin{frame}  \frametitle{One} Content \end{frame}        \section{First Section}       \begin{frame}  \frametitle{Two} Content \end{frame}      \subsection{First Sub-Section}        \begin{frame}  \frametitle{Three} Content \end{frame}     \end{document}


title: Texstudio user-defined hover preview

text: When hovering the cursor over the starting symbol of inline math mode, `$`, or over `\begin{equation}`, Texstudio gives a preview of the typeset math. I love this feature, but it only works in these two cases. Mostly I use `\[` for math, or the `align` environment, so I would like to add my own environments to trigger this preview. Someone else felt the same way and opened this ticket on Sourceforge, and it was closed as "implemented". But then how does one do it? http://sourceforge.net/p/texstudio/feature-requests/322/


title: LaTeX - lstinline

text: I want to include a short code snippet using the `listings` package. I have already chosen the parameters for `\lstset` and my C++ code looks nice with these setttings. For an inline code snippet I try to use the `\lstinline` command. But when trying something like this:               \lstinline$#define EXAMPLE$          the output is like this:      #      define          EXAMPLE          instead of this:     #define EXAMPLE      I made a minimal version and could see that it is because of `\singlespacing` in my `\lstset` settings. How can I fix this without losing the `\singlespacing` command? minimal version:               \documentclass[a4paper,oneside,12pt,2.1headlines]{scrreprt}          \usepackage{setspace}     \usepackage{listings}          \lstset{       basicstyle=\singlespacing     }          \begin{document}            \lstinline$#define EXAMPLE$          \end{document}


title: Is it possible to use bibunits and multibib simultaneously?

text: I'm typesetting a contributed book, which has a whole bunch of chapters written by a different author each. My job is make sure all contributions use more or less the same typesetting conventions and select index words. For the references we wish to create a separate list for each chapter. Originally I was doing this using `multibib`, but it seems that package actually keeps each .aux file open while running pdflatex, hence now that I've finished editing a bunch of chapters, I'm suddenly running into the limited write-stack. So I switched to `bibunits`, which is better suited for the job anyway. However....... one of the contributions actually has four separate bibliographies that go with it. This is again precisely the problem `multibib` tries to solve and I happened to start with this contribution, which explains my original choice for that package. So what I would like to do, is to use `bibunits` for all contributions and use `multibib` to split the references in this one special contribution. Since `bibunits` closes each unit before continuing to the next unit, I should be safe then wrt the limited write stack. Unfortunately these packages don't work well together, so it seems. I guess this has to do with the fact that both of these try to redefine similar same commands (although, since `multibib` explicitly defines `\citeXXXX` commands for each bibliography unit `XXXX` I kind of expected things to be allright) The error I'm getting, is the standard, infamous:               ! TeX capacity exceeded, sorry [input stack size=5000].     <inserted text>                      }\endwrite      l.901 ...liographysyta{syta_vdweygaert-references}          !  ==> Fatal error occurred, no output PDF file produced!      What also strikes the eye, is that at some point I get an enormous long list of lines saying:               (./bu.aux) (./bu.aux) (./bu.aux) (./bu.aux) (./bu.aux) (./bu.aux) (./bu.aux)      Allright... back to what I guess is my question: I tried to get separate reference lists for a single chapter, while also creating references for individual chapters and failed. How can I succeed in doing this?


title: Styling a lstlisting caption using caption package

text: I'd like to style a caption in a specific way, but I can't seem to figure out the proper settings to do so. First off, I'd like to change the label from "Listing" to "Algorithm" when I use `\captionof{lstlisting}{foo}` Secondly, I'd like to make the "Algorithm 1" part be bold with the rest of the label non boldface Thirdly, I'd like to have a line above the caption. Here's an image of something akin to what I'd like to achieve, and following is my code. ![enter image description here](http://i.stack.imgur.com/F218x.png) And this is what I have: ![enter image description here](http://i.stack.imgur.com/x5FRP.png)               \documentclass{article}          \usepackage{listings}     \usepackage{caption}     \usepackage{geometry}     \usepackage{DejaVuSans}     \usepackage{DejaVuSansMono}     \renewcommand*\familydefault{\ttdefault}          \geometry{left=1.0in,right=1.0in,top=1.0in,bottom=1.0in }          \lstset{       frame=top,frame=bottom,       basicstyle=\small\normalfont\sffamily,    % the size of the fonts that are used for the code       stepnumber=1,                           % the step between two line-numbers. If it is 1 each line will be numbered       numbersep=10pt,                         % how far the line-numbers are from the code       tabsize=2,                              % tab size in blank spaces       extendedchars=true,                     %       breaklines=true,                        % sets automatic line breaking       captionpos=t,                           % sets the caption-position to top       mathescape=true,       stringstyle=\color{white}\ttfamily, % Farbe der String       showspaces=false,           % Leerzeichen anzeigen ?       showtabs=false,             % Tabs anzeigen ?       xleftmargin=17pt,       framexleftmargin=17pt,       framexrightmargin=17pt,       framexbottommargin=5pt,       framextopmargin=5pt,       showstringspaces=false      % Leerzeichen in Strings anzeigen ?      }          \DeclareCaptionFormat{listing}{#1#2#3}     \captionsetup[lstlisting]{format=listing,singlelinecheck=false, margin=0pt, font={sf}}          \DeclareMathVersion{sans}     \SetSymbolFont{operators}{sans}{OT1}{cmbr}{m}{n}     \SetSymbolFont{letters}  {sans}{OML}{cmbrm}{m}{it}     \SetSymbolFont{symbols}  {sans}{OMS}{cmbrs}{m}{n}          \lstnewenvironment{sflisting}[1][]       {\lstset{#1}\mathversion{sans}}{}               \begin{document}          \begin{sflisting}[caption=Spanning tree broadcast algorithm.]     Initially $\langle M\rangle$ is in transit from $p_{r}$ to all its children in the spanning tree.          Code for $p_{r}$:     1:  upon receiving no message:                                          // first computation event by $p_{r}$     2:      terminate          Code for $p_{i},\ 0\leq i\leq n-1,\ i\neq r$:     3:  upon receiving $\langle M\rangle$ from parent:     4:      send $\langle M\rangle$ to all children     5:      terminate     \end{sflisting}     \end{document}


title: Using \onslide in Tikz and pgfplots

text: I am having trouble with using beamer's `\onslide` in TikZ and pgfplots. The issue I have encountered is that if I use `\onslide` then the specific parts of the picture I want to appear on a specific slide appear on all the slides in the frame. Using `\only` works (I do not obtain the same error). However, I want to use `\onslide` because then the figure takes up the same space all the time. The following example demonstrates my problem. It should run as follows: There is a curve and an x-axis (slide 1). Then a second curve is added (slide 2). Then the y-axis is added (slide 3). Then some text is added (slide 4). However, the picture on slide 1 when I run this is how it should look at slide 3. Having given this a lot of thought and google-powered effort, I have no idea what the issue could possibly be! (This tex.SE question is relevant, but does not really resolve the issue, or tell me the underlying issue (which I would be interested to know).)               \documentclass{beamer}           \usepackage{tikz}     \usepackage{pgfplots}          %%%          \begin{document}          \begin{frame}     \frametitle{A frame}          \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[             every axis plot post/.append style={mark=none,domain=-3:3,samples=50,smooth},             clip=false,             axis y line=none,             axis x line*=bottom,             ymin=0,             xtick=\empty,     ]     \onslide<1->{%on all slides. Note: Changing this to \onslide<2-> does not change anything - all parts of the image occur on all slides.         \addplot {x^2};     }     \onslide<2->{%on the 2nd slide and those coming after         \addplot {x^2+1};     }     \onslide<3->{%on the 3rd slide and those coming after         \draw (axis description cs:0.5,0) -- (axis description cs:0.5,1);     }     \end{axis}     \end{tikzpicture}\end{figure}          \onslide<4->{%on the 4th slide and those coming after     Slide 4.     }     %     \end{frame}     %     \end{document}      Note: In reality, I want to do this in a minipage. So if you provide an alternative method then you might want to bear this in mind. Or not. Thanks in advance!


title: Reveal TikZ Mindmap step by step with Beamer

text: > **Possible Duplicate:**   >  Mindmap tikzpicture in beamer (reveal step by step) Using a mindmap example from here, with only sligth modifications. The target is to control what mindmap pieces are visible at a given time in the presentation. Here is what i tried:               \begin{tikzpicture}       \path[mindmap,concept color=black,text=white]         node[concept] {Computer Science}         [clockwise from=0]         child[concept color=green!50!black] {           node[concept] (herb) {practical}  %herb           [clockwise from=90]           child { node[concept] {algorithms} }           child { node[concept] {data structures} }           child { node[concept] {pro\-gramming languages} }           child { node[concept] {software engineer\-ing} }         }           child[concept color=blue] {           node[concept] (muh) {applied}  %muh           [clockwise from=-30]           child { node[concept] {databases} }           child { node[concept] {WWW} }         }         child[concept color=red] { node[concept] {technical} }         child[concept color=orange] { node[concept] {theoretical} };         \uncover<1-1>{herb} %should uncover on 1         \uncover<2-2>{muh} %should uncover on 2     \end{tikzpicture}      Although i get to select the two different versions in the pdf, they appear identical. How can i display the mindmap step by step to help my audience follow my trail.


title: Loop around node in state diagram

text: I have a feeling this should be simple, but I can't find how to do it. I'm trying to draw an arrow looping around the corner of a node in a state diagram. I have the following, but as you see it cuts the corner, plus ideally the arrow would loop from nearer the corner.               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \pagestyle{empty}          \begin{tikzpicture}[%node distance = 15mm and 300mm,         node/.style={             draw,             rectangle,             text width=25mm,             text centered,             minimum height=20mm         },           arrow/.style={             very thick,             ->         }]          \node[node] (state) {State};          \draw [arrow] (state.south)  to [out=270, in=0]  (state.east);          \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/UPf16.png)


title: Adding tikz figure in caption

text: I am writing one long document using lyx. I wanted to add small tikz code within a caption of a figure of my document. However when I tried to run it it is giving following error. Please help me resolve this problem.               ! Use of \use@pgfplotslibrary doesn't match its definition.     \pgfutil@ifnextchar ...1\def \pgfutil@reserved@a {                                                    #2}\def \pgfutil@reserved@...     l.1411 ... method \label{fig:Velocity-curves-for}}      Here is the code portion                \documentclass{svmono}      \usepackage{mathptmx}      \renewcommand{\familydefault}{\rmdefault}      \usepackage[T1]{fontenc}      \usepackage[latin9]{inputenc}      \usepackage{color}      \usepackage{float}      \usepackage{amsmath}      \usepackage{amssymb}     \usepackage{graphicx}      \usepackage{esint}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     \DeclareRobustCommand{\greektext}{%      \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}      \DeclareRobustCommand{\textgreek}[1]{\leavevmode{%      \IfFileExists{grtm10.tfm}{}{\fontfamily{cmr}}\greektext #1}}      \DeclareFontEncoding{LGR}{}{}      \DeclareTextSymbol{\~}{LGR}{126}      \newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}      \text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}           %% Because html converters don't know tabularnewline      \providecommand{\tabularnewline}{\\}            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.       \usepackage {tikz,pgfplots}       \usetikzlibrary{shapes,arrows,shadows,snakes}       \usepgfplotslibrary{colormaps}            \@ifundefined{showcaptionsetup}{}{%       \PassOptionsToPackage{caption=false}{subfig}}        \usepackage{subfig}        \makeatother     \begin{document}     \begin{figure}          \centering{}\caption{Velocity curves of the vehicle for 1$^{st}$ scenario. (a) DWA.       \tikz[baseline]\draw[dashed,thick, color = blue](0ex,0ex)--(1ex,0ex);(b)     The proposed method \label{fig:Velocity-curves-for}}     \end{figure}     \end{document}


title: Calligraphic E (not \mathcal)

text: I write my notes in statistics with LaTeX. The lector uses a special E as the sample space and I can't find it in LaTeX. Are there any other calligraphic math font styles then `\mathcal` and `\mathscr`? Here's what the symbol looks like handwritten: ![symbol image](http://i.stack.imgur.com/hW7En.png)


title: Tagging equations with three \ast

text: I want to tag some equations with `\ast`, for `\ast` and `\ast \ast` it's good, but for the third I would like to have the three `\ast` placed like in a triangle, so two `\ast` at the bottom and the third in the middle about above the base two.               $$\tag{$\ast$} \label{eq-1}$$     $$\tag{$\ast \ast$} \label{eq-2}$$     $$\tag{$\threeast$} \label{eq-3}$$      because `$\ast\ast\ast$` is too long


title: No numbers in schemes with chemstyle package

text: Following this ordeal: Compounds defined implicitly in captions (chemscheme/chemstyle/chemcompounds) I completely removed TeX and installed MacTeX 2011. My document now compiles, but every number in every scheme is missing (replaced with the usual `?` symbol). There are no obvious errors relating to this in the console, apart from:               <Thesis-pics.pdf, id=2, page=1, 162.6075pt x 150.5625pt>     <use Thesis-pics.pdf, page 1> [1     Non-PDF special ignored!     Non-PDF special ignored!{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/upd     map/pdftex.map} <./Thesis-pics.pdf>]      near the top. (The `chemstyle` package uses `epstopdf` to generate pdf images for compilation with `pdflatex`). Every instance of this error appears to be caused by a different problem... Edit: compounds referred to in the text work fine...


title: overlapping nodes

text: How to solve the problem of overlapping nodes? I want the below of n1.               \usetikzlibrary{positioning}     \tikzset{every node/.style={blue,rounded corners}}     \begin{tikzpicture}     \node[draw,fill=yellow] (n1) {         \begin{minipage}{5cm}             alignment of nodes                  with \verb|minipage|                  long text                  fourth line         \end{minipage}     };     \node[draw,fill=orange!25] (n2) [below =1cm of n1.west,anchor=west] {below node};     \node[draw,fill=green!25] (n3) [right = of n1.north east,anchor=north west] {         \begin{minipage}{5cm}             right node                  with \verb|minipage|                  tirth line.         \end{minipage}     };     \draw[<-,>=latex,red,very thick] (-.3,-1) to [out=0,in=180] (1,-1.5) node[right] {problem here.};     \end{tikzpicture}      ![i need below of n1.](http://i.stack.imgur.com/4VdJH.png) i need below of n1.


title: overline over no text

text: Suppose I want to have the function `$\bar: A \to B$` where instead of `$\bar$` it's a longer bar. What is the proper way to do this? Note that the bar here is floating on top of no text. It's just floating. I also wasn't sure what tags to use. Sorry. Thanks.


title: how to suppress "chapter" in \chapter (while keeping numbering)

text: Using `\chapter` I get: > Chapter 1. The meaning of this novel   >  Chapter 2. The plot of this novel   >  Chapter 3. The moral of this novel I want to get instead: > 1\. The meaning of this novel   >  2\. The plot of this novel   >  3\. The moral of this novel


title: renew command chapter - suppress "chapter" show only number and name

text: I am using the report document class and would like to define the following behaviour when using the chapter command: Normally it makes the chapter the following way:               \chapter{Theory}      > Chapter 1 Theory I would like to make it look the following: > 1 Theory I know this sounds a lot like just using an article and sections but I want to use sections and subsections in my chapters.


title: Resize brackets for publication?

text: I am unsure how to select appropriate size of brackets for different equations. Example               \begin{equation}     (v, \frac{\partial^{2} u}{\partial t^{2}}) + c^{2}(\nabla v, \nabla u)     - c^{2} (v, \frac{\partial u}{\partial n})_{\partial \Omega} = (f,v).     \end{equation}      output ![enter image description here](http://i.stack.imgur.com/RNYo4.png) Example 2               \begin{equation}     \Big(v, \frac{\partial^{2} u}{\partial t^{2}}\Big)      + c^{2}(\nabla v, \nabla u)     - c^{2} \Big(v, \frac{\partial u}{\partial n}\Big)_{\partial \Omega} = (f,v).      \end{equation}      output ![enter image description here](http://i.stack.imgur.com/Q4nJp.png) I think the last example is the best one because the brackets are as high as the inner thing. **Is there any way to automatise the resizing of brackets for publication format?**


title: How to position text on top of a node?

text: How to position text on top of a node?               \documentclass{report}          \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}     \tikzset{every node/.style={rounded corners,minimum height=5cm}}     \begin{tikzpicture}     \node[draw,fill=yellow] (n1) {         \begin{minipage}{5cm}             alignment of nodes                  with \verb|minipage|                  long text                  fourth line         \end{minipage}     };     \draw[<-,>=latex,red,thick] (-2.5,2.4) to[bend left] (-2.5,3) node[right,blue] {i need text here.};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/2eY5T.png)


title: knitr pdf search invisible text

text: I use the fantastic knitr to generate beamer-pdf’s with hundreds of slides of plots. Every plot shows data of different measuring equipment, so for example the plot showing result of measuring equipment “hello0023a” may be on slide 48. I don’t want to print the name of the equipment on every slide (too many equipment), but I would like to search the pdf for “hello0023a” so that it finds slide 48. The name of the equipment is included in the plot-legend, but that is in png so not searchable. Can this be done?


title: Calling a previously named path in tikz

text: Using the `intersections` library, we are able to name a path. For example               \path[name path=line1] (0,0) -- (1,1);      Now, how can I later in the picture call upon this path with the name `line1` and do things to it -- such as drawing, marking etc.? PS. I did look at answers to some other seemingly related questions (such as part drawing of a path etc.) but not able to find an answer.


title: Debugging 'Font shape undefined' and 'Corrupted NFSS tables' (T5, concretevn and sig-alternate)

text: I was told to take a look for an unspecified problem with the fonts in one of my PDFs generated by `pdflatex`.. I couldn't find anything obvious, except for the innocuous:               LaTeX Font Warning: Font shape `T1/lmr/bx/sc' undefined     (Font)              using `T1/lmr/bx/n' instead on input line 103.      Well, what I wanted to have is basically portions of text written in small caps, and I liked concretevn; however, what I was not aware of, is that this is a Vietnamese font, and it follows T5 encoding! That I realised only after finding and looking at `concretevn-test.tex`. So I thought I try to look at this on an minimal example, and I think there are some problems when using this font and Alternate ACM LaTeX2e Style File V2.4 (APRIL 2009 CLS) (from ACM SIG Proceedings Templates — Association for Computing Machinery). First, there are seemingly no problems at all when using the default `article` document class (calling the file `fonttest.tex`):               \documentclass{article}          \usepackage[T5]{fontenc}    % must have for new font selection style (11533 bytes PDF size)                                 % , else on \fontencoding{T5} line:                                 %% ! LaTeX Error: Encoding scheme `T5' unknown.                                 % ... not needed for old (?) font selection style;                                 % but if used, 11534 bytes - if not used, 17846 bytes of PDF size               %%%%% old (?) font selection style     % \newfont{\myscfont}{vncccsc10 scaled 900}          \begin{document}          This is a test of normal text... This is a test of normal text... This is a test of normal text... This is a test of normal text...          {     %%%%% old (?) font selection style     % \myscfont          %%%%% new font selection style     \fontencoding{T5}     \fontfamily{ccr}     \fontseries{m}     \fontshape{sc}     \fontsize{10}{12}     \selectfont       Trying Small Caps Out...     }          This is a test of normal text... This is a test of normal text... This is a test of normal text... This is a test of normal text...          \end{document}      Both old (?) and new font selection system (NFSS) work fine ( _the above file demonstrating the NFSS method_ ); `pdflatex` doesn't give any warnings or errors; `evince` opens PDF file OK; `pdffonts` reports:               $ pdffonts fonttest.pdf     name                                 type              emb sub uni object ID     ------------------------------------ ----------------- --- --- --- ---------     TVOLGQ+VNR10                         Type 1            yes yes no       4  0     VNWFOD+Vncccsc10                     Type 1            yes yes no       5  0      The problem starts if I replace the `article` document class with `\documentclass{sig-alternate}`:               ...     No file fonttest.aux.     ! Corrupted NFSS tables.     wrong@fontshape ...message {Corrupted NFSS tables}                                                       error@fontshape else let f...     l.14 \begin{document}     ...      If I press ENTER here, the pdf actually does get generated:               LaTeX Font Warning: Some font shapes were not available, defaults substituted.     ...     Output written on fonttest.pdf (1 page, 17702 bytes).          $ pdffonts fonttest.pdf     name                                 type              emb sub uni object ID     ------------------------------------ ----------------- --- --- --- ---------     NJOBBG+CMR10                         Type 1            yes yes no       4  0     VNWFOD+Vncccsc10                     Type 1            yes yes no       5  0      ... and strangely, the font does seem to be embedded fine ?! In any case, `evince` opens it fine, shows the right fonts... Now, where I get surprised, is if I look at the .log file:               ...     LaTeX Font Info:    Redeclaring font encoding T1 on input line 43.     )     LaTeX Font Info:    Try loading font information for T1+aer on input line 100.          (/path/to/texlive/texmf-dist/tex/latex/ae/t1aer.fd     File: t1aer.fd 1997/11/16 Font definitions for T1/aer.     )))     (/path/to/texlive/texmf-dist/tex/latex/base/fontenc.sty     Package: fontenc 2005/09/27 v1.99g Standard LaTeX package          (/path/to/texlive/texmf-dist/tex/latex/vntex/t5enc.def     File: t5enc.def 2006/11/21 v1.4 Vietnamese T5 encoding     )     LaTeX Font Info:    Try loading font information for T5+aer on input line 100.     LaTeX Font Info:    No file T5aer.fd. on input line 100.          LaTeX Font Warning: Font shape `T5/aer/m/n' undefined     (Font)              using `T5/cmr/m/n' instead on input line 100.          LaTeX Font Info:    Try loading font information for T5+cmr on input line 100.     (/path/to/texlive/texmf-dist/tex/latex/vntex/t5cmr.fd     File: t5cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions     ))     ....     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 14.     LaTeX Font Info:    ... okay on input line 14.     LaTeX Font Info:    Checking defaults for T5/cmr/m/n on input line 14.     LaTeX Font Info:    ... okay on input line 14.     ! Corrupted NFSS tables.     wrong@fontshape ...message {Corrupted NFSS tables}                                                       error@fontshape else let f...     l.14 \begin{document}          ?          LaTeX Font Warning: Font shape `T5/aer/m/n' undefined     (Font)              using `OT1/cmr/m/n' instead on input line 14.     ...     LaTeX Font Info:    Try loading font information for T5+ccr on input line 28.          (/path/to/texlive/texmf-dist/tex/latex/vntex/t5ccr.fd     File: t5ccr.fd 2006/08/02 Fontinst v1.927 font definitions for T5/ccr.     ) [1          {/path/to/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}          ] (./fonttest.aux)          LaTeX Font Warning: Some font shapes were not available, defaults substituted.     ....      Note that the same behavour (Corrupted NFSS tables with `sig-alternate`) happens if I use the old (?) font selection style, too - but _only if_ the line "`\usepackage[T5]{fontenc}`" is used! If this line is commented, then `pdflatex` reports no warnings, and evince renders the PDF fine. Now, if I'm reading the .log correctly, " _Font shape 'T5/aer/m/n' undefined_ " basically means something requested the `aer` font in T5 encoding; but I don't understand what?! The `sig-alternate` class indeed uses this `aer` font:               $ grep -n --context=1 aer sig-alternate.cls     1458-\ProcessOptions     1459:\fontfamily{aer}     1460-\RequirePackage[T1]{fontenc}     --     1466-    \renewcommand{\sfdefault}{aess}     1467:    \renewcommand{\rmdefault}{aer}     1468-    \renewcommand{\ttdefault}{aett}      ... but the way I see it - shouldn't all this (related to `aer` font) have been set up when the "`\documentclass{...}`" command executes; and then when the .tex file comes to the "`\fontencoding{T5}`" part, shouldn't it refer only to the "`\fontfamily{ccr}`" font ?! That is what I'd like to understand better - because in my original problem (where I use the old style font selection) `pdflatex` seemingly looks for the small caps font in T1 encoding ( _and looks for the wrong font,`lmr`, at that_), which I cannot reproduce in the minimal example above; I could maybe try to include a "`\usepackage[T5]{fontenc}`" to deal with that - but the minimal example tells me trouble awaits there? So how would I proceed with debugging that? Thanks in advance for any comments,   Cheers!


title: How do I prevent LaTeX from showing a whitespace following a quote when in an lstlistings environment?

text: When I am inside the `lstlistings` environment, it seems that using a quote such as (`'`) or (`"`) will toggle on the showing of whitespace indicators (small little half rectangles). Am I doing something wrong? Here is my listing definition:               \lstdefinestyle{verbo}{         basicstyle=\scriptsize\ttfamily,         breaklines=true,         breakatwhitespace=true,         tabsize=1,         resetmargins=true,         xleftmargin=0pt,         frame=none,     }       And here is the text that uses it:               \begin{lstlisting}[style=verbo]     - foo      - bar' hello world     \end{lstlisting}      After the `bar'`, all the spaces will printout with an ugly whitespace separator, e.g. between "`hello`" and "`world`". Is there a simple switch to disable this? I searched the `listings` documentation and could not find a way to do it. Edit: Here a complete Example:               \documentclass[a4paper]{article}     \usepackage{color}     \usepackage[ngerman]{babel}          \usepackage{listings}     \lstset{       language={XML},       basicstyle=\ttfamily,       showspaces=false     }          \begin{document}     \begin{lstlisting}[language=XML]     <test attr="Here should not be any whitespace-sign."/>     \end{lstlisting}     \end{document}      In the string these whitespace-signs occure, but they should not.


title: How to make figure captions working inside a macro?

text: I am writing a report often having the need to insert two figures next to each other with separate figure numbers (not subfigures a,b). To speed up the process I wrote a macro but somehow the captions do not display properly:               \begin{figure}[h!]       \centering       \captionsetup{width=0.45\textwidth}       \begin{minipage}{0.49\textwidth}         \centering         \includegraphics[width=0.95\textwidth]{%<figure1%>}         \caption{%<captionfig1%>}\label{fig:%<labelfig1%>}       \end{minipage}       \begin{minipage}{0.49\textwidth}         \centering         \includegraphics[width=0.95\textwidth]{%<figure2%>}         \caption{%<captionfig2%>}\label{fig:%<labelfig2%>}       \end{minipage}     \end{figure}      When I remove the captions the thing does compile.


title: Referencing a figure in the text before the figure

text: I'm wanting to reference a figure, but I know that the usual way of doing it:               \begin{document}     \begin{figure}[h!]      \centering     \includegraphics{image.png}\\     \label{fig:fig1}}     \end{figure}     \end{document}      then using `\ref{fig:fig1}` in the text only allows you to reference a figure when the reference in the text comes after the figure placement. Is there a way of doing it so that I can reference a figure earlier in the text?


title: Center sideways text in table

text: I'm trying to make a two-column table environment. The left column is supposed to center the sideways text "Tips" vertically and the right column should be a normal paragraph column. Here's what I have so far:               \documentclass[12pt]{book}     \usepackage{rotating} % for sideways     \usepackage{array}    % for the m centering          \newenvironment{tips}     {         \begin{tabular}{m{5mm}|p{0.9\textwidth}}         \begin{sideways} \textbf{Tips} \end{sideways} &     }     {\end{tabular}}      I have tried both m and c, but the left column text is still at the top. ![enter image description here](http://i.stack.imgur.com/5LKcS.png) This also gives me the problem that for longer texts in the left column, the vertical space before the table becomes larger. Any help? Also, a quick second question: Is there a unit which makes the second column "fill out" the remainder of the page horizontally? I'm missing out a couple of millimeters using 0.9*\textwidth.


title: BibTeX alpha long keys cause indentation of entry

text: I'm using BibTeX with the alpha style to keep track of my references. Whenever there is an entry with 4 or more authors, the entry id composed of their names and publication years causes the first line of the entry to be indented, thereby messing up the alignment of the whole entry. What's the best way to fix this?


title: What package \isp macro from?

text: What package macro `\isp` comes from? As I understood, there is not way not get such infomation quick, reliable way. I hope I am wrong. EDIT: My problem is that I have legacy code, that used a very ancient versions of everything. Now I have a take to build it on moder LaTeX environment. It looks like inverted by vertical `\Phi`.


title: Linking quotation environment with citation styles

text: I was just wondering if it is possible to combine citation commands (preferably of `biblatex`) with quotation environments. The reason is this: In German language papers you often have two choices (besides some formal ones).   1. You either use a paraphrase/summary and add the source with the abbreviation " _Vgl._ " (engl. compare).    2. Or you use a direct quotation with quotation marks and a source without " _Vgl._ ".  Linking them together would save the author some work because it would avoid the need for manual adjustments. Two examples: > This is a summary. (Vgl. Bauer 2009) > > "This is a quotation" (Bauer 2009) My question is:   Is it possible to define the `\cite` command in a quotation sensitive way that   1. automatically generates a _Vgl._ -less output (for example "`(Bauer 2009)`") when used in a quotation environment? And that   2. generates a _Vgl._ output (for example "`(Vgl. Bauer 2009)`") when used without quotation mark?


title: FlowChart with TikZ

text: I'm trying to build a flowchart using the tikz environment but I'm having some trouble connecting the "No" line from _decision_ to _int_ (and from _update_ to _int_ ). How can i draw a line avoiding overlapping?               % Define block styles     \tikzstyle{decision} = [diamond, draw, fill=blue!20,          text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]     \tikzstyle{block} = [rectangle, draw, fill=blue!20,          text width=5em, text centered, rounded corners, minimum height=4em]     \tikzstyle{line} = [draw, -latex']     \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,         minimum height=2em]          \begin{tikzpicture}[node distance = 4cm, auto]         % Place nodes         \node [block] (init) {Generazione scariche ($2^H$)};              \node [block, left of=init] (W_legali) {$\mu_W$ \break $\rho_b^{-1}=\frac{P}{n_b+1}$};         \node [block, right of=init] (W_nlegali) {$\mu_W$ \break $\rho_b^{-1}=\frac{P}{n_b}$};               \node [block, below of=W_legali] (fo_legale) {$min$ $f.o_{W \ge W_L}$};          \node [block, below of=W_nlegali] (fo_nlegale) {$min$ $f.o_{W < W_L}$};              \node [decision, below of=init, node distance=6cm] (decide) {$min$ $f.o_{W \ge W_L}$ < $min$ $f.o_{W < W_L}$};         \node [block, right of=fo_nlegale, node distance=3cm] (update) {Aggiorno $n_b$};              % Draw edges         \path [line] (init) -- node {$W_i \ge W_L$}(W_legali);         \path [line] (init) -- node {$W_i < W_L$}(W_nlegali);         \path [line] (W_legali) -- (fo_legale);         \path [line] (W_nlegali) -- (fo_nlegale);              \path [line] (fo_legale) -- (decide);         \path [line] (fo_nlegale) -- (decide);              \path [line] (decide) -| node [near start] {si} (update);         \path [line] (decide) |- node {no} (init);          \end{tikzpicture}      I strive for something like this (forget about line thickness): ![enter image description here](http://i.stack.imgur.com/dDFLI.png)


title: Problem with the font Traditional Arabic for aligning parenthesis ()

text: I'm using Polyglossia to write a book of probability in arabic, and I've recently changed of machine, then I've some problems (great) of typesetting my old files, which are compiling usually in my old machine. One problem is that, with the font "traditional arabic", the compilation gives parenthesis behind the words... i.e are not on the some line with the characters...even if all the characters are latin.. see the following example, in referred equation and in it's reference. What happens and how can I solve this problem ? I give an example file, and I hope that it's not a problem for the font... We can see that there is no problem in compilation for the font "Simplified Arabic", for example ...               \documentclass[14pt,a4paper]{extbook}          \usepackage{amsmath,amssymb}     \usepackage{polyglossia}     \setmainlanguage[numerals=maghrib]{arabic}     \setotherlanguage{english}     \newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}     \setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}          \begin{document}     \LR{     Let  $E_{1}, E_{2},\ldots, E_{n}$, some disjoint events (of null intersection), then     \begin{equation} %eqn3.1     \label{eqn3.1}     P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})     \end{equation}     The equation       \eqref{eqn3.1} generalizes to...     }     \end{document}      ![enter image description here](http://i.stack.imgur.com/QLDVS.png) Hello I just saw your answer but the main font of the book must be the font "Traditional Arabic". I put the example of the other font to watch the difference... By the way I've just installed windows 8.1 and the result is better but is still not very good... not like your font which is exactly centered around the number 1... That's what I want for my font ! ![enter image description here](http://i.stack.imgur.com/qDuHR.gif)               You can find an example with arbic text here, after updating to windows 8.1          The TEX File     \documentclass[14pt,a4paper]{extbook}          \usepackage{amsmath,amssymb}     \usepackage{polyglossia}     \setmainlanguage[numerals=maghrib]{arabic}     \setotherlanguage{english}     \newfontfamily\arabicfont[Script=Arabic,Scale=1.2,AutoFakeSlant=-0.02]{Traditional Arabic}     \setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}          \begin{document}     \LR{     Let  $E_{1}, E_{2},\ldots, E_{n}$, some disjoint events (of null intersection), then     \begin{equation} %eqn3.1     \label{eqn3.1}     P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})     \end{equation}     The equation       \eqref{eqn3.1} generalizes to...     }     \\     لاحظ أنه يتبع أن، لكل مجموعة منتهية للحوادث المتنافية         $E_{1}, E_{2},\ldots, E_{n}$,     \begin{equation} %eqn3.1     \label{eqn3.2}     P \left(\bigcup_{1}^{n} E_{i}\right) = \sum_{i = 1}^{n} P (E_{i})     \end{equation}     تبع المعادلة من المسلّمة 3 عبر تعريف![3]         $E_{i}$  كالمجموعة الخالية، لكل               $i$  أكبر من            $n$.    المسلّمة  3 متكافئة مع المعادلة             \eqref{eqn3.2}  لما فراغ العينة محدود            (لماذا؟)         لكن، العمومية المضافة للمسلّمة $3$ ضرورية لما      فراغ العينة غير محدود.           \end{document}      ![enter image description here](http://i.stack.imgur.com/QslGy.gif)


title: Biblatex - capital names in references, regular in cites

text: I am trying to achieve a biblatex style that would do the following: in the case of `\parencite{}` I would get `...like that (Smith 2010). ` in the case of `\textcite{}` I would get `Smith (2010) says that...` but in References I would get `SMITH, J. Bookname.` How can I achieve this? I use `\usepackage[style=authoryear, firstinits=true]{biblatex}` I tried `\renewcommand*{\mkbibnamelast}[1]{\MakeUppercase{#1}}` but that makes the name uppercase even in the text, which is undesirable especially with `\textcite{}`


title: LaTeX beamer: How to use "squeeze" option only for part of a slide?

text: I'm using the `beamer` package for a presentation. On some slide, I have two lists, one long list on the left with many short items, one short list on the right with some explanations. The list on the left only fits onto the slide when using the `squeeze` option. The right list, however, then looks too compressed. Is there a way to make the `squeeze` option only apply to the left list? * * * Minimal example:               \documentclass[9pt]{beamer}     \usetheme{Madrid}     \begin{document}          \begin{frame}[squeeze] % <- squeeze option       \frametitle{Title}       % two-column layout       \begin{columns}         \begin{column}[T]{4cm}           \centering           % left: long list with short items           \begin{block}{}             \begin{itemize}               \item $e$               \item $\mu$               \item $\mu \lor e$               \item $\mu \land e$               \item $\mu\mu$               \item $ee$               \item $ee \lor \mu$               \item $ee \lor e$               \item $\mu\mu \lor e$               \item $\mu\mu \lor \mu$               \item $\mu\mu \lor ee$               \item $(e \land \mu) \lor \mu\mu$               \item $(e \land \mu) \lor ee$               \item $(e \land \mu) \lor ee \lor e$               \item $(e \land \mu) \lor ee \lor \mu$               \item $(e \land \mu) \lor \mu\mu \lor \mu$             \end{itemize}           \end{block}         \end{column}         \hfill         \begin{column}[T]{6cm}           \centering           % right: shorter list with explanations / remarks  <- this would be nicer if not squeezed           \begin{block}{}             \begin{itemize}               \item Many combinations               \item Single and di-object trigger               \item Also works for jet triggers               \item Primary goal lepton triggers \\                 (plateau efficiency below $1$)             \end{itemize}           \end{block}         \end{column}       \end{columns}            % another box at the bottom       \begin{block}{}         \begin{itemize}           \item $\lor$: logical OR, $\land$: logical AND           \item $ee$: di-electron trigger etc.         \end{itemize}       \end{block}     \end{frame}          \end{document}


title: Text wrap with shapepar (insert image between text)

text: How do insert image between text and text wrap with shapepar or other package? ![enter image description here](http://i.stack.imgur.com/LcnBA.png)


title: How to wrap one column text around a centered figure?

text: Can I wrap one column text around a figure at the center of a page? The `wrapfig` package does not have a `c` option, and only refers to two columns text. Also on this site I see many questions about wrapping inside two columns and none about one column. Is there some technical reason why this isn't implemented?


title: IEEE affiliation blocks

text: I'm using the IEEE format to write a paper. I have 4 authors from two institutions so I need blocks of affiliations. This is how I want it to look like:               Author 1*, Author 2#, Author 3#, Author 4*     Affiliation 1, {1,4}@abc.com     Affiliation 2, {2,3}@def.com      Note that the 1st and the 4th are from one institution, and the 2nd and the 3rd from another one. Everything is centered, of course. How to do this?


title: Memoir class conflict with datetime

text: Hi I'm running into a warning when trying to call the `datetime` package within a document using the `memoir` class. MWE is:               \documentclass{memoir}     \usepackage{datetime}     \begin{document}     Hello World     \end{document}      This results in:               Package fmtcount Warning: \ordinal already defined use \FCordinal instead. on input line 450.      The conflict between `fmtcount` and `memoir` is well documented and the solution is, as suggested, to use `\FCordinal` in place of `\ordinal`. The problem I have is I am not calling `\ordinal`. It must be occurring within the `datetime` file (or similar). Can anyone advise how to address this.


title: Sectioning paragraphs, such as for different cases inside a proof

text: I'd like to have offset paragraphs inside a proof, say to delineate one case from another. I've been using                   \newtheoremstyle{component}{}{}{}{}{\itshape}{.}{.5em}{\thmnote{#3}#1}         \theoremstyle{component}         \newtheorem*{component}{}      and implementing it as                   \begin{component}[Case 1]         ...         \end{component}      which works nicely, and has the look I want. Unfortunately, if this happens to fall towards the end of a proof, I need to manually add a \qedhere at the end, as otherwise the tombstone appears one line below. Is there some simpler way to implement something similar, that would also solve the tombstone problem? I know I could just go with                   \medskip         \noindent \emph{Case 1.}         ...              \medskip      but that's even more tedious, and is the whole reason I used the component theoremstyle in the first. Thanks for any suggestions you may have.


title: Using Excel2LaTeX in Excel 2010

text: I just installed Excel2LaTeX in Excel 2010. I do see it in add-ins. However, I cannot find a way to operate it. That is, there is no change in the ribbon area after the package was installed. How does one use the package?


title: lstinline error "ended by EOL" in dtsyntax

text: I'm using the package `dtsyntax` to highlight code text based on listings. For in-line annotation they make a new command `\modelica{ }` based on lstinline as follows :               \newcommand{\modelica}[1]{\lstinline[basicstyle=\ttfamily,language=modelica]|#1|}      But when i use this as follows               this is a test concerning highlighting \modelica{"modelica"} in LaTeX ...      I get the following error which i can not trace back :               Package Listings Error: lstinline ended by EOL.      can anyone help me with this ?


title: theoremprework Error with ntheorem

text: I have defined               \theoremheaderfont{\normalfont\bfseries}     \theoremprework{\bigskip\hrule}     \theorempostwork{\hrule\bigskip}     \theorembodyfont{\slshape}     \newtheorem{definition}[satz]{Definition}      and now i am able to write something like               \begin{definition}fooBar\end{definition}      but i am getting a weird behavior with the prework of the theorem! LaTeX sets the top `\hrule` on one page and the rest of the definition on another page! See here what i mean. Althoug it is german you can see that the top hrule of definition 1.2.7 is on page 6 while the rest can be found on top of page 7 (pages have a header line in my layout!). Any idea how to move this hrule to the same page as the definition **without** using `\newpage` to have still a dynamic document?


title: Generate large document by pdfTeX, then break result into many PDF files while preserving links

text: This is the PDF file of a book I wrote: http://www.abstractmath.org/Handbook/handbook.pdf It takes a long time to download because it is a big file. I generated it using pdfLaTeX. Is there a way to generate it as many different PDF files while automatically preserving the links between pieces? (It makes quite heavy use of internal links.)


title: Change editor font size in kile

text: I am using Kile 2.1.3 on Ubuntu 13.10. How can I change the editor font size? I went to "Configure Kile" > "Fonts & Colors" > "Font" > "Size" and changed it to 12. But that did not have any effect. What am I doing wrong? NB: This question is not about font sizes in the LaTeX output. It's just about the font size displayed in the editor.


title: Margin on a4 paper is too big

text: I'm currently writing on a document for school. We have to use these margins:   * left: 3cm   * bottom and top: 2.5cm   * right: 2cm But when I'm using the `geometry` package the margins are way too big which means that when it's printed all the margins are about 1 or 1.5 cm too big. This is my whole preamble:               \documentclass[12pt,a4paper,oneside]{article}     \usepackage{setspace}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage{fancyhdr}     \usepackage{tabularx}     \renewcommand{\rmdefault}{phv}     \renewcommand{\sfdefault}{phv}     \usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}     \onehalfspacing      Could you please suggest a solution?


title: How to place todonotes in left and right margin?

text: I want to place todonotes not only on the left _or_ the right margin. I want to use both at the same time, and that the notes should decide by themself where to place. E.g. when the note points to a place near the left margin it should go to the left margin. Or when the left margin is full, it should use right margin then. There are already similar questions, but I couldn't find some focusing also on the todonotes package.


title: Problem of duplicate identifier when using bibentry and hyperref

text: I want to used `\bibentry`and `hyperref` in my document. However when I use it as in the sample below I get the error > destination with the same identifier > (name{cite.Duhm_AppliedPhysicsLetters_2009}) has been already used, > dublicate ignored I found this work around which works well (commented version in the sample below). However, the bibliography style statto, hyperlinks the title to the respective url, which I would like to keep also in the `bibentry` (I don't care if there is a hyperlink to the item in the bibliography itself). Is there a solution for this problem, which is not a simple work around which completely ignores the hyperlink?               \begin{filecontents}{mytestbib.bib}          @ARTICLE{Duhm_AppliedPhysicsLetters_2009,       author = {Duhm, Steffen and Salzmann, Ingo and BroÌˆker, Benjamin and Glowatzki,         Hendrik and Johnson, Robert L. and Koch, Norbert},       title = {Interdiffusion of molecular acceptors through organic layers to metal         substrates mimics doping-related energy level shifts},       journal = {Applied Physics Letters},       year = {2009},       volume = {95},       pages = {093305},       doi = {10.1063/1.3213547},       issn = {00036951},       url = {http://link.aip.org/link/APPLAB/v95/i9/p093305/s1&Agg=doi},       urldate = {2011-11-05}     }               \end{filecontents}     \documentclass{article}     \usepackage{filecontents}     \usepackage{natbib}     \usepackage[pdftex]{hyperref}     \usepackage{fancyhdr}     \usepackage{bibentry}     \makeatother \nobibliography*               \begin{document}          A full in-text cite of     %\begin{NoHyper}\bibentry{Duhm_AppliedPhysicsLetters_2009}\end{NoHyper}.     \bibentry{Duhm_AppliedPhysicsLetters_2009}.          A regular citation  \cite{Duhm_AppliedPhysicsLetters_2009}.               \bibliographystyle{statto}     \bibliography{mytestbib}          \end{document}


title: Unicode-math in combination with \begin{proof} \end{proof}

text: If I use unicode-math in combination with \begin{proof} \end{proof} the black square at the end of the proof, misses the top part. If I don't use unicode-math, the symbol looks normal again. If you have sharelatex, you could look at this: https://www.sharelatex.com/project/527107e156f405b1710029c7 Or otherwise, this is my xelatex file:               \documentclass[12pt,a4paper]{article}     \usepackage{amsmath, amssymb, amsthm}     \usepackage{fontspec}     \usepackage{unicode-math}     \begin{document}     \begin{proof}     \end{proof}          \end{document}      The result is: ![enter image description here](http://i.stack.imgur.com/vahfi.png)


title: Why do some biblatex options need to be set in the preamble and cannot be called from a style file using \ExecuteBibliographyOptions?

text: I personally prefer to set biblatex's package options in a `.bbx` file using `\ExecuteBibliographyOptions` so that I can just call biblatex minimally in my preamble (preferably using only `\usepackage[style=myStyle, natbib=true,backend=biber]{biblatex}`). I noticed however that some options do not work when parsed from the .bbx file using `\ExecuteBibliographyOptions` but **must** be supplied in the _preamble_ using either `\usepackage` options or `\ExecuteBibliographyOptions`. In my case I found the following options to cause the problem while others worked fine:   1. labelyear   2. uniquename   3. uniquelist Of course, I only use a small set of all the possible options so there very well be more options with the same problem. * * * **EDIT - added minimal example** * * * Calling for options from an external `.bbx` file               \documentclass{article}          \usepackage{filecontents}          \begin{filecontents}{mystyle.bbx}     % Build on the original author-year comp     \RequireBibliographyStyle{authoryear-comp}          \ExecuteBibliographyOptions{         maxcitenames = 2,          mincitenames = 1,          firstinits = true,         terseinits = false,         labelyear=true,           uniquename=false,          uniquelist=false,     }     \end{filecontents}          \begin{filecontents}{mystyle.cbx}     \ProvidesFile{emi.cbx}[biblatex style for Environmental Microbiology]          \RequireCitationStyle{authoryear-comp}          \endinput     \end{filecontents}          \begin{filecontents}{\jobname.bib}     @article{ref1,       author = {Doe, J. and Dane, D., and Dewy, R.},       year = {2000},       title = {This and that},       journal = {Journal of deep understanding of things},     }          @article{ref2,       author = {Doe, J. and Dewy, D., and Dane, R.},       year = {2000},       title = {The other},       journal = {Journal of deep understanding of things},     }     \end{filecontents}          \usepackage[style=mystyle,natbib=true,backend=biber]{biblatex}          \addbibresource{\jobname.bib}          \begin{document}          Some text and a ref \citep{ref1}.     Then another ref with same first author and year \citep{ref2}          \printbibliography          \end{document}      Produces an undesired output: ![enter image description here](http://i.stack.imgur.com/cW9Sh.png) But calling for the same options with `\usepackage` produces the desired output               \documentclass{article}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @article{ref1,       author = {Doe, J. and Dane, D., and Dewy, R.},       year = {2000},       title = {This and that},       journal = {Journal of deep understanding of things},     }          @article{ref2,       author = {Doe, J. and Dewy, D., and Dane, R.},       year = {2000},       title = {The other},       journal = {Journal of deep understanding of things},     }     \end{filecontents}          \usepackage[style=authoryear-comp,natbib=true,          maxcitenames = 2,          mincitenames = 1,          firstinits = true,         labelyear=true,           uniquename=false,          uniquelist=false,         terseinits = false,         backend=biber]{biblatex}          \addbibresource{\jobname.bib}          \begin{document}          Some text and a ref \citep{ref1}.     Then another ref with same first author and year \citep{ref2}          \printbibliography          \end{document}      ![enter image description here](http://i.stack.imgur.com/uqh8j.png)


title: Unicode and listings - still no luck

text: Although there are already some discussions on this issue, I can't get any of the proposed solutions to work for me. Take this document and compile it with xelatex:               \documentclass[12pt,a4paper,parskip=half+,ngerman]{scrartcl}     \usepackage{fontspec}     \usepackage{polyglossia}     \setmainlanguage{german}     \usepackage[babel,german=quotes]{csquotes}          \usepackage{listings}     \setmonofont{Consolas}     \lstset{       breaklines=true,       extendedchars=true,       frame=single,       keepspaces=true,       showspaces=false,       showstringspaces=false,     }          \begin{document}     Test     \lstinputlisting[language=SQL,numbers=none,firstline=1,lastline=1]{code.sql}     Test     \lstinputlisting[language=SQL,numbers=none,firstline=2,lastline=2]{code.sql}     Test     \lstinputlisting[language=SQL,numbers=none,firstline=3,lastline=3]{code.sql}     Test     \lstinputlisting[language=SQL,numbers=none,firstline=4,lastline=4]{code.sql}          \end{document}      Code.sql:               Adélaïde de Maiziére     Mikuláš Frashëri     Petrė Meier     Şimşek Đurić      The result looks like this:   ![enter image description here](http://i.stack.imgur.com/tqtrR.png) I tried the suggestion from The 'listings' package and UTF-8 and copied the given code into my document (do I maybe need to customize the hex-codes? What do they mean?). The result stays exactly the same. Then, I tried the solution using literate from Having problems with listings and UTF-8. Can it be fixed? by adding the following line:               literate={á}{{\'a}}1 {é}{{\'e}}1 {Ş}{{\c S}}1 {ş}{{\c s}}1 {ć}{{\'c}}1 {ï}{{\"i}}1 {Đ}{{D}}1 {š}{{s}}1,      The result (note the additional spacing in the first line and the incorrect handling of the other characters).   ![enter image description here](http://i.stack.imgur.com/slAA7.png) What can I do?


title: Expanding line height when equations have displaystyle fractions

text: In my document, I have got a lot of equations in inline mode, like:               \documentclass{article}     \begin{document}     Eu sit tincidunt incorrupte definitionem, vis mutat affert percipit cu, eirmod     consectetuer signiferumque eu per. In usu latine equide\textbf{j} dolores. Quo no falli      viris intellegam, ut fugit veritus placerat per. Ius $\displaystyle\frac{2}{3}$ id vidit     volumus mandamus, vide veritus democritum te nec, ei eos \textbf{tttttttt} conqueste      consulatu. No mei ferri graeco dicunt, ad cum veri accommodare. Sed at malis omnesque      delicata, usu et iusto zzril meliore.     \end{document}      That renders as expected: ![Normal text](http://i.stack.imgur.com/gfaUN.png) The problem is that, as lots of books do, I want to force lines with that kind of equations (they can have more things than just `\dfrac{...}{...}` or `\displaystyle ... \frac{...}{...}`) to have more line height, so the line height is equal to the other lines, and not forced like in the following image: ![Fraction problem](http://i.stack.imgur.com/z7Cn9.png) Then, I want this result, where the "j" and the "t"s they don't "compress" the line height. ![What I want](http://i.stack.imgur.com/zTlI2.png) PS: when I'm saying "so the line height is equal to the other lines" I refer to that: ![Same line spacing](http://i.stack.imgur.com/QWMuY.png)


title: LyX AMS align environment justification/ horizontal alignment

text: I'd like to know how to justify individual columns in the AMS align environment. In the matrix environment, the Table toolbar buttons are active, but not inside the AMS align environment.


title: Lyx: How to add option to package automatically load

text: I got the problem, that links in `\url` only break in LyX when there is a `\` character in it. I found the solution to add `\usepackage[hyphens]{url}` to my preamble. But the problem is, LyX loads the package `url` with no options, and I get an error. How can I solve this?


title: Smileys in LaTeX

text: I would like to include smileys in my LaTeX document. Is there any package with lots of different smileys? In `mnsymbol` and `wasysym`, I found some general symbols:               \documentclass{article}     \usepackage{MnSymbol,wasysym}     \begin{document}     wasysym: \smiley{} \frownie{} \blacksmiley{}          MnSymbol: \(\smile{} \frown{}\)     \end{document}      ![output](http://i.stack.imgur.com/DZmFe.png) But I do not like the output. Actually, I am looking for smileys which look like "default smiles" in Google Talk, MSN, ... ;) <\- this one is my favourite. ;)


title: Is it possible to connect a database to LaTeX to produce data-driven documents?

text: I'm starting to write a LaTeX-based reference manual, and have realised that a lot of my needs could be solved by writing a database and then producing the reference manual from that. Lots of my pages will be exactly the same, with slightly different information in them. Is there a way to link LaTeX to a database, in a similar way to Database Report engines do - so that I can, for example, create a page per record in the database, including each field in different locations on the page?


title: how do I change the following macro to let me add labels or to enumerate using numbers?

text: I have the following macro that I found:               \newenvironment{itemizetight}[2]       {\begin{list}{\labelitemi}{%          \setlength{\itemsep}{#1}%          \setlength{\labelwidth}{#2}%          \setlength{\leftmargin}{\labelwidth}%          \addtolength{\leftmargin}{\labelsep}%        }%       }       {\end{list}}      However, it does not let me use `\item[1.]`. How can I change it so that I can use labels like in a typical itemize environment? Or alternatively, what would be the parallel for an enumerate environment? The way to use it, for example is:               \begin{itemizetight}{-0.2em}{0.5em}     \item item 1     \item item 2     \end{itemizetight}


title: How to preserve tabs and whitespaces in \parbox in latex

text: I am currently trying to insert a batch file programming code in my report. I am using the code listing. I am not able to preserve white spaces and tabs to format my code! I tried using \hspace but it didn't worked. I have following code example yet:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{xcolor}     \usepackage{listings}              \begin{document}              \begin{lstlisting}[escapechar=ä]          ä\colorbox{white}{%           \parbox{3.9in}{\color{black}\texttt{Microsoft Windows [Version 6.2.9200]\\\\            (c) 2012 Microsoft Corporation. All rights reserved.}}}ä         \end{lstlisting}              \end{document}       The output is like this which I don't prefer:               Microsoft Windows [Version 6.2.9200]          (c) 2012 Microsoft Corporation. All rights reserved.      I prefer a tab or white space before the second line starts. The output I prefer is as below:               Microsoft Windows [Version 6.2.9200]                (c) 2012 Microsoft Corporation. All rights reserved.      Thanks.


title: Understanding the arguments in newtheorem e.g. \newtheorem{theorem}{Theorem}[section]

text: I would like to understand what the arguments following `\newtheorem` are e.g.:               \newtheorem{theorem}{Theorem}[section]           \newtheorem{lemma}[theorem]{Lemma}          \newtheorem{proposition}[theorem]{Proposition}          \newtheorem{corollary}[theorem]{Corollary}      I even see some of the arguments switched up in various places. Why is it that in the `\newtheorem{theorem}` we have the squarebrackets `[]` being in the 3rd argument instead of the second? Or for example why is there both a `{corollary}` and `{Corollary}` as well as a `[theorem]` tag sandwiched between the two? The same happens with the lemma and proposition new theorems, these however also have the square bracketed argument in the middle. Why is all of this? Thanks, Brian


title: Problem with XeTeX input and output encoding

text: As we all known, the TeX engine `XeTeX` takes UTF-8 as its default input and output encoding format. However, it provides two new primitive control sequences that could define input encoding:   * `\XeTeXinputencoding` defines the input encoding of the following text.   * `\XeTeXdefaultencoding` defines the input encoding of subsequent files to be read. Thus, one could put one of these two commands to specify the encoding that will be read by XeTeX, which makes XeTeX can handle files that are encoded by other formats. But unfortunately, XeTeX provides no interface to specify the output encoding format, so that it would write files with UTF-8 in every situation, even if we put `\XeTeXinputencoding` or `\XeTeXdefaultencoding` at the beginning of the master `.tex` file. A MWE that shows this problem:               \XeTeXdefaultencoding "GBK"     \documentclass{article}     \begin{document}     \tableofcontents     \section{测试一}     这里是中文测试。     \clearpage     \section{测试二}     这里是中文测试。     \clearpage     \section{测试三}     这里是中文测试。     \clearpage     \section{测试四}     这里是中文测试。     \clearpage     \end{document}      (Note that there is no selection of CJK fonts here.) If you save this piece of code as `GBK` (M$ calls it `cp936`), and compile it by `XeLaTeX`, no error will be reported. However, you would not be surprised that the `.toc` and `.aux` files are written as `UTF-8`. The fact interpreted above will lead to another embarrassing tangible. These temp files were written by `UTF-8`, whereas the master file was saved as `GBK`. Hence, if we put `\XeTeXinputencoding "GBK"` at the begining of the master file, temp files will be read as `UTF-8`; if we use `\XeTeXdefaultencoding "GBK"`, then temp fils will be read as `GBK` (but they themselves are `UTF-8`). ERROR occurred so quietly but sadly. Is there any clues or hints?


title: Pgfplots: Linewidth when using \ref in custom legend

text: I'm creating a custom legend for some `pgfplots` graph by drawing a node containing a shortstack. Inside the node I'm using `\ref{}` to insert correct line-styles in front of my text labels. The problem is that while the lines in the graph are printed with `line width=1pt`, the lines from `\ref` are the standard thin size of pgfplots. This does not happen when using the normal pgfplots legend setup (`\addlegendentry`), but this is not possible in this graph since the legend either needs to contain extra information or is a common legend for 2 different axis. So how can I control the line width when using `\ref`?


title: How can I get the subcaption to be aligned left of the subfigure?

text: The picture says it all. I would like the subcaption to be on the left of the subfigure, _below the top of the subfigure_. Ideally, a solution with the subcaption package would be good (if there is one) as I am already using it. MWE and what I have so far:                   \documentclass[12pt, a4paper]{report}     %---------------packages for figures and captions-----     \usepackage{graphicx}      \usepackage[bf]{caption}     \usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption} %subcaption package is used to typeset subfigures. singlelinecheck=false sets the subcaptions to flush left; aboveskip sets the space between subcaption and subfigure.     %---------------packages for subfigures-------------     \renewcommand\thesubfigure{\Alph{subfigure}} %subcaption labels are A, B, C etc instead of (a), (b), (c)     %---------------------------------------------------------     \begin{document}     \begin{figure}             \captionsetup[subfigure]{labelformat=simple}             %\captionsetup{font={onehalfspacing},skip=-10pt}             \begin{subfigure}[t]{0.3\textwidth}                     \caption{}                                    \includegraphics[width=\textwidth]{example.pdf}                     \label{fig2a}             \end{subfigure}             \caption{figure legend}\label{fig2}     \end{figure}               \end{document}      ![fig](http://i.stack.imgur.com/1LFJZ.png) Alternatively, I could bring the subcaption lower with `\vspace{-10pt)` but this makes the subcaption disappear behind the subfigure (which has a white background). Is there a way to bring the subcaption to the foreground or send the subfigure to the background?


title: I want to force a justification to both sides after using \newline

text: \documentclass[11pt,a4paper]{article}     \usepackage[cp1250]{inputenc}     \begin{document}     \noindent In year 1000 somebody wrote something\footnote{\emph{something}} because he     wanted to. Some thought he is clever, but some said no. Yet 100 years later     somebody\footnote{\emph{something}}\footnote{\emph{something}}\newline and somebody     else\footnote{\emph{something}} did something. It means that is something important.     \end{document}      That's example for that. I cannot have "and" at the end of the line, but after using `\newline` a former line looks ugly. Any solution? Note that I cannot delete the `\noindent`, because it's required.


title: Lemmas and sub sections

text: I want to write a `LaTeX` code to show,               Lemma 1 : x+y=z     Lemma 1.1:  z-r+t=3     Lemma 1.2:   q=r      How do I do that?


title: Skipping outline table of contents of some sections in beamer

text: I'm trying to make a table of contents for a beamer presentation, and I want to have the outline show up for every section except the first. Right now I'm using:               \AtBeginSection[] {       \begin{frame}[t]         \frametitle{Overview}           \tableofcontents[sectionstyle=show/shaded,hideothersubsections]       \end{frame}     }       Normally I can do this using `\section*`, but that makes it not show up in the table of contents at all. Is there a way to have it do the table of contents after every section, but skip the first one and still have the first section in the table of contents?


title: Base document page numbers with pdfpages

text: I'm writing a report, in LaTeX. And I need to include, as appendices, other latex documents I have written. I am currently doing this using `pdfpages` and it works. However, the inserted PDF has no page numbers and it overlays my base documents page numbering, resulting in no page numbers on the PDF pages. My questions:   1. How to solve the above problem.   2. Is there a better way to do this.


title: Move the position of figure subcaption of subfloat command

text: As the following code shows, it will label an 'a' and 'b' under each picture. How can I put the label at the left-top corner of each figure?               \documentclass{article}     \usepackage{graphicx}     \usepackage{subfig}     \usepackage{caption}          \begin{document}          \begin{figure}[!ht]       \captionsetup[subfigure]{labelformat=simple}       \centering       \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}\quad       \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}       \caption{Caption about here}       \label{fig:fig1}     \end{figure}          \end{document}      I have no right to upload pictures, so I did the following sketch map. I hope they can help to express what I mean. what I get:               ------------     -------------     -          -     -           -     -  fig1    -     -   fig2    -     -          -     -           -     ------------     -------------         a                 b      Figure 1: Caption about here      What I want:               A                B     ------------     -------------     -          -     -           -     -  fig1    -     -   fig2    -     -          -     -           -     ------------     -------------     Figure 1: Caption about here      How can I do this?


title: Adding to the appendix title

text: What I'm looking to get is the word "ANNEX" prefixing all of my Appendix names, both in the document chapters and in the TOC. Is there a method of adding "Annex" to the name of the appendix chapter so that it looks like: **ANNEX A Something** Rather than: **A Something** I'm using Memoir, and if I try to use the appendix class as such:               \usepackage[titletoc,page]{appendix}      I get an `option clash` for appendix. NB. There's a number of examples of people adding the word "Appendix" to the TOC (1, 2, 3, 4), and the answer may well be contained in these links but my latex-fu is still too underdeveloped to figure out the answer. I tried changing the appendix chapter name as per this, but this still doesn't insert the name into the chapter.


title: Spacing problem with \phantom in array

text: Using               $\begin{array}{ccc}     x & := & \phantom{ a + } b + c\\     y & := & a \phantom{ + b } + c\\     z & := & a + b \phantom{ + c }     \end{array}$      I get ![some not quite beautiful equation array](http://i.stack.imgur.com/QoUXn.png) which is not quite what I hoped for as my "phantoms" don't take as much space as expected.               How can I correct this?      Thanks!


title: Change background color in metapost

text: I have a metapost diagram using colour that when displayed in normal latex (with a white background) works well. Now, I want to add the same diagram to a presentation done in Beamer (Warsaw theme) which has a blue background. The diagram does not look good at all -- colour clash, too dark compared to the blue... I have done this:               background:=white;     unfill (0,0)--(20u,0)--(20u,10u)--(0,10u)--cycle;      Which has the effect of drawing a white rectangle that then contains the diagram but it feel like a dirty hack. How can I change the background of the diagram more elegantly?


title: Using two bibliographies with and without backref

text: For my thesis, I would like to generate a smaller bibliography in the beginning that includes only my previous work that was adapted in the thesis, in addition to a (normal) bibliography. Some entries might appear in both bibliographies. This works rather well when using biblatex:               \documentclass{report}     \usepackage[backref=true, backend=biber]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha Title},       keywords = {self}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \printbibliography[heading=bibintoc, keyword=self, title={Previously Published Work}]          \chapter{First}     Some text \cite{A01}.          \printbibliography[heading=bibintoc, title={References}]          \end{document}      However, I would like to get rid of the backrefs in the first listing and re- enabling them for the second. Is this possible with biblatex?


title: XeLaTeX and Biber/BibLaTeX: switching font for cyrillic references

text: My main font unfortunately does not have support for Cyrillic script. Mixing it with Linux Libertine (which does have the required glyphs) works fine in the main text where I can simply switch the language, especially that I am writing text in large blocks so the difference in font is not visible at all. However, what can I do with references that are written in Cyrillic? Putting font switching commands within the bibliography file doesn't work in case of author names but does look acceptably in case of titles and other elements. Is there a cleaner way (apart from switching fonts) or one that would work with author names? For reference, my main font is Palatino because it works wonderfully in ClassicThesis; however, if there is an alternative to Palatino that looks nicely, has ligatures and contains Cyrillic glyphs by all means please suggest it!


I am having a problem with my references, the error message is > Bibliography not compatible with author-year citations. I have stripped down all tex and references files however I still have the same problem. I have tried the following:   * Delete all the temp file. I am using WinEdt8    * I have year in my reference    * Using `\citet` instead of `\cite`   * Try `\usepackage[square,sort,comma,numbers]{natbib}` It will be much help you can help point out where did I went wrong :( Here are the content of the files `.tex` file:               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{babel}     \usepackage[authoryear]{natbib}     \begin{document}     Text here          \citet{Ioannou2001}          \bibliographystyle{IEEEtran}     \bibliography{reference}          \end{document}      `.bib` file (with only one record)                   @ARTICLE{Ioannou2001,           author = {Ioannou, G and Kritikos, M and Prastacos, G},           title = {A greedy look-ahead heuristic for the vehicle routing problem with       time windows},           journal = {J Oper Res Soc},           year = {2001},           volume = {52},           pages = {523--537},           number = {5},           month = apr,           __markedentry = {[duongh:6]},           issn = {0160-5682},           owner = {d},           publisher = {Palgrave Publishers Ltd},           timestamp = {2013.03.29},           url = {http://dx.doi.org/10.1057/palgrave.jors.2601113}         }


title: classicthesis part numerals TOC vs. in text

text: My question is similar to this one this one. I use classicthesis and have the problem that a) when I don't redefine `\thepart`, I get   * **lower case (instead of uppercase)** roman numerals in the TOC   * uppercase roman numeral in the text (on the "title page" of the part) b) when I use `\AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}` in the preamble, I get   * upper case roman numerals **in small caps (instead of spaced low small caps)** in the TOC   * uppercase roman numeral in the text c) when I use `\AtBeginDocument{\renewcommand{\thepart}{\spacedlowsmallcaps{\Roman{part}}}}`in the preamble, I get   * upper case roman numerals in the TOC   * uppercase roman numeral in **low small caps (instead of standard font/capitalization)** in the text What I want, is a combination of both:   * _upper case roman numerals in spaced low small caps_ in the TOC   * _uppercase roman numerals in standard font/capitalization_ in the text EDIT: sorry, here is a MWE               \documentclass[12pt,                    a4paper,                    footinclude=true,                    headinclude=true,                    titlepages                    %draft                    ]{scrbook}          \usepackage[linedheaders,                 eulermath,                 eulerchapternumbers,                 parts,                 floatperchapter]{classicthesis}           % a) without a redefinition of \thepart     % --          % b) redefinition with uppercase roman number     % \AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}          % c) redefinition with spaced low small caps     % \AtBeginDocument{\renewcommand{\thepart}{\spacedlowsmallcaps{\Roman{part}}}}          \begin{document}     % ******************************************************************************     \tableofcontents          \cleardoublepage\part{Introduction and Background}     \cleardoublepage\part{Empirical Studies}     \cleardoublepage\part{Conclusion}     \cleardoublepage\part{Appendix}     % ******************************************************************************     \end{document}