title: Label inside mdframed messes up spacing

text: I have a problem with `mdframed` in combination with `\parskip` and `\label`. Consider the following code, which is a MWE stripped down from a large document.               \documentclass{article}     \usepackage[framemethod=tikz]{mdframed}     \parskip=32pt          \begin{document}            \begin{mdframed}[suppressfirstparskip=false,frametitle={Theorem 1.}]       Text       \label{Yeah}       \end{mdframed}            \begin{mdframed}[suppressfirstparskip=false,frametitle={Theorem 2.}]       \label{Yeah}       Text       \end{mdframed}          \end{document}      (I am aware of the fact that the `\label` command does not make sense here; it does in my original document and I see the same behaviour in that document). This code is rendered as follows: ![enter image description here](http://i.stack.imgur.com/C0Xsc.png) Clearly, the second theorem has too much vertical space due to the `\label` command. Is there a way to fix this? **EDIT** : After @Gonzalo Medina's answer, I added `\leavevmode` to the environment that I am actually using. This almost gets me to where I want to be, except there is still an unexpected space showing up in my document. The MWE is:               \documentclass{article}     \usepackage[framemethod=tikz]{mdframed}     \parskip=32pt          \newenvironment{theorem}[1]%       {\begin{mdframed}[suppressfirstparskip=false,frametitle={#1}]\leavevmode\ignorespaces}%       {\end{mdframed}}               \begin{document}            \begin{theorem}{Theorem 1.}       Text       \label{Yeah}       \end{theorem}            \begin{theorem}{Theorem 2.}       \label{Yeah}       Text       \end{theorem}          \end{document}      This is rendered as follows: ![enter image description here](http://i.stack.imgur.com/8CyOF.png) There is an extra space in the second environment. **EDIT 2** : I ended up replacing `\label` inside the `mdframed` scope:               \makeatletter     \newenvironment{theorem}[1]%       {\begin{mdframed}[suppressfirstparskip=false,frametitle={#1}]%        \let\@oldlabel=\label%        \renewcommand\label[1]{\@oldlabel{##1}\ignorespaces}%        \leavevmode\ignorespaces}%       {\let\label=\@oldlabel%        \end{mdframed}}     \makeatother


title: phantom in environments

text: I want to show a box that's equivalent to the space needed by the text (or figure). I have already the code below, but I can't seem to find a way to use `\phantom` in the environment to make the boxedminipage the right height.               \usepackage{boxedminipage}     ...     \newenvironment{onblackboard}     {\begin{boxedminipage}{\linewidth}}     {\end{boxedminipage}}}      Using white font with `\color{white}` is not an option, because sometimes I have graphics in the environment, which I also do not want to show. Any ideas?


title: How to "fix baselines" in tikz nodes?

text: I want to define nodes which are shapes with some text in it using `\ce{}` from the `mhchem` package. How would I go around ensuring the baselines are the same between nodes, right now it shifts if I use subscript. Here's a MWE:               \documentclass{article}     \usepackage[version=3]{mhchem}          \usepackage{tikz}     \usetikzlibrary{shapes}          \newbox\nodebox     \newcommand\mycommand[2]{%         \begin{tikzpicture}%             \node[text=#1, rectangle, inner ysep=4pt, inner xsep=2pt, rounded corners=7, minimum height=5mm, minimum width=10mm, fill=#1] {\tiny\sffamily \textbf{\ce{#2}}};             \node[yshift=-0.5,text=black!95!white] {\scriptsize\sffamily \textbf{\ce{#2}}};             \node[text=white] {\scriptsize\sffamily \textbf{\ce{#2}}};         \end{tikzpicture}%     }          \begin{document}          \mycommand{red!40!white}{Al2O3} \mycommand{blue!40!white}{Al}          \end{document}


title: latex table appearing below references

text: I have a table using the `tabular` environment:               \begin{table}[ht]     \centering     \begin{tabular}{c|cccccc}     & Landmarks in the Human Genome Project \\     \hline     \rowcolor{LightCyan}     1953& Watson-Crick publish DNA structure & & & & & & \\     1975& F.Sanger, A.Maxam and W.Gilbert develop methods for sequencing DNA & & & & & & \\     \rowcolor{LightCyan}     1977& Bacteriophage $\Phi X -174$ sequenced: first complete genome sequenced & & & & & & \\     1980& US Supreme court rules genetically modified bacteria are pantentable & & & & & & \\     \rowcolor{LightCyan}     1981& Human mitochondrial DNA sequenced: $16569$ base pairs & & & & & & \\     1984& Epstein-Barr virus genome sequenced: 172,281 base pairs & & & & & &\\     \rowcolor{LightCyan}     1990& International Human Genome Project launched & & & & & & \\     1991& J. Craig Venter identifies sequences of DNA complementary to messenger RNA & & & & & & \\     \rowcolor{LightCyan}     1992& Complete low resolution linkage map of the human genome & & & & & & \\     1992& \textit{Caenorhabditis} sequencing project begins & & & & & & \\     \rowcolor{LightCyan}     1992& J. Craig Venter forms the Institute for Genome Research (TIGR) & & & & & & \\     1992& Wellcome Trust and UK Medical Research Council establish The Sanger Center for large-scale genomic sequencing  & & & & & &\\     \rowcolor{LightCyan}     1995& First complete sequence of bacterial genome, \textit{Haemophilus influenzae} by TIGR & & & & & & \\     1996& High resolution map of human genome & & & & & &\\     \rowcolor{LightCyan}     1996& Completion of yeast genome, first eukaryotic genome sequence & & & & & & \\     1996& Celera claims to finish sequencing human genome by 2001, Wellcome Trust respond by increasing funding to the Sanger Center & & & & & &\\     \rowcolor{LightCyan}     1998& \textit{Caenorhabdtis elegans} genome published & & & & & & \\     \hline     \end{tabular}     \end{table}      which runs fine, and appears in the document where I want it to, however when I add one or more items to the table, the table appears at the bottom of the document below the references. why is this? also i'm not sure how to parse latex code on here to show you the table - if anyone can show me how that would be great.


title: Make a 2cell diagram more beautiful (or less ugly)

