title: asymptote.sty not found

text: Running a sample code with `\usepackage{asymptote}`, I get `asymptote.sty` not found. I have installed ProTeXt which installed MikTeX 2.9. Now, to resolve this issue, I installed `asypictureb` package the definiton given as `User- Friendly Integration of Asymptote into LaTeX` by MikTeX Package Manager (I couldn't find a package named asymptote). Even after installation and rebuilding the system, I get the same error. What should I do? The Code:               \documentclass{standalone}     \usepackage{asymptote}          \begin{document}          \begin{asy}[width=10cm,height=10cm]     import three;          currentprojection=perspective(300,-650,500,center=true);               // define two types of ions     surface iona = scale3(20)*unitsphere;     surface ionb = scale3(25)*unitsphere;          // surface properties and color of the ions     material White = material(diffusepen=gray(0.4),emissivepen=gray(0.6));     material Red = material(diffusepen=red,emissivepen=lightred);          // style of lines connecting ions     pen thick=linewidth(2);          for(int x=-1; x<2; ++x) {       for(int y=-1; y<2; ++y) {         for(int z=-1; z<2; ++z) {           draw(shift(100*(x,y,z))*iona,White);         }       }     }          for(int x=-1; x<2; ++x) {       for(int y=-1; y<2; ++y) {         for(int z=-1; z<2; ++z) {           if(x<1) draw(100*(x,y,z)--100*(x+1,y,z),thick);           if(y<1) draw(100*(x,y,z)--100*(x,y+1,z),thick);           if(z<1) draw(100*(x,y,z)--100*(x,y,z+1),thick);         }       }     }          for(int x=-1; x<2; x+=2) {       for(int y=-1; y<2; y+=2) {         for(int z=-1; z<2; z+=2) {           draw(shift(50*(x,y,z))*ionb,Red);         }       }     }     \end{asy}          \end{document}


title: abntex and hyphenat problems in url formatting

text: **Problem** I would like to disable all hyphenation within the document, but I want the bibtex URL entries to be properly hyphenated, and also properly linked according to the `hyperref` package. Because of this I'm having some issues using `abntex` bibliography formatting with the `\usepackage[none]{hyphenation}` call. **Example** This bibtex entry:               @ARTICLE{Engelhardt2008,       author = {Sebastian Engelhardt},       title = {The Economic Properties of Software},       journal = {Jena Economic Research Papers},       year = {2008},       volume = {45},       url = {http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jportal_derivate_00119979/wp_2008_045.pdf}     }      Placed in a document like this:               \documentclass{abnt}     \usepackage[brazilian]{babel}     \usepackage[utf8]{inputenc}     \usepackage{makeidx}     \usepackage{hyperref}     \usepackage{abnt-UFPR}     \usepackage{abntcite}     \usepackage[none]{hyphenat}          \begin{document}       \sloppy       \cite{Engelhardt2008}       \bibliography{test.bib}     \end{document}      Will make `abntex` format the following bibitem:               \bibitem[Engelhardt 2008]{Engelhardt2008}     \abntrefinfo{Engelhardt}{ENGELHARDT}{2008}     {ENGELHARDT, S. The economic properties of software.     \emph{Jena Economic Research Papers}, v.~45, 2008.     Dispon{\'\i}vel em:       \htmladdnormallink{$<$http:\-/\-/zs\-.thulb\-.uni-jena\-.de\-/servlets\-/MCR%     FileNodeServlet\-/jportal\underline{\ }derivate\underline{\       }00119979\-/wp\underline{\ }2008\underline{\       }045\-.pdf$>$}{http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jport%     al_derivate_00119979/wp_2008_045.pdf}.}      **Output** That looks like this in the A4 page: ![wrong bibitem formatting](http://i.stack.imgur.com/zC4GQ.jpg) If I remove `\usepackage[none]{hyphenat}` from the preamble, this same entry will have the desired formatting, but the whole text will be hyphenated. ![right bibitem formatting](http://i.stack.imgur.com/tIlo7.jpg) **Workarounds Tried** Using `\usepackage[hyphens]{url}` will output this on compilation:               ! LaTeX Error: Option clash for package url.      I could also use just `\usepackage{url}` and change all my bibtex entries `url` params to:                note = {Disponível em: $<$\url{http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jportal_derivate_00119979/wp_2008_045.pdf}$>$}      But I really wouldn't like to do this, as I'm using a bibliography manager to generate the `.bib` file.


title: How to align two plots horizontally

text: I want to align these two plots horizontally:                \begin{tikzpicture}             \begin{axis}[                 xmin=1995,                 xmax=2010,                 ymode=log,                 xtick={1975,1980,...,2015},                 x tick label style={/pgf/number format/1000 sep=},                 xlabel={Year},                 ylabel={Cost of gene synthesis $(\$/base$)},             ]                 \addplot coordinates {(1998,30) (2001,15) (2002,10) (2003,5) (2006,0) (2007,0.7)};             \end{axis}         \end{tikzpicture}      and               \begin{tikzpicture}             \begin{axis}[                 xmin=1975,                 xmax=2010,                 ymode=log,                 xtick={1975,1980,...,2015},                 x tick label style={/pgf/number format/1000 sep=},                 xlabel={Year},                 ylabel={Length in base pairs},             ]                 \addplot coordinates {(1978,207) (1990,2100) (1995,2700) (2003,7500) (2005,14600) (2006,32000) (2009,583000)};             \end{axis}         \end{tikzpicture}      I tried to use `\subfigure` but without success.


title: Unnumbered sections appearing in TOC in REVTeX 4.1

text: I'm having a problem with REVTeX adding unnumbered sections to my TOC. Here's a small example:               \documentclass[]{revtex4-1}     \usepackage{lipsum}          \begin{document}          \tableofcontents     \newpage          \section{Numbered section}     \lipsum     \section*{Unnumbered section}     \lipsum          \end{document}      Outputs the following: Contents page: ![Contents page](http://i.stack.imgur.com/CMnrw.png) Body: ![Sections](http://i.stack.imgur.com/D4Kgx.png) Is this a bug? Is there a problem with my installation? The unnumbered sections are not there if I use a different document class (e.g. article).


title: How to put white space under header in theorem environment

text: Ok, I am pretty new with latex so maybe this is a basic question. I am writing in theorem environment and I want to produce only white space under my theorem header, with the text continuing right after it, but the text goes automatically under the header. any help?


title: Bibtex Key definition

text: I only recently started using Latex for my university documents and for my current one I am using a template provided by them. I am using bibtex to manage my sources. Here is an example bibtex-entry:               @misc{webpage1,        shorthand = {CompanyName},        author = {Company Name Ltd.},        title="The company's webplatform",        howpublished = "\url{http://company.com/}",        lastchecked = {01.01.2013},        year = 2013     }          @misc{webpage2,        shorthand = {OtherCompanyName},        author = {Some other Company Name Ltd.},        title="Another company's webplatform",        howpublished = "\url{http://other-company.com/}",        lastchecked = {01.01.2013},        year = 2013     }      In my Latex document I use the following code to create a bibliography:               \bibliography{references}    % this causes the references to be listed (file: references.bib)     \bibliographystyle{alpha}      My problem is now that when I compile my document, the result is that the bibliography has the following format:               [Ltd13a] Full Company Name Ltd.     [Ltd13b] Some Other Company Name Ltd.      I already tried putting a comma between the name and the Ltd. like so:               author = {Company Name, Ltd.}      but this results in this               [FC13a] Ltd. Full Company Name      I have read that shorthand is supposed to help, but I did not succeed.


title: Listings package and BigInteger Library Conflict?

text: In my java code, I have extensively used the variables and methods from the `BigInteger` library. In LaTeX, in order to display my code neatly, I have used `listings` package. So between the `\begin{lstlisting}` and `\end{lstlisting}` I paste the aforementioned java code. But I am not able to compile it in TexStudio because anywhere I've used the methods from the `BigInteger` library, i get an error. However, if I have a java code that doesn't use the BigInteger library, it gets compiled properly in TexStudio without any errors. I have TexStudio for creating my LaTeX documents. Is there anyway to circumvent this issue?


title: How do I set default settings for all program listings in a Lyx document?

text: I know that I can change the language, placement, and highlighting details of a listing in `Settings`. How do I set the default settings for all listings?


title: How do I change the subsection by Roman letter to number in Lyx?

text: I am using one IEEE template to write one two column paper, after converted into pdf format, the subsection is identified with Roman letters, such as I, II, III, IV, etc. I want to change it to numbers like: 1, 2, 3, 4, etc. How can I do that?


title: Macro to retrieve the real name of the source file if pdflatex is invoked with -jobname

text: > **This question led to a new feature in a package:**   >  As of version 0.6 `currfile` supports the requested feature via a new > package option and the `-recorder` compiler switch. For details, see > Martin's answer below. From the documentation I assumed that Martin Scharrer's `currfile` package would do this. However, while it deals well with tracking the actual file name over `\input`s and `\include`s, the name of the main `.tex` file is still set to `\jobname`:               \documentclass{article}     \usepackage{currfile}          \begin{document}       I was compiled as job \texttt{\jobname} from the file \texttt{\currfilename}.     \end{document}      If saved as `test.tex` and compiled with `pdflatex -jobname bla test.tex` the output is: ![enter image description here](http://i.stack.imgur.com/ffZPj.gif) Even compiling with `pdflatex -jobname bla "\input{test.tex}"` does not change the output.


title: How can I get the style alpha.bst sorted as plain.bst in Bibtex?

text: I like alphanumerical citations written as in `alpha.bst` style, with initials of authors and years, but I would like references to appear sorted as in `plain.bst` style. As an example, I prefer the order > [BN07] M. Baker and S. Norine (2007)...   >  [Blo07] S. Bloch (2007)...   > to > [Blo07] S. Bloch (2007)...   >  [BN07] M. Baker and S. Norine (2007)...   > Then I would like to know how to modify the `*.bst` file in order to get what I want.


title: Watermark for table row

text: I have a `longtable` with some columns, all of fixed with (e.g. `p{3cm}`), so all rows are of the same known width. I want to add a textual watermark (like "New") behind _some_ rows. Of course the rows can have different heights; the watermark should be horizontally and vertically centered. How can I achieve this?


title: Are the datetime package and the memoir class known to conflict?

text: Using the `\formatdate` macro from the `datetime` package within a `\date` definition seems to break when using the `memoir` class. Is this just something strange that I'm doing because it seems reasonable. A minimal example of this is:               \documentclass{memoir}     \usepackage{datetime}     \title{Dummy}     \date{\formatdate{1}{1}{2001}}     \begin{document}     \maketitle     \end{document}      causes pdflatex to complain saying:               Package fmtcount Warning: \ordinal already defined use \FCordinal instead. on input line 430.          (/usr/local/texlive/2012/texmf-dist/tex/latex/fmtcount/fc-english.def))))     ! Incomplete \iffalse; all text was ignored after line 4.      I'm obviously doing something more complicated in reality and can work around this bug, but it's a bit unexpected!


title: How to add a condition in \tikzset?

text: I am trying to make some modification on the answer of Andrew Stacey of my previous question "A macro of drawing a rectangle with several parameters in TikZ". The current code is the following:               \documentclass{article}     \usepackage[frenchb]{babel}     \usepackage{tikz}     \usetikzlibrary{fit}          \tikzset{       my funny rectangle/.style n args={4}{%         rectangle,         draw,         append after command={\pgfextra{\let\mainnode=\tikzlastnode}           node[above right] at (\mainnode.north west) {#3}%           node[above left] at (\mainnode.north east) {#4}%           node[below left] at (\mainnode.north west) {#1}%           node[above left] at (\mainnode.south west) {#2}%         },       }     }          \begin{document}     \begin{tikzpicture}     \node[my funny rectangle={1}{7}{4}{8}] {a text};     \node[my funny rectangle={$i$}{$i$}{4}{8}, text width={3cm}, minimum height={3cm}, text centered] (abc) at (5,5) {text};     \end{tikzpicture}     \end{document}      I would like to add a condition inside the `append after command`: if `#1` = `#2`, do only `node[below left] at (\mainnode.west) {#1}`, else do `node[below left] at (\mainnode.north west) {#1}` and `node[above left] at (\mainnode.south west) {#2}`. The answer that @Werner suggested works fine for arguments like `{1}{7}{4}{8}`, but does not work for arguments like `{$i$}{$i$}{4}{8}`. Does anyone have an idea?


title: How do I add an image in the upper, left-hand corner using TikZ and graphicx

text: This is perhaps a simple question with a simple answer, but I'm stumped as a `tikz` novice. What would be the best method to add an image (logo) file to the upper left-hand corner of my document? ![sample document with desired result](http://i.stack.imgur.com/8cbWA.png) MWE:               \documentclass[12pt]{article}          \usepackage{lipsum}     \usepackage{showframe}     %\usepackage{tikz}     %\usepackage{graphicx}          \begin{document}          \section*{Lorem Ipsum}          \lipsum[1]          \end{document}      I wish to avoid using `fancyhdr` to achieve this result.


title: Putting Images on the top right

text: Hi everyone am just a beginner on latex, can anyone please show me, how to put a picture on the top right or top left and on bottom left and bottom right only thanks.


title: Page number alignment

text: This is my code:               \usepackage[french]{minitoc}     \fancyfoot{}     \fancyfoot[RO,LE]{ \textbf{ \small \textsf{\thepage}}}     \documentclass[12pt,a4paper]{book}      \usepackage[T1]{fontenc}     \renewcommand{\baselinestretch}{1.5}      \begin{document}     \include{Chapter1}     \include{Chapter2}     \end{document}      With this code, I have the number of pages: one on the left and one the right. I ask how can change it all on the middle? And the first page of each chapter (which contains the `minitoc`) is without number, I ask how can add a number of page in this page?


title: Minus-like sign with stuff on top

text: I want to create an operator that works like a minus sign (including the spacing), but has the characters `res` on top (in `\textrm` mode). The length of the minus sign should be adjusted to look like underlining the `res` characters, and it needs to work in a subscript. Currently I am using               \newcommand{\residue}[2]{#1\overset{\text{res}}{\relbar\mathrel{\mkern-3mu}\relbar\rule{0pt}{2pt}}#2}      which means in particular the operator I am using is               \relbar\mathrel{\mkern-3mu}\relbar\rule{0pt}{2pt}      but it leaves a bit of space between the two dashes (especially in subscripts), and in inline or display mode, there's too much line to the left of the letters `res`. What is a better way to produce this symbol?


title: What is the state of support for (Unicode) Indic scripts in Context?

text: I have used XeTeX for typesetting a book using Unicode Malayalam. It is working perfectly and the production is fine. Reading about ConteXt, I learn it is more suitable and flexible for book production by publishing houses. I have tried but Malayalam Unicode is not supported. What should be done to achieve this? Is there any similar attempt successful in Tamil, Hindi,......any Unicode Indic script?


title: How do I get the author and the year in square brackets?

text: I have to following problem. I'm working on a presentation. Therefore I need, when I cite a paper or something else, the whole name and year of the paper. Everything went well until now. When I cite something it is displayed like this: > Donald Knuth [1995] But I want it this way: > [Donald Knuth, 1995] This is my preamble:               \documentclass{beamer}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage{amsmath,amsfonts,amssymb}     \usepackage[square,sort,comma,super,authoryear]{natbib}     \usepackage{url}     \usepackage{color}     \usepackage{tikz}     \bibliographystyle{plainnat}     \def\newblock{} % To avoid a compilation error about a function \newblock undefined


title: Can the navigation headbar link to a specific frame in the section, rather than the first one?

text: When clicking on a section title in the navigation bar, I arrive quite naturally on the first slide of that section. But when this slide is e.g. a bullet list with pauses between the items, I would rather link directly to the frame where the whole of the bullet list is displayed. This is because I'll use the nav bar not so much for skipping slides during a talk (I show all of them in sequence), but during questions when I want to show again a specific point. Is there a way of prescribing this behaviour?


title: Standalone - \newlabel being written to .log instead of .aux

text: In my compiled document, which consists of many sub-documents using `standalone`, I have _one_ sub-document in which the Figure references are undefined - they show up as `??`. No MWE I've tried can reproduce this error. In case anyone wants to have a go at this particular bug, the `.log` and `.aux` files are here: https://gist.github.com/keflavich/5421912#file-thesis- log-L2696 (the link is specifically to the line with `\newlabel{fig:...}` in the `thesis.log` file). The problem is that I am including multiple documents in a parent document, and everything goes fine until a certain document is included, after which `\newlabel` commands are sent to `thesis.log` instead of `thesis.aux`, which means that `??`s show up instead of figure numbers.


title: Problem with custom width of nodes in TikZ

text: I'm in trouble with some nodes, I'd like to get your help.   I'm trying to set the text width of a node, but when I declare this parameter, there is something wrong. Maybe there's something missing in the preamble, I don't know.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}     \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}          \begin{document}     \begin{tikzpicture}          \tikz \draw (0,3) node[draw,rounded corners,align=left,text width=30mm]{\textbf{Title}\\ Text text text text text text text text text text text text text text text text text text text text text};          \end{tikzpicture}          \end{document}


title: Force page format with section title plus images

text: I have to add an appendix to my thesis where I have to put some graphs for many objects. The appendix is structured with a section for each object containing a series of graphs. What I want to do is to force latex to put in each page the section title and the set of graphs. So latex have to resize all things to allow such thing. So                   \begin{appendices}         \chapter{data}         \section{obj1}         \begin{figure}[H]         ...         \end{figure}         \begin{figure}[H]         ...         \end{figure}         \section{obj2}         ...         ...         \end{appendices}      and I want all in a page so, if images are too large, LaTeX have to resize them. A thing like resizebox will work for many figures? And if yes how can I resize them?


title: Matrix creating "missing \item" error

text: I don't even have an `enumerate` nor an `itemize` in my document, but I'm getting a message that says "! LaTeX Error: Something's wrong--perhaps a missing \item." I've searched here and elsewhere, and the only references I can find have to do with why this happens in an enumerate environment. Okay, I DO have an `\enumerate`, but it's carefully enclosed by `\begin{itemize}` and `\end{itemize}`; the matrix is well outside that... Can anyone shed any light?


title: Knitr plotting outside margin

text: I like the look of plots that extend beyond the margins               \documentclass{article}     \usepackage{lipsum}     \usepackage[demo]{graphicx}          \begin{document}       \begin{figure}         \centering         \makebox[\textwidth]{\includegraphics[width=0.9\paperwidth]{}}       \end{figure}       \lipsum[1-5]          \end{document}      What options do I need to specify in a `knitr` chunk to achieve this effect? The option `fig.width` appears to only change the aspect ratio.


title: How set a table in margin?

text: \documentclass[12pt]{book}     \usepackage[top=3.cm,bottom=3cm,left=2.2cm,right=6.2cm,marginparwidth=4.5cm,headsep=10pt,a4paper]{geometry}     \usepackage{amsmath,amsfonts,amssymb,amsthm}     \usepackage{booktabs}     \reversemarginpar     \usepackage{marginnote}     \begin{document}      \marginpar{%         \begin{table}[h]     \centering     \begin{tabular}{l l l}     \toprule     1 & 1 & 1\\     \midrule      1 & 1 & 0.562 \\      2 & 1 & 0.910 \\      3 & 11 & 0.296 \\     \bottomrule     \end{tabular}     \caption{}     \end{table}     }     \end{document}


title: Remove URLs from journal articles but not web pages in bibtex?

text: I'm using BibTeX (requirement of the journal I'm submitting to), and I'm referencing mostly journal articles, but also one blog post. I would like to hid the urls in the references list, but _only_ for the journal articles. The url should still display for the blog post. Is this possible without removing the URLs from the `.bib` file?


title: Fancy Theorem Environment and Colors

text: I'm trying to make a boxed theorem environment with colors. I thought I had done it, but I was mistaken--lists were the wrong colors. ![enter image description here](http://i.stack.imgur.com/F1Jll.jpg) In the picture above, I would like the "list" to be the same color as the text. Any suggestions would be welcome! I've included sample code:               \documentclass{amsart}          \usepackage{environ,tikz}          \NewEnviron{thm}{%       \begin{center}     \begin{tikzpicture}       \node[rectangle, rounded corners, inner sep=5pt,minimum width=\textwidth,         text=white!93!brown!93!yellow, text opacity=1,         draw=gray, ultra thick, draw opacity=1,         fill=black, fill opacity=.7]        (box){%         \begin{minipage}{.95\textwidth}           \textbf{Theorem}\qquad\BODY       \end{minipage}};     \end{tikzpicture}     \end{center}     }          \begin{document}          \begin{thm}     Hello, check out my list:     \begin{enumerate}     \item Not the correct color\dots     \end{enumerate}     \end{thm}          \end{document}


title: Divide a rectangle into n times k equal cells

text: Is there a way to divide a given rectangle in tikz into n times k equal cells and give a list of coordinates (n_i,k_i) of cells, which should get a colored background? Edit: I think I should describe a bit more explicit, what I want: I want a function `\myrec` such that for example: `\myrec{(0,0),(4.2,6.7),(3,1)}` draws a rectangle from starting point (0,0) with height=4.2 and width=6.7 which is equally divided like this: ![Rectangle 3x1](http://i.stack.imgur.com/Gg6Mb.jpg) or `\myrec{(0,0),(4.2,6.7),(3,2)}` a rectangle like this: ![Rectangle 3x2](http://i.stack.imgur.com/fXPQ8.jpg) Now lets count the cells in such a divided rectangle from the corner on the left below, then I want to be able to give the (i,k)'s cell some color, for example `\myrec[(1,2),(3,1),blue]{(0,0),(4.2,6.7),(3,2)}` should give something like this: ![Rectangle 3x2 colored](http://i.stack.imgur.com/YpmCe.jpg) Is sufficient to give each colored cell the same color.


title: Why does \num{} not work in situnitx's S columns?

text: Consider the following MWE:               \documentclass{article}          \usepackage{siunitx}          \begin{document}       \begin{tabular}{SS}             0.01    & \num{0.01} \\             0.1     & \num{0.1} \\             1       & \num{1} \\             10      & \num{10} \\             100     & \num{100} \\       \end{tabular}     \end{document}      Which gives:   ![enter image description here](http://i.stack.imgur.com/ZVDJX.png) Why does the left column display as desired, and the right not? Secondly, I would like to add a range of numbers of the table.               \documentclass{article}          \usepackage{siunitx}          \begin{document}       \begin{tabular}{rS}             0.01        & \num{0.01} \\             0.1         & \num{0.1} \\             1           & \num{1} \\             10          & \num{10} \\             100         & \num{100} \\             101--1000   & \numrange{101}{1000}       \end{tabular}     \end{document}      ![enter image description here](http://i.stack.imgur.com/s8sh9.png) How would I do that typographically "correct"?


title: Strange hyphenation behaviour with babel's italian option

text: As an odd recurrence with many previous documents (and by subsequent trials and errors), I noticed that with this default, reduced MWE:               \documentclass[a4paper]{article}     %     \usepackage[OT1]{fontenc}     \usepackage[utf8]{inputenx}     %     %\usepackage{amsmath,amssymb,amsthm}     %     %\usepackage{fixltx2e}     %     %\numberwithin{equation}{section}     %\numberwithin{figure}{section}     %\numberwithin{table}{section}     %     \usepackage[english,italian]{babel}     %     \begin{document}     %     All'interno di una semicirconferenza vi è uniformemente distribuita una carica $Q$, definibile      %     \end{document}      some lines of text contain evidently too much space between words; as the output clearly shows: > ![enter image description here](http://i.stack.imgur.com/U8HNw.png) To me it's difficult to think that `babel` wasn't able to recognize the correct hyphenation for the last line word `carica`, as the legal breaking `ca-ri-ca` should have sufficed to decrease the word spacing of the first line. The rather surprising part came out after deleting the `italian` option, because at first this error was shown:               ! Package babel Error: You haven't loaded the option italian yet.     See the babel package documentation for explanation.     Type  H <return>  for immediate help.     ...                                                 l.3 \select@language{italian}                           ?       I honestly do not know _why_ this error message is supposed to exist. However, by disregarding this, the generated output is: > ![enter image description here](http://i.stack.imgur.com/sj0xP.png) Now the last word of the line was wrongly hyphenated (as suspected); but still, this leads to this final question: _why`babel` couldn't simply hypenate `carica` as `ca-`, gaining the correct word spacing, instead as leaving those ugly voids?_. I know that this word is not esoteric, and should be enlisted into the hypen dictionary. And, for the sake of completeness, _why there is such an error when I delete a language option?_ My thought about this could be that whenever an option is modified, the `*.aux` file somehow interferes with the new declaration, hence pointing out an error; but I'm not sure.


title: How to make an article's table of contents clickable so it can redirect to a section?

text: I'm using Mixtex 2.9 in Windows XP and I'm trying to make my article's table of contents clickable. I tried to add the package hyperref like this:               \usepackage{hyperref}     \hypersetup{         colorlinks,         citecolor=black,         filecolor=black,         linkcolor=black,         urlcolor=black     }      but it throws the following error:               Runaway argument?     \sf@counterlist \relax \def \sf@temp {\@nil }\ifx \sf@temp \@nnil \else \ETC.     ! Paragraph ended before \sf@setref was complete.     <to be read again>                         \par      l.15       What is going on? If I try this in a new article it does work, so how comes it doesn't work on mine? My article is defined as:               \documentclass[10pt]{article}      I'm importing these packages;               \usepackage[utf8]{inputenc}                         \usepackage[spanish]{babel}                        \usepackage{graphicx}                                    \usepackage[usenames,dvipsnames]{color}               \usepackage{wallpaper}                              \usepackage{fancyhdr}                               \usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}      \usepackage{marvosym}                                \usepackage{caption}     \usepackage{subcaption}     \usepackage{subfig}     \usepackage{chapterfolder}


title: Referencing enumerated observations in proof

text: I am writing a rather complicated proof (graph theory/algorithmics), which contains a number of listed observations that are going to be referenced later in the course of the proof. The observations are related to the proof directly, so the list cannot be taken out as an observation before the proof.               \begin{proof}          (...)          In this case the colors look like this:XX.          (...)          Observe that:          \begin{enumerate}               \item White is white               \item Black is black          \end{enumerate}          (...)          By the second observation, we know that black is not green.          (...)     \end{proof}      Is there any "right" way to do it? I have browsed through the other similar questions suggested by the system here and all of them seem to just show how to adjust how labels/references to enumerated items are presented. I would most preferably like to know if there is any "conventional" way to do this. Drop the enumerate somehow completely? Embed it in some kind of Observation environment and reference the items as sub-observations?


title: Redefining the quote environment

text: Can somebody tell me what is wrong with this:               %%Tweaked quote environment     \let\origquote\quote     \renewenvironment{\quote}{%       \vspace{-0.5\parskip}       \origquote     }%     {\endorigquote} My goal is to reduce the spacing above a quote environment.


title: mdframed: splittopskip does not work when the first object after splitting is another mdframed box

text: ## Question I would like to add space in an `mdframed` environment after a splitting (a page break) and in the case where the first object after the splitting (the page break) is another `mdframed` environment. Is it possible? ## Picture and code ![enter image description here](http://i.stack.imgur.com/9WntN.png)               \documentclass[a4paper]{article}     \usepackage{mdframed}     \begin{document}          \begin{mdframed}[     innerrightmargin = 0.5cm,      innertopmargin = 0.5cm,      skipbelow = 135mm,      backgroundcolor = red,      skipabove = 35mm,      linewidth = 0pt,      userdefinedwidth = 11cm,      innerbottommargin = 0.5cm,      splitbottomskip = 10mm,      splittopskip = 10mm,      roundcorner = 5pt,      innerleftmargin = 0.5cm,      align = center]          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          \begin{mdframed}[     innerrightmargin = 0.5cm,      innertopmargin = 0.5cm,      skipbelow = 135mm,      backgroundcolor = blue,      skipabove = 35mm,      linewidth = 0pt,      userdefinedwidth = 9cm,      innerbottommargin = 0.5cm,      splitbottomskip = 10mm,      splittopskip = 10mm,      roundcorner = 5pt,      innerleftmargin = 0.5cm,      align = center]          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.     \end{mdframed}          \end{mdframed}               \end{document}


title: Creating Interactive graphs like Stack exchange reputation tab

text: I like to prepare an interactive timeline graph (static on load, but dynamic on `MouseHover` event). Somehow is similar to the Stack-exchange reputation tab for an user. One classic example is **here**. When the page loads, it shows the graph with separate colored lines for every sites. But, on `mouse hover` at any point an `interactive pop-up` shows the status of reputation on that particular day of that user. Since this is a regular task for me to prepare a Record Tracker every day. I wish to automate this by:   * preparing a template for the report (containing only the graph),   * connecting to an external `CSV` containing data, on which basis the report would be generated,   * and finally add some interactivity like the **previous link**. Connecting to database is some how I have managed using `datatool` package. But, I have no idea how to create a PDF file, that is **_`static on load`_** but **_`dynamic on hover`_**. I have gone through some animated examples from `animate` package. But, not able to find any specific package to use in this occasion. Being less-known in this field, I wish if someone guides me to the way to get the solution. I am unsure whether this could be done in `LaTeX` or not. Is this possible using `LaTeX` at all? Any help (either some code or pointing out some resources) is greatly appreciated.


title: Tracking in full caps and italicized small caps

text: The microtype package includes a tracking option, in which the space between letters is increased. This should normally be done for sequences of both full caps and small caps, see e.g. Bringhurst's style book. The tracking set by `microtype`, however, appears only in upright small caps, not for italicized small caps, and not for full caps at all. I find this somewhat odd, and it honestly looks inappropriate in a document that uses all of them. Is there a way to circumvent this problem?               \documentclass{article}     \usepackage[tracking = true]{microtype}     \usepackage{libertine}     \begin{document}     ABCD \textsc{abcd} \textit{ABCD \textsc{abcd}}     \end{document}      ![enter image description here](http://i.stack.imgur.com/gUPKX.png)


title: How to get a description from glossary entry?

text: I define my entry with:               \newglossaryentry{foo}{name={foo}, description={foo description}}      I can refer to it in a text with \Gls{foo} which puts a href link to Glossary. Is is possible to get a raw string with description from glossary entry? For example               The term \gls{foo} is defined as: \GlsDesc{foo}      or something like this. I'd like it to output a raw description text without hreflinks and such in the middle of the text. So the output of that would be:               The term foo is defined as: foo description      Is it possible ? EDIT: It would be nice if a reference to another glossary entry in description wouldn't break:               \newglossaryentry{bar}{name={bar}, description={bar description}}     \newglossaryentry{foo}{name={foo}, description={foo and \gls{bar} description}}          This is foo desc: \glsdesc{foo}      The reference is broken, this is the output:               This is foo desc: foo and ``gls-bar`` description      instead of expected:               This is foo desc: foo and bar description


title: How to change the caption name in the article class when using babel?

text: I have used the following lines in my preamble               \usepackage{babel}     \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }     \newcommand{\noun}[1]{\textsc{#1}}     \renewcommand{\tablename}{Tableau}     \usepackage[labelsep=endash]{caption}      It still shows `Table 1 - ...` but I want it to be like `Tableau 1 - ...` I tried to use `\addto\captionsfrench\renewcommand{\tablename}{Tableau}` it didn't work either besides I am not using `babel`. What I don't understand is that it was working fine in another document using the `amsart` class, but it does not work in this document using the `article` class. How can I change the name of the caption for tables in my document ?


title: Angle Quotes with English Text and English Figure and Table Labels

text: I use a standard package, `csquotes`, to handle quotes. But if I use it like in the MWE below, then in front of every table I get foreign language spelling for `figure` and `table` instead of English `figure` and `table`. Like here:               \documentclass[12pt]{article}     \usepackage{amsmath, booktabs, setspace}     \usepackage[demo]{graphicx}     \usepackage[english,russian]{babel}     \usepackage[usenames]{color}     \usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry}     \usepackage[style=russian]{csquotes}     \begin{figure}[h]         \centering         \includegraphics[scale = 0.5, angle = 0]{Test}             \caption{CAPTION GOES HERE}                 \label{fig:FIGURE NAME GOES HERE}     \end{figure}     \begin{table}[h]         \centering             \begin{tabular}{|llr|}             \toprule                 \multicolumn{2}{c}{A} \\                 B & C & D (\$) \\                 \midrule                 E & F & G \\                 & H & I \\                 J & K & L \\                 \bottomrule             \end{tabular}                 \caption{CAPTION GOES HERE}                     \label{tab:TABLE NAME GOES HERE}     \end{table}          \end{document}      If I replace `\usepackage[english,russian]{babel}` with `\usepackage[russian, english]{babel}`, then get English text for figure and label, but the correct angle quotes get replaced with << and >> which are a little too low. How do I need to configure my preamble to get English standard formatting everywhere except where `csquote` controls style of quotes? (I do this for my preferred readability, and an editor right now only needs to change the style in `csquote` to get English style quotes again.)


title: Looking for the "conditional" sign

text: In a paper, I found the following definition: ![definition found in the paper](http://i.stack.imgur.com/hW705.png) I'm looking for the first sign, the OCR program failed to recognize. It's something like a combination of a `\vdash` and a `\sim`. I tried Detexify, but failed to find the correct symbol. Does this symbol exists in LaTeX, or can I generate such symbol (for instance by adding a description in METAFONT?) Somewhere further in the paper, the negation of that symbol also appears: the same symbol but with a diagonal line.


title: How do I combine the vc-bundle, Arara, and Sublime Text 2's build methods?

text: **Note:** This question is about getting Arara and the vc-bundle to work with a Sublime Text 2 build method. I write my papers with Sublime Text 2, and I use Git for version control. I use the vc-bundle to give me access to information from Git. In order to make calling the scripts easier I use Arara as my automation tool. I have the following in my working directory.   * araravcmwe.tex   * vc (the Git version of the script from vc-bundle)   * vc-git.awk   * A Git repo with at least one commit The .tex file looks like this.               % arara: vc     % arara: xelatexmk: {synctex: true, options: '-pv'}     \documentclass{memoir}          \input{vc.tex}          \title{Title}     \date{\VCDateISO}          \begin{document}     \maketitle     Some words.     \end{document}      I also have an Arara rule that looks like this.               !config     identifier: vc     name: VC     command: sh vc     arguments: []      It's saved as 'vc.yaml' somewhere Arara can see it i.e. in the path set in my araraconfig.yaml. That all works. I can do `$ arara araravcmwe` and get a PDF with the date of the last commit where I want it. So, this isn't a problem with the way I've set up the vc-bundle or Arara. My problem is with my Sublime Text 2 build method. I tried the following, saved as 'Arara.sublime-build' in Packages/User/.               {   "cmd": ["arara",                 "$file"],              "path": "$PATH:/usr/texbin",              "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)"     }      That also seems to work, except for my vc rule. When I use the method the vc.tex file is generated, but it's blank. (Therefore \VCDateISO is undefined and the file won't compile.) The xelatexmk directive that comes with Arara works fine with the build method; the problem is something specific to the vc rule. My first thought is that somehow the build method doesn't 'see' vc- git.awk. But that could be completely wrong.


title: algpseudocode side effect

text: All tables in my document seem to be affected after I've started using package `algpseudocode`. Pretty much every table now always starts with two additional lines. These lines are utilized properly when writing an algorithm as they serve as the placeholder for the algorithm's caption. However, this affects all other tables and it looks especially bad in captionless tables. Has anyone noticed this issue before? Any suggestions on how it can be solved?               \documentclass{article}     %\usepackage{algorithm}     %\usepackage{algpseudocode}     \usepackage{float} \restylefloat{table}     \begin{document}     This is a test      \begin{table}     \begin{tabular}{| l | l | l | l |} \hline a & b & c & d \\ \hline \end{tabular}     \end{table}      \end{document}


My problem is that if I try to recompile a text after correction of some mistake, e.g. missing "}", the I get a message **Runaway argument? {\contentsline {figure}{\numberline {\relax 3.9}{\ignorespaces ! File ended while scanning use of \@writefile. \par l.128 \begin{document}** Then I delete the *.aux file and other auxiliary files and so I can recompile without any problem. Howewer if again I get a mistake, compile the text,get an error message, stop compiling, fix an error in the text and try to recompile, again I will get the same "File ended while scanning use of \@writefile." and again the only one way is to delete the auxiliary files. Any suggestions how to fix the problem?


title: Info boxes in bibliography

text: I remember seeing a gorgeous review article a while back. Sadly I cannot find it, so I can neither reference it nor get a screenshot. What was unique was in the bibliography. Certain papers that were of particular note were emphasized by making the title of the article cited bold. If memory serves, the page behind the entry was also colored a very light orange. In other entries the text was not bold. Additionally a small box containing one to two sentences was seen in the margin. Each of these small info-boxes had a heading referencing the bibliography entry and a sentence or two describing the article. All of these boxes were placed on the same page as the reference they described. I would like to repeat this design for my thesis, as I am free to do so. Is this possible with biblatex? **Edit** : I was asked off-line what I meant by this question. To ensure minimal ambiguity I grabbed a screenshot off a random bibliography and drew on it. Obviously I do not want anything nearly this ugly, and I do not intend to use this bibliography style. But the idea should be crystal clear now. Emphasize special bibliography entries and have a brief info-box in the margin. ![enter image description here](http://i.stack.imgur.com/bmGQm.png)


title: Why does LyX flag the following maths macro definition as an error?

text: The following macro is the LaTeX equivalent of a macro that I defined using the LyX maths macro facility.               \global\long\def\fdd#1#2#3{\mathscr{F}^{\left(#1\right)}\left[#2_{#3}\right]}      LyX comes up with the following error when I compile my document:               ! Undefined control sequence.     \fdd #1#2#3->\mathscr {F}^{\left (#1\right )}\left [#2_{#3}\right ]      However, the following macro, in which `\mathscr` is replaced with `\textrm`, compiles successfully.               \global\long\def\fdd#1#2#3{\textrm{F}^{\left(#1\right)}\left[#2_{#3}\right]}      What could be wrong with the first macro?


title: Set frame subtitle size

text: What is the correct way to set subtitle size? I have this:               \documentclass{beamer}     \setbeamertemplate{frametitle}{\insertframetitle\\\insertframesubtitle}     \setbeamerfont{frametitle}{size=\scriptsize}     \setbeamerfont{framesubtitle}{size=\Large}          \begin{document}     \begin{frame}{title}{subtitle}     \end{frame}     \end{document}      but the subtitle appears in scriptsize, not Large. I can put the `\Large` command inside the `\setbeamertemplate` argument, before `\insertframesubtitle`, and it works; but why it does not work in this way? What's wrong in my code?


title: "Undefined Control Sequence"-Error when using Biblatex with apa style

text: Today I started to try biblatex for the first time in my `apa6.cls` document:               \documentclass[ngerman,man,12pt,a4paper,noextraspace,donotrepeattitle]{apa6}     \usepackage[latin1]{inputenc}      \usepackage[english,ngerman]{babel}     \usepackage[T1]{fontenc}         \usepackage{lmodern}             \usepackage{etoolbox}          \usepackage{csquotes}     \usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}     \DeclareLanguageMapping{ngerman}{ngerman-apa}     \addbibresource{Literatur.bib}          \begin{document}          \cite{vonDavier2011}          \printbibliography          \end{document}      I just copied the content of the .bib file from the `bibliography.bib` of the `apa6.cls` example file for some testing so the .bib content is alright. This works as long as I load `biblatex` only with `\usepackage[backend=biber]{biblatex}`. But when I additionally specify apa citation style like in the example above, I get the Error ![Undefined Control Sequence](http://i.stack.imgur.com/sBMDJ.jpg) right after the `\printbibliography` line. I have to mention that I am not an advanced latex or even biblatex user. F. e. I just changed the output profile from bibtex to biber and don't know what is meant with "biber %" I read about in other topics. Should I include that anywhere? Thanks for answers!


title: Trimming images

text: Just a quick question, do you all trim the images by trail and error and plugging numbers there?? Do you use a mark or something to at least keep some reference? well that's how I do it and is really painful.


title: correct environment/command for booktitles, names, etc

text: What is "the correct" environment/command for booktitles, names, songtitles, names of movies or other papers? Example Sentence: > Some ideas of that are also reviewed in `\c1{Max Mox}`'s interview with > `\c1{Arnold Fitzgerald}`, who himself is author of the book `\c2{The Book}` > which was later turned into a a film `\c3{the film}` by `\c1{the filmer}`. In other situations I would use quotation marks or italics. But I guess there are some commands which also catch the semantic aspct in that case instead of just using `\textit` or quotation marks. (Like __in html to semantically label emphasis)


title: Listing background broken by \colorbox and \framebox

text: I am using `listing` environment (`listings` package) with the background parameter. I want to highlight some lines of code and I am using the `\colorbox`, `\makebox` and `\framebox` to achieve this. However, a problem with my solution is that the background is broken (space without background in the `listing` environment). Would you please to help me to solve out this problem.               \documentclass{beamer}     \usetheme{Montpellier}     \usepackage{listings}     \usepackage{xcolor}          \begin{document}          \begin{frame}[fragile]     \frametitle{Background broken}     \begin{lstlisting}[escapechar=$, backgroundcolor=\color{lightgray}]     int a = 0;     $\colorbox{green}{int b = 0;}$     int c = 0;     $\framebox{int d = 0;}$     int e = 0;     int f = 0;     int g = 0;     \end{lstlisting}          \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/eREz4.png)


title: How to make LyX use prettyref or refstyle

text: In LyXm in "Document Settings" window on "Document class" pane I can choose to use either prettyref or refstyle. However the TeX code looks as if it used ordinary /ref. Why?               %% LyX 2.1.0 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{amsart}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{geometry}      \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm,headheight=2cm,headsep=2cm,footskip=2cm}     \usepackage{amsthm}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \numberwithin{equation}{section}     \numberwithin{figure}{section}          \makeatother          \usepackage{babel}     \begin{document}     \label{k}          \begin{equation}     hbbhh\label{eq:eee}     \end{equation}               \ref{eq:eee}     \end{document}


title: Updownarrows in commutative diagrams

text: Can anybody tell me how to draw a diagram from A to B with an uparrow and a downarrow? Thanks.


title: Best practices for writing a latex document for web publishing (html)

text: I want to create a latex document that can be compiled as a single _pdf_ file and also converted to a bunch of small _html_ files for a web site. How to automate the task of converting a latex document to many _html_ files?


title: Vertically aligning figures on their center using subcaption package

text: Is there a way to make figures vertically align on their centers using the subcaption package? Currently I get the following result:![enter image description here](http://i.stack.imgur.com/ZQeHQ.png) The captions below them are vertically aligned on their tops. This is as intended. I want the figures to be vertically aligned on their centers. Is this possible? I am using the following latex code:               \begin{figure}[htbp]     \centering     \begin{subfigure}[t]{0.49\textwidth}\centering     \includegraphics{Img/Ramsey_Gijs.pdf}     \caption{Schematic representation of Ramsey experiment. Figure from     \citep{Lange2012Quantum}}     \label{fig:Ramsey_gijs}     \end{subfigure}     \begin{subfigure}[t]{0.49\textwidth}\centering         \includegraphics{Img/electron_T2star.pdf}     \caption{$T_2^*$ decay of the electronic-spin.}     \label{fig:electron_T2*}     \end{subfigure}     \caption{some caption}      \end{figure}


title: How i can use \IfFileExist{FileName}{}{} with spaces in FileName

text: Have anyone an idea how i can use `\IfFileExist{}{}{}` for file names with spaces? f.e. didn't work               \newcommand{\runI}{D:/Test/run1 - T2}     \newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}          \begin{figure}[htbp]     \centering     \IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runI/LatexTestFig2.png}     \caption{run 1}     \label{overflow}     \end{figure}      f.e. work               \newcommand{\runII}{D:/Test/run1-T2-Kopie}     \newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}          \begin{figure}[htbp]     \centering     \IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runII/LatexTestFig2.png}     \caption{run 1}     \label{overflow}     \end{figure}      what can I do? THX


title: How to place a full citation in the abstract using BibTeX?

text: This question is similar to this one but not exactly the same. I would like to include a reference in the abstract of a paper. This reference should be the full reference, not a key, and it should not interfere with the rest of the citations I make. The journal wants the references to be ordered numerically, and if I use `bibentry` the citation in the abstract gets `[1]` and so the first one in the paper is `[2]`... any ideas how I could accomplish this?


title: How do you deal with fixed resolution screenshots? (e.g. GUI screenshots)

text: In my LaTeX document I need to show some screenshots of a GUI, which has a fixed resolution (for example, 1200x600) and I cannot change it (not without much hassle). The text in such figures always appear crappy in my documents to the point where it's almost impossible to read without zooming in/out to the figure's normal resolution. No need to say this gets even worse when you try to print the document. I was curious as to what strategies you guys have in dealing with these oh so painful figures. Is there a way to vectorize text automatically in a 2D GUI screenshot?


title: restating a theorem using theomac.sty

text: I am trying to restate a theorem environment using theomac.sty which floats around, following a suggestion I received here: how do I refer back to counters? The package I downloaded loads well, but whenever I run pdflatex I get the following error:               ! You can't use `\spacefactor' in vertical mode.     \@->\spacefactor                       \@m      l.199 \@             newtheoremWithMacro{replemma}{lemma}      I am confused what it means. I tried following it a bit in google, but it still does not make much sense to me. Here is the lemma environment my style file defines:               \def\lemmaname{Lemma}     \newtheorem{lemma}{\lemmaname}%[section]     \def\thelemma{\arabic{lemma}}     \def\lemmafont{}     \def\lemmaheadfont{\bfseries}      The theomac style file can be found in: http://cookp.com/thread/1500775/Equation%20kopieren%20referenzieren can someone identify why I am getting this error? Just a hint as to what it means could be also helpful... I can't find the command spacefactor in either syle files (`theomac.sty` or the style file that defines theorems.)


title: Create a Frequency Allocation Diagram

text: I need to reproduce a frequency allocation diagram in TeX. I prefer TikZ but open to PSTricks. I can create a simple bar allocation char using `\node` but unsure how to create layered blocks like the dark blue Public Safety / Broadband / Guardband / LMR block in the below graphic example. ![Source Image](http://i.stack.imgur.com/nRvT5.png) My current code is very very wrong. The blocks are a set size, the the block length needs to correspond to the how much frequency is allocated; nor are the blocks touching. Can we write a macro that draws the block based on some input length?               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{figure}[!h]     \centering     \begin{tikzpicture}[node distance = 4cm, auto]          \tikzstyle{boxT}=[rectangle, draw=black!50, fill=teal, minimum width=5em, minimum height=3em, level distance=10cm,align=center, anchor=north, text=black, text width = 2.75cm]          \tikzstyle{boxB}=[rectangle, draw=black!50, fill=blue, minimum width=5em, minimum height=3em, level distance=10cm,align=center, anchor=north, text=white, text width = 2.75cm]          \node [boxT] (a) {Commercial};     \node [boxT, right of=a] (b) {Commercial};     \node [boxT, right of=b] (c) {D Block};     \node [boxB, right of=c] (d) {Broadband};     \node [boxB, right of=d] (e) {Guardband};     \node [boxB, above of=e] (f) {Public Safety};             \end{tikzpicture}     \end{figure}     \end{document}


title: Different proofs in amsmath with different QED symbol?

text: I'm trying to expand the amsmath package to get two different proof environments:   * `\begin{proof} ... \end{proof}` and    * `\begin{proof*} ... \end{proof*}` so `proof*` should act exactly like proof except of the QED Symbol. `proof` should provide be a blacksquare while `proof*` provides the normal square. I found               \let\proof*\proof      and               \renewcommand{\qedsymbol}{$\blacksquare$}      in some questions but this changes every QED symbol. Any advice?


title: How to programmatically coax pgfplots to recognize nan within surface as matlab does

text: I came across this post after wondering why nan's did not appear to be handled by pgfplots as they are by matlab when working with the matlab pcolor function. My typical workflow in this context is:   1. create plot in matlab   2. call matlab2tikz   3. call a script which wraps the output of matlab2tikz such that it is compileable, write to file.   4. compile latex document which is output in above step (the preview environment so that a figure sized .pdf, with controllable border results).    5. place .pdf resulting from compilation at destination path. At the moment, I'm wondering how to build the suggestions put forth in the post referenced above into my process (more or less fully automated). The matlab2tikz options `extraCode`, `extraAxisOptions` and `extraTikzpictureOptions` seem relevant to me. Tentatively, I would begin by trying something like this:               MATLAB2TIKZ('extraCode','\tikzset{declare function={Ceil(\x)=round(\x+0.49999);}}',...)      However, I am unaware of a mechanism to pass the code:               opacity=Ceil(\pgfplotspointmetatransformed)      as an option to the `\addplot3` command. In summary, any suggestions/advice on how to implement the fix proposed in the linked post programmatically are greatly appreciated.


title: Using PGFPLOTS to make vertical barchart with labels from data file

text: I have a version of this working with LaTeX Writer and PGFPLOTS 1.5.1 on my iPad. Moving over to Linux and TeXLive 2013 with PGFPLOTS 1.10 sees the Y AXIS LABELS disappear after the first. The bars seem correct otherwise. I'm trying to reproduce some XBAR plots created with PicTeX, but each bar colored according to a category label in the data file. Here is what I have now: ![XBAR Chart with categories color coded.](http://i.stack.imgur.com/XSRux.jpg)               \documentclass{standalone}     \usepackage[margin=1in]{geometry}     \usepackage{filecontents}      \usepackage{pgfplots}      \usepackage{pgfplotstable}     \pgfplotsset{width=.90\textwidth, compat=newest}           \pgfplotsset{         discard if/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{#1}}                 \edef\tempb{#2}                 \ifx\tempa\tempb                     \def\pgfmathresult{inf}                 \fi             }         },         discard if not/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{#1}}                 \edef\tempb{#2}                 \ifx\tempa\tempb                 \else                     \def\pgfmathresult{inf}                 \fi             }         }     }          \begin{document}          \begin{filecontents}{data.csv}     Miles,   Bike,    rdate     215,     Yel-11,  {Yel-11    03/24/14}     159,     Fuji,    {Fuji      05/23/14}     134,     8000SHX, {8000SHX   03/25/14}     106,     Fuji,    {Fuji      05/25/14}     58,      Y-22,    {Y-22      05/12/14}     55,      Yfoil,   {Y Foil 77 05/25/14}     \end{filecontents}          \pgfplotstablegetrowsof{data.csv}          \begin{tikzpicture}     \begin{axis}[     %/pgf/number format/.cd,1000 sep={},     width=0.9\linewidth,height=6cm,     xbar,/pgf/bar shift=0pt,     xmin=0, xmax=250, xticklabel pos=upper, tick align=outside,     xticklabel style={major tick length=20pt, color=black,tickwidth={10pt}},     axis x line*=top, %tickwidth={2pt},     axis y line*=left, xtick={0,50,100,150,200,250},     %xtick=\empty, %xlabel= {},     %enlarge x limits={value=0.1, upper},     enlarge y limits=0.1,     ytick={0,...,\pgfplotsretval},      y dir=reverse,     y tick label style={major tick length=5pt},     yticklabels from table={data.csv}{[index]2},     nodes near coords, nodes near coords align=horizontal,     %point meta=explicit symbolic     ]          \addplot [draw,fill=blue!95!black, discard if not={Bike}{Fuji}]              table [y expr=\coordindex, x index=0, col sep=comma]{data.csv};          \addplot [draw,fill=blue!60!white, discard if not={Bike}{Yfoil}]              table [y expr=\coordindex, x index=0, col sep=comma]{data.csv};          \addplot [draw,fill=yellow,  discard if not={Bike}{Yel-11}]              table [ y expr=\coordindex, x index=0,col sep=comma]{data.csv};          \addplot [draw,fill=red,     discard if not={Bike}{Y-22}]              table [ y expr=\coordindex, x index=0,col sep=comma]{data.csv};          \addplot [draw,fill=gray,    discard if not={Bike}{8000SHX}]              table [ y expr=\coordindex, x index=0,col sep=comma]{data.csv};          \end{axis}     \end{tikzpicture}          \end{document}      I am hoping to do number of these plots like this with 40-50 entries per plot. How do I get the Y AXIS labels to display again. Is there an easier way to do this? How can I apply Tufte style features such as shifted axis on top, no axis on left, a multi-line title on top, etc.? I'm still new to PGFPLOTS, and any and all help is greatly appreciated. Regards, Dave


title: Reduce space between Table number and title in List of Tables

text: I am currently not using any packages for my table of contents, list of figures/tables and would like to keep it that way. Is it possible to reduce the horizontal space between a table number and title in a list of tables without the need to use tocloft/tocstyle/etc ? Many thanks in advance! Kind regards, Pieter


title: Chapter and figure numbers in TiKz externalize prefix

text: I would like my externalised figures to have prefixes reflecting the chapter in which they are from, but when I do:               \usetikzlibrary{external}     \tikzexternalize[prefix=TiKz/\value{chapter}]     \tikzexternalize      or               \usetikzlibrary{external}     \tikzexternalize[prefix=TiKz/\c@chapter]     \tikzexternalize      I get errors and the correct labels are not created. So the question is: What is the right way? What other variables can we stick in there? (ie other than counters, what else can TiKz give us. It obviously has some idea of the filename of that contains the figure...) How can the filename prefix be suppresed. TiKz does a great job of automagically putting the filename as prefix, but in some circumstances this is not so great, for example when using subfiles, and reusing the externalised figures in the master document. Please note when I say filename I mean the .tex document that is being built by pdflatex. Not as in the many examples of .tikz include. 8)


title: Ensuring embedded Fonts are hinted for on-screen PDF viewing

text: I'm trying to recreate a pleasing page layout from an existing pdf as a way to get more familiar with book design in latex. The geometry part was fairly simple to get right, but I've come across a strange phenomenon related to font apperence: On-screen the original looks wonderful while my version seems to have a much darker color and doesn't look nearly as nice even though I've closely matched the dimensions, leading, line- breaks and (natrually) the body font. If I zoom-in the visual difference disappears. xelatex and fontspec were used to generate the PDF and the font is in OpenType Format. After investigating I discovered that turning off the "text hinting" option (I'm using okular on Linux) makes both versions appear identical, while turning it back on improves the appearence of the original dramatically yet has only a negligable effect on my version. Obviously, the hinting information in my version is either different or missing then what's used by the original. What can I do to correct this? How can I inspect the files to figure out what's going on? What should I be looking for?


title: How to indent subsection in AMS TOC

text: I used AMS LaTeX template with gsm-l package to write my teacher's book. The table of content that produced has the following form: ![enter image description here](http://i.stack.imgur.com/ONpoy.png) in which 1, 2, 3.... are sections and 3.1, 3.2, 4.1, 4.2,.... are the subsection. I want to indent the subsection with respect to the section, like this (it's ok without dots, though): ![enter image description here](http://i.stack.imgur.com/cFWwC.png)


title: How to install `babel` in Texmaker?

text: How do I install babel language pack in Texmaker? I want to use `\usepackage[swedish]{babel}` in Texmaker. At the moment,               Jag är bäst      in Texmaker gives > Jag r bst in the PDF. I use Windows 8.


title: Where can I download upref version 2.04?

text: From this PDF, it looks as if the current version of `upref` is 2.04, but the version on CTAN is 2.01. Where can I download version 2.04? `upref` version 2.01 does not seem to handle italic corrections properly when the `hyperref` package is used; is this fixed in version 2.04?


title: How to put a whole part of generated HTML from htlatex in a special div?

text: Using TeX files, I generate two pdf deliverables and one website from the same source. I generate my `html` using `htxelatex` and a `config` file like that has the following:               \Css { .tableofcontents {       float:left;       top:20px;       padding-left:2%;       width:30%;       background:#eee;       font-size:1em;       }     }     \Css { .container {       float:left;       top:20px;       padding-left:15px;       width:65\%;       height:1024px;       }     }      This what I just add the following to my generated HTML using scripting               <div class="container">        <--! The whole tex code except the tableofcontents -->     </div>      And now I have a gorgeous `HTML` with the table of contents on one half of the screen and the content on the other one. It works I was just wondering if there is a way to add the whole body in the div automatically from the config file somehow. When I generate the `html`, the `tableofcontents` is inside the body so I can't use `body` object


title: Design that imitate Google browser

text: I would like to write some tutorials about HTML, and I would like to do it efficiently without using too many screenshots. What I would like to obtain is a frame which looks like a web browser, such as this. ![frame](http://i.stack.imgur.com/voklg.png) (Image from here.)


title: Create a command for header titles

text: how can i be able to create this one by simply making this into command? ouput:               \begin{center}     \myname{Mike Backlund}     \myschool{School 1}     \myschool{School 2}     \end{center}      display would be: > >                                 Mike Backlund >                                     School1 >                                     School2 >   Hope you could help me


title: Create command for a width

text: How can I put this code into command to be more organized and precise?![enter image description here](http://i.stack.imgur.com/pQp19.png)


title: using unicode-math with math keyboard or hotkeys?

text: Here is more information about the unicode math-package: http://ctan.mackichan.com/macros/latex/contrib/unicode-math/unicode-math.pdf A great pro for using unicode math, is that your code is much more readable. But typing all those symbols using alt+xxxx doesn't seem to be a very fast solution. I was thinking, in theory it could be possible to have a math keyboard ( i mean in hardware form), where you see all those math characters at your keyboard. Would be quite cool, but I have no idea if this already exist. On the other hand, just designing hotkeys could be (in the end) even more usefull. Does there already exist a (complete) hotkey list for math unicode symbols?


title: Command for table with label

text: How can I create a command for a 2 tables with a label on top and a command for the options below? example of what i am saying is: ![enter image description here](http://i.stack.imgur.com/3hRNt.png)


title: Remove trailing space from \input

text: It seems that `\input` appends a trailing space. MWE: **foo.tex**               \documentclass{article}                                                              \begin{document}     foo\input{bar.txt}baz     \end{document}      **bar.txt**               bar      Which, using `pdflatex foo` gives the output `foobar baz`, with a space in between. How do I remove it?


title: How to put a figure in one column and its caption in another column in a two column article latex

text: Could some one help me to figure this issue out? I have a two column article and I have figures that are long. They fit in one column and that's ok but if I want to add the caption under the figure, the tex will be too large and does not fit in that column. Is there a way to put the figure in one column and the caption in front of it in the other column?! I tried different things such as figure* or floatrow but that does not give me what I want.                  \begin{figure}[!p] %the figure is as long as a column in a two column page        \begin{center}         \includegraphics[width=\linewidth]{figure3.png}         \caption{(Color online) a very long text, as long as a column in a two   column page}         \end{center}         \end{figure}


title: PGFPlots how can I hide extra y tick marks?

text: simple question (I hope) Using pgfplots 1.5.1, miktex 2.9 on Windows 7 32 bits. I'd like to hide the tick marks at the right and top side of the plot, but without losing the lines (e.g. keep the plot axis style as box but only keep tick marks in the left y axis and bottom x axis, keeping the lines in the upper x axis (without tick marks nor labels) and right y axis (without tick marks nor labels) If i use `ytick=\empty` it removes all of the labels and ticks, but I don't want that, I just want the extra y and x ticks removed. So far I've tried:               every extra y tick = \empty,     every extra y tick/.style={\empty},     extra y ticks={},     extra ytick =\empty,      hide extra y ticks,     extra y tick style={tickwidth=0cm,major tick length=0cm},      But no luck, Any help is much appreciated. Best regards, (edit: Forgot to add I'm using Latex->PDF profile)


title: Alignment in table

text: I'm creating a table but I'm not getting the correct alignment in the last row of the table. It's a `multirow` and `muticolumn` example. Of course, I'm putting some fictitious information and data in the table :) but my original table has the same format. I'm putting a minimal code below. There are two problems:   1. I can't get the numbers 12 and 1000 in the last column aligned in the center position as the other numbers are. Now I have simple small numbers as 12 and 1000 but the alignment becomes worse if I have bigger numbers and with decimals.   2. A second problem is setting the 10 and 3 in the "sex ratio between second and first value" rows to be aligned in the middle between "male" and "female".              \documentclass[10pt]{article}     \usepackage[latin1]{inputenx}     \usepackage[T1]{fontenc}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{booktabs}     \usepackage[below]{placeins}     \usepackage{threeparttable}     \usepackage{multirow}          \begin{document}     \begin{table}[htbp]     \begin{center}     \begin{threeparttable}     \caption{\label{tab:freqcompa} Testing for table}          \begin{tabular}{@{}lcccc@{}}     \toprule     \multicolumn{1}{c}{\multirow{2}{2cm}{Case\tnote{2}}} & \multicolumn{4}{c}{Number      of dogs} \\     \cmidrule(r){2-5}     \multicolumn{1}{c}{} & \multicolumn{2}{c}{Dogs of type 1} & \multicolumn{2}{c}{     Very very bad Dogs of type 2\tnote{1}} \\     \midrule     \multicolumn{1}{c}{} & \multicolumn{1}{c}{male} & \multicolumn{1}{c}{female}     & \multicolumn{1}{c}{male} & \multicolumn{1}{c}{female}\\     $\omega_a= 100$  & $1$ & $2$ & $4$ & $12$ \\[2mm]     \cmidrule(r){1-1}     Sex ratio \\[-1.5mm]     between second \\[-1.5mm]     and first value & \multicolumn{2}{c}{$2$}  & \multicolumn{2}{c}{$3$} \\[2.3mm]     \midrule     \multicolumn{1}{c}{} & \multicolumn{1}{c}{male} & \multicolumn{1}{c}{female}     & \multicolumn{1}{c}{male} & \multicolumn{1}{c}{female}\\     $\omega_b= 200$ & $1$ & $60$ & $100$ & $1000$ \\[2mm]     \cmidrule(r){1-1}     Sex ratio \\[-1.5mm]     between second \\[-1.5mm]     and first value & \multicolumn{2}{c}{$60$}  & \multicolumn{2}{c}{$10$} \\[2.3mm]          \bottomrule     \end{tabular}     \begin{tablenotes}     \item[1]\textit{considering all stray dogs.}     \item[2]\textit{considering two possible cases}     \end{tablenotes}          \end{threeparttable}     \end{center}     \end{table}     \end{document}       Any help will be most appreciated...


title: How to use listings with multiple languages?

text: I've got a HTML document with JavaScript inside that I want to show in my article. For that I would like to use my JavaScript and HTML formatting. How can I get the `listings` package to use two styles? Is there something like `language={HTML, JavaScript}` ?


title: How to typeset a matrix with MathJax?

text: I need to typeset a matrix with square brackets as delimiters for math.se (I believe they use MathJaX). How would I do that?


title: Same height for list of comma-separated vectors

text: I am trying to typeset a list of vectors spanning a multidimensional space, using the notation span{v_1,v_2,...,v_n} (I haven't found out how to inline it as rendered latex) i.e.:               span \{       \begin{pmatrix} 1      \\ \vdots \\ \vdots \\ 1      \\ 1      \end{pmatrix},       \begin{pmatrix} 0      \\ 1      \\ \vdots \\ \vdots \\ 1      \end{pmatrix},       \begin{pmatrix} 0      \\ 0      \\      1 \\ \vdots \\ 1      \end{pmatrix}       \begin{matrix}  \cdots \\        \\ \ddots \\ \ddots \\ \cdots \end{matrix}       \begin{pmatrix} 0      \\ \vdots \\ \vdots \\      0 \\ 1      \end{pmatrix}     \} but the fourth "vector", consisting of only various dots does not have the same size as the other vectors, since the dots take up more vertical space than 1 or 0 do. I understand LaTeX doesn't know how to align them since they are all independent matrices but I'm not satisfied with the result. Is there any way to make them all have the same height?


title: How to use the results of `raw output` to create a smooth plot

text: As by my previous question on plotting an implicit curve I've got some output. But as you can see it is not quite what it should be (apart from your browser's downscaling by a factor 2 of course. ![](http://i.stack.imgur.com/tq2fH.png) The code used to reproduce this is (run with `--shell-escape`, of course)               \begin{tikzpicture}[xscale=1,yscale=.25]       \draw plot[id=curve, raw gnuplot] function{         f(x,y) = y**2 + (x**2 - 5)*(4*x**4 - 20*x**2 + 25);         set xrange [-4:4];         set yrange [-15:15];         set view 0,0;         set isosample 1000,1000;         set size square;         set cont base;         set cntrparam levels incre 0,0.1,0;         unset surface;         splot f(x,y)       };     \end{tikzpicture}      I presume `gnuplot` returns the coordinates of end points of line segments and it's up to TikZ to connect them. ~~But the results are not quite satisfactory because`gnuplot` returns the segments in a strange order. At least, that's what I assume given the graph.~~ Now, as the documentation on `raw gnuplot` is rather sparse and there are not much examples of this to be found on the Internet, certainly not with surface plots or implicit functions, I hope someone could give some pointers (or a full-fledged answer, you won't see me complaining). EDIT: As @Yossi pointed out, the `.table` file `gnuplot` creates contains several parts of the curve separated by 2 new lines each. Now TikZ connects these parts but it shouldn't. We're getting there :).


title: The definition of key default value by keyval package

text: For a key `keya` defined by               \define@key{fam}{keya}[\def\y#1{#1}]{\def\x##1{##1x#1}}      the _keyval_ package uses               \def\KV@def#1#2[#3]#4{%       \begingroup\toks@{#3}%       \xdef\@gtempa{\expandafter\noexpand\csname KV@#1@#2\endcsname{\the\toks@}}%       \endgroup       \expandafter\let\csname KV@#1@#2@default\endcsname\@gtempa       \expandafter\def\csname KV@#1@#2\endcsname##1{#4}%     }      to define the default value as               \KV@fam@keya@default{\KV@fam@keya{defau}}      This style of defining the default value is called _the standard format_ by the _xkeyval_ package. Packages such _fancyvrb_ don't adhere to this standard. The _xkeyval_ package says that such packages _abuse_ the default-value format. I have always wondered why the _keyval_ package chose to define the default value of a key in this way, instead of the apparently cheaper approach of storing the default value in a macro like               \def\KV@fam@keya@default{defau}      Without eTeX this should actually be               \newtoks\toksa     \toksa{defau}     \edef\KV@fam@keya@default{\the\toksa}      or something similar.


title: Change margins on the first of \tableofcontents page only

text: I need to change a page bottom margin, but do that **for the first page of ToC only**. Sure thing the following does not work as it adjusts all pages of ToC:               {       % bottom margin must be bigger       \changepage{-35mm}{}{}{}{}{}{}{}{}       \tableofcontents     }      So `\changepage` should be somehow "injected" into `\tableofcontens` to detect and apply to the first page only. I need some special LaTeX magic. Please assist. **Update.** \changepage may not be used with `\addtocontens`, but Stefan's suggestion helped:               \addtocontents{toc}{\protect\enlargethispage{-35mm}}     \clearpage     \tableofcontents      I have another problem now (create a separate question?): i'm looking for some general approach, kind of "apply these change to the current page only; limit the scope they affect". Namely: i have to put such frame on the first ToC page, and such one on the rest of ToC pages. (I have frames as PDFs, so i just don't know how to ask LaTeX to place them in required order; tried `afterpage` and `wallpaper` packages.)


title: How to improve in-text math expressions with multiple delimiters such asl `(`, `|`?

text: Consider this equation:               first $\lceil (cN-n) |S_{n+1}|\rceil$ points      which renders to: ![enter image description here](http://i.stack.imgur.com/KkQp2.png) Is there a way to improve this, from the perspective of readability? The only improvement I could suggest is:               first $\lceil\, (cN-n) |S_{n+1}|\,\rceil$ points      which renders to: ![enter image description here](http://i.stack.imgur.com/zSEyx.png) I believe it would even better to read, if the interior of the ceiling would be shrinked only a bit, so the ceiling delimiters are a bit higher.               \documentclass{article}       \begin{document}     first $\lceil\, (cN-n) |S_{n+1}|\,\rceil$ points     \end{document}      **Edit:** replaced minimal class with article, as suggested by egreg.


title: math font for xelatex

text: I'm looking for a math font to be used in xelatex. Right now I use `Asana Math`, which actually looks nice, but is too bold for my purposes. For normal text I use the `Roboto` font, if I write               normal vs. $\mathsf{math}$      I get: ![enter image description here](http://i.stack.imgur.com/oB6SU.png) I tried many different math fonts, but they all look bolder than the normal font. Is there either a way to tell xelatex to use a thinner font or is there a math font which is thinner innately?


title: How to get aleph and beth symbols in similar font?

text: If aleph, beth, gimel, and daleth are needed in their mathematical meanings (identifiers for cardinality), how can we get them in the same font or at least reasonably similar in style. The following simple approach makes aleph different from the rest in style:               \documentclass{article}     \usepackage{amssymb}     \begin{document}     \[ \aleph \beth \gimel \daleth \]     \end{document}      The aleph is smaller and has thinner strokes: ![enter image description here](http://i.stack.imgur.com/ElI2S.png) Apparently the reason is that amssymb does not have aleph. What might be the simplest fix?


title: Titles directly below a float is causing spacings below the float to increase

text: I'm using `\begin{figure}... \end{figure}` with memoir class, and if there is a title (`\section`, `\subsection`, `\subsubsection`) right below the figure, the spacing below the figure is greatly increased. If there is text below the figure, the spacing is fine. I know the titles add some spacing above and below, but the spacing created from this is much greater. It was hard to create an example. I was wondering if anybody has a solution to this. Thanks!


title: LyX: How to put temporary files to the lyx-file folder (for TrueCrypt compatibility)

text: I am working on a document in a TrueCrypt volume. As far as I understand, when I view PDF, LyX puts a temporary PDF file (and probably all temporary pdflatex files) into some other folder (at least, I don't see them in the folder with the lyx-file). Can I change this? I would like all files, even those later deleted, to reside in a TrueCrypt folder. I have tried to remove the path in the Preferences/Paths/Temporary directory, but the PDF file still doesn't appear in the lyx-file folder.


title: Numbers and bullets in table of contents

text: I would like to combine both section numbering and bullets in the table of contents of a document of article class just to avoid so much long section number (for example 1.2.1.1.1). So, I would like to have something like this:   1. First section 1.1 First subsection 1.2 Second subsection                 1.2.1 First subsubsection               · First paragraph               · Second paragraph                 - First subparagraph      1.3 Third subsection   2. Second section How can I modify the table of contents to put those bullets instead of numbers?


title: What is the correct way of writing a percentage next to \oldstylenums?

text: If I want to write in text e.g. 1.1-1.5% and use `\oldstylenums` to get non- lining numbers, what would be the correct way of specifying the percent sign? When I simply write the percent sign as               \oldstylenums{1.1}--\oldstylenums{1.5}\%      the percent sign seems too large and out-of-place next to non-lining numbers and lowercase letters. Is there some way of getting a smaller, "lowercase" percent sign or should the "capitalized" percent sign simply be considered correct?


title: Biblatex: subdivided categories

text: I'm trying to create a complex subdivided bibliography for my Master thesis using:               \DeclareBibliographyCategory{primary}     \DeclareBibliographyCategory{secondary}     \addtocategory{primary}{primaire}     \addtocategory{secondary}{secondaire}      in the preambule as I sorted my sources by the keywords "primaire" and "secondaire". This, by using the commands:               \printbibliography{category=primary, heading=subbibliography,%                 title={Sources Primaires}}     \printbibliography{category=secondary,heading=subbibliography,%                 title={Sources Secondaires}}      enabled me to have two subdivisions in the bibliography entitled "Sources primaires" and "Sources secondaires". My issue is that I have different types of primary sources and different types of secondary sources that I want to subdivide by using several keywords in the bib file. In the primaray category I want to sort them by type and in the secondary by keywords, having eventually a bibliography with two big category, each one being subdivided in several sub-categories (each sub-category having it's own heading title). I've looked through the biblatex documentation without finding an answer. I now how to separate both (creating categories or having a subdivided bibliography by type or keywords) but I don't see anything about "subdividing categories" themselves. I hope my question is clear enough.


title: I have a problem with mathptmx

text: My aim is to write a paper in Times New Roman. The journal that I am submitting to advised me in their template to use the `mathptmx` package. So I downloaded the `psnfss` package from CTAN. I installed it like this:   1. I extracted and saved the files in my directory where I keep all my packages   2. I refresh FNDB   3. I install in package manager (where it says that psnfss is already installed from before and I can't find mathptmx in the list I try to compile the following code:               \documentclass[smallextended]{svjour3}     \usepackage{amsmath}     \usepackage{mathptmx}     \usepackage[T1]{fontenc}     \usepackage{epstopdf}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{geometry}     \usepackage{graphicx}     \usepackage[comma,authoryear]{natbib}          \begin{document}     \title{Very good title here}               \author{Fantastic author here}          \maketitle          \begin{abstract}     Abstract          \keywords{First keyword \and Second keyword}     \end{abstract}          \end{document}      If I compile without the line `\keywords{First keyword \and Second keyword}` it works! So my guess is that my problem has something to do with the symbol `\and` and that I need some other package for the compiling to work. Does anyone have a suggestion?


title: How to refer to a glyph in a font from xelatex?

text: I have a font, and I want to refer to a specific glyph without any regards to the encoding (I am using Unicode for everything else). Just pick glyph #n out of it. Can this be done in xelatex?


title: embedding listing code into tables?

text: I want to create a simple table in this case with the first column having snippet of code, and the secon column describing it. The command \java is just defined as:               \newcommand{\java}{\begin{lstlisting}[language=Java]}      The whole row becomes the style of my java code.               \begin{tabular}{l|l}     \java     private     \end{lstlisting}     &   Only entities declared inside the class are allowed to refer to private symbols \\          \java     protected     \end{lstlisting}     &   Entities declared inside the class or children of the class \\          \java     public     \end{lstlisting}     &   Everyone is allowed to refer to public symbols          \\          default (no qualifier specified)     &   Entities in the class, children of the class, or anyone in the same package are allowed access.     \end{tabular}


title: LaTeX templates

text: I am writing my thesis using LaTeX and it actually is the first time I use it. I am using some templates from my university but they are in Spanish and I want to write my work in English. The reason of this message is that I am getting crazy with the indexes and the bibliography because, although I want the title of these chapters to be in English, they are written in Spanish. Of course I have tried to find out where the mistake is and even found some information on the Internet but it is not working out. This is how I am managing the indexes:               \addcontentsline{toc}{chapter}{List of figures}            \listoffigures            \newpage \thispagestyle{empty}          \addcontentsline{toc}{chapter}{List of tables}        \listoftables            \newpage \thispagestyle{empty}      But instead of List of figures/tables, the Spanish translation appears in the pdf. On the other hand, this is how I managed the references:               \bibliographystyle{unsrt}     \bibliography{references}


title: How is typesetting in multiple columns implemented

text: I can type               \documentclass[twocolumn]{scrartcl}      to get a document typeset in two columns. But how does this works internally? I read _The TeXbook_ , but didn't find a single paragraph about this. (Maybe I didn't look carefully enough.)


title: Saving language preferences for inputing source code

text: Using the `listings` package, I am trying to input a Java source file into my document using a specified, user-defined style. This works just fine if I have the specified style definition in the same document. However, I wish to save the style so that I can use it without having the definition directly in my document. Section 2.4.1 of the `listings` manual sounded promising, so I attempted to save my style in a file called `listings-java.prf` in the same directory as the `listings.cfg` file itself. I then added `\input{listings-java.prf`} at the bottom of `listings.cfg`. However, when I try to use the style, I get an error saying that it cannot load the requested style for whatever reason. It's the same error I get if I try to specify a style that doesn't exist, so I assume that it is not even trying to read my file or else my file incorrectly written/specified/otherwise linked to. The guide says to ensure the file is located within TeX's search path, and I assume that the directory containing `listings.cfg` is in that path, which is why I placed it there. What am I doing wrong, and how can I fix it? **EDIT:** Following the suggestion in comments, I have shifted my `\input` command up a line, directly before the `\endinput` command in `listings.cfg`. Now, I get the following error (despite `listings-java.prf` being in the same directory):               (E:\non-modeling\LaTeX\tex\latex\listings\listings.sty     (E:\non-modeling\LaTeX\tex\latex\listings\lstmisc.sty)     (E:\non-modeling\LaTeX\tex\latex\listings\listings.cfg          ! LaTeX Error: File `listings-java.prf' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: prf)      So it would appear that the same directory does not count as being in TeX's search path. How can I add it? When I manually input the absolute path to the file, it proceeds to read it, but then tells me that `\definecolor` is an undefined control sequence. I tried adding `\usepackage{xcolor}` to the top of the file, but then I get errors about that package already being in use (because I also have it at the top of my document file). Can this be fixed, or do I need to inline all references to the defined colors? Here's `listings-java.prf`:               \definecolor{bg}{RGB}{25,25,25}       % code background color     \definecolor{fg}{RGB}{166,166,166}    % code foreground color     \definecolor{kw}{RGB}{194,77,67}      % keyword color     \definecolor{ct}{RGB}{80,84,79}       % comment color     \definecolor{st}{RGB}{185,185,114}    % string color     \definecolor{cs}{RGB}{248,248,242}    % classname color     \definecolor{hl}{RGB}{71,148,99}      % highlighting color     \definecolor{at}{RGB}{253,151,31}     % annotation color          \lstdefinestyle{Java}{         language=Java,                  % choose the language of the code         basicstyle=\footnotesize        % the style of the fonts that are used for the code                    \ttfamily                    \color{fg},         numbers=left,                   % where to put the line-numbers         numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers         stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered         numbersep=5pt,                  % how far the line-numbers are from the code         backgroundcolor=\color{bg},     % choose the background color         showspaces=false,               % don't show spaces by adding particular underscores         showstringspaces=false,         % don't underline spaces within strings         showtabs=false,                 % don't show tabs within strings by adding particular underscores         frame=single,                   % adds a frame around the code         rulecolor=\color{BrickRed},         tabsize=2,                      % sets default tabsize to 2 spaces         captionpos=b,                   % sets the caption-position to bottom         keywordstyle=\color{kw}\bf,     % the style of the font used for keywords         commentstyle=\color{ct},        % the style of the font used for comments         stringstyle=\color{st},         % the style of the font used for strings         breaklines=true,                % sets automatic line breaking         breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace         escapeinside=\`\`,              % if you want to jump out to LaTeX within the code         moredelim=**[is][\color{hl}\bf]{@@}{@@} % delimeters for highlighting pieces of code     }      I get the same error even if I remove all information concerning color and have only the style definition in the file. Here's `listings.cfg`:               %%     %% This is file `listings.cfg',     %% generated with the docstrip utility.     %%     %% The original source files were:     %%     %% lstdrvrs.dtx  (with options: `config')     %%      %% The listings package is copyright 1996--2004 Carsten Heinz, and     %% continued maintenance on the package is copyright 2006--2007 Brooks     %% Moses. From 2013 on the maintenance is done by Jobst Hoffmann.     %% The drivers are copyright 1997/1998/1999/2000/2001/2002/2003/2004/2006/     %% 2007/2013 any individual author listed in this file.     %%     %% This file is distributed under the terms of the LaTeX Project Public     %% License from CTAN archives in directory  macros/latex/base/lppl.txt.     %% Either version 1.3 or, at your option, any later version.     %%     %% This file is completely free and comes without any warranty.     %%     %% Send comments and ideas on the package, error reports and additional     %% programming languages to Jobst Hoffmann at <j.hoffmann@fh-aachen.de>.     %%     \ProvidesFile{listings.cfg}[2014/03/04 1.5c listings configuration]     \def\lstlanguagefiles         {lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty}     \lstset{defaultdialect=[R/3 6.10]ABAP,             defaultdialect=[2005]Ada,             defaultdialect=[68]Algol,             defaultdialect=[gnu]Awk,             defaultdialect=[ANSI]C,             defaultdialect=[light]Caml,             defaultdialect=[1985]Cobol,             defaultdialect=[WinXP]command.com,             defaultdialect=[ISO]C++,             defaultdialect=[95]Fortran,             defaultdialect=[5.2]Mathematica,             defaultdialect=[OMG]OCL,             defaultdialect=[Standard]Pascal,             defaultdialect=[67]Simula,             defaultdialect=[plain]TeX,             defaultdialect=[97]VRML}     \lstalias[]{TclTk}[tk]{tcl}     \lstalias[6.1]{ABAP}[R/3 6.10]{ABAP}     \lstalias[3.1]{ABAP}[R/3 3.1C]{ABAP}     \lstalias[4.6]{ABAP}[R/3 4.6C]{ABAP}          \input{listings-java.prf}          \endinput          %%     %% End of file `listings.cfg'.


title: LaTeX is crossing its limits

text: Pardon for the funny title. I have a large report in the middle of which there is a sentence               Let $\mathcal{L}$ : $\mathcal{O}$ $\rightarrow$ $\mathcal{S}$ be a function      This shows in the report as in the third line of the following image. ![L:O->S](http://i.stack.imgur.com/DYhhl.png) Now I want the function declaration `L:O->S` to be in one line. Can anything be done? Also, there is another line in the report               For example, a square lattice has the security classes, $\mathcal{S}$ = \{\textit{Unclassified},\textit{$Secret_1$},\textit{$Secret_2$},\textit{Top Secret}\}.      This line shows in the report like this ![S={U,S1,S2,TS}](http://i.stack.imgur.com/qoOQv.png) I don't want `S = {Unclassified, Secret1, Secret2, Top Secret}` to go beyond the margins. MWE for this problem is:               \documentclass{report}     \begin{document}     For example, a square lattice has the security classes, $\mathcal{S}$ = \{\textit{Unclassified},\textit{$Secret_1$},\textit{$Secret_2$},\textit{Top Secret}\}.     \end{document}      Can anything be done?


title: Reduce vertical spacing/gap - for \listoftables, \listoftables between heading and first entry

text: The following MWE demonstrates the large gap between the heading 'List of Tables' and the caption for the first entry in this list.   How can the vertical space between the heading and first line of text be reduced?               \documentclass[12pt]{book}     \usepackage[Bjornstrup]{fncychap}     \begin{document}             \listoftables                     \begin{table}                     \begin{tabular}{ll}                         1 & 2  \\                          3 & 4  \\                      \end{tabular}                     \caption{This is my table 1.}             \end{table}     \end{document}