text: I want to draw a two-cell diagram using xypic, the problem is that the bigone label is to long, how can I make the following diagram: ![enter image description here](http://i.stack.imgur.com/rV18R.png) looks like this one: ![enter image description here](http://i.stack.imgur.com/y2Z4N.png) using exclusively the two-cell feature of xypic, or at least, keep the `\uppertwocell` and `\lowertwocell` commands and draw a `{=>}` arrow using `-|` feature. Here is the code:               \xymatrix{\star &  & \star\lltwocell_{g{}_{1}g{}_{2}}^{g''_{1}g''_{2}}<7>{^{(\alpha'\circ\beta')\bullet(\alpha\circ\beta)}}}      Knowing that the second diagram was drawn using `\ar` commands, but in LyX environment, which prevent from scrolling horizontally the window, using only `\ar` commands is not very comfortable!


title: How to join arrows within xymatrix?

text: I use `xymatrix` (`\usepackage[all]{xy}`) in order to create the following picture:               \[       \xymatrix{A \ar@{-}[d] & B \\ \ar[r] & C}      \]      ![enter image description here](http://i.stack.imgur.com/nAYgo.png) Is there any possibility to join the lines?


title: A macro that behaves like a font-changing command (affects the rest of the current group)

text: Many LaTeX packages provide an interface to modify the typesetting of certain elements with the standard "parameterless" font commands, such as `\bfseries`, `\sffamily` or `\color{red}`. All of these commands are "parmeterless" in the sense, that they do not get a macro parameter of the content to format, but have an effect until the end of the current group. So:               Standard, but we {switch to \bfseries bold and \color{red} red until the end} of the group.      gives us: ![enter image description here](http://i.stack.imgur.com/o5724.gif) However, what do do if the macro one would like to apply for a certain formatting is not "parameterless", but a "parameterless" macro is expected? The MWE demonstrates this problem with `\fbox` and `listings`:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{listings,xcolor,beramono}          \lstset{language=C,basicstyle=\ttfamily,keywordstyle=\bfseries}           \lstset{moredelim=**[is][\color{red}]{<}{>}}  % works     \lstset{moredelim=**[is][\mystyle]{@}{@}}     % hmmm...          \def\mystyle{\fbox} % how to get the parameter to for \fbox?          \begin{document}       \begin{lstlisting}[gobble=4]         int main() {           if( printf ("Hello, <tex.se!") == 0 )             <return -1;> // error!           @return 0;@   // success          }       \end{lstlisting}     \end{document}      ![enter image description here](http://i.stack.imgur.com/536DQ.gif) As you can see, a small `\fbox` appears at the begin of the affected line, but the goal is that it should be around the _return 0;_. Is it possible, to define `\mystyle` in a way that it retrieves everything until the end of the group and can then (robustly) pass this to `\fbox`?


title: Teaching LaTeX and friends

text: Similar questions on how to teach LaTeX have been posted here already, but I would like to give them a slightly different touch: Has anybody experience with teaching LaTeX in relation with other tools needed for larger projects? What I have in mind is something like a student seminar (say some 10 dates, 90min each or so) which covers a good introduction how students can write a larger project (like a PhD thesis) using LaTeX, but also in a professional way. I made the experience that student somehow manage to master LaTeX but produce unreadable code (for me as an advisor) and "organize" their work in a rather erratic way (to say it politely). So I would like to introduce them not only to LaTeX, but also to some "best- practice" concepts in LaTeX. This should include some ideas of how to produce readable code (that the collaborators or supervisors can get into it quickly), naming macros, label, etc. in a reasonable way and so on. Furthermore, I would like to introduce them to some tools for organizing their typing, like a version control system (personally I use git), a professional bibliography mangement like BibTeX, a reliable editor (don't want to start a flamewar here :), a good production workflow, and exchanging code with the supervisor (maybe even remotely located via git, email...) To make my question more precise: has anyone suggestions which "best-practice" topics one should cover, how actually they look like, which tools beside the LaTeX core are useful, necessary, superflous...? EDIT: Concerning the pre-knowledge of the students. This is of course rather unclear to me as well. But to have some idea, let's just say that they have some basic experience with LaTeX, some basic ideas about Linux/bash etc and some basic ideas about the problematics of collaboration. With other words, I do not want to start from scratch but upgrade their skills to a better level.


title: How do I include a font package with a document?

text: I want to use the sourcecodepro tex package to typeset some figures in an academic paper, but when I submit this to the journal, I don't provide a PDF, I provide latex code and they compile it on my behalf. This means that I cannot modify the texmf directory and must include all (non-standard) dependencies with my document. I can easy include extra latex packages by placing the .sty file in my document directory. _Is there a way to do something similar with a font package like sourcecodepro?_ I tried placing all of the font files and sty files in my document folder and I got an error:               kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 SourceCodePro-Regular-tlf-t1--base     mktexpk: don't know how to create bitmap font for SourceCodePro-Regular-tlf-t1--base.     mktexpk: perhaps SourceCodePro-Regular-tlf-t1--base is missing from the map file.     kpathsea: Appending font creation commands to missfont.log.


title: tikzscale and \tikzsetnextfilename do not work together

text: `\tikzsetnextfilename` does not work with `tikzscale` package. In the MWE, included file is `A.tikz` which should produce `A.pdf`. MWE works if tikzscale is not used. MWE:               \documentclass{report}     \usepackage{tikz,tikzscale}     \usetikzlibrary{external}     \tikzexternalize     %     \begin{filecontents}{A.tikz}       \begin{tikzpicture}         \draw (0,0) rectangle (2,2);       \end{tikzpicture}     \end{filecontents}     %     \begin{document}         \newcommand{\figFilename}{}         \renewcommand{\figFilename}{A}         \tikzsetnextfilename{\figFilename}         %\input{\figFilename.tikz}         \includegraphics[width=\linewidth]{\figFilename.tikz}     \end{document}


title: \xrightarrow: position of text over an arrow should be lower

text: The following example of LaTeX code               \documentclass[b4paper,oneside, final, 10pt]{article}     \usepackage[english]{babel}     \usepackage{charter}     \usepackage{amsfonts}     \usepackage{mathtools}     \usepackage[top=1.5cm, bottom=2.9cm, left=2.1cm, right=2.1cm]{geometry}          \begin{document}         \noindent\textbf{\large Algebraic Morse Theory:} Let $R$ be any ring. A      \emph{based $R$-complex}, is a chain $R$-complex $(A_\star,\partial_\star)$,      together with a chosen decomposition $A_n\!=\bigoplus_{i\in I_n}\!\!\!A_{n,i}$      for every $n$. Then $\partial_{n,i,j}\!=\!\partial_{i,j}$ denotes the $R$-module      homomorphism $A_{n,i} \smash{\overset{\iota}{\longrightarrow}}      A_n \smash{\overset{\partial_n}{\longrightarrow}}A_{n-1}      \smash{\overset{\pi}{\longrightarrow}}A_{n-1,j}$, where $\iota$ is the coordinate inclusion and      $\pi$ is the coordinate projection. The associated digraph of $A_\star$,      $\Gamma_{\!A_\star}\!=\!\Gamma$, is a directed simple graph whose vertices are      the indices from all $I_n$, and directed edges correspond to nonzero maps      $\partial_{i,j}$. Each edge $(i,j)$ will be denoted by $i\!\to\!j$.\\[2mm]              \noindent\textbf{Conclusion:} Given a based $R$-complex $(A_\star,\partial_\star,I_\star)$,      any Morse matching $\mathcal{M}$ on $\Gamma_{\!A_\star}$ induces a homotopy      equivalence between complexes $(A_\star,\partial_\star)$ and      $(\mathring{A}_\star,\mathring{\partial}_\star)$, more precisely $A_\star     \xrightarrow{\pi\text{ s.d.r. }}\pi(A_\star) = \pi(\mathring{A}_\star)     \xleftarrow{\pi=p^{-1}\,\cong}\mathring{A}_\star$, and therefore isomorphisms      $H_n(A_\star,\partial_\star) \cong H_n(\mathring{A}_\star,\mathring{\partial}_\star)$      for all $n\!\in\!\mathbb{Z}$. In particular, if $\mathcal{M}^0_{n-1}\!=      \emptyset =\!\mathcal{M}^0_{n+1}$ then there holds $H_n(A_\star,\partial_\star)      \cong  \mathring{A}_n$.     \end{document}      produces ![enter image description here](http://i.stack.imgur.com/IJZ9b.jpg) (\iota, \partial, \pi are too high) instead of ![enter image description here](http://i.stack.imgur.com/otRJ0.jpg). Furthermore, it produces ![enter image description here](http://i.stack.imgur.com/rWbg6.jpg) instead of (lowered text) ![enter image description here](http://i.stack.imgur.com/lcCUM.jpg) or even better (lowered text and better overlay with p) ![enter image description here](http://i.stack.imgur.com/1nwk2.jpg). Is there a way to create a better command `\xrightarrow` (and if possible, also `\xleftarrow`, `\xRightarrow`, `\xLeftarrow`, etc.), that positions the text better, like in the pictures above? The style in the second and fifth pics is most desirable. Also, I would be most happy if this command had an optional argument `[...]` that specified offset from the line of the arrow (including negative space). P.S. By the way, is there a way to make the + and - sign in sub and superscripts appear with less space left and right of it? For example, -1 in the above picture is too far away from p.


title: Adding "Revtex4-1" to Sublime 2

text: I work with Sublime 2 on Ubuntu. I managed to install Package Control. At the moment, I would like to install the package "revtex4-1". First, I downloaded the package and added it to the installed packages folder of Sublime. (I used this method succesfully before and included the packages "feynmf" and "commath"). However, in this case I get the error "revtex4-1.cls file not found", whereas this file is indeed in the folder revtex4-1 in the installed packages folder. I tried looking for revtex4-1 via Package control, but it is not available. Can anyone help me resolve this issue?


title: How can I standardize my square root signs?

text: I've noticed that when square root signs get too large, their front leg goes vertical (1), and that otherwise, it angles to the right (2). How can I standardize all my square root signs to either behavior?               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{align}     \Delta F_0 &= \sqrt{\sum_{i=1}^n\left(\frac{\delta F_0}{\delta x_i}\Delta x_i\right)^2}\\[0.2cm]     \Delta F_0 &= \sqrt{6.044 \cdot  10^{-6}\text{m}^2}     \end{align}          \end{document}      ![enter image description here](http://i.stack.imgur.com/agHws.png)


title: Specify dimensions of block matrices in Latex

text: I recently started learning LaTeX and though I found answers for almost all of my questions by looking online (and especially here), there is still one more thing I would like to be able to do but can't for the article I am writing: I would like to be able to specify the dimensions and the "subdimensions" below a matrix. To be clearer, let us take the following example:               $ D =       \underbracket{\begin{pmatrix}        D_1 & 0      & 0   &   &        &    \\        0   & \ddots &     &   &    {\textrm{\huge 0}}    &    \\        0   & 0      & D_n &   &        &    \\            &        &     &   &        &    \\            &   \textrm{\huge 0}     &     &   &   {\textrm{\huge 0}}     &    \\            &        &     &   &        &    \\       \end{pmatrix}}_N $      this gives a nice matrix whith the dimension N specified as a bracket under the matrix. That is fine, however I would like to add a second bracket to specify the smaller dimension n of the inner block matrix right below the matrix (and possibly above the first main bracket) which is shorter, i.e. I would like it to extend from 1 to n and not all the way below the matrix. I am open to any solution, but the simpler the better for me :)


title: How can long formulas be written more beautifully?

text: How do you write a long formula in a more beautiful manner   1. for the better, all my formulas in lines with the same length.    2. formulas are long with slightly smaller text.    3. Is it better to be done automatically (because I have a lot of formulas).  I was was wondering that how formulas in the books are so pretty? How are they written? For example, I put some of my equations below:               \documentclass{article}     \usepackage[fleqn]{amsmath}     \usepackage{amsthm}     \usepackage{amssymb}     \usepackage{breqn}     \title{break a long formulation}     \author{}     \begin{document}     \maketitle     It was wandering that how formula in book are very pretty? how they write?     \begin{align*}     &\left( \hat{E}h+2{{E}^{s}} \right)\,\left[ \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{u}_{mj}}+\left( \sum\limits_{m=1}^{{{N}_{x}}}{A_{im}^{x}}{{w}_{mj}} \right)\left( \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{w}_{mj}} \right) \right]+\\     &\left[ \nu \hat{E}h+Gh+2{{E}^{s}} \right]\,\left[ \sum\limits_{m=1}^{{{N}_{x}}}{\sum\limits_{n=1}^{{{N}_{y}}}{A_{im}^{x}A_{jn}^{y}{{v}_{mn}}}} \right.+\left( \sum\limits_{n=1}^{{{N}_{y}}}{A_{jn}^{y}}{{w}_{in}} \right).\\     &\left. \left( \sum\limits_{m=1}^{{{N}_{x}}}{\sum\limits_{n=1}^{{{N}_{y}}}{A_{im}^{x}A_{jn}^{y}{{w}_{mn}}}} \right) \right]\left[ Gh+2\left( \left. 2{{\mu }^{s}}-{{\tau }^{s}} \right) \right. \right]\left[ \sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}{{u}_{in}}} \right.+\\     &\left. \left( \sum\limits_{m=1}^{{{N}_{x}}}{A_{im}^{x}}{{w}_{mj}} \right)\left( \sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}{{w}_{in}}} \right) \right]=\rho h{{\ddot{u}}_{ij}}-\mu \rho h\left( \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{{\ddot{u}}}_{mj}} \right.+\\     &\left. \sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}}{{{\ddot{u}}}_{in}} \right)\\          \end{align*}          \begin{dmath}     \left( \hat{E}h+2{{E}^{s}} \right)\left[ \sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}{{v}_{in}}}+\left( \sum\limits_{n=1}^{{{N}_{y}}}{A_{jn}^{y}{{w}_{in}}} \right)\left( \sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}{{w}_{in}}} \right) \right]+\left( \nu \hat{E}h+Gh+2{{E}^{s}} \right)\left[ \sum\limits_{m=1}^{{{N}_{x}}}{\sum\limits_{n=1}^{{{N}_{y}}}{A_{im}^{x}A_{jn}^{y}{{u}_{mn}}}} \right.+\left( \sum\limits_{m=1}^{{{N}_{x}}}{A_{im}^{x}}{{w}_{mj}} \right)\left( \sum\limits_{m=1}^{{{N}_{x}}}{\sum\limits_{n=1}^{{{N}_{y}}}{A_{im}^{x}A_{jn}^{y}{{w}_{mn}}}} \right)+\left[ Gh \right.+\left. 2\left( 2{{\mu }^{s}}-{{\tau }^{s}} \right) \right]\left[ \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{v}_{mj}}+ \right. \left. \left( \sum\limits_{n=1}^{{{N}_{y}}}{A_{jn}^{y}}{{w}_{in}} \right)\left( \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{w}_{mj}} \right) \right]=\rho h{{\ddot{v}}_{ij}}-\mu \rho h\left( \sum\limits_{m=1}^{{{N}_{x}}}{B_{im}^{x}}{{{\ddot{v}}}_{mj}} \right.+ \left. +\sum\limits_{n=1}^{{{N}_{y}}}{B_{jn}^{y}}{{{\ddot{v}}}_{in}} \right)     \end{dmath}               \begin{equation}     \begin{split}     &\left\{ \left[ {{T}_{44}}\left( 1,1 \right)+2{{T}_{44}}\left( 5,1 \right)+{{T}_{44}}\left( 2,1 \right) \right]\left( \sum\limits_{m=1}^{{{N}_{\xi }}}{\bar{D}_{im}^{\xi }}w_{mj}^{b}+B_{i1}^{\xi }\kappa _{1j}^{bx}+B_{i1}^{\xi }\kappa _{{{N}_{\xi }}j}^{b\xi } \right)+ \right.\\      &\left[ {{T}_{44}}\left( 1,2 \right) \right.+2{{T}_{44}}\left( 5,2 \right)+\left. {{T}_{44}}\left( 2,2 \right) \right]\left( \sum\limits_{n=1}^{{{N}_{\eta }}}{\bar{D}_{jn}^{\eta }w_{in}^{b}}+B_{j1}^{\eta }\kappa _{i1}^{b\eta }+B_{j1}^{\eta }\kappa _{i{{N}_{\eta }}}^{b\eta } \right)+\\     &\left[ {{T}_{44}}\left( 1,3 \right) \right.+2{{T}_{44}}\left( 5,3 \right)+\left. {{T}_{44}}\left( 2,3 \right) \right]\sum\limits_{n=1}^{{{N}_{\eta }}}{A_{jn}^{\eta }}\left( \sum\limits_{m=1}^{{{N}_{\xi }}}{\bar{C}_{im}^{\xi }}w_{mn}^{b}+A_{i1}^{\xi }\kappa _{1n}^{b\xi } \right.+A_{i{{N}_{\xi }}}^{\xi }.\\      &\left. \kappa _{{{N}_{\xi }}n}^{b\xi } \right)+\left[ {{T}_{44}}\left( 1,4 \right)+2{{T}_{44}}\left( 5,4 \right)+{{T}_{44}}\left( 2,4 \right) \right]\sum\limits_{m=1}^{{{N}_{\xi }}}{A_{im}^{\xi }}\left( \sum\limits_{n=1}^{{{N}_{\eta }}}{\bar{C}_{jn}^{\eta }}w_{mn}^{b} \right.+A_{j1}^{\eta }\kappa _{1n}^{b\eta }\\     &\left. +A_{j{{N}_{\eta }}}^{\eta }\kappa _{{{N}_{\eta }}n}^{b\eta } \right)+\left. \left[ {{T}_{44}}\left( 1,5 \right)+2{{T}_{44}}\left( 5,5 \right)+{{T}_{44}}\left( 2,5 \right) \right]\sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{B_{im}^{\xi }B_{jn}^{\eta }}w_{mn}^{b}} \right\}2\mu {{\tau }^{s}}\\     &-2\mu {{\tau }^{s}}\left\{ \left[ {{T}_{44}}\left( 1,1 \right)\hspace{0.15 cm}+ \right.2{{T}_{44}}\left( 5,1 \right)\hspace{0.15 cm}+\left. {{T}_{44}}\left( 2,1 \right) \right]\sum\limits_{m=1}^{{{N}_{\xi }}}{D_{im}^{\xi }}w_{mj}^{s}\hspace{0.15 cm}+ \right.\left[ {{T}_{44}}\left( 1,2 \right) \right.+\\     & 2{{T}_{44}}\left( 5,2 \right)+\left. {{T}_{44}}\left( 2,2 \right) \right]\sum\limits_{n=1}^{{{N}_{\eta }}}{D_{jn}^{\eta }w_{in}^{s}}+\left[ {{T}_{44}}\left( 1,3 \right) \right.+2{{T}_{44}}\left( 5,3 \right)+\left. {{T}_{44}}\left( 2,3 \right) \right].\\      &\sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{C_{im}^{\xi }A_{jn}^{\eta }}w_{mn}^{s}}+\left[ {{T}_{44}}\left( 1,4 \right)+2{{T}_{44}}\left( 5,4 \right)+{{T}_{44}}\left( 2,4 \right) \right]\sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{A_{im}^{\xi }C_{jn}^{\eta }}w_{mn}^{s}}+\\      &\left. \left[ {{T}_{44}}\left( 1,5 \right)+2{{T}_{44}}\left( 5,5 \right)+{{T}_{44}}\left( 2,5 \right) \right]\sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{B_{im}^{\xi }B_{jn}^{\eta }}w_{mn}^{s}} \right\}+\left( kGh+2{{\tau }^{s}} \right).\\     &\left[ {{T}_{22}}\left( 1,1 \right)\sum\limits_{m=1}^{{{N}_{\xi }}}{B_{im}^{\xi }} \right.w_{mj}^{s}+{{T}_{22}}\left( 1,2 \right)\sum\limits_{n=1}^{{{N}_{\eta }}}{B_{jn}^{\eta }}w_{in}^{s}+{{T}_{22}}\left( 1,3 \right)\left. \sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{A_{im}^{\xi }A_{jn}^{\eta }w_{mn}^{s}}} \right]\\      &+\left( 2{{\tau }^{s}}+\mu {{m}_{0}}\frac{{{\partial }^{2}}}{\partial {{t}^{2}}} \right)\left[ {{T}_{22}}\left( 1,1 \right)\sum\limits_{m=1}^{{{N}_{\xi }}}{B_{im}^{\xi }} \right.\left( w_{mj}^{b}+w_{mj}^{s} \right)+{{T}_{22}}\left( 1,2 \right)\sum\limits_{n=1}^{{{N}_{\eta }}}{B_{jn}^{\eta }}w_{in}^{b}\\     &\left. +w_{in}^{s} \right)+\left. \sum\limits_{m=1}^{{{N}_{\xi }}}{\sum\limits_{n=1}^{{{N}_{\eta }}}{A_{im}^{\xi }A_{jn}^{\eta }\left( w_{mn}^{b}+w_{mn}^{s} \right)}} \right]={{m}_{0}}\frac{{{\partial }^{2}}\left( w_{ij}^{b}+w_{ij}^{s} \right)}{\partial {{t}^{2}}}      \end{split}     \end{equation}     \end{document}


title: How to arrange references at the end of each chapter (in a Thesis)?

text: I am writing my PhD thesis and my supervisor has asked me to append the references at the end of each chapter. However, the template (which I am using) is unable to do so. I have downloaded this template, somewhere from the Internet. I am using `\printbibliography` at the end of the chapters but still I can't see any references at the end. As a MWE (Thesis_Template), I am using two chapters with one common reference (Bannerman_2009) and a different reference (Chan05). I can see their proper citation in the text (Please see pg. no. 17 and 19 in `main.pdf`) but they are not being listed at the end. I am very worried because my professor want chapters for the review but my thesis is still not in the specified format. I am using MiKTeX 2.9 with TeXstudio for compiling the code. Please explain elaborately, where I am making a mistake or there is some specific order of compiling the code, which I have to follow. Looking forward to your kind and prompt help. My files are as follows: %%% Main.tex %%%               \documentclass[12pt,twoside]{report}     \usepackage{hyperref}     \usepackage[style=numeric- comp,bibstyle=numeric,hyperref=true,backref=false,refsection=chapter,sorting=none,abbreviate=true]{biblatex}     \bibliography{main}%%% the bibtex file     \defbibheading{thesisChapterBib}{\section{References}}     \begin{document}     \include{Chapter1}     \include{Chapter2}     \appendix     \end{document}      %%% Chapter1.tex %%%               \chapter{Example One}      This is a part of chapter one.~\cite{Bannerman_2009}     \printbibliography[heading=thesisChapterBib]      %%% Chapter2.tex %%%               \chapter{Example Two}      Chapter with Nunc vitae placerat ligula.~\cite{Bannerman_2009, Chan05}     \printbibliography[heading=thesisChapterBib]      %%% main.bib %%%               @ARTICLE{Bannerman_2009,        author = {Bannerman, M. N.},        title = {Discrete potentials are good},        journal = {J. M. B.},        year = {2009},        volume = {1},        pages = {1-100},        owner = {mjki2mb2},     }     @ARTICLE{Chan05,        author = {Chan, R.H. and Chung-Wa Ho and Nikolova, M.},        title = {Salt-and-pepper noise removal by median-type noise detectors and         detail-preserving regularization},        journal = {Image Processing, IEEE Transactions on},        year = {2005},        volume = {14},        pages = {1479-1485},        number = {10},        doi = {10.1109/TIP.2005.852196},        issn = {1057-7149}     }


title: Format title output bold and larger

text: I use the code               \documentclass[a4paper]{article}          \usepackage{amsmath,amsxtra,amssymb,latexsym, amscd,amsthm}     \usepackage{indentfirst}     \usepackage[mathscr]{eucal}     \usepackage[utf8]{vietnam}          \begin{document}     \title{Tại sao lý thuyết Maxwell lại khó hiểu?}          \author{Dịch bởi: Nguyễn Duy Khánh}        \date{18-12-2012}            \maketitle          \section*{Khiêm tốn không phải lúc nào cũng là đức hạnh}     \end{document}      And here is the result, you can see the title is not bold and it is small, but the section is in bold and large ![And here is the result:](http://i.stack.imgur.com/qsrxw.png) Could you please show me which code I can use to have result like this : ![enter image description here](http://i.stack.imgur.com/7vVbw.png)


title: conversion issues using htlatex and MathJax/mathML method

text: I am using the method shown in this answer below to convert my LaTeX file to HTML so that the resulting LaTeX file is processed by MathJax via MATHML: Convert Latex to MathJax-HTML                 "... mathml which can be then displayed with mathjax...."      Everything works well, and using the above method, the math looks much better than the standard `htlatex` method. Except for things such as `$\dot{x}$` which shows up really strange now and is not rendered well. I tried this on IE, Firefox, and Chrome, all with the same problem. I'll show the small tex file, then the `htlatex` command I used, then the `htlatex` `.cfg` file (which is the same exact `.cfg` file show in the above answer), then show the HTML output. LaTeX file:               \documentclass[12pt]{article}%     \begin{document}         $\dot{\alpha}$     $x \dot{x}$     \end{document}      Command used to generate HTML (which is also the same command given in the above answer):                htlatex t.tex "t.cfg,charset=utf-8" " -cunihtf -utf8"      The `t.cfg` file used above is the same one shown in the answer above, so will not show it here again. Screen shot of the HTML generated (notice how the `x` with the dot does not look right): ![enter image description here](http://i.stack.imgur.com/umaWI.png) Compare that to the PDF output: ![enter image description here](http://i.stack.imgur.com/n5cLD.png) Here is the HTML file itself. I think the problem is the MATHML is not right? Is this a `htlatex` bug? or MATHML? Or MathJax? And how to correct it?               <!DOCTYPE html>      <html>      <head> <title></title>      <meta charset="UTF-8" />      <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" />      <link rel="stylesheet" type="text/css" href="t.css" />      <script type="text/javascript"      src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"      ></script>      <style type="text/css">      .MathJax_MathML {text-indent: 0;}      </style>      </head><body      >     <!--l. 4--><p class="noindent" ><!--l. 4--><math       xmlns="http://www.w3.org/1998/Math/MathML"       display="inline" ><mover      accent="true"><mrow      ><mi      >α</mi></mrow><mo      class="MathClass-op">̇</mo></mover></math>     <!--l. 5--><math       xmlns="http://www.w3.org/1998/Math/MathML"       display="inline" ><mi      >x</mi><mi      >ẋ</mi></math>     </p>          </body>      </html>      Although over all the math looks better in this new method (mathml/mathjax which I have no idea how it actually works), but there are few spots where the math does not render well in HTML. Here is another case               \documentclass[12pt]{article}%     \begin{document}         $\dot{x}_{1}^{2}$         \end{document}      ![enter image description here](http://i.stack.imgur.com/LvT7k.png)


title: Can you run mk4ht on iPad or Android?

text: I need to create html files from tex using mk4ht on an iPad or an Android tablet... Is there any way to run mk4ht on iOS or Android? Preferably without requiring Internet connection, but if that's not possible then I suppose with Internet connection would be OK too.


title: How to change the numbering for different figures?

text: Let's say I have two standard figures and two supplementary figures. If I change the name of figure using `\renewcommand{\figurename}` the figure counter will still count all figures continuously (i.e. _Fig 1, Fig 2, Supp Fig 3, Supp Fig 4_ – see code below). How can I reset the figure counter so it will count standard figures separately from supplementary figures?               \documentclass[]{article}     \usepackage[footnotesize]{caption}     \begin{document}     \begin{figure}[ht]     \caption{}     \end{figure}     \begin{figure}[ht]     \caption{}     \end{figure}     \begin{figure}[ht]     \renewcommand{\figurename}{Supplementary Figure}     \caption{}     \end{figure}     \begin{figure}[ht]     \renewcommand{\figurename}{Supplementary Figure}     \caption{}     \end{figure}     \end{document}


title: make nodes different sizes in the same image

text: I want to make all the nodes the same size. But the problem is that some of them have more text in them so they automatically get bigger. Any help would be nice thanks. ## Code               \begin{tikzpicture}       [scale=.5,auto=left,every node/.style={circle,inner sep=0pt, fill=blue!20}]         \node (n1) at (-5,1) {$v_{1}$};        \node (n2) at (-5,6) {$v_{i}$};       \node (n3) at (-5,11) {$v_{n}$};       \node (n4) at (1,-5) {$u_{1}$};        \node (n5) at (6,-5) {$u_{j}$};       \node (n6) at (11,-5) {$u_{n}$};       \node (n7) at (1,1) {$(u_{1},v_{1})$};        \node (n8) at (1,6) {$(u_{1},v_{i})$};       \node (n9) at (1,11) {$(u_{1},v_{n})$};            \node (n10) at (6,1) {$(u_{j},v_{1})$};        \node (n11) at (6,6) {$(u_{j},v_{i})$};       \node (n12) at (6,11) {$(u_{j},v_{n})$};            \node (n13) at (11,1) {$(u_{m},v_{1})$};        \node (n14) at (11,6) {$(u_{m},v_{i})$};       \node (n15) at (11,11) {$(u_{m},v_{n})$};          \foreach \from/\to in {n2/n3,n1/n2,n4/n5,n5/n6,n7/n8,n8/n9,n10/n11,n11/n12,n13/n14,n14/n15,n9/n12,n12/n15,n8/n11,n11/n14,n7/n10,n10/n13}     \draw[loosely dotted] (\from) -- (\to);        \path [every node/.style={font=\scriptsize, inner sep=+.1667em}]              (n1) edge [bend left]  node[swap] {} (n3)             (n4) edge [bend right]  node[swap] {} (n6)             (n9) edge [bend right]  node[swap] {$a$} (n7)             (n7) edge [bend right]  node[swap] {$b$} (n13)              (n13) edge [bend right]  node[swap] {$c$} (n15)             (n15) edge [bend right]  node[swap] {$d$} (n9);     \end{tikzpicture}


title: XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

text: The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in `TikZ` or `pgfplots`. As suggested in this forum, calling `\usepackage[cmyk]{xcolor}` should do the trick, but I have no way of verifying that my resulting document is indeed set using CMYK. Using `imageMagick`, the PDF is reported as:               $ identify -verbose test.pdf | grep Colorspace        Colorspace: Gray        Colorspace: sRGB        [... lots of Colorspace: sRGB lines here ...]      I tried the command provided in the accepted answer of this thread on stackoverflow:               $ gs \        -o test-cmyk.pdf \        -sDEVICE=pdfwrite \        -sProcessColorModel=DeviceCMYK \        -sColorConversionStrategy=CMYK \        -sColorConversionStrategyForImages=CMYK \         test.pdf       But the result when calling `identify` is the same: every single colorspace is reported as `Colorspace: sRGB`. The same happens when I use `imageMagick` directly to try and convert the PDF:               $ convert in.pdf -profile "/usr/share/ghostscript/9.07/iccprofiles/default_cmyk.icc" out.pdf      I found a few discussions in this channel, in particular the two below. However, neither give me a final answer as to how to check if my PDF is indeed using the CMYK color model. PDF colour model and LaTeX Option cmyk for xcolor package does not produce a CMYK PDF In particular, the latter sugests the use of the command `\pdfcompresslevel=0`. The problem with that is, that apparently `XeLaTeX` does not like that command:               ! Undefined control sequence.     l.4 \pdfcompresslevel                          =0


title: Double-nested logical-and and logical-or symbols?

text: I'm typesetting a bunch of source code, and I really like the way the double- nested logical-and and logical-or symbols look for denoting bitwise logical and/or. Unfortunately, LaTeX doesn't seem to have these symbols, so I resorted to rolling my own using a combination of `\land` and `\lor` with carefully rotated and aligned rules. The results are acceptable to my eye at 10pt, but the placement of the rules is fragile for a couple of reasons. Here's how they look magnified: ![home-rolled double-nested logical-and and logical- or](http://i.stack.imgur.com/GfYHE.png) The first reason they're fragile is because (against my better judgment, but not knowing a better way), I'm making assumptions about spacing:               \newcommand{\bland}{% bitwise logical and       \hbox{%         $\land$%         \hspace{-.47em}%         \raisebox{-.04em}{%           \rotatebox{66}{%             \vrule width .3em height .45pt depth 0pt%           }%           \hspace{.065em}%           \rotatebox{-66}{%             \hspace{-.3em}%             \vrule width .3em height .45pt depth 0pt%           }%         }%         \hspace{.20em}%       }%     }      Thus, when shown in a smaller size—for example when stacked atop `=` or `\Leftarrow`—the internal lines are off by a small but noticeable amount. The second reason is more insidious and seems to have to do with rounding error in PDF conversion or display: the inner wedge "wobbles" half a pixel or so (as compared to the outer wedge) at various sizes. I'm wondering what the best solution is here. I'm not opposed (in theory) to diving into XeLaTeX to see how `U+2A53` and `U+2A54` look, but if possible I'd prefer to avoid dependencies on XeTeX/XeLaTeX for this. Also, the first thing I tried was nesting a `\tiny\land` inside a `\land` but the slopes of the strokes were different. Basically I need something with the same slopes and thicknesses, and it would also be nice if they had rounded edges, but I haven't the TeXpertise to make that happen. Here's how the symbols look at a more regular size (top line is regular boolean logical operators; second two lines are bitwise boolean operators): ![sample code](http://i.stack.imgur.com/k4Kak.png) By the way, I did come across a double-nested less-than and greater-than in a standard LaTeX package, which I think I could _maybe_ use—if I rotated them 90 degrees—but the problem I have with those is that they override/redefine `\ll` and `\gg` rather than adding new control sequences, and I have places elsewhere where I want to use the real `\ll` and `\gg`.


title: Compile document without any in-text citations

text: Is there any way for me to easily and reversibly remove in-text citations from LaTeX output? I need to provide an accurate character count for my senior thesis that excludes citations (and figures and figure captions, but there are few enough of those that I'm willing to remove them by hand). Right now I'm just exporting to plain text and running the result through `sed`, but this is not as nice as just being able to set a flag in the preamble or somesuch. If it makes it any simpler (or harder!), I'm using LyX.


title: scrpage2 - Chapter and Section on two lines in header?

text: Here is a the beginning of my code :               \documentclass[twoside,a4paper,11pt]{scrbook}     \usepackage[UTF8]{inputenc} %encodage clavier     \usepackage[T1]{fontenc} %encodage police     \usepackage[francais]{babel} %langue     \usepackage{scrpage2} %head-foot koma     \deftripstyle{fancy}[0pt][0.4pt]               {\leftmark}{}{\thepage}               {Nom du document}{}{Lieu} %page style for right pages (odd)     \pagestyle{fancy}      ...which works like a charm, header/footer respect the `twoside` option by changing the display on odd/even pages. Question : **As I have a lot of sections and chapters in my document, and both are useful to situate the page, I'd like to have both of them displayed on the inner header, on 2 lines, how can I do that?** I have tried this: (which doesn't work)               \documentclass[twoside,a4paper,11pt]{scrbook}     \usepackage[UTF8]{inputenc} %encodage clavier     \usepackage[T1]{fontenc} %encodage police     \usepackage[francais]{babel} %langue     \usepackage{scrpage2} %head-foot koma     \deftripstyle{fancy}[0pt][0.4pt]                 {\leftmark \newline \rightmark}{}{\thepage}                 {Nom du document}{}{Lieu} %page style for right pages (odd)     \pagestyle{fancy}


title: Configure latexmk in TeXworks (TeX Live 2013)

text: I am trying to configure latexmk in TeXworks 0.4.5 accompanied by TeX Live 2013. I followed the instructions on the TeXworks site, as noted in the picture below: ![**TeXworks latexmk configuration](http://i.stack.imgur.com/Ey5jq.png) My code is very simple as follows:               \documentclass[a4paper,twoside]{report}          \begin{document}     This is my first latex test.     \newpage     how are you.     \newpage     This is a new line.     \newpage     This is another line.     \end{document}      But I cannot compile it. The error message is:               Latexmk: Stopping because executing following code from command line         $pdflatex=q/pdflatex -synctex=1 %O %S     gave an error:         Can't find string terminator "/" anywhere before EOF at (eval 8) line 1.          C:\texlive\2013\bin\win32\runscript.tlu:650: command failed with exit code 2:     perl.exe c:/texlive/2013/texmf-dist/scripts/latexmk/latexmk.pl -e "$pdflatex=q/pdflatex -synctex=1 %O %S" -pdf test.tex      I also followed the steps in configure latexmk in Texworks 0.2.3. However it also failed in the end. After that, I switched to TeXstudio which is configured beforehand:               latexmk -pdf -silent -pdflatex="pdflatex -synctex=1 %%O %%S" %      Although this works in TeXstudio, it does not compile my code in real-time mode, which behaves as the normal pdfLaTeX command.   1. What reference should I refer to for latexmk?   2. Is latexmk not compatible with TeXworks (TeX Live 2013)?


title: How to reduce the space between nodes?

text: I want to make the nodes in the following `vector`-illustration touch each other. But no matter what I do to `text width` or `node distance` the distance between the nodes stays the same.               \usetikzlibrary{backgrounds}     \usetikzlibrary{decorations.pathreplacing}          \tikzstyle{cell} = [rectangle, draw, text width=1.3cm ]     \tikzstyle{capx} = [rectangle, draw, text width=1.3cm, color=black!40  ]          \begin{tikzpicture}[         every node/.style={text centered,  minimum height=1.5em, minimum width=1.5cm,node distance=0pt},         background rectangle/.style={fill=black!10},show background rectangle,         ]             \node at (10,0) [capx] (n5) {leer};        \node at (12,0) [capx] (n6) {leer};        \node at (14,0) [capx] (n7) {leer};             \node at (0,0) [cell] (n0) {wert};            \node at (2,0) [cell] (n1) {wert};        \node at (4,0) [cell] (n2) {wert};        \node at (6,0) [cell] (n3) {wert};        \node at (8,0) [cell] (n4) {wert};          \draw [decorate,decoration={brace,amplitude=10pt},xshift=-4pt,yshift=0pt]       (-0.6,0.5) -- (8.8,0.5) node [black,midway,xshift=-0.5cm,yshift=18pt]        {\hskip6ex size()};          \draw [decorate,decoration={brace,amplitude=10pt,mirror},xshift=-4pt,yshift=0pt,color=black!40]       (-0.6,-0.5) -- (14.8,-0.5) node [black,midway,xshift=-0.5cm,yshift=-18pt,color=black!40]        {\hskip6ex capacity()};          \end{tikzpicture}      ![bad vector](http://i.stack.imgur.com/p6vGM.png)


title: Beamer note page: Increase slide size

text: I'm using the `beamer` class with `note` pages. In the upper right corner I see always the slide the notes are referring to. Is it possible to change the size of this preview?               \documentclass{beamer}          \setbeameroption{show notes}          \begin{document}          \section{foo}     \begin{frame}{foo}     Some text.     \end{frame}     \note{Many notes}          \end{document}


title: pgfdeclareshape fillable background path with invisible parts

text: I want to make a new shape from rectangle, which has only its top and bottom line drawn, but which can be filled. The answer, thank's to Andrew Stacy and percusse look by now as follows:                   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         \documentclass[twoside,reqno,12pt]{amsart}         \usepackage{a4wide} %% uncomment if a4wide is not installed         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         %% T i k Z          %%   -- packages         %%   -- macros & shapes         \usepackage{tikz}         \usetikzlibrary{arrows,backgrounds}         \usetikzlibrary{decorations.pathreplacing}         \usetikzlibrary{decorations.markings}         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         %%         %% new shape : iso         %%         \makeatletter         \newif\ifpullback         \pgfkeys{/tikz/pullback/.is if=pullback}         \pgfkeys{/tikz/pullback=false}         \pgfdeclareshape{iso}{%             %             \inheritsavedanchors[from=rectangle]             \inheritanchorborder[from=rectangle]             \inheritanchor[from=rectangle]{north}             \inheritanchor[from=rectangle]{north west}             \inheritanchor[from=rectangle]{north east}             \inheritanchor[from=rectangle]{center}             \inheritanchor[from=rectangle]{west}             \inheritanchor[from=rectangle]{east}             \inheritanchor[from=rectangle]{mid}             \inheritanchor[from=rectangle]{mid west}             \inheritanchor[from=rectangle]{mid east}             \inheritanchor[from=rectangle]{base}             \inheritanchor[from=rectangle]{base west}             \inheritanchor[from=rectangle]{base east}             \inheritanchor[from=rectangle]{south}             \inheritanchor[from=rectangle]{south west}             \inheritanchor[from=rectangle]{south east}             %             \savedanchor\centerpoint             {                 \pgf@x=0pt                 \pgf@y=0pt             }             \anchor{text}{%                  \pgf@x=0pt                  % adjust vertical positioning                  \pgf@y=0pt                  \advance\pgf@y by -0.2\ht\pgfnodeparttextbox             }             %             \backgroundpath{%               \northeast \pgf@xa=\pgf@x \pgf@ya=\pgf@y               \southwest \pgf@xb=\pgf@x \pgf@yb=\pgf@y               \begingroup                  \tikz@mode                  \iftikz@mode@draw                     % -- draw top and bottom line                     \pgfpathmoveto\northeast                     \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}                     \pgfpathmoveto\southwest                     \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}                     \pgfusepath{stroke}                  \fi                  \iftikz@mode@fill                     % -- fill rectangle if demanded                 \pgfsetlinewidth{\pgflinewidth}                     \advance\pgf@ya by -0.5\pgflinewidth%                     \advance\pgf@yb by  0.5\pgflinewidth%                     \pgfpathrectanglecorners{\pgfqpoint{\pgf@xb}{\pgf@yb}}{\pgfqpoint{\pgf@xa}{\pgf@ya}}                     \pgfusepath{fill}                  \fi                  \ifpullback                     % -- if option pullback is given draw hook                 \northeast \pgf@xa=\pgf@x \pgf@ya=\pgf@y                     \southwest \pgf@xb=\pgf@x \pgf@yb=\pgf@y                     \pgf@xc=\pgf@xb                     \advance\pgf@xc by  3\pgflinewidth                     \pgf@yc=\pgf@ya                     \advance\pgf@yc by -2\pgflinewidth                     \pgfpathmoveto{\pgfqpoint{\pgf@xc}{\pgf@ya}}                     \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@yc}}                     \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}                     \pgfusepath{stroke}                  \fi             \endgroup             }         }         \makeatother         \begin{document}              \begin{tikzpicture}           \draw (0,-2) grid (6,3);           \node[fill=blue!20,line width=2pt,iso,draw,minimum width=2.5cm,inner ysep=0pt] at (2,2){$=$};           \node[fill=green!20,pullback,line width=1.25pt,iso,draw,minimum width=2.5cm,inner ysep=0pt] at (2,1){$=$};         \end{tikzpicture}     \end{document}      This solution also takes care of the fact that the rectangle used to fill the box overrides part of the top and bottom lines, halving their width. Hence before drawing the filler rectangle, the northeast and southwest y-coordinates are altered by half \pgflinewidth. On option `pullback` is added which draws a small hock in the top left corner. [This shape is meant to depict a iso-2-cell in 2-tangles for 2-categories].


title: How does expansion matter?

text: \newcount\@repeat%     \def\repeat#1#2{%     \@repeat#1\relax%     \ifnum#1>\z@\relax%       \advance\@repeat by -1\relax%       \repeat{\@repeat}{#2}#2%     \fi}%     \repeat{2}{1}\\%     \repeat{11}{f}\\%     \repeat{\repeat{2}{1}}{f}% this does not work      The macro `\repeat#1#2` repeats the argument #2 a total of #1 times. I expect the last two lines produce the same thing, but the last line is wrong. Why can't the last line produces the letter f 11 times? Does expandability matter? I don't quite understand it. How I should edit the code so that they produce the same thing?


title: Changing font size of chapter headings the same as that of section

text: ![enter image description here](http://i.stack.imgur.com/hepCV.png) I have a memoir document that has `mystyle` chapter copied from Modify default memoir chapter style. How can I change the font size of the chapter to the same as that of section? Or, how I can I change the fontsize of chapters in general?               \documentclass[12pt,oneside]{memoir}          \title{Document}     \author{prosseek}     % }          % http://tex.stackexchange.com/questions/97465/modify-default-memoir-chapter-style     \makeatletter     \newcommand{\fonttitle}{\chaptitlefont}     \makechapterstyle{mystyle}{%     \def\chapterheadstart{\vspace*{\beforechapskip}}     \def\printchaptername{}     \def\printchapternum{}     \def\printchapternonum{}     \def\printchaptertitle##1{\fonttitle \space \fonttitle \thechapter.\space \fonttitle ##1}     \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}     }     \makeatother          \chapterstyle{mystyle}          \begin{document}          \maketitle     \tableofcontents          \chapter{The Domain Problem and Stakeholders}     \section{First}     abcdef.           \end{document}


title: Table of Contents within Appendix

text: My Minimum Working Example:               \documentclass{article}          \usepackage{appendix}          \begin{document}          \section{My First Section}          \section{My Second Section}          \begin{appendices}          \section*{My First Appendix}          Here I want something like:          \noindent My First Subsection ........... 1          \noindent My Second Subsection ........ 1          \subsection*{My First Subsection}          \subsection*{My Second Subsection}          \section*{My Second Appendix}          \end{appendices}          \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/2im09.png) So basically, I want a table of contents within My First Appendix, only containing references to the subsections appearing in this Appendix.


title: Simple vertical text in TikZ

text: How do we write this title vertically in TikZ - similar to vertical text (not in table)?:                        T     T        I     H        T     I  I  M  L     S  S  Y  E


title: Automatically adjusting textheight dependant on header / footer size

text: I want to have a variety of page styles used throughout my document, with different header and footer formats / content. I'm having trouble with getting the footer to not flow off the page. The work-around I have used is to set the positioning absolutely, as per example below:               \documentclass[12pt, a4paper]{article}          \usepackage{blindtext}     \usepackage{fancyhdr}     \usepackage[margin=2cm, includefoot]{geometry}          \usepackage[utf8]{inputenc}     \usepackage{lastpage}     \usepackage{mdwlist}     \usepackage{titlesec}          \fancypagestyle{firstpagestyle}     {       \fancyhf{} % clear all header and footer fields       \chead{           \LARGE \textbf{Common Header} \\           \small diff header line 1 \\            \small diff header line 2 \\           }       \cfoot{\thepage \ of \pageref{LastPage}}       \renewcommand{\headrulewidth}{2pt}            \setlength\headheight{60pt}       \setlength{\footskip}{15pt}          }          \fancypagestyle{otherpagesstyle} {       \fancyhf{} % clear all header and footer fields       \chead{           \LARGE \textbf{Common Header} \\ \small           }       \cfoot{\thepage \ of \pageref{LastPage}}       \renewcommand{\headrulewidth}{2pt}            \setlength{\headheight}{33pt}       \setlength{\footskip}{42pt}     }                    \pagestyle{otherpagesstyle}          %==============================================     \begin{document}            \thispagestyle{firstpagestyle}     %==============================================          \subsection*{Section0}     \vspace{-0.4em}       \blindtext          %==============================================          \subsection*{Section1}     \vspace{-0.4em}     \hrule     \vspace{1em}            \blinditemize       \blindtext       \blinditemize       \blindtext     %==============================================     \subsection*{Section2}     \vspace{-0.4em}     \hrule     \vspace{1em}            \blindtext       \blinditemize       \blindtext       \blinditemize       \blindtext       \blinditemize       \blindtext     \end{document}      However I'm not satisfied with this solution as it doesn't seem like it will scale well for more complicated documents, not to mention coupling between the header / footer / text area, so that a change to one will possibly require a (manually calculated) change to all. I have tried to alter the textheight attribute per pagestyle but 'firstpagestyle' doesn't seem to overload the default settings (eg `\pagestyle{otherpagesstyle}`).... Is there a neater way to do this?


title: TeX Parameter Processing imitating key-value pairs

text: I am thoroughly confused by this answer to How to generate n points on a circumference and connect all of them while having constraints on the image size as I don't understand how the parameter processing works? The macro is declared as               \def\drawconnectvertices[num vertex=#1, circle radius=#2] at (#3);{%         \pgfmathtruncatemacro\vertices{#1}         \pgfmathsetmacro\circleradius{#2}         ...     }      and is invoked as:               \drawconnectvertices[num vertex=6, circle radius=3] at (0,0);      When I read this, I see `#1` as `num vertex=6, circle radius=3`, so the `\pgfmathtruncatemacro\vertices{#1}` would be:               \pgfmathtruncatemacro\vertices{num vertex=6, circle radius=3}      and should have failed. TeX appears to be even more flexible in how you can define macros than I had though. So the question I have are:   * Is this an acceptable way to define macros? If not, how should they be defined.   * One problem is that the first parameter is not really optional. But other than that are there other issues that are lurking in this way of defining macros? ## Code:               \documentclass{article}% Extracted from http://tex.stackexchange.com/a/88312/4301     \usepackage{tikz}     \usetikzlibrary{shapes.geometric} % required for the polygon shape          \def\drawconnectvertices[num vertex=#1, circle radius=#2] at (#3);{%     \pgfmathtruncatemacro\vertices{#1}     \pgfmathsetmacro\circleradius{#2}     \pgfmathsetmacro\halfcircleradius{\circleradius/2}     \draw[blue] (#3) circle (\halfcircleradius cm) node[regular polygon, regular polygon sides=\vertices, minimum size=\circleradius cm, draw=none, name={vertex set}] {};     \foreach \x in {1,...,\vertices}{         \node[draw,circle, inner sep=1pt,blue, fill=blue] at (vertex set.corner \x) {};     }          \foreach \x in {1,...,\vertices}{         \foreach \y in {\x,...,\vertices}{                 \draw[ultra thin, red] (vertex set.corner \x)--(vertex set.corner \y);         }     }     }          \begin{document}     \begin{tikzpicture}         \drawconnectvertices[num vertex=6, circle radius=3] at (0,0);     \end{tikzpicture}     \end{document}


title: How to change the bibliography toc's number page

text: I'm trying to put a bibliography into my report this way: Here is my `.tex` code:               \documentclass[12pt,english,french]{report}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{babel} \usepackage{csquotes}% recommended in output (biblatex)      \usepackage[backend=biber, style=alphabetic]{biblatex}      \addbibresource{bibli.bib}      \usepackage{titletoc}          \begin{document}     \nocite{*}     \printbibliography     \addcontentsline{toc}{chapter}{Bibliographie}     \end{document}      snipped of the `.bib` file, which you can multiplicate until getting 3 pages of bibliography:               @book{atl1,         label       = {Tavares et al.},         author      = {Cristopher Tavares and Kirk Fertitta and Brent Rector and Chris Sells},         title       = {ATL Internals},         subtitle    = {Working with ATL 8},         edition     = {2},         publisher   = {Addison-Wesley Professional},         date        = {2006-07-15},         totalpages  = {888}         }      But doing that I get in the toc as number page 81 instead of 78, knowing that the bibliography ends at the 81th page. Thanks a lot!


title: Guaranteeing that the vertical space above and below a figure are equal

text: How do I guarantee that the vertical space above and below a figure (including the caption) are equal? The automatic [h!] placement is not doing this by default. In my particular case, it's leaving more space below the figure than above it. I understand that the spacing will never look "exactly as I want it". However, can I at least make sure that they are equal from above and below?


title: using \pgfkeys to set style parameters being passed to tkz-euclide

text: I've been using `pstricks` for a long time and feel very much at home there. But, recently I decided I want to learn `tikz` since that seems to integrate better with beamer. However, I keep running into road blocks. While the manual can be useful, it also gives me headaches for things that would be straight- forward in `pstricks` but have a completely different (and for me, non- intuitive) approach in `tikz`. For example, I want to use `pgfkeys` to set the style parameters for points: their color, their fill-color, their size. But my invocation of `\pgfkeys` seem to get ignored. I've tried various approaches. Some lead to errors and other to no effect. Here's what my first attempt at this looked like for which the desired result did not take effect.               \documentclass{article}      \usepackage[dvipsnames]{xcolor}      \usepackage{tkz-euclide}      \pagestyle{empty}     \begin{document}          I would like something that looks like:\vspace{1cm}\par     \begin{tikzpicture}[scale=0.25]          \tkzDefPoint(0,0){A}         \tkzDefShiftPoint[A](70:8){B}         \tkzDefShiftPoint[A](30:5){C}         \tkzDefShiftPoint[A](-30:10){D}         \tkzDefShiftPoint[A](-130:7){E}              %% first scope         \begin{scope}[line width=4]             \tkzDrawPoints[color=blue,fill=red](A,B,C)         \end{scope}              %% second scope         \begin{scope}[line width=2]             \tkzDrawPoints[color=red,fill=yellow](D,E)         \end{scope}     \end{tikzpicture}          Here the code is set up more along the lines of how I would like to write     it, but the results are not what I expected.\vspace{1cm}\par     \begin{tikzpicture}[scale=0.25]          \tkzDefPoint(0,0){A}         \tkzDefShiftPoint[A](70:8){B}         \tkzDefShiftPoint[A](30:5){C}         \tkzDefShiftPoint[A](-30:10){D}         \tkzDefShiftPoint[A](-130:7){E}              %% first scope         \begin{scope}[line width=4]             \pgfkeys{/drawpoint/.style={color=blue,fill=red}}             \tkzDrawPoints(A,B,C)         \end{scope}              %% second scope         \begin{scope}[line width=2]             \tkzDrawPoints[color=red,fill=yellow](D,E)         \end{scope}     \end{tikzpicture}          \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/4xPFm.png) I've tried to find an answer in the `pgfkeys` question posted here. But, I'm getting very lost and very confused.


title: 'r' rendered improperly in Devanagari ligature

text: Have bumped into a LaTeX-specific problem (on my current system at least) in typesetting Devanagari: 'r' in conjunct consonants such as 'ntrya' does not render properly (e.g., as न्त्र्य, see image below) for me using xelatex. It has rendered properly in the past, so I'm not sure what's going on. I've looked at fontspec and tried various fonts, and the problem doesn't appear in Libreoffice (I'm on Ubuntu 12.04, using texlive 2011). Sure I must be missing something silly. Here's a mwe,               \documentclass{article}     \usepackage{fontspec}     \usepackage{polyglossia}     \usepackage{geometry}     \geometry{papersize={5in,3in},total={4in,2in}}     \setmainfont[Script=Devanagari]{Sanskrit 2003}     \newfontfamily\latinfont[Script=Latin,Ligatures=TeX]{Linux Libertine O}     \setdefaultlanguage{sanskrit}     \setotherlanguages{english}     \newcommand\eng[1]{\latinfont #1}     \begin{document}     {\huge मन्त्र्यमाण \eng{--- This is not what           \bigskip          “mantryamāṇa” should look like!}}      \end{document}      which produces the image below on my machine: ![enter image description here](http://i.stack.imgur.com/ykHxl.png) Does anyone know why I'm getting this alternate form and how I can switch to the expected 'r' form? * * * Based on Jamadagni's feedback, I upgraded to TeXLive 2012 and the problem has disappeared.


title: Double line spacing, except in tables

text: Extending the question Double line spacing (as I'm new round here I don't seem to be able to comment), I'd like to use double spacing too. Except in tables, where I'd like to be able to leave that at single spacing, or specify a separate line spacing. But I have a constraint: my LaTeX is being generated from MultiMarkdown via Pandoc, and so I don't get much control over the code. I do get to insert header code before the `\begin{document}`, so these lines do take effect:               \usepackage{setspace}     \doublespacing      Is there a way of setting tables to be single spaced **in the header**? If it matters, I believe the table package used in the generated source is `longtable`.


title: Bind command to command output

text: How can I bind the command to the output of another command, determined at the time the command is bound? For example with the following code,               \newcommand{\hello}{foo}     \newcommand{\world}{\hello}     \renewcommand{\hello}{bar}     \world % outputs 'bar'      how can I modify the second line so that running `\world` after the third line executes will output `foo`?


title: Why is caron treated differently than breve

text: I'm using biblatex and wanted to add the author Kruzhkov into my Bibliography. As far as I see he is written `Kru\u{z}kov` Writing him that way leads to an error as here: inputenc Error: Unicode char \u8: not set up for use with LaTeX If I write `Kru\v{z}kov` instead everything works fine. I'm using the inputenc package with [utf8] option. Any ideas?


title: Transliteration problem with arabxetex package

text: The following code is not producing properly formatted transliteration of the arabic text. I have no trouble producing proper arabic characters with the [voc] option, but the [trans] option is not functioning: \documentclass[]{article}   \def\latexmode{memoir}   \usepackage{arabxetex}   \newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Scheherazade}   \begin{document}   \begin{arab}[trans] fI qulUbi-him wa-jawAri.hi-him   \end{arab} inline: (\textarab[trans]{fI qulUbi-him wa-jawAri.hi-him})   \end{document} Output:   _fI qulUbi-him wa-jawAri.hi-him_ inline: _(fI qulUbi-him wa-jawAri.hi-him)_ Should be something like: _fī qulūbi-him wa-jawāriḥi-him_


title: Synctex between Emacs and Evince, which would move focus for backward search

text: There is a great way to make Emacs, Evince and Synctex work together. However it has a minor caveat: when you do backward search, focus is not moved to Emacs (so you have to do that using mouse or Alt+Tab). This is a slight but nonetheless untoward problem. In Linux (which I use) there is a CLI utility called wmctrl which can be used to move focus between windows. However I don't know how to add it to the script mentioned above, so I decided to ask. (I believe the main point of this question is using Emacs Lisp so it is _less_ relevant to Ask Ubuntu).


title: Biblatex - How can I suppress some fields for multiple entry types?

text: Based on lockstep's answer here, I wrote               \ifentrytype{book,collection,incollection}{%     }{%     \clearfield{url}%     \clearfield{urldate}%     \clearfield{review}%     \clearfield{series}%     }%      to suppress the URL and its date for the listed source types. The catch is, it even suppresses the URL for @ONLINE sources now, even if I only specify one entry type. Is the code above outdated or is it due to my settings? ## Output ![enter image description here](http://i.stack.imgur.com/fY0jQ.png) ## MWE, made after musicman's answer               \documentclass{article}          \usepackage[     style=authoryear-icomp     ]{biblatex}          \AtEveryBibitem{%     \ifentrytype{book,collection,incollection}{         \clearfield{url}%         \clearfield{urldate}%         \clearfield{review}%         \clearfield{series}%%     }{}     }          \usepackage{filecontents}          \begin{filecontents}{test-lit.bib}     @book{Abook,       author = {AAAAbook, A.},       year = {2001},       title = {Alpha},       url = {tex.stackexchange.com},     }     @online{Bonline,       author = {BBBBonline, B.},       year = {2002},       title = {Bravo},       url = {tex.stackexchange.com},     }     @collection{Ccollection,         editor = {CCCCColletionEditor, C.},         year = {2002},         title = {Charlie},         url = {tex.stackexchange.com},     }     @incollection{Dincollection,         author = {DDDDincollection, D.},         year = {2002},         crossref = {Ccollection},         title = {Delta},         url = {tex.stackexchange.com},     }     \end{filecontents}          \addbibresource{test-lit.bib}          \nocite{*}          \listfiles          \begin{document}          Abc.          \printbibliography          \end{document}


title: How to set different alignment for Name/Title in ModernCV?

text: I'm trying to write my CV using ModernCV template. As you see in the picture below, the Name/Title section at the left-top of the first page in this template is **bottom-aligned** to the personal information at the right-top of the first page. ![Bottom-Alignment](http://i.stack.imgur.com/i5VYC.png) I was just wondering how is that possible to change the alignment of Name/Title to be **_top-aligned_** , or even better **_middle-aligned_** with the personal information section!? Your great help is truly appreciated. Thank you.


title: Error: multiply-defined labels

text: Below given example gives this error. ! SIAM Label Error: There were multiply- defined labels. Correct multiply-defined labels.               \documentclass[final,leqno,onefignum,onetabnum]{siamltex1213}     \usepackage{amsmath}     \usepackage{subfig}     \title{USING SIAM'S \LaTeX\ MACROS\thanks{This work was     supported by the Society for Industrial and Applied     Mathematics}}     \begin{document}     \maketitle          \section{example}          \begin{figure}[H]     \subfloat[Read Availability (13 copies)]{\includegraphics[width=3in]{readavail13.jpg}}     \label{Worst Quorum Size}     \hfil     \subfloat[Read Availability (40 copies)]{\includegraphics[width=3in]{readavail40.jpg}}     \label{Optimal Quorum Size}     \caption{Read Availability}     \label{ra}     \end{figure}               \begin{figure}[H]     \subfloat[Write Availability (13 copies)]{\includegraphics[width=3in]{writeavailthrt.jpg}}     \label{Worst Quorum Size}     \hfil     \subfloat[Write Availability (40 copies)]{\includegraphics[width=3in]{writeavailforty.jpg}}     \label{Optimal Quorum Size}     \caption{Write Availability}     \label{figsim}     \end{figure}     \end{document}       All labels defined are unique and not repeated.The **siamlatex1213.cls** file can be found at http://www.siam.org/journals/auth-info.php.


title: mathtools' \vcentcolon and fourier's utopia

text: The `mathtools` package has a centered colon, `\vcentcolon`, which is used to display the definition symbol `:=` correctly. However when using the `fourier` package, I get the following output ![enter image description here](http://i.stack.imgur.com/JFj6s.png) from               $:\vcentcolon=$      where I have added a normal colon as comparison. The second colon is slightly adjusted, but not entirely centered upon the `=`. How do I get `\vcentcolon:` right?


title: How can I highlight keywords with special characters or numbers in them?

text: In the following MWE the declared keywords `te-st` and `999` are not highlighted as expected:               \documentclass{scrartcl}     \usepackage{listings,xcolor}     \lstdefinelanguage{mylang}{keywords={test,te-st,999,xyz},keywordstyle=\color{red}}     \begin{document}     \begin{lstlisting}[language=mylang,basicstyle=\ttfamily]     abc test      def te-st     ghi 999     jkl xyz     \end{lstlisting}     \end{document}      ![enter image description here](http://i.stack.imgur.com/u577Z.png) How can I define keywords like `999` or `te-st`?


title: Drawing edges of a pentagonal pyramid in tikz

text: I want to draw lines between v_2,...,v_6 and from v_1 to all the other points (a pyramid). This is how far I got:               \documentclass{article}     \usepackage{graphics, tikz, tkz-berge}     \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}[scale=1,transform shape]       \tikzstyle{LabelStyle}=[fill=white,sloped]       \Vertex[x=0,y=0]{$v_2$}       \Vertex[x=3,y=0]{$v_3$}       \Vertex[x=4,y=1.5]{$v_4$}       \Vertex[x=1.5,y=2.5]{$v_5$}       \Vertex[x=-1,y=1.5]{$v_6$}       \Vertex[x=1.5,y=4.5]{$v_1$}     \end{tikzpicture}     \caption{Graph}     \end{figure}     \end{document}      It produces the following graph: ![Graph](http://i.stack.imgur.com/ScOKe.png) Which is almost okay, but I can't seem to add edges. I tried to add `\Edge[]($v_1$)($v_2$)` to the code but that gives me the error 'paragraph ended before parse was completed'. Apparently the problem has something to do with the `$v_i$` because the code runs if I delete the dollar signs.


title: Add additional page number, from original work, in margin

text: In this beautiful example from frabjous the original page numbers from the source is place in the margin (below is a screenshot of page 8, which is page 9 and 10, marked by a red marker in the text, in the original) ![some of page 9 and 10 of Bertrand Russell Introduction to Mathematical Philosophy](http://i.stack.imgur.com/QrXoD.png) frabjous has made a very beautiful website where the code is available, but the specif code to make the original page numbers in the margin is quite elaborate. Does anyone here know if there is a package to do this or maybe an easier solution the the one used by frabjous?


title: vertical equal sign

text: I am looking to create a vertical equal sign that might function similarly to an underbrace. I often use this symbol when taking notes on paper.                (x+z) + (y+d) = 10       ||      ||        5       5      The alignment is not entirely perfect in this example but I believe the idea comes across.


title: Why has m/s changed in siunitx package?

text: I would have expected `\meter\per\second` to generate an output `m/s`. But when using the package `siunitx` the output is similar to ms^-1. I referred the documentation for the package and there too the latter is presented. What may be the reason for this? Do SI standards recommend it that way? Is the simple `m/s` obsolete?


title: Sublime Text 2 Snippet escaping backslash

text: I'm trying to set up a snippet for building a set with appropriate spacing. I want the snippet to generate the following markup when I type "set" + TAB:               \{ \, content here \, \}      I have the following snippet:               <snippet>     <content><![CDATA[     \{\, ${1} \,\}     ]]></content>     <tabTrigger>set</tabTrigger>     </snippet>      However, this produces the following:               {\,  \,}      It's escaping the first backslash and the last one. Any ideas on how to prevent this?


title: Two code blocks working syncronously

text: I need two code blocks in my `beamer` `frame`. One will be the code and other will be the output for each line of code. I want to uncover each code line and corresponding output line. So, first it will show               code 1 line 1     code 1 line 2                         output 1      and then               code 1 line 1     code 1 line 2     code 2 line 1     code 2 line 2                    output 1     output 2      I cannot use `semiverbatim` because I need code formatting. Here is my code:               \documentclass{beamer}     \usepackage{listings} %for listings of the source code          \lstset{basicstyle=\ttfamily}          \begin{document}          \lstset{language=sh}     \begin{lstlisting}     code 1     code 2     code 3     \end{lstlisting}          \begin{lstlisting}     output 1     output 2     output 3     \end{lstlisting}          \end{document}      Any ideas? Only solution I could think of is, adding each code line into a separate `savebox` and then animating each `savebox`.


title: Blank page before TikZ family tree picture

text: I drew a family tree using TikZ with the positioning library, following in the footsteps of Gonzalo. The problem is that there is a blank page generated before the family tree. Can anyone explain why it is there and how to get rid of it? I've tried fiddling with the code to shrink the tree with no success. I put a bounding box around the figure, but the box is on the same page. I've left out the connecting edges for brevity. It is still quite long. If necessary I could probably strip it down further, but if I do, this also increases the risk that a fix may not work on the actual example. @DavidCarlisle suggested the workaround               \setlength{\textheight}{.8\maxdimen}      This suppresses the blank page, but also suppresses any additional pages.               \documentclass{article}     \usepackage{tikz}     \usepackage{standalone}     \usetikzlibrary{positioning}     \setlength{\oddsidemargin}{-0.6in}     \setlength{\evensidemargin}{-0.10in}     \setlength{\topmargin}{-0.5in}     \setlength{\headsep}{0.0in}     \pagenumbering{gobble}     \begin{document}          \tikzset{     every node/.style={rectangle,draw,minimum height=3em,text width=2.0cm},     female/.style = {fill=red!20, rounded corners},     male/.style = {fill=blue!20},     neutral/.style = {fill=green!20}     }     \begin{tikzpicture}[node distance=8pt and 33pt]          % GEN 1          \node[female] (Female1) {Female1};     \node[male,below=of Female1] (Male1) {Male1};          % GEN 2           \node[female,above right=of Female1, yshift=5cm] (Female2) {Female2};      \node[female,below=of Female2, yshift=-2cm] (Female3) {Female3};      \node[male,below=of Female3, yshift=-2cm] (Male2) {Male2};      \node[male,below=of Male2, yshift=-2cm] (Male3) {Male3};      \node[female,below=of Male3, yshift=-4cm] (Female5) {Female5};           % % GEN 2 SPOUSES           \node[male,above=of Female2] (Male4) {Male4};      \node[male,above=of Female3] (Male5) {Male5};      \node[male,above=of Male2] (Male2-wife) {Wife};      \node[female,above=of Male3] (Female6) {Female6};      \node[male,below=of Female5] (Male6) {Male6};          % GEN 3           \node[female,above right=of Female2, yshift=4cm] (Female7) {Female7};      \node[male,below=of Female7, yshift=-1.5cm] (Male7) {Male7};      \node[female,below=of Male7, yshift=-1cm] (Female8) {Female8};      \node[male,below=of Female8, yshift=-1cm] (Male8) {Male8};      \node[male,right=of Female3] (Female9) {Female9};           \node[female,above right=of Male3, yshift=4cm] (Female10) {Female10};      \node[female,below=of Female10, yshift=-3cm] (Female11) {Female11};      \node[male,below=of Female11, yshift=-1.5cm] (Male9) {Male9};      \node[male,below=of Male9, yshift=-0.5cm] (Male10) {Male10};           \node[male,right=of Male6] (Male11) {Male11};           % GEN 3 SPOUSES           \node[male,above=of Female7] (Male12) {Male12};      \node[male,below=of Female7] (Female7-husband) {husband};      \node[male,below=of Female10] (Male13) {Male13};      \node[male,above=of Female11] (Male14) {Male14};      \node[male,below=of Female11] (Male15) {Male15};      \node[female,below=of Male10] (Female12) {Female12};          % GEN 4           \node[female,right=of Male12] (Female7-daughter1) {daughter};      \node[female,below=of Female7-daughter1] (Female7-daughter2) {daughter};      \node[male,right=of Female9, yshift=0.5cm] (Male16) {Male16};      \node[male,right=of Female10, yshift=0.5cm] (Male17) {Male17};      \node[female,below=of Male17] (Female18) {Female18};      \node[male,right=of Male14, yshift=1cm] (Male18) {Male18};      \node[female,right=of Female11, yshift=0.1cm] (Female19) {Female19};      \node[male,right=of Male15] (Male19) {Male19};      \node[female,right=of Male10, yshift=0.5cm] (Female20) {Female20};      \node[male,below=of Female20] (Male20) {Male20};           % GEN 5           \node[male,right=of Male20, yshift=1cm] (Male20-son1) {son};      \node[male,below=of Male20-son1] (Male20-son2) {son};      \node[male,below=of Male20-son2] (Male20-son3) {son};      \node[female,below=of Male20-son3] (Male20-daughter1) {daughter};          \end{tikzpicture}     \end{document}      UPDATE: Thanks to Harish and Gonzalo for the solutions. They both work, and it was difficult to pick one, but I liked the simplicity of `\usepackage[a4paper,margin=1in]{geometry}`, so I'm currently using that.


title: How to fix the chapter title and number using libertine font?

text: I came across this chapter style and borrowed the code (see MWE below). The original code was using the font `pbk`; I want to use the `libertine` instead, since it is the font used throughout the thesis. When I use the `libertine` the title font becomes thin, I want it to be thicker like the one by `pbk` or similar or: _How to make chapter title and number look nicer using libertine?_ **MWE Code**               \documentclass{scrreprt}     \usepackage{lipsum}     %\usepackage{libertine}     \usepackage{tabularx}     \usepackage{xcolor,fix-cm}     \definecolor{numbercolor}{RGB}{150,20,0}          \makeatletter     \renewcommand\chapterheadstartvskip{\vskip50pt}          \newcommand\chaptitlefont{%       \fontfamily{pbk}\fontseries{b}%       \fontshape{n}\fontsize{25}{35}\selectfont\raggedright}          \newcommand\chapnumfont{%       \fontfamily{pbk}\fontseries{bd}\fontshape{n}%       \fontsize{1in}{0in}\selectfont\color{numbercolor}}          \renewcommand\chapterheadendvskip{\par\vskip2mm\hrule\vskip40pt}          \renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip       {%         \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%         \normalfont\sectfont\nobreak\size@chapter{}%         \if@chapterprefix           \let\@tempa\raggedsection         \else           \let\@tempa\@hangfrom         \fi         \@tempa{\ifnum \c@secnumdepth >\m@ne%               \if@chapterprefix                 \expandafter\size@chapterprefix               \else                 \expandafter\size@chapter               \fi               \if@chapterprefix                 \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip               \fi           \fi         }%     \begin{tabularx}{\textwidth}{Xl}     {\parbox[b]{\linewidth}{\chaptitlefont #1}}     & \raisebox{-15pt}{\chapnumfont\thechapter}%     \end{tabularx}%      \nobreak\chapterheadendvskip     }%     }     \renewcommand*{\@@makeschapterhead}[1]{%       \chapterheadstartvskip%       {\normalfont\sectfont\nobreak\size@chapter{}%         \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%         \raggedsection \interlinepenalty \@M      \begin{tabularx}{\textwidth}{X}%     {\parbox[b]{\linewidth}{\chaptitlefont #1}%     \vphantom{\raisebox{-15pt}{\chapnumfont 1}}}     \end{tabularx}%     \par}%       \nobreak\chapterheadendvskip%     }     \makeatother          \begin{document}     \tableofcontents     \chapter{Introduction}     \lipsum[1]     \chapter{Materials \& Methods}     \lipsum[2]     \chapter*{Curriculum Vitae}     \end{document}      **Output: PBK**   ![enter image description here](http://i.stack.imgur.com/1YVEl.png) **Output: Libertine**   ![enter image description here](http://i.stack.imgur.com/8YwPI.png)


title: Align multiple equations under longer equation

text: I want to do what this MWE would do if the `hspace{-1in}` actually moved that second alignment column to the left, underneath the big quadratic formula. ![enter image description here](http://i.stack.imgur.com/PuGKD.png)               \documentclass{article}          \usepackage{amsmath}          \begin{document}         \begin{alignat*}{2}             x &= \frac{-(-13) \pm \sqrt{(-13)^2 - 4(7)(0)}}{2(7)}\\               &= \frac{13 \pm \sqrt{169}}{14}\\               &= \frac{13 + 13}{14}& \hspace{-1in} &\phantom{=} \frac{13-13}{14}\\               &= \frac{26}{14}& &= \frac{0}{14}\\               &= \frac{13}{7}& &= 0         \end{alignat*}     \end{document}      I'm trying to get rid of the unnecessary white space, and both equations in the third line are solutions of the equation in the first line, so it makes sense to have them underneath. But I still want the left one aligned vertically with the first two equal signs and the second one aligned vertically. Any ideas?


title: XeTeX kerning with \newunicodechar

text: Am using Adobe Garamond Pro and need the two characters ʾ and ʿ that do not exist in that font. I have solved this by rotating ˘ 90 degrees either direction and making these new unicode characters with `newunicodechar`. This way I can type ʿ and ʾ directly in the source code to get the right output. Now, these characters are quite odd and need some adjusted kerning. I want to do this with `\XeTeXinterchartoks`. The problem is that this does not work with the newly created characters. Why is that and is there a workaround?               \documentclass{article}     \usepackage{fontspec}     \usepackage{newunicodechar}     \setmainfont{Adobe Garamond Pro} %substitute as desired          % make new character     \newunicodechar{ʾ}{\rotatebox[origin=center]{90}{˘}\hspace{-1.2ex}}          % (absurly large) kerning     \XeTeXinterchartokenstate=1     \newXeTeXintercharclass\dia     \XeTeXcharclass `\ʾ=\dia     \newXeTeXintercharclass\el     \XeTeXcharclass `\l=\el     \XeTeXinterchartoks \el \el {\kern 1em}     \XeTeXinterchartoks \dia \el {\kern 1em}               \begin{document}          \Huge     llʾllll     \end{document}      ![enter image description here](http://i.stack.imgur.com/ATgJL.png) Bonus question: Is there a way to rotate only the glyph ˘ and not the space below it?


title: TikZ legend changes the line legend into a rectangle legend

text: I am using TikZ to insert MATLAB figures but the problem is that I have two legends one is a line and the other is a rectangle. When I insert it, both look like a rectangle. How should I correct it ?


title: How to label specific words as in a diagram

text: I would like to add descriptions to specific words as in `ls` and `foo.bar` in the image below. ![enter image description here](http://i.stack.imgur.com/lOZm7.jpg)


title: Drawing SQL tables

text: I'd like to draw SQL tables, some example content and relations between the id's. Output should be something like below, without the contents. ![Relational model](http://i.stack.imgur.com/OhudL.jpg) Could you help me with a head start here? Is there any libraries for this already?


title: Place two algorithm into two column

text: I have single column page. I would like to add my two algorithm into two column. How can I do this? My algorithms are below.               \begin{algorithm}[h]     \caption{Resolve 1}     \begin{algorithmic}     \scriptsize     \STATE $ P_i $ sends $ id,t_1,t_2,P_j,h_j $ to TTP where $ P_j $ is the party that does not send $ V_j^{(2)} $ to $ P_i $, TTP does the following and sends the returned message to $P_i$:          \IF{$ currenttime > t_1 $}     \STATE \textbf{send} $ msg $ ``Abort Resolve 1"     \ELSE     \IF { Search($ id, t_1, t_2 $) == NULL }         \STATE \lst = Create($ id, t_1, t_2 $)          \STATE \slst = Create($ id, t_1, t_2 $)         \STATE \lst.add($ P_i, (P_j,h_j) $)          \STATE \textbf{send} $ msg $ ``Come after $ t_2 $"     \ELSE          \STATE \lst.add($ P_i, (P_j,h_j $))          \STATE \textbf{send} $ msg $ ``Come after $ t_2 $"     \ENDIF       \ENDIF       \end{algorithmic}       \end{algorithm}          \begin{algorithm}[h]     \caption{Resolve 3}     \begin{algorithmic}     \scriptsize     \STATE $ P_i $ comes either to receive decryption of a $ \{V^(2)_t\}_{t \in M} $ where $ M \subseteq N $ or his desired decryption shares from TTP's record.     \STATE $ condition $  =  \lst.isEmpty()     \IF {$ condition $ is false }     \STATE \textbf{send} msg ``Protocol is aborted"     \ELSE     \IF {$ P_i $ give $\{V^(2)_t\}_{t \in M} $}         \FORALL {$ t $ in $ M $}             \STATE \textbf{send} Decrypt($ sk, V^(2)_t $)         \ENDFOR      \ELSE          \FORALL {$ t $ in $ \slst $ as $ (P_i, shares_t) $}         \STATE \textbf{send} $ shares_t $         \ENDFOR     \ENDIF     \ENDIF          \end{algorithmic}     \end{algorithm}


title: Extensible \rightrightharpoons and \leftleftharpoons

text: How to achieve extensible double-harpoons in the style of the `\xleftrightharpoons` family of arrows from `mathtools`, but with both harpoons pointing in the same direction? ![enter image description here](http://i.stack.imgur.com/j6xUz.png) Preferably without Tikz.


title: Split environment not vertically centering equation number

text: I'm trying to compile the following code:               \documentclass{article}     \usepackage{amsmath}          \newcommand{\invexpsqrt}[1]{{#1}^{- \tfrac{1}{2}}}          \begin{document}     \begin{align}     \begin{split}     \rho_{out} &= \exp \left[ - \frac{1}{2} \left( x \cdot \gamma \cdot x + x' \cdot \gamma \cdot x' \right) + x \cdot \beta \cdot x' \right] \\     &= \exp \left[- \frac{1}{2} \left( V \gamma_D^{-\tfrac{1}{2}} y V^T \gamma_D V V^T \gamma_D^{- \tfrac{1}{2}} y + V \invexpsqrt{\gamma_D} y' V^T \gamma_D V V^T \invexpsqrt{\gamma_D} y' \right) \right. \\     &\qquad \qquad \left. + V \invexpsqrt{\gamma_D} y \beta V^T \invexpsqrt{\gamma_D} y' \right] \\     &= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \left( \invexpsqrt{\gamma_D} V \beta V^T \invexpsqrt{\gamma_D} \right) \cdot y' \right] \\     &= \exp \left[ - \frac{1}{2} \left( y \cdot y + y' \cdot y' \right) + y \cdot \beta' \cdot y' \right]     \end{split}     \end{align}     \end{document}      to get a single, vertically centered equation number. However, my output comes out like this: ![Misaligned equation number](http://i.stack.imgur.com/AhbZl.jpg) I have tried replacing the align environment with the equation environment and using \aligned within \equation. All of these yield the same result. Is there a command in my code that messes up the alignment, or is this problem caused by my compiler? **Edit:** I just noted that another piece of code like this in the same file does not produce the same problem. Could it be that the second line of equations is too wide and therefore 'pushes' the numbering down?


title: When do variables in classes get evaluated?

text: I am developing a non-trivial class that is fairly large and complex. So far, everything has worked the way I designed it to be. I apologize ahead of time as I cannot provide a MWE as my question is more conceptual than anything else. I am using the package etoolbox to do evaluations of boolean and other flags. Earlier, I had run across a stackexchange thread that describes how one might have different fancyhdr styles for different pages. I went ahead and defined a couple of `\fancypagestyle` styles (briefly: one style for first page, contains a header and a footer, while the other (for all other pages) contains only a footer). I placed the following code snippet in my class file:               \pagestyle{fancy}     \ifnumcomp{\value{page}}{=}{1}{\settoggle{isfirstpage}{true}}{\settoggle{isfirstpage}{false}}     \iftoggle{isfirstpage}{\thispagestyle{firstpageform}}{\thispagestyle{otherpageform}}      Now, I find that the page style corresponding to `firstpageform` gets applied to the first page correctly. However, for the second page in the two page document I have, no fancy page style is applied! I have the `\maketitle` fix in place: \g@addto@macro{\maketitle}{\thispagestyle{fancy}} Before I defined these styles (with the above `\maketitle` fix in place), I was getting headers and footers on every page. Basically, I had `\lhead` and `\rhead` directives in place immediately after the `\pagestyle{fancy}` without any distinction of which page number I was on. So, when is the `\ifnumcomp` above being computed? Is it automatically recomputed when the second page is created internally? If not, how do I make sure it provides values corresponding to the current value of `page` counter? Sorry, once again - an MWE is impossible and does not make sense. Further, my class file has nearly 3000 lines, and it contains some information specific to my University that I do not have the right to distribute.


title: Evince keep position like xdvi

text: One feature I miss from the dvi days is the ability to keep position from page to page that xdvi has, > -keep (.keepPosition) Sets a flag to indicate that xdvi should not move to > the home position when moving to a new page. See also the `k' keystroke. > This flag is honored by all page switching actions and by up-or-previous() / > down-or-next(), although the latter only honor the horizontal postion, not > the vertical one. This allows for a "continuous" scrolling back an forth > through a document with a display window narrower than a page width. I can find no equivalent in Evince (or other PDF viewer). Is there any such feature, and if so, how do I invoke it? Added: I found this feature request which is basically asking for the same thing. It is apparently unanswered.


title: Using footnotebackref with hyperref option "hidelinks"

text: If you use the package `footnotebackref` with `hyperref`'s package option "hidelinks" you will get an option clash error, and the hidelinks option with be disregarded. Is there any way to hidelinks while using package `footnotebackref`?               \documentclass{article}     \usepackage[symbol=$\uparrow$]{footnotebackref}     \usepackage[hidelinks]{hyperref}          \begin{document}          This is a statement.\footnote{And it is supported by this footnote.}          \end{document}


title: Caption with math gives undefined control sequence

text: I'm trying to include a caption for a figure with two subfigures with quite some math. However, I get: > Undefined control sequence I've tried to replace the the `$` with `\begin{math}` and `\end{math}` but that only gave the error: > Argument of \@caption has an extra }.               \documentclass{report}     \usepackage[english]{babel}     \usepackage[superscript]{cite}     \usepackage{fixltx2e}     \usepackage{mathtools}     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{caption}     \usepackage{subcaption}     \usepackage[export]{adjustbox}     \usepackage{gensymb}     \usepackage{tabulary}     \usepackage{hyphenat}     \usepackage{bbm}          \begin{document}          \begin{figure}[!h]             \centering             \begin{subfigure}[t]{0.45\textwidth}                     \centering                     \includegraphics[width=\textwidth,valign=t]{ResultsFlapWinglets}             \end{subfigure}             \begin{subfigure}[t]{0.45\textwidth}                     \centering                     \includegraphics[width=\textwidth,valign=t]{ResultsFlapFences}             \end{subfigure}     \caption{The experiments have been carried out with freestream velocity $u = 30 m/s$,      angle of attack $\alfa = 10\degree$ and flap deflection $\delta_{f} = 32\degree$.}     \label{fig:FenceResults}     \end{figure}          \end{document}


title: combine enumeration of chapters

text: at the beginning of one part of my document I've got a tabular with some values and in the chapters afterwards I'll explain them. Some values need to be combined; so the chapters have to be enumerated eg. that way:               1. A     2. B     3. - 5. C     6. - 7. D     8. E      I think of something like defining an alternate chapter-command `\chapterA`. For instance:               \chapter{A}     \chapter{B}     \chapterA{3}{C} % combine 3 values     \chapterA{2}{D} % combine 2 values     \chapter{E}      What does this command have to look like? I found this but couldn't manage to apply it to the `\chapter` command.


title: Using Metapost inline in LaTeX (no ConTeXt)

text: When I was more active in LaTeX and Metapost (~10 years ago) I could not find a way to directly use Metapost in LaTeX. There were few tutorials on how to use it within ConTeXt, but for using it with LaTeX you had to make the .mp file separate, compile it into .ps or .pdf and then add the .ps (for latex → dvi → ps) or .pdf (for pdflatex → pdf) using the graphix package. I am currently seeing many questions related to TikZ, and most examples use TikZ within LaTeX. So. Are there current tools to use the Metapost language within LaTeX without using a separate source and a separate compilation?


title: How to make a table look nicer

text: I am currently working on my master thesis and my tables which are used as a type of matrix simply look awful. How can i make them look much better?               \begin{table}[H]         \centering         \begin{tabular}{c|c|c|c|c}             &\textgreater& =+ & =- & \textless \\             \hline             \textgreater & 1 & 0 & 0 & -1 \\             \hline             =+ & 0 & 1 & 0 & 0 \\             \hline             =- & 0 & 0 & 1 & 0 \\             \hline             \textless & -1 & 0 & 0 & 1 \\             \hline         \end{tabular}     \end{table}      ![enter image description here](http://i.stack.imgur.com/XJbTp.png)


title: Cannot see special character

text: \documentclass[11pt,table,a5paper]{article}       \usepackage[top=2cm, bottom=2cm, outer=2.1cm, inner=1cm,twoside, headsep=26pt]{geometry}       \usepackage{collcell}       \begin{document}           20 µg/mL       \end{document}      In the above example mu is not visible. How can i fix this error?


title: hyperref trouble with natbib citation inside of tabular

text: I'm using `latex`->`dvips`->`ps2pdf` to create pdf documents. Using `natbib`'s `\cite` command inside of a `tabular` environment, I run into trouble that `hyperref` does not creates a box reference around the citation but only "underlines" it. Without `natbib` everything works fine. `pdflatex` also works fine. Even outside of `tabular` `natbib` works fine. What could be the reason for this strange behavior?.. Here a minimalistic example:               \documentclass{article}          \usepackage{hyperref}     \usepackage[numbers]{natbib}               \begin{document}          \cite{miranda:1999:3581}     \bigskip          \begin{tabular}{|c|}         \hline         \cite{miranda:1999:3581}\\         \hline     \end{tabular}          \bibliography{papers_litstudy_diplexer}     \bibliographystyle{plain}               \end{document}      Output: ![LaTeX output](http://i.stack.imgur.com/fkKEO.png)


title: LyX: set width of image to 100% of page width

text: When I insert an image into LyX and set it to 100% page width, its left side is not at the farthest most edge of the left page. Instead it starts where the text margin is, and since it's too large to display, it cuts off on the right. Is there a way to set a different margin for figures than that of the text?


title: What kind of symbol is that?

text: ![enter image description here](http://i.stack.imgur.com/wWdgR.jpg) I could not find the yellow marked symbols with Detexify, nor in the Comprehensive LaTeX symbols list. Are these symbols even supported by latex?


title: Grepping through an entire texmf tree

text: I always forget the syntax of command-line tools for searching through multiple files. What's the easiest/fastest way to search through, say, all of the `.sty` files distributed in TeX Live for the occurrence of a string, say, `\everypar`? (Let's assume Linux/Mac OS X.)