title: Tree in tikz, with triangles standing for sub-trees

text: I need to draw a tree in tikz similar to this one: ![A tree](http://i.stack.imgur.com/sa5Vk.jpg) What I CAN'T DO is drawing the dashed triangle leaves (standing for unspecified subtrees). I think I can manage to draw the legend by myself, and am working on it. Any hint or idea? Here is a MWE showing what I did so far:               \documentclass[a4paper]{article}          \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[sibling distance=5cm, level 2/.style={sibling distance =2cm}]     \node[circle,draw,fill=black] {}         child{ node[circle, fill = black] {}                 child{ node[circle, draw] {}                             child{ node {Q1} }                      }                 child{ node[rectangle, fill = black] {}                         child {                             node[rectangle, fill = black] {}                                 child{ node {Q2} }                                 child { node[circle,draw] {}                                          child { node {Q3} }                                                              }                             }                     }             }         child{ node[circle, draw] {}                 child{ node {Q4} }                 child{node {Q5} }                    };     \end{tikzpicture}     \end{document}


title: Self adjusting vertical line in scalar product

text: I'm trying to define a new command for scalar product. So far, it looks like this:               \newcommand{\ilskal}[2]{\left(#1\left|#2\right)}      However, when I was trying to put something riddiculously high in one of the fields, the separator (|) remained the same height. I tried modifying the command:               \newcommand{\ilskal}[2]{\left(#1\left|\phantom{\right}#2\right)}       However, that doesn't work; by putting a matrix in one of the fields I get an error. Putting anything else produces an error as well. Why? I tried substituting | for other vertical lines, but it didn't help.


title: Relative positioning of Lewis electrons in chemfig

text: I am defining a submolecule in chemfig (2,2'-bipyridine) and I want to show the lone pair of electrons on both the Nitrogens. (For those who care, I wish to show a coordination bond between the lone pairs and a metal but that's the next question!) I have defined the submolecule and when I display it rotated the positioning of the lone pairs does not rotate as the `\lewis` command uses absolute positions rather than relative positions. Is it possible to have relative lewis positions which can allow for rotation of the full molecule? (I attach nodes to the Ns so I can draw dative bonds from them at a later stage...) MWE below...               \documentclass{article}     \usepackage{chemfig}               \definesubmol{bipy}{*6(-=-(-*6(-=-=-@{datN1}\lewis{3:,N}=))=@{datN2}\lewis{2:,N}-=)}               \begin{document}                    \chemfig{!{bipy}}          \vspace{1cm}%just for clarity     \chemfig{[:60]!{bipy}}\\     Should have the lone pair of electrons on the lower N in position 4 and on the upper N in position 5 according to   \verb|\lewis{}| command in chemfig     \end{document}      ![bipy molecule](http://i.stack.imgur.com/zmWFR.png) ![enter image description here](http://i.stack.imgur.com/zdken.png)


title: Typewriter quotation marks in texttt

text: I'd like to do the text               "conservative"      with the quotation marks into a `\texttt`. However, when I do so, the first quotation mark is removed. I'm using the LNCS documentclass, I'm not sure if this has something to do with it. I also can't escape the first `"`, then it puts two dots above the `c`, which is wrong.


title: How can I get my LaTeX set up on Emacs/AUCTeX to use the -file-line-error option when calling pdfTeX

text: I have been puzzling over this for the past few hours and can't quite figure it out. I am using AUCTeX 11.87 and MiKTeX 2.9 on Emacs 24.2 (obtained from Vincent Goulet with AUCTeX pre-packaged): I am having trouble getting AUCTeX to compile my LaTeX file on windows 7 and throws me into a blank screen with a cryptic message of 'Error after last TeX file closed". Even though same file compiles on my set-up on Ubuntu 12.1. From my searching this site and Google I seem to have tracked the problem to the need to use the -file-line-error flag when pdfTeX gets called. I read through the code for AUCTeX but it gets very convoluted and I can't figure out where I would need to insert -file-line-error in any of the customizable options. Any suggestions on how to proceed would be welcome. I would prefer not to manually change any configuration files as I came across an admonishment not to do so in the pdfTeX manual.


title: What is the command prompt ? How can I use it in Texmaker for package installation using "kpsewhich" tool

text: Someone is answering me to use a command (`kpsewhich --help`) in the command prompt. I have a stupid question: what is the "command prompt" and how can I use it in `Texmaker`?


title: Do something on every page

text: I want to know how to do something on every page. I'm just curious. I have checked KomaScript source code, but it is too complicate and too difficult for me. I tried to see how `\lohead` was made. This "doing something on every page" bothers me a lot. I need to know.


title: bbm.sty not found, unknown option 'ngerman'

text: there is a piece of my header.tex:               \documentclass[paper=a4,toc=bibliography,chapterprefix,parskip=true}{scrreprt}     % -------------------------------------------------------------------          %%% Laden elementarer Pakete     %     % Deutsche Schriftpakete                  % alternativ: 'utf8' oder 'latin9' statt ansinew               \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     % Mathematische Pakete     \usepackage{amsmath,amssymb, bm, bbm}         % Formelsetzung und      mathematischen Symbole     \usepackage[amsmath, thmmarks]{ntheorem}     % Theorem-Umgebungen,      alternativ: 'amsthm'     %     % Grafik-Pakete einbinden     \usepackage{graphicx,psfrag}                % Basis-Pakete zum Laden von      Bildern (jpg?)     \usepackage{float}     \usepackage{color}         But I get errors               ! Package babel Error: Unknown option `ngerman'. Either you misspelled it     ! Package babel Error: You haven't specified a language option.     header.tex line 14! LaTeX Error: File `bbm.sty' not found.      But packages texlive-babel-german, texlive-bbm, texlive-bbm-macros, texlive- collection-extras are installed. Replacing ngerman by german or ngermanb or germanb has no effect. And in the line 15 of header.tex I have nothing about bbm. Thanks in advance! the whole project as a zip-file


title: (k)ubuntu, TeXLive manually installed, tlmgr not working

text: (Summary: `tmlgr` was not working in a typical manual (non-apt) install of TeXLive in Ubuntu.) In Kubuntu, I used `install-tl-unx.tar.gz`, and `install-tl --gui=text` to make a basic install. That is, I prefer not to use the full install, and get the few packages I need as I need them (`parskip`, etc.). I put               PATH=/usr/local/texlive/bin/x86_64-linux:$PATH; export PATH       in my `~/.profile` (and reboot) so that my Linux can find `latex` and `tlmgr`. Here are the type of errors I get when trying to use `tlmgr`.               (running on Debian, switching to user mode!)                                               cannot setup TLPDB in /root/texmf at /usr/bin/tlmgr line 5336.        Googling for this leads to a suggestion to use               tlmgr init-usertree       Then I get               sudo tlmgr install parskip.sty     (running on Debian, switching to user mode!)     /usr/bin/tlmgr: Initialization failed (in setup_unix_one):     /usr/bin/tlmgr: could not find a usable xzdec.     /usr/bin/tlmgr: Please install xzdec and try again.     Couldn't set up the necessary programs.     Installation of packages is not supported.     Please report to texlive@tug.org.     tlmgr: exiting unsuccessfully (status 1).      Okay, drum roll for the answer... as simply formulating the question carefully pointed me to an obvious next step, which seems to be the "terminal" of my problem.


title: How to add additional space for the last group of bars in gnuplot?

text: I used this:               plot 'dat' u 2:xtic(1) t 'pca-10', \          'dat' u 3 t 'pca-20', \          'dat' u 4 t 'pca-30', \          'dat' u 4 t 'pca-30'      my data is:               antlr   0.9424  0.9363  0.7754  0.7506     bloat   0.9623  0.9357  0.8704  0.7807     eclipse 0.7874  0.7958  0.3617  0.3903      fop    0.8866  0.8720  0.6590  0.6146     luindex 0.9028  0.9031  0.5168  0.5847     average 0.8950  0.8926  0.6185  0.6332      The last row is the average. How can I add additional space just before the average group of bars, so that it would be more visible?


title: Difficulty modifying an array environment

text: I have an array that I had past help on and now I am attempting to modify that array. However, when doing so, parts of my "theorem" keep getting shifted to the next line. Here is a MWE:               \documentclass{article}     \usepackage{amsmath,array}% http://ctan.org/pkg/{amsmath,array}     \newcommand{\twolinebrace}{\rlap{$\smash{\raisebox{.5\height}{\bigg\}}}$}}     \newlength{\LHS}\newlength{\RHS}     \newcolumntype{M}{>{$}p{\LHS}<{$}}     \newcolumntype{N}{>{$}p{\RHS}<{$}}     \begin{document}     \begin{theorem}     Let $\{A_{\alpha \colon \alpha \in A}\}$ and $\{B_{\beta \colon \beta \in  B}\}$ be families of subsets if a set $X$. Then:     \[     \renewcommand{\arraystretch}{1.1}     \begin{array}{@{}l@{\quad}l@{}}     \left.\kern-\nulldelimiterspace\                 \begin{array}                                                                       {>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}       (a) & \big(\bigcup_{\alpha\in A} A_{\alpha}\big) \cup \big(\bigcup_{\beta\in B} B_{\beta}\big) & \bigcup_{(\alpha,\beta)} A_{\alpha} \cup B_{\beta}\      (b) & \bigg(\bigcap_{\alpha \in A A_{\alpha}} \bigg) \cap \bigg(\bigcap_{\beta \in B B_{\beta}} \bigg) &  \bigcap_{(\alpha,\beta)} A_{\alpha} \cap B_{\beta}      \end{array}\right\} & {\text{Associative Laws}} \    \left.\kern-\nulldelimiterspace\begin{array}{>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}       (c) & X \cup (Y \cup Z) & (X \cup Y) \cup Z \      (d) & X \cap (Y \cap Z) & (X \cap Y) \cap Z      \end{array}\right\} & {\text{Associative Laws}} \    \left.\kern-\nulldelimiterspace\begin{array}{>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}       (e) & X \cup (Y \cap Z) & (X \cup Y) \cap (X \cup Z) \      (f) & X \cap (Y \cup Z) & (X \cap Y) \cup (X \cap Z)     \end{array}\right\} & {\text{Distributive Laws}} \    \end{array}     \]     \end{theorem}     \end{document}      I needed to add to my array, and now I am having additional problems. Now, the "text" 'Associative Laws', 'Distributive Laws', and 'de Morgan's Laws' are not being displayed correctly. Here is my latest MWE:               \documentclass{article}     \usepackage{amsmath,array}% http://ctan.org/pkg/{amsmath,array}     \newcommand{\twolinebrace}{\rlap{$\smash{\raisebox{.5\height}{\bigg\}}}$}}     \newlength{\LHS}\newlength{\RHS}     \newcolumntype{M}{>{$}p{\LHS}<{$}}     \newcolumntype{N}{>{$}p{\RHS}<{$}}     \begin{document}     \begin{theorem}     Let $\{A_{\alpha \colon \alpha \in A}\}$ and $\{B_{\beta \colon \beta \in  B}\}$ be families of subsets of a set~$X$. Then:     \[     \renewcommand{\arraystretch}{1.25}     \begin{array}{@{}l@{\quad}l@{}}     \left.\kern-\nulldelimiterspace\begin{array}{>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}     (a) & X \cup Y &  Y \cup X \\       (b) & X \cap Y &  X \cap Y     \end{array}\right\} & {\text{Commutative Laws}} \\     \left.\kern-\nulldelimiterspace\begin{array}{>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}     (c) & X \cup (Y \cup Z) & (X \cup Y) \cup Z \\       (d) & X \cap (Y \cap Z) & (X \cap Y) \cap Z      \end{array}\right\} & {\text{Associative Laws}} \\     \left.\kern-\nulldelimiterspace\begin{array}{>{\bfseries}p{2em}@{\quad}M@{\quad$=$\quad}N}     (e) & X \cup (Y \cap Z) & (X \cup Y) \cap (X \cup Z) \\       (f) & X \cap (Y \cup Z) & (X \cap Y) \cup (X \cap Z)     \end{array}\right\} & {\text{Distributive Laws}} \\     \end{array}     \]     \end{theorem}      Any additional help would be greatly appreciated in this matter.


title: Specifications for input image

text: I need to specify a specific location for a picture. Are there any options for this in LaTex? The picture should be specified with something like: 2cm from top and 3 cm from left side.The reason for this is that i need to print the document to some labels.


title: AUCTeX preview-latex previews are ugly (too narrow)

text: Is there a way to fix Emacs AUCTeX's preview-latex to make the previews look less ugly? Specifically, they are squashed vertically to a height of exactly one line of text. I have screenshots to show you what I mean. ![LaTeX](http://i49.tinypic.com/345ybv6.png) (notice how lines 69 and 70 are wider than the surrounding lines to add make the section names stand out). ![Preview](http://i46.tinypic.com/3444e4o.png) (notice how lines 69 and 70 are now the same width as the other text lines). How can I fix this behaviour so that the size of lines get resized automatically to allow for correctly proportioned previews? The example above is just for a section name, but it also happens for equations, which are affected even more. Thanks! EDIT: Here's an example of an equation preview: ![Equation preview](http://i49.tinypic.com/k1xqnk.png) Compare to: ![Correct equation preview](http://kubieziel.de/pics/auctex-preview.png) Furthermore, the problem is not with the images being restricted to only one line spacing after all (this equation takes up the equivalent of about 3 lines of vertical spacing), but they are still stretched out too wide.


title: Package inputenc Error: Unicode char -> from bibliography file

text: Recently I added a name in my bibliography file with the letter É. When I tried to compile, Texstudio gave me the following code: > Package inputenc Error: Unicode char \u8:É. not set up for use with LaTeX > N.~Nisan, T.~Roughgarden, É. My first step was to change the letter to E in the bibliography file (Jabref) but the error did not go away. Even after deleting the complete entry from the bibliography I still get the same error. My Latex document contains the following bibliography formatting:               \usepackage[comma, sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers' which was after square           %Underneath should help with citing an article's title....     \def\mybibtexdatabase{Bibliography}          \usepackage{usebib}     \newbibfield{title}     \bibinput{\mybibtexdatabase}      In what way can I get rid of the error message? **edit:** I found out that the file main.bbl (my main latex file is main.tex) still contained the bibliography entry that gave the error. When I deleted the entry from that file everything was able to compile again. This solves my question.


title: How to reduce the size of an .eps file?

text: I know that this issue is not LATEX, but I think that it´s usefull for me and for others, because .eps is very used with latex. I have 15 .eps files of 4 MB, and I note that it´s a little heavy to the viewer and to the compile to PDF. How could I reduce this size without lossing many quality. I use imagemagick sometimes. Here is an example file https://www.dropbox.com/s/7n9hlpszm7m10jc/p01.eps


title: Overlong line even with suggestions for hyphenation

text: I have a paragraph which starts with               \documentclass[a4paper,11pt,twoside]{book}     \setlength{\textwidth}{14.6cm}            \hyphenation{MnTPPCl  CoTPP}     \begin{document}          We studied surface doping with the following molecules:     2,3,5,6-tetrafluoro-7,7,8,8-tetra\-cyano\-quino\-dimethane     (F$_4$TCNQ), manganese(III)-tetra\-phenyl\-porphyrin-chloride     (MnTPPCl), cobalt(II)-tetra\-phenyl\-porphyrin (CoTPP), and     fullerene (C$_{60}$).     \end{document}      which ends up to give an overlong line at "(MnTPPCl)" ![enter image description here](http://i.stack.imgur.com/SDYmW.png) Even giving possibilities for hyphenation, it gives me the overlong line with "(MnTPPCl)" sticking out. Why doesn't it just make a line break before "(MnTPPCl)"? How can I prevent it?


title: What is causing undefined control sequence?

text: I'm getting this error:               ! Undefined control sequence.     l.64 ...p(- \frac{E_j - E_i}{k_B T}) & \quad \text                                                       {:  E_j > E_i}\\     ?      ! Undefined control sequence.     l.65     1 & \quad \text                             {:  E_j<E_i}\\     ?       which is from this:               \begin{equation}\label{eq:hop}     w_{i,j}=w_0 exp(-2 \gamma R_{i,j})\left\{        \begin{array}{l l}         exp(- \frac{E_j - E_i}{k_B T}) & \quad \text{:  E_j > E_i}\\         1 & \quad \text{:  E_j<E_i}\\       \end{array} \right.     \end{equation}      But I don't understand why I get the error. This is my header:               \documentclass[11pt]{iopart}     %\newcommand{\gguide}{{\it Preparing graphics for IOP journals}}     %Uncomment next line if AMS fonts required     \usepackage{iopams}     \usepackage{graphicx, wrapfig}     \usepackage{fixltx2e}     \graphicspath{{images/}}     \DeclareGraphicsExtensions{.pdf,.png,.jpg,.gif}     \makeatletter     \g@addto@macro\@floatboxreset\centering     %\def\@cite#1{\textsuperscript{[#1]}}     \makeatother      And my class file is the standard IoP one from here Can anyone help me get read of this error?


title: TikZ: scope fading doesn't work with \includegraphics

text: In this example, the included PNG (the large rectangle in the middle) should fade from left an right due to the `scope fading` on a previous path. Why doesn't it? Edit: I genuinely need a fade as I am trying to simulate a crossfade by layering a partially transparent image onto another image. Using `\pgfdeclaremask` doesn't really work as the source textures are being cropped to the left and right (and the exact dimensions involved may change), so the mask size can't easily be determined. How can I obtain a crossfade? ![enter image description here](http://i.stack.imgur.com/1grUD.png) MWE:               \documentclass{article}     \usepackage{tikz}          \usetikzlibrary{shadows}          \tikzset{path image/.style 2 args={     path picture={     \node at (path picture bounding box.center) {     \pgfimage[height=#2]{#1}     };}}}          \begin{document}     \begin{tikzpicture}         \draw[path image={texture_red.png}{90mm}] (3mm,3mm) rectangle (63mm-3mm,88mm-3mm);         \draw[black,scope fading=east] (0,0) rectangle (63mm,88mm);          \draw[path image={texture_black.png}{90mm}] (3mm,3mm) rectangle (63mm-3mm,88mm-3mm);     \end{tikzpicture}     \end{document}      `texture_black.png` ![\[\]](http://i.stack.imgur.com/KyUlO.png) `texture_red.png` ![\[http://i.stack.imgur.com/MidAg.png\]](http://i.stack.imgur.com/MidAg.png)


title: unknown language \selectlanguage{english}

text: I'm writing my second document in latex and I'm using my universities template. But since I'm working on an English document and the template is for German papers I have to adjust the language.               ...     \begin{document}     \selectlanguage{english}      but it fails with:               ! Package babel Error: Unknown language `english'. Either you have     (babel) misspelled its name, it has not been installed,     (babel) or you requested it in a previous run. Fix its name,     (babel) install it or just rerun the file, respectively.      I tried to: sudo apt-get install texlive-lang-english and even: sudo apt-get install texlive-lang-all Any idea how to fix this?


title: How to prevent pagebreak in quote environment?

text: \begin{quote}     ``No matter how far apart the particles are when we try to collect one of them the relative probabilities of finding it in different places are strongly affected by the `interference term' in the cross-section it is not really `free' \dots "     \end{quote}      How to prevent a page-break occurring mid-quote in the above sample?


title: How to place text and image above the exact subfigure?

text: I want to draw something like this: ![enter image description here](http://i.stack.imgur.com/6Kz8T.png) I am able to draw like this: ![enter image description here](http://i.stack.imgur.com/Abcvj.png) This is the code for the same:               \documentclass{article}     \usepackage{tikz,subfig}     \begin{document}          \begin{figure}       \centering       \subfloat[Iteration Domain for a Tile]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \subfloat[Convex Bounding Boxes]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \subfloat[Disjoint Bounding Boxes]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \subfloat[Disjoint Bounding Boxes]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \caption{Bounding boxes for disjoint union of data regions}     \end{figure}          \end{document}      Now, I am facing two problems:   1. How can place center aligned text exactly above figure 1(b) and both figure 1(C) and (d)?   2. How do I draw a rectangle above figure (b), (c) and (d) only? Is there any way to do it?


title: Does biblatex-chem automatically format citations in captions for a particular publishers style?

text: I'm looking to insert a citation into the caption using `biblatex` and `biblatex-chem`. I'm trying to follow the citation style of the RSC. When making a reference in an RSC journal within a caption the output I've seen in journals is typically `(adapted from ref. 29.)`. So there is no superscript or parentheses. I can't replicate this using `\autocite{}` or any of the other biblatex citation commands when citing within a `\caption{}`. In the MWE below `\autocite{}` will result in the general citation style used in normal text to be used.               \documentclass{article}     \usepackage[backend=biber, style=chem-rsc, articletitle, chaptertitle, language=auto, doi, isbn, defernumbers=false]{biblatex}      \usepackage[autostyle=true]{csquotes}     \addbibresource{./References/Thesis.bib}              \begin{document}          \begin{figure}     \includegraphics{Test.pdf}     \caption{Test test test test \autocite{Test2012}}     \end{figure}          \end{document}


title: XeLaTeX changing linespacing after macro

text: I have document for theses, and I noticed that line spacing changed after macro, creating part headline. I cant figure out what could cause this. If anyone has some idea let me know. this is the macro:               \renewcommand{\part}[1]{       \refstepcounter{part}       \addcontentsline{toc}{section}{\thepart~~\uppercase{#1}}%       \clearpage       \normalfont       \vspace*{9cm}      \begin{center}\huge \bfseries\thepart. \uppercase{#1}\end{center}%      \markboth{}{}\par      \nobreak      \clearpage       }      here is editable source document: https://www.writelatex.com/1099369kwfvst


title: Optimal arrangement of pictures/boxes in a page

text: **Does anybody come up with a way to automatically arrange a few figures or boxes in a larger rectangle or page?** Here it is a real world example: One is producing a `beamer` presentation. One has 4 or 5 ready made figures, of different aspect ratios. And wants to distribute the figures regardless of any special order but want the slide to more or less fill up and the height or width of each figure to adjust "nicely" and not necessarily regular or rectangular. _The idea is to minimize the unused space and/or make the pictures align/resize nicely._ But Doing this manually requires a lot of error and trial and keeping track of similar forced width or height of nearby images. For example, Google Images and Google+ uses this technique to optimize the space taken by images and posts: ![googleimages](http://i.stack.imgur.com/1y5oi.png) Fake code (will display 5 things automatically arranged, sequential order may be lost):               \begin{frame}     \begin{arrangedfigure}[5] %five boxes/images     \includegraphics{fig1} &     \includegraphics{fig2} &     \includegraphics{fig3} &     \minipage{text} &     \includegraphics{fig4}     \end{arrangedfigure}     \end{frame}      Related questions, dealing with this but not in an automatic way: Special arrangement of subfigures What is the best way of arranging multiple minipages on a page? How to arrange a figure consisting of four subfigures?


title: natbib does not show year

text: I'm using `natbib` and `plainnat` as bibliography style.               \documentclass[a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage[round]{natbib}     \usepackage[spanish]{babel}     \usepackage[utf8]{inputenc}     \begin{document}     \citet{DIJKSTRA1959}        \bibliographystyle{plainnat}     \bibliography{mybib}     \end{document}      where `mybib.bib` contains               @article{DIJKSTRA1959,        author    = {Dijkstra, E. W.},        title     = {A note on two problems in connection with graphs},        journal   = {Numer. Math.},        pages     = {269-271}        year      = {1959},        volume    = 1     }      I don't know why `\citet{DIJKSTRA1959}` not print the year. The result is: > Dijkstra > > E. W. Dijkstra. A note on two problems in connection with graphs. > Numer.Math., pages 269271. Is there a problem with the word "note" in the article's title


title: fit a very wide matrix

text: I'm tring to fit a 4x4 matrix that has long formulas as elements to A4 width.               \documentclass[]{scrbook}     \usepackage{amsmath}          \begin{document}     \begin{math}     \begin{bmatrix}     cos(a1)*cos(a4) - sin(a4)*(cos(a2)*cos(a3)*sin(a1) - sin(a1)*sin(a2)*sin(a3)) & cos(a4)*(cos(a2)*cos(a3)*sin(a1) - sin(a1)*sin(a2)*sin(a3)) - cos(a1)*sin(a4) & cos(a2)*sin(a1)*sin(a3) + cos(a3)*sin(a1)*sin(a2) & - b*sin(a1) - d*(cos(a2)*cos(a3)*sin(a1) - sin(a1)*sin(a2)*sin(a3)) - e*(cos(a2)*sin(a1)*sin(a3) + cos(a3)*sin(a1)*sin(a2)) - c*cos(a2)*sin(a1) \\      sin(a4)*(cos(a1)*cos(a2)*cos(a3) - cos(a1)*sin(a2)*sin(a3)) + cos(a4)*sin(a1) & cos(a4)*(cos(a1)*cos(a2)*cos(a3) - cos(a1)*sin(a2)*sin(a3)) - sin(a1)*sin(a4) & cos(a1)*cos(a2)*sin(a3) - cos(a1)*cos(a3)*sin(a2) & b*cos(a1) + d*(cos(a1)*cos(a2)*cos(a3) - cos(a1)*sin(a2)*sin(a3)) + e*(cos(a1)*cos(a2)*sin(a3) + cos(a1)*cos(a3)*sin(a2)) + c*cos(a1)*cos(a2) \\      sin(a4)*(cos(a2)*sin(a3) + cos(a3)*sin(a2)) & cos(a4)*(cos(a2)*sin(a3) + cos(a3)*sin(a2)) & cos(a2)*cos(a3) - sin(a2)*sin(a3) & a + d*(cos(a2)*sin(a3) + cos(a3)*sin(a2)) + e*(sin(a2)*sin(a3) - cos(a2)*cos(a3)) + c*sin(a2) \\      0 & 0 & 0 & 1     \end{bmatrix}     \end{math}     \end{document}      Is there a way to wrap the text? Please be patient, I'm new to this.


title: Latex equivalent of <pre>

text: This is probably a simple question, but I can't find the answer anywhere. How can I tell tex (latex specifically) not to format a piece of text? I.e. I want to keep indentation, line breaks, etc.


title: Using fancyhdr to create an image based header and footer

text: I'm trying to generate a latex report (via Sweave and R) where the header of the document is an image that covers everything (including the top/left/right page margin) and the footer covers everything (including the bottom/left/right page margin) such that the graphics for header and footer are flush to the page edges. Kind of like this: ![enter image description here](http://i.stack.imgur.com/sOUxJ.png) I've been playing around with `fancyhdr` but I can't seem to get it to do anything but stick out in the middle of the page. Additionally, I can't seem to get the header/footer to show up on ALL pages. Help would be appreciated, here's where I am so far:               \documentclass[a4paper]{letter}     \usepackage{fancyhdr}      \usepackage{lastpage}     \usepackage{float}      \usepackage{graphicx}     \floatstyle{boxed}      \restylefloat{figure}      \pagestyle{fancy}          \begin{document}     \lhead{\includegraphics{documenthead.jpg}}     \lfoot{{\includegraphics{footer.jpg}}}     \rfoot{\thepage}     \title{Example Document}     \author{Author Name}     \date {\today}     \maketitle     \section{This is a good example}     Example text goes here \\     Repeat me to force a new page \\      \end{document}


title: Hyphenation does not work with acro and luatex, but with pdftex

text: I'm using luatex 0.70.1 together with acro 1.2 and I have the following MWE.               \documentclass{minimal}     \usepackage[ngerman]{babel}     \usepackage{acro}          \DeclareAcronym{DNA}{         short=DNA,         long=Desoxyribonukleinsäure     }          \begin{document}     Das ist ein sehr langer Satz und er wird an seinem Ende leider nicht richtig umgebrochen: DNA-Sequenzierung          Das ist ein sehr langer Satz und er wird an seinem Ende leider nicht richtig umgebrochen: \acs{DNA}-Sequenzierung     \end{document}      Document looks normal with pdftex (both lines wrapped after dash), but when using luatex the 2nd line continues into the margin. I would have posted images, but due to the fact that this is my first post the systems doesn't allow it.


title: Creating software function index

text: I need to create some type of index for exported functions in the software for the latex manual. The doxygen feature of exporting to LaTeX does not allow to do it by default. The required form is following: Index: [function name], [function description] ....... [page] _other functions Text: [function name[ [function description] [additional information(function parameters, return type and so on...] Traditional index package have no possibility to add custom description to the index however (or I have not looked thoroughly?) Or the glossaries package has the required functionality? Here is file example:               GetOperationState %function name     function returns the actual state of measurement. %function description     %below is additional information     \begin{verbatim}     unsigned short GetOperationState(unsigned short Op)      \end{verbatim}     Parameters      \begin{description}         \item{Op}  Reserved for future use.      \end{description}     Return Values      ...Some Text...      Please help or give the direction of where to look.


title: Bibliography style with only the initials of the first names

text: I created a .bib file using BibDesk, which contains the following reference:               @article{Farrell:2005aa,         Author = {Farrell, Jay and Sharma, Manu and Polycarpou, Marios},         Cited-By = {113},         Date-Added = {2014-03-11 16:36:51 +0000},         Date-Modified = {2014-03-11 16:38:05 +0000},         Journal = {Journal of Guidance, Control, and Dynamics},         Number = {6},         Pages = {1089-1102},         Title = {Backstepping-based flight control with adaptive function approximation},         Volume = {28},         Year = {2005},     }      When I generate a TeX Preview in BibDesk this entry looks as follows: ![ex](http://i98.photobucket.com/albums/l272/Pinokkio89/ScreenShot2014-03-31at194449_zps765fdcbd.png) In my LaTeX document I use the following code to insert the references:               \bibliographystyle{plain}     \bibliography{MyBibFile}      With the following result: ![ex2](http://i98.photobucket.com/albums/l272/Pinokkio89/ScreenShot2014-03-31at194907_zps6a954996.png) Now I would like the reference in my report to look like as in the first example, that is with only the initials of the first names.


title: Customize the width of \widetilde on letters H, K, M, N, W, and X

text: For example either               $\widetilde{\bm{H}}$      or               $\widetilde{\boldsymbol{H}}$      would result rather huge tilde over the letter H, K, M, N, W, and X, please see the following alphabet: ![The \\widetilde \\bm alphabet](http://i.stack.imgur.com/CWqK4.png) I can understand the command adaptively adjust the width for specific letters, but how could I customize this width?


title: \bigl( \bigr) in inline mode and in align environment

text: The following, I believe, is a strange behavior of `\bigl(<math content>\bigr)` in inline math mode and in the align environment. Consider the following MWE: ![enter image description here](http://i.stack.imgur.com/IDzbV.png)               \documentclass[letterpaper]{article}     \usepackage{amsmath,amssymb,mathtools}     \usepackage{fourier}     \begin{document}     Consider having an exponential expression raised to another power; for instance, $\bigl(a^2\bigr)^4$. Using the definition of $a^n$,         \begin{align*}         \bigl(a^2\bigr)^4 &= \bigl(a^2\bigr)\bigl(a^2\bigr)\bigl(a^2\bigr)\bigl(a^2\bigr) && \text{Here the base is $\bigl(a^2\bigr)$}\\         &=\underbrace{(a\cdot a)(a \cdot a)(a \cdot a)(a \cdot a)}_{\text{$2 \cdot 4$ or 8  factors}}\\         &=a^8         \end{align*}     \end{document}      The difference is obvious if you zoom in. For example: ![enter image description here](http://i.stack.imgur.com/EX1wv.png)![enter image description here](http://i.stack.imgur.com/k5AYY.png) Note the parenthesis are of different heights. I suppose its due to the definition of the commands `\bigl` and `\bigr`. Can any one shed some insight into the matter. I know several users here prefer using the above rather than `\left` to `\right` so am refraining from these commands. I would also like a fix to the size of the parenthesis. ## EDIT It seems that the exponent, "superscript", is the one to blame here for its behaviour in the modes `\textstyle` and `\displaystyle`.


title: Not using abbreviations with cleveref

text: I’d like to use the `cleveref` package but I don’t like that it inserts most names as abbreviations; for instance, it will print “… fig. 2.1 …” instead of “… figure 2.1 …”. Is there a way of changing that _without_ manually changing all the `crefname`s? There doesn’t seem to be an appropriate option. Furthermore, when used in conjunction with the `hyperref` package, only the number is actually linked. The text in front of it (“figure” in my example) isn’t. Can this also be changed (again, without redefining all the commands)?


title: Figures in odd pages, text in even pages; if no figures, then odd=even pages (i.e., no blank pages w/ numbering and headers...)

text: I'm writing my thesis using `\documentclass{book}`. I have plenty of figures and I want them to appear always on the right hand of my manuscript (since this is the "attraction" page when reading, and figures in my field are much more important). Figures on left pages, text on right ones with class book, numbering only on right pages Figures on left pages, text on right ones with class book (cont.) do not cover this issue quite in the same way, and I didn't manage to improve that into something useful to me... In this case, the odd pages should have normal headings (differently defined for odd and even pages with `\usepackage{fancyhdr}`), normal numbering and no blank pages should appear unless defined. Figures should try to appear always in the odd pages, BUT if there is more figure pages than text pages, figures should be located in the even pages as normal (see Example 1), and if there is more text pages than figure pages, text should be placed in odd pages as normal (see Example 2). No figures from Chapter 1 should appear in Chapter 2, for obvious reasons. Example 1 > Output:   >  Text pages: 20   >  Figure pages: 23   >  Three extra odd pages with figures would have appeared and three even pages > would be blank. Instead one should be able to locate some of those figures within the text in the even pages, as normal. Example 2 > Output:   >  Text pages: 23   >  Figure pages: 20   >  Three extra even pages with text would have appeared and three odd pages > would be blank. Instead one should be able to locate part of text in odd pages, as normal. I am a newbie, so my apologies if this is posted somewhere and I couldn't find it, or if this problem has an easy solution that I could have solved myself. Now that I've explained in detail, I have the feeling that has no easy solution, though! I hope you guys can help me!


title: How to divide a line or a curve into n equal pieces and tick it using PSTricks

text: When we draw `\psaxes` they initially have ticks and there's an option which lets us to omit them. I'm trying to put some ticks on my `\pscurve`, I was wondering is there a way to divide a line or a curve into n (e.g., 12) equal pieces and put a tick for them? As we do for the axes.               \documentclass{article}          \usepackage{pstricks , pst-plot}     \usepackage{pst-bezier}      \usepackage{pst-math}          \begin{document}          \psset{xunit=0.5cm,yunit=0.5cm}     \centering     \begin{pspicture}(8,8)     \psaxes[labels=none,ticks=none]{->}(0,0)(8,8)[$x$,0][$y$,0]     \pscurve{-}(1,1)(3,4)(6,6)(8,4)% want to devide this curve into 6 equal pieces and putting a tick on each     \end{pspicture}          \end{document}      this is what I get ![enter image description here](http://i.stack.imgur.com/SoUjW.jpg) While I want to have something like this : ![enter image description here](http://i.stack.imgur.com/1YoRH.jpg)


title: Usings tikz, how can I specify a coordinate with the x value from the coordinate in one system and the y value from the coordinate in another system?

text: Usually, I would use `(a, b |- c, d)` to get the coordinate `(a, d)`. But what do I do when `(a, b)` and `(c, d)` are in different coordinate systems? In particular, my first coordinate is `(axis cs:a, b)` (from `pgfplots`) and the second coordinate is simply `(c, d)`. In addition, I'm using symbolic x coordinates, so `a` is specified as `{foobar}`.               \documentclass{article}     \usepackage{fullpage}     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[symbolic x coords={{foo}, {bar}}]          \addplot [] coordinates {         ({foo}, 0)         ({bar}, 0)     };          % Works fine:     \draw [->, green] (axis cs:{foo}, 0.1) -- (axis cs:{bar}, 0.1);          % Package PGF Math Error: Could not parse input ' 0 |- 0' as a floating point     %  number, sorry. The unreadable part was near '|- 0'..     \draw [->, red] (axis cs:{foo}, 0 |- 0, -0.1) -- (axis cs:{bar}, 0 |- 0, -0.1);          \end{axis}     \end{tikzpicture}     \end{document}


title: Set margin background colour for all chapter pages

text: # Problem The `\setupbackgrounds` macro has the ability to change the background colour of the margins, from the top of the page to the bottom:                 \setupbackgrounds[footer,header,text][rightmargin][         background=color,         backgroundcolor=blue,       ]      However, once set, there does not seem to be a way to stop the backgrounds. This is preventing me from setting the background colour for only the chapter pages. I'm fairly certain I could use a layer for this, but since `\setupbackgrounds` already has context for the right margin's header, footer, and text areas, I thought it would be easiest to commandeer this macro:                 \setuphead[chapter][         header=empty,         footer=empty,         before={%           \setupbackgrounds[footer,header,text][rightmargin][             background=color,             backgroundcolor=blue,             state=repeat,           ]         },         after={%           \setupbackgrounds[footer,header,text][rightmargin][             background=color,             backgroundcolor=blue,             state=stop,           ]         }       ]      The `state=stop` doesn't stop the margin from being blue after the chapter page. Rather, the blue continues in the margin for the remainder of the document. I tried to stop the blue within the section:                 \setuphead[section][         before={%           \setupbackgrounds[][][state=stop]         }       ]      # Question Is it possible to use a `\setupbackground` in this way (if so, how)? If not, how would you use a layer to fill in the right-hand margin from the top of the page to the bottom? # Related   * http://www.ntg.nl/pipermail/ntg-context/2009/039667.html   * http://wiki.contextgarden.net/Overlays   * http://wiki.contextgarden.net/Titles#Title_page_with_special_background


title: Automatically count of glossary entries

text: I want to count all glossary entries of a document globally and automatically. Can I expand the macro `\glossaryentry` to do that and in such a way that I don't introduce a newly defined macro? I have heard about something like `\newcommandx` or similar. The counter must persist to the `.aux` so that I can use it in the body of the document.


title: How can I typeset determinants of Cramer's rule?

text: I want to typeset the determinants of the system               $\begin{cases}     a_1x+ b_1y = c_1,\\     a_2x+ b_2y = c_2.     \end{cases}$      I tried               $D=\left| \begin{matrix}        {{a}_{1}} & {{b}_{1}}  \\        {{a}_{2}} & {{b}_{2}}  \\     \end{matrix} \right|={{a}_{1}}{{b}_{2}}-{{a}_{2}}{{b}_{1}}$      and               $D_x=\Biggl| \begin{matrix}        {{c}_{1}} & {{b}_{1}}  \\        {{c}_{2}} & {{b}_{2}}  \\     \end{matrix}  \Biggr|={{c}_{1}}{{b}_{2}}-{{c}_{2}}{{b}_{1}}$      I don't understand, I get ![enter image description here](http://i.stack.imgur.com/zbqey.jpg)


title: How to avoid empty 'thebibliography' environment (bibtex) if there are no references?

text: I have a general and central preamble for a lot of similar-style documents (several dozens) and most of the documents have a Bibliography at the beginning, so I call               \bibliographystyle{alphadin}     \bibliography{refs}      in the central preamble to avoid a lot of duplicate code and to be able to change the bibliography style centrally. But sadly, a minority of these documents has an empty bibliography. And these give me a warning about an empty thebibliography environment. But the bigger problem is: the bibliography headline still appears in the pdf output. Is there a way to only get the bibliography headline and no warning when there is a non-empty bibliography? What would be the correct counters or booleans to address? Or is there an easy-to-use option? Minmal example:               \documentclass{article}          \begin{document}       \bibliographystyle{alphadin}       \bibliography{test}     \end{document}      Run latex, bibtex, latex, latex. Get for test.bbl               LaTeX Warning: Empty `thebibliography' environment on input line 10.      Entering the "patch" doesn't solve the problem. What I want ist: If there's no \cite{} within the document, don't display the bibliography. Content of bbl:               \begin{thebibliography}{}          % this bibliography is generated by alphadin.bst [8.2] from 2005-12-21          \providecommand{\url}[1]{\texttt{#1}}     \expandafter\ifx\csname urlstyle\endcsname\relax       \providecommand{\doi}[1]{doi: #1}\else       \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi          \end{thebibliography}


title: How do I make the first Part and Section in my ToC appear without a number to their right?

text: In the preamble I have:               \documentclass[11pt,a4paper]{book}     \setcounter{secnumdepth}{4}     \setcounter{tocdepth}{4}     \setcounter{part}{-1}      \setcounter{subsection}{0}      Which works out great for the Part of the book, but not the sections which follow, which now appear as:               Part     0.1 Chapter        0.2 Chapter     1 Part     1 Chapter       I don't want that 0.1 and 0.2 to appear. Instead, I'd like it to appear thus:               Part     Chapter     Chapter     1 Part     1.1 Chapter       How can I adjust my preamble to get those results? Any tips would be much appreciated. Thanks a lot.


title: LaTeX "command" /incantation for R

text: I am using the tufte-handout class in LaTeX and I want to refer to R using the "correct" sans-serif font. I am currently using               \newcommand{\R}{ {\bf \sffamily R } }      used as ...               ... function in the \verb|spatstat| \R package ...      What LaTeX "command" / incantation would you use?


title: Cannot create animation in beamer with xelatex using the animate package

text: I 'm not a TEX expert and I am trying to ceate some animations in a beamer presentation using the animate package. Making the animations in a "normal" document (not a presentation) everything is fine. When I try to put these animations into Beamer nothing happens. There is only the first frame(?) and nothing is working. I use the XELATEX flavor of TEX. For example, I can compile the code found in the second frame (answered by AlexG) in the page Animating Protocols, with LATEX, but not with XELATEX. Is there something I can do? Thanks in advance. Kostas.


title: Expand abbreviation automatically at beginning of line

text: According to an tradition in Spanish typesetting (Martinez de Sousa, MELE4), the abbreviation `etc.` should be fully expanded to `etcétera` when it appears at the beginning of the line (Spanish page in Wikipedia). I guess this could be done, using LuaTeX; by retypesetting the paragraph after checking if the beginning of the line is `etc.`. I think that upper limit of iterations should be used (probably the times `etc.` appears in the paragraph) because a new typesetting could move the location of `etc.`. (note: This practise is now not used because of this reflow of the text.) My question: Is someone willing to fight this challenge?


title: Error with pdf latex output "The font 'Roman' contains bad /Widths"

text: I have a paper written in latex with few figures. The figures were drawn with the powerpoint and converted to pdf and included in the latex source. When I generate the pdf form latex, and open it in Acrobat , I get an error "The font 'Roman' contains bad /Widths". I tried removing the Times new roman font from the figures, but still i receive the same warning. Although, the file is correctly rendered once I accept the warning, but when uploaded to an online paper submission portal the file can not be converted due to this error. Can any one suggest a solution or work around to remove this error.


title: More generic live preview editor? (can support pandoc and/or custom scripts)

text: I'm a fan of using things like pandoc, GPP and Rake to make my source files to look cleaner, be human readable, simplify my workflow and get some level of style/semantics separation (especially for larger projects). Yet, using these workflows I find I really miss having a live preview, like I did with latexian. My ideal solution would work on OS X and linux, and be able to let me use vim as my editor (like http://www.charlietanksley.net/philtex/vim-live-latex- preview/ or https://github.com/suan/vim-instant-markdown) but let me define a custom build script of some sort. Failing that, even a viewer that would regen the pdf whenever I write a source file to disk would suffice. It needn't support things like syncing to where i'm currently editing (though it would be nice), as long as whenever the pdf is reloaded it won't change the current position it's looking it. Failing even that, if someone could point me towards language bindings for a PDF Viewer or something similar so I can write my own script or app for this purpose I'd be very thankful.


title: How to change font-size for a grammar declaration

text: I have a grammar declaration like this:               \documentclass[12pt,a4paper]{report}     \usepackage{syntax}     \begin{document}     ...         \begin{figure}[h!]             \begin{grammar}                 <A> ::= `<--' <B> <C> `-->'                      <B> ::= <D>                      ...             \end{grammar}             \caption{A sample grammar}             \label{fig:sample-grammar}         \end{figure}     ...     \end{document}      LaTeX uses a superfluously large font to render it and some lines do not even fit on the page and need to be wrapped, which has a bad impact on clarity. How do I change font-size only for the grammar?


title: Reducing File size

text: I am using `XeTeX+bibTeX` to compile my LaTeX file. I have around 34 pages, which includes over 20 high Quality images (Large size which are rescaled) and I am using `a5paper` for the `book` document class. also I'm using `figure`, `TiKz` and `lslisting`. after compiling the document I now have a PDF of size 250MB ! could someone please give me a better compiling option (I'm using TeX Maker) or what to do to reduce size(best practices)? I forgot to mention that when having the `draft` option the file size becomes 100MB Thanks !


title: How to make the \frametitle row smaller in berkeley theme in beamer

text: ![my problem of berkeley ](http://i.stack.imgur.com/EYmn4.jpg) This theme is good,but I want the row a little small, how can I edit it. Thanks               \documentclass[14pt]{beamer}     \usepackage[space,noindent]{ctex}     \usetheme{Berkeley}     \setbeamercolor{normal text}{bg=black!10}     \begin{document}     \kaishu     \title[aaa]{aaa}     \subtitle{aaa}     \author{aaa}     \institute[aaa]{aaa}     \date[aaa]{aaa}     \logo{\includegraphics{TeXlogo.pdf}} % you can % it     \begin{frame}     \titlepage     \end{frame}     \section{aaa}     \subsection{aaa}     \begin{frame}     \frametitle{aaa}     \framesubtitle{aaa}     aaa 1、2、3...     \end{frame}     ...          \begin{frame}     aaa...     \end{frame}          ...     \section{aaa}     \subsection{aaa}     \begin{frame}     ...     \end{frame}     \end{document}


title: How to use the combine document class with the siunitx package

text: I am trying to squish several journal papers together (using the `combine` document class) to provide the filling for my thesis sandwich. The papers make use of the `siunitx` package but causes an error. A similar posting is here: Using the "combine" document class with the listings package from which I have adapted the folowing minimal working example:               \documentclass{combine}                       \usepackage[load=named]{siunitx}     \begin{document}          \begin{papers}     \coltoctitle{Title}     \coltocauthor{Author}     \label{lbl}     \import{test}     \end{papers}          \end{document}      and in test.tex               \documentclass{article}     \begin{document}      Hello World     \end{document}      and I get the following error:               ERROR: LaTeX error: "kernel/command-already-defined"         --- TeX said --- !     ! Control sequence \c_siunitx_textsf_tl already defined. Can anyone help?


title: Problems with Subfigures?

text: As a newbie to LaTeX, I am currently preparing my very first paper. Since the conference to which I am going to submit my paper to requires the authors to use the IEEE conference paper template. I encounter problems with the subfigures. The following is my **code**.               \documentclass[conference]{IEEEtran}     \usepackage{natbib} % for the bibliography     \usepackage[pdftex]{graphicx}     \usepackage[cmex10]{amsmath} % http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/     \usepackage{algorithm} % http://ctan.org/pkg/algorithms     \usepackage{algpseudocode} % http://ctan.org/pkg/algorithmicx     \usepackage{array} % http://www.ctan.org/tex-archive/macros/latex/required/tools/     \usepackage{mdwmath}     \usepackage{mdwtab} % http://www.ctan.org/tex-archive/macros/latex/contrib/mdwtools/     \usepackage{eqparbox} % http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/     \usepackage[tight,footnotesize]{subfigure} % http://www.ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/     \usepackage{fixltx2e} % http://www.ctan.org/tex-archive/macros/latex/base/     \usepackage{stfloats} % http://www.ctan.org/tex-archive/macros/latex/contrib/sttools/     \usepackage{url} % http://www.ctan.org/tex-archive/macros/latex/contrib/misc/          \begin{document}          \title{Title}          \author{     \IEEEauthorblockN{         Name1\IEEEauthorrefmark{1},         Name2\IEEEauthorrefmark{2},         Name3\IEEEauthorrefmark{3} and         Name4\IEEEauthorrefmark{4}}     \IEEEauthorblockA{\IEEEauthorrefmark{1}institute1\\ Email1}     \IEEEauthorblockA{\IEEEauthorrefmark{2}institute2\\ Email2}}          % make the title area     \maketitle          \begin{abstract}     %\boldmath     The abstract goes here.     \end{abstract}          \section{Conclusion}     % An example of a double column floating figure using two subfigures.     % (The subfig.sty package must be loaded for this to work.)     % The subfigure \label commands are set within each subfloat command, the     % \label for the overall figure must come after \caption.     % \hfil must be used as a separator to get equal spacing.     % The subfigure.sty package works much the same way, except \subfigure is     % used instead of \subfloat.     %     \begin{figure*}[!t]     \centerline{\subfloat[Case I]\includegraphics[width=2.5in]{subfigcase1}%     \label{fig_first_case}}     \hfil     \subfloat[Case II]{\includegraphics[width=2.5in]{subfigcase2}%     \label{fig_second_case}}}     \caption{Simulation results}     \label{fig_sim}     \end{figure*}          \end{document}      **Error Messages:**               ! Undefined control sequence.<argument> \subfloat[Case I]\includegraphics [width=2.5in]{subfigcase1}\lab... \label{fig_first_case}}     ! Undefined control sequence. \subfloat     ! Extra }, or forgotten \endgroup.\@endfloatbox ...pagefalse \outer@nobreak \egroup\color@endbox \end{figure}     ! Extra }, or forgotten \endgroup.\@endfloatbox ...pagefalse \outer@nobreak \egroup\color@endbox \end{figure}     Label `fig_sim' multiply defined.     There were multiply-defined labels.      Where did I do wrong?


title: How to make columns of multiple tables the same size?

text: In my document I have a couple of tables that each have to columns. I'd like to make the first column of all tables the same width, and the second column of each table should consume the rest of the page. The second requirement I could achieve with tabularx and using X. However, I do not know how I can make the first column of each table the same size without specifying an exact size. I do not want to specify an exact size since I want the first columns of all tables to have the minimal width that is necessary to display the longest text in the first column in any table. Is there any way to achieve that without specifying a concrete width?


title: How to write this equation in publication?

text: I have the equation in the twocolumn view               \documentclass[twocolumn]{article}     \usepackage{amsmath}               \begin{document}             \begin{equation}     \begin{aligned}       X(m) &= \frac{b-a}{N} \sum_{k=1}^{N} e^{-i2\pi (k-1)(m-1)/N} x(a + (b-a)\frac{k-1}{N}) \\      &= \frac{b-a}{N} \sum_{k=1}^{N} e^{-i2\pi (a + (b-a)\frac{k-1}{N})*\frac{m-1}{b-a}} \\     & x(a + (b-a)\frac{k-1}{N})e^{i2\pi a \frac{m-1}{b-a}} \\     & \xrightarrow{ N\to\infty } \int_{a}^{b} e^{-2\pi t \frac{m-1}{b-a}} x(t) dt\\     & e^{i2\pi a \frac{m-1}{b-a}} Qx(\frac{m-1}{b-a}).      \end{aligned}     \end{equation}     \end{document}      Output ![enter image description here](http://i.stack.imgur.com/QgUXu.png) **How would you present this equation in a twocolumn view?**


title: How to avoid the poles of the voltages to overlap the resistors?

text: Using this code in circuitkz I get this circuit ![enter image description here](http://i.stack.imgur.com/B5doJ.png)                \begin{circuitikz}[american]         \ctikzset {voltage/distance from node=1};         \draw           (0,0) to[battery,l=V] (0,2)          to[R,l^=$R_1$,v=$V_1$] (4,2)          to[R,l=$R_2$,v=$V_2$] (4,0)          (4,0) -- (0,0)         ;         \end {circuitikz}      How can I move V1 and V2 labels to the left and down, both the label themselves and the poles? It's so nasty to get the poles overlapping the resistors!!


title: Any way to check with a macro if an equation is too long to fit into a single line?

text: I have some very long equations which span a few lines. I'd like to   1. Break lines automatically.   2. Pagebreak.   3. Have an equals sign both at the end of the first line and at the beginning of the second line.   4. Have only one number for the whole thing. Environments I've tried:   1. split inside equation (manual line breaking, no pagebreaks)   2. dmath (no equals sign at the end of the first line and all workarounds lead to manual line breaking, no pagebreaks) (Putting an equal sign both at the end and at the beginning of the line (dmath))   3. aligned (manual line breaking, no pagebreaks)   4. align (manual line breaking, excessive numbers have to be removed manually, lack of centering looks _awful_ to me (just took a look at my calculus textbook and it seems I'm not the only one who thinks multiline equations should be centered))   5. gather (manual line breaking, excessive numbers have to be removed manually)   6. multline (manual line breaking) Of those 1-3 aren't usable because I'm left with half of a page blank. Of 4-6 multline seems the best one, alignment looks normal and it doesn't add numbers to every line. I'd like to to write a macro which would take one parameter. This parameter would be an equation (without any \\ and \nonumber inserted). It would find all equals signs and, at every sign, figure out whether the equals sign should be replaced with =\\=. Then it would put everything inside multline environment. So here's my question: is there any function which, given an equation as a parameter, could tell me whether it would fit in a single line or no?


title: beamer vs pptx for the slide of presentation

text: I am a very beginner of beamer. I know it can have good visual effect. But for me, it takes time. If I use a template, the slide would be boring. E.g., I do not add comments and others signs. So after my second think, at the moment, I decide to use pptx. And I want to if I try to lean beamer, is there any good book worth to read?


title: TeXmaker unable to find packages after installing texlive-full

text: I know this isn't the TeXmaker forum, but I was hoping someone had the same problem. Also, if someone knows the official texmaker forum please link it. I had a problem with algorithm2e and someone suggested installing texlive- full. So I did, and now my texmaker can't find (most) packages and just returns: 'Undefined control sequence.' On these lines:               \usepackage{algorithm2e}     \usepackage{ulem}     \usepackage{enumitem}      Might downgrading to texlive work? Any help is appreciated.


title: Adding rows to a table defined in a class

text: I want to create a table head in a class file and to be able to add new rows in that table in a .tex file. Is it possible?


title: How to properly define NOx

text: I'm writing a document containg NOx a lot. It appears in section titles, regular text and tables, in sans serif, roman, bold and medium. Therefore I defined a command:               \newcommand \nox {NO\textsubscript{x}\xspace}      To use this with hyperref I redefined in to:               \newcommand \nox {\texorpdfstring{NO\textsubscript{x}}\xspace}      The problem I now encounter is that the \xspace command no longer works and all spaces between NOx and the next word disappeared. I can manually include the space by adding a ~-symbol, but that makes spaces appear everywhere, which is also unwanted. How should I redefine \nox to achieve correct spacing and work together with hyperref.


title: Label(s) may have changed run pdflatex

text: I script my latex build in my source build. Sometimes it happens that I get this warning when I change something: > LaTeX Warning: Label(s) may have changed. Rerun to get cross-references > right. I found this question. But the solution just to run the command multiple times is not really a nice solution. Is there a way to tell pdflatex to build until the Labels and cross-references are okay?               $pdflatex --version     pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)     kpathsea version 5.0.0     Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     There is NO warranty.  Redistribution of this software is     covered by the terms of both the pdfTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the pdfTeX source.     Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     Compiled with libpng 1.2.46; using libpng 1.2.46     Compiled with zlib 1.2.3.4; using zlib 1.2.3.4     Compiled with poppler version 0.18.2


title: Skip foreach-frame when missing content

text: I automatically generate slides with foreach:               \foreach \n in {1,...,200} {%       \begin{frame}{Slide with jpeg number \n}         \includegraphics[height=3cm]{FileA_\n.jpg}         \includegraphics[height=3cm]{FileB_\n.jpg}       \end{frame}%     }      The .jpg's come from another source, and sometimes a few of them are missing which causes the whole pdf-generation to break: "Package pdftex.def Error.File 'FileB_17.jpg' not found". If any of the two .jpg dont exist, I would like that the slide it belongs to will be skipped but that the compilation continues with the rest of the slides. How can I program that in LaTex? I work in RStudio with knitr.


title: How to typeset an isomorphism symbol ($\simeq$) with a long bar

text: Is there any way to typeset in LaTeX a `\simeq` with a longer bar, or equivalently `\stackrel{\sim}{\longrightarrow}` without the arrowhead?


title: How to write macros that behave like \item in an enviroment?

text: I am attempting to add an environment to a project that would take the following form:               \begin{example}       \source some text goes here to be used as an example.       \target some more text goes here as a translation for the first line.       \expl   here goes some text that explains the translation or provides               some comment. This part tends to be longer and may span several               lines, but never be more than a single paragraph.     \end{example}      What I would like to reproduce is the behaviour of the `\item` macro in the `itemize` environment; however, I have no idea where to begin. As far as it is possible, I would prefer to have a macro that does not require brackets but takes the following lines, including single line breaks as argument delimiters. Is writing something like:               \def\source#1\par{%       \textit{#1}\par}      the right way to go?


title: How to \maketitle in standalone

text: `\maketitle` does not seem to play very well with the `standalone` class. This document               \documentclass{standalone}     \title{Standalone does not like titles}     \author{Me}     \begin{document}        \maketitle     \end{document}      yields the error               ! Missing \endgroup inserted.     <inserted text>                      \endgroup      l.5    \maketitle      Is it possible to use them together?


title: listings package cannot load any language

text: My MWE cannot load any language. OS: Ubuntu 14.04 64 bit. TexWorks Version 0.5 r.1350 (Debian) Here is the code:               \documentclass[11pt]{article}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{graphicx}     \usepackage[margin=1in]{geometry}     \usepackage{float}     \usepackage{algorithm2e}     \usepackage{hyperref}     \usepackage{listings}          \lstloadlanguages{[5.2]Mathematica}                         \title{Test\\}     \author{Omar Shehab\\       Department of Computer Science and Electrical Engineering,\\       University of Maryland, Baltimore County, USA\\       \texttt{shehab1@umbc.edu}}     \begin{document}          \maketitle          \begin{lstlisting}     (* The objective function *)     objectiveFunction[q12_, q13_, q24_, q34_, q35_, q46_,         q56_] := (q12 + q13) - 2 (q12 q13) + (q12 + q24) -         2 (q12 q24) + (q35 + q56) - 2 (q35 q56) + (q46 + q56) -         2 (q46 q56) - 4 (q13 + q34 + q35) +         3 (q13 q34 + q34 q35 + q35 q13 ) - 4 (q24 + q34 + q46) +         3 (q24 q34 + q34 q46 + q24 q46);          (* A helper function to evaluate the objective function *)     evaluateObjectiveFunction[list_] :=        objectiveFunction[list[[1]], list[[2]], list[[3]], list[[4]],         list[[5]], list[[6]], list[[7]]];          (* Generating all possible inputs *)     all7BitBinStrings = IntegerDigits[Range[0, 2^7 - 1], 2, 7];          (* Exhaustive evaluations *)     For[i = 1, i <= Length[all7BitBinStrings], i++,       Print[i, "#", all7BitBinStrings[[i]], " : " ,        evaluateObjectiveFunction[all7BitBinStrings[[i]]]]]     \end{lstlisting}          \end{document}      TexWorks output is:               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)      restricted \write18 enabled.     entering extended mode     (./mwe.tex     LaTeX2e <2011/06/27>     Babel <3.9h> and hyphenation patterns for 2 languages loaded.     (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty     For additional information on amsmath, use the `?' option.     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))     (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty     (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty))     (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty)     (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)     (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))     (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)     (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))     (/usr/share/texlive/texmf-dist/tex/latex/amsmath/float.sty)     (/usr/share/texlive/texmf-dist/tex/latex/lib-shehab/algorithm2e.sty     (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)     (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)     (/usr/share/texlive/texmf-dist/tex/latex/lib-shehab/relsize.sty)     ********************************************************     Package `algorithm2e' Release 5.0 -- january 06 2013 --     - algorithm2e-announce@lirmm.fr mailing list for announcement about releases     - algorithm2e-discussion@lirmm.fr mailing list for discussion about package     subscribe by emailing sympa@lirmm.fr with 'subscribe <list> <firstname name>'     - Author: Christophe Fiorio (cfiorio@um2.fr)     ********************************************************     ) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty)     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/lib-shehab/url.sty))          Package hyperref Message: Driver (autodetected): hpdftex.          (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))     (/usr/share/texlive/texmf-dist/tex/latex/lib-shehab/listings.sty     (/usr/share/texlive/texmf-dist/tex/latex/lib-shehab/lstmisc.sty))          ! Package Listings Error: Couldn't load requested language.          See the Listings package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.12 \lstloadlanguages{[5.2]Mathematica}          ?


title: nopagebreak between rule and custom theorem env

text: I'm making a custom theorem environment. Here's a minimal example of my problem, with some filler text borrowed from the GPL:               \documentclass{scrbook}          \usepackage[dvipsnames]{xcolor}     \usepackage{amsthm}     \usepackage{etoolbox}     \usepackage{changepage}          \newcommand{\thmcolour}{\color{blue}}     \newcommand{\rulecolour}{blue}          % Indent theorem-like environments on both sides.     \newtheoremstyle{mytheorem}     {3pt}% space before     {3pt}% space after     {}% body font     {}% indent     {\bfseries\thmcolour}% header font     {.}% punctuation     {.5em}% after theorem header     {}% header specification (empty for default)          \theoremstyle{mytheorem}\newtheorem{definition}{Definition}[chapter]          \newcommand{\patchthm}[1]{       \AtBeginEnvironment{#1}{%         \goodbreak%         \begin{adjustwidth}{2.5em}{2.5em}%         \textcolor{\rulecolour}{%           \rule{\linewidth}{0.4pt}%         }\nopagebreak%       }       \AtEndEnvironment{#1}{%         \par\nopagebreak\noindent%         \textcolor{\rulecolour}{%           \rule{\linewidth}{0.4pt}%         }%         \end{adjustwidth}\par\goodbreak%       }     }     \patchthm{definition}          \begin{document}          Here is some text. The following rule represents a large figure that takes up a lot of space on the page.          \rule{0.5cm}{12cm}          The GNU General Public License is a free, copyleft license for software and other kinds of works.          The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.          When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.          The following definition breaks in the wrong place with my page margins.          \begin{definition}[bad break]     If a rule is separated from its content, this is bad.     \end{definition}          \end{document}      99% of the time this gives good-looking theorems with rules above and below and some indentation so that theorems stand out from the rest of the page:               text text text text text text text text text text text text                -------------------------------------------------               Definition 4 (foo). text text text text text text           text text text text text text text text text ...               -------------------------------------------------          text text text text text text text text text text text text       However, in some cases LaTeX doesn't care about my `nopagebreak`s and ends one page with a rule, starting the theorem/definition text on the next page which is bad. What I'd like is for LaTeX never to make a pagebreak between the opening rule and a theorem's text or the end of a theorem's text and a closing rule. If a theorem contains several paragraphs then I don't care about pagebreaks between them as long as the rules don't stand on a page on their own. Any suggestions, or have I made a simple mistake like putting the nopagebreak in the wrong place? Or is there a better way to get the effect I'm after? **EDIT:** I've turned it into a MWE - when I compile this, the opening rule of the definition lands on page 1 and the rest on page 2. I also changed `rulecolour` from a `\color` to a `\textcolor` command due to this question as `color` apparently produces a "whatsit" (???) and put a `\goodbreak` before the opening rule, still no luck though.


title: Day of the year

text: I'm using the _day of the year_ a lot in my documents and I wonder if I can have LaTex calculating it for me? Example: 2013178 where 2013 is (surprise) the current year (which I know could be achieved by `\the\year`) and **178** , the day of the year. Was googling both in english and in german ( _"LaTex day of the year"_ and _"Latex Tag des Jahres"_ ) and found only posts and howtos regarding the day of the week and month. PS: I tagged it with _macros_ since I assume that this might need one to be solved.


I have               \documentclass{article}     \usepackage{pdfpages}          \begin{document}        Lorem. Read the answer for this from the document \ref{3rd_part}     ....          \appendix     \includepdf[pages={-}]{3rd_part.pdf} \label{3rd_part} % NOT working, problem here!     \end{document}      This labelling does not work. There is no need for   * no figure environment   * no table environment   * no caption, since the document is only a WYSIWYG made document. **How can you label an included pdfdocument and refer to it?**


title: How to cite another reference entry in BibTeX

text: In BibTeX, I need to cite another entry as a note/comment of a first one, something like:               @article{Paper1,     author = {Author A.},     journal = {The Journal of XX},     number = {1},     pages = {4252},     year = {2000},     note = {see updated results in \cite{Paper2}    }     }          @article{Paper2,     author = {Author B.},     journal = {The Journal of YY},     number = {2},     pages = {1},     year = {2001}     }      Could you give a suggestion in doing this? I think my need is not really fitting to what proposed here: How to cite within a reference entry using biblatex


title: How to keep a short word together with the rest of the sentence?

text: I'm writing an article. In a certain paragraph, the last sentence is spread over two lines. The second line is just a short word ('in') and that's a bit ugly. Is there an easy way to keep it together with the rest of the sentence on a single line? I think about shrinking the space between the words or the characters.


title: Placing node relative to legend

text: > Sorry for the lengthy example but when I tried shorting it I just messed > things up. Don't mind the overlapping bars. If used in the main document the > lines are properly sized. I have been trying to place some text above my legend which kind of works (line 77 and 90). However I would like to have the node located centred and above the legend automatically. I have found this but have not had any luck transferring it to my problem. The name "legend" (set in line 66) is supposedly unknown. The desired result: ![enter image description here](http://i.stack.imgur.com/BaZQh.png)               \documentclass[dvipsnames, border=5pt]{standalone}     \usepackage{pgfplots, pgfplotstable}     \usepackage{xcolor}          \begin{document}          \begin{tikzpicture}     \pgfplotstableread{ % Read the data into a table macro     RoomA   Oc  Cc  Bc  A   Bh  Ch  Oh     Porto   0.000   0.001   0.017   0.907   0.061   0.015   0.000     Madrid  0.000   0.008   0.010   0.857   0.125   0.000   0.000     Larnaca 0.000   0.005   0.013   0.749   0.233   0.000   0.000     Copenhagen  0.000   0.000   0.004   0.966   0.030   0.000   0.000     Belgrade    0.000   0.002   0.018   0.886   0.094   0.000   0.000     Banja~Luka  0.000   0.000   0.004   0.953   0.043   0.000   0.000     }\roomA          \pgfplotstableread{ % Read the data into a table macro     RoomB   Oc  Cc  Bc  A   Bh  Ch  Oh     Porto   0.01    0.07    0.01    0.90    0.02    0.00    0.00     Madrid  0.00    0.00    0.01    0.97    0.02    0.00    0.00     Larnaca 0.00    0.01    0.02    0.98    0.00    0.00    0.00     Copenhagen  0.00    0.02    0.03    0.95    0.00    0.00    0.00     Belgrade    0.00    0.01    0.03    0.96    0.00    0.00    0.00     Banja~Luka  0.00    0.00    0.01    0.78    0.21    0.00    0.00     }\roomB          \pgfplotstableread{ % Read the data into a table macro     RoomC   Oc  Cc  Bc  A   Bh  Ch  Oh     Porto   0.00    0.00    0.01    0.86    0.11    0.03    0.00     Madrid  0.00    0.00    0.04    0.87    0.08    0.01    0.00     Larnaca 0.00    0.00    0.01    0.76    0.20    0.04    0.00     Copenhagen  0.00    0.00    0.02    0.94    0.04    0.00    0.00     Belgrade    0.00    0.00    0.04    0.90    0.06    0.00    0.00     Banja~Luka  0.00    0.00    0.00    0.83    0.17    0.00    0.00     }\roomC               \pgfplotsset{xbar stacked,   % Stacked horizontal bars         width=0.9\textwidth,         xmin=0,         % Start x axis at 0         xmax=100,         ymin=-0.75,         % Start x axis at 0         ymax=5.75,         %xtick=\empty,          %ytick=\empty,         ytick=data,     % Use as many tick labels as y coordinates         %yticklabels from table={\roomA}{RoomA},  % Get the labels from the Label column of the \datatable         unit vector ratio=1 11, % changing the aspect ratio of the immage         }                  \begin{axis}[bar shift=11, bar width=8, axis x line = none, axis y line = none]     \addplot [fill=red] table [x expr=100*\thisrow{Oc}, y expr=\coordindex] {\roomA};         \addplot [fill=purple] table [x expr=100*\thisrow{Cc}, y expr=\coordindex] {\roomA};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bc}, y expr=\coordindex] {\roomA};         \addplot [fill=SeaGreen] table [x expr=100*\thisrow{A}, y expr=\coordindex] {\roomA};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bh}, y expr=\coordindex] {\roomA};         \addplot [fill=purple] table [x expr=100*\thisrow{Ch}, y expr=\coordindex] {\roomA};         \addplot [fill=red] table [x expr=100*\thisrow{Oh}, y expr=\coordindex] {\roomA};         \end{axis}     \begin{axis}[bar shift=-11, bar width=8, axis x line = none, axis y line = none, legend style={draw=none,                              fill=none,                              at={(0.5,1.02)},                             anchor= south,                             name=legend,                             },                             legend columns={7}, area legend]     \addplot [fill=red] table [x expr=100*\thisrow{Oc}, y expr=\coordindex] {\roomC};         \addplot [fill=purple] table [x expr=100*\thisrow{Cc}, y expr=\coordindex] {\roomC};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bc}, y expr=\coordindex] {\roomC};         \addplot [fill=SeaGreen] table [x expr=100*\thisrow{A}, y expr=\coordindex] {\roomC};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bh}, y expr=\coordindex] {\roomC};         \addplot [fill=purple] table [x expr=100*\thisrow{Ch}, y expr=\coordindex] {\roomC};         \addplot [fill=red] table [x expr=100*\thisrow{Oh}, y expr=\coordindex] {\roomC};         \legend{a, b, c, d, e, f, g} %Bh, Ch,Oh     \coordinate(aboveLegend) at (axis cs:50,6.6);     \end{axis}          \begin{axis}[bar shift=0, bar width=8, ytick=data, yticklabels from table={\roomA}{RoomA}, xtick={0,20,...,100}, xlabel={time [\%]}]     \addplot [fill=red] table [x expr=100*\thisrow{Oc}, y expr=\coordindex] {\roomB};         \addplot [fill=purple] table [x expr=100*\thisrow{Cc}, y expr=\coordindex] {\roomB};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bc}, y expr=\coordindex] {\roomB};         \addplot [fill=SeaGreen] table [x expr=100*\thisrow{A}, y expr=\coordindex] {\roomB};         \addplot [fill=yellow] table [x expr=100*\thisrow{Bh}, y expr=\coordindex] {\roomB};         \addplot [fill=purple] table [x expr=100*\thisrow{Ch}, y expr=\coordindex] {\roomB};         \addplot [fill=red] table [x expr=100*\thisrow{Oh}, y expr=\coordindex] {\roomB};         \end{axis}          \node at (aboveLegend){Climate categories };          \end{tikzpicture}          \end{document}


title: simulating text on a ribbon

text: Imagine text on a thin strip of paper that is being wound around like a ribbon. I thought that this might be possible with tikz. What I want is something that satisfies three properties:   1. Highlights the background to the text in one colour (say yellow).   2. The background to each line is visible (so the background doesn't merge into one big coloured block).   3. A further coloured rectangle (say grey), behind the yellow, which would be at an angle joining the end of the line wrap to the beginning of the next line. In the MWE this rectangle of property 3 start at the A in the text and finish at B.  The following MWE only satisfies property 1.               \documentclass{article}          \usepackage{tikz}          \newcommand\ribbonText[1]{%     \tikz\node[rectangle, fill=yellow, text width=31mm]{#1};%     }%               \begin{document}          \ribbonText{hello world this is some dummy text}          \end{document}      **EDIT** The answer by Ignasi has some merit, but is it not possible to automatically find the line breaks in a tikz node?


title: How to change separators in BibTex?

text: According to the rules of my university, if an article from some journal was used, it should be separated with //. Example: Lyness J. N. and Jespersen D. Moderate degree symmetric quadrature rules for the triangle//J. Inst. Math. Appl. How should I do this? Do I have to change something in *.bst file?


title: How can I make \citetitle work in a hyperref section bookmark?

text: I'm trying to use `hyperref` on a very large number of section headings for pieces of artwork in a document, but I have to use a workaround to get the title of the artwork into a bookmark of the section:               \documentclass{article}          \usepackage[backend=biber]{biblatex}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @ARTWORK{gizapyramid,       title = {Pyramids at Gizeh},       year = {ca.\@ 2500 BCE}     }     \end{filecontents}     \addbibresource{\jobname.bib}          \usepackage[hidelinks]{hyperref}          \begin{document}          \section{\texorpdfstring%     {\citetitle{gizapyramid} (\citedate{gizapyramid})}%     {Pyramids at Gizeh}}          \end{document}      Doing that properly displays "Pyramids at Gizeh" in the bookmark; however, since I occasionally find myself tweaking the title of various artworks to more accurately match common names, I would like to do something like this:               \documentclass{article}          \usepackage[backend=biber]{biblatex}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @ARTWORK{gizapyramid,       title = {Pyramids at Gizeh},       year = {ca.\@ 2500 BCE}     }     \end{filecontents}     \addbibresource{\jobname.bib}          \usepackage[hidelinks]{hyperref}          \begin{document}          \section{\texorpdfstring%     {\citetitle{gizapyramid} (\citedate{gizapyramid})}%     {\citetitle{gizapyramid}}}          \end{document}      The problem with that is it throws the warning: > Package hyperref Warning: Token not allowed in a PDF string > (PDFDocEncoding): (hyperref) removing `\citetitle' on input line 20. Then, it displays the tag "gizapyramid" in the bookmark instead of "Pyramids at Gizeh" as desired. How can I make `\citetitle` work in a `hyperref` section bookmark like I want without ruining its normal behavior elsewhere in the document?


title: How can I cite from bibliography in separate .tex files?

text: I'm working on a large document, and for that reason I'm using a `main.tex` file and including several files like `chapterX.tex` etc. Problem is that only my `main.tex` file has the bibliography in the preamble, TeXStudio doesn't give me the list of references when I type `\cite{` The workaround I've been using is to add               \usepackage{csquotes,lmodern}     \usepackage[backend=bibtex,style=chem-acs,biblabel=dot]{biblatex}     \addbibresource{library.bib}      to the `chapterX.tex` documents while typing so it shows me the list, and then removing these lines again when I compile the main document. Is here a better way to solve this problem?


title: LaTeX Error: Command \widering already defined

text: I keep getting this error whenever I start an article with the basic set of packages:               \documentclass[10pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage{lmodern}     \usepackage{kpfonts}     \usepackage{fourier}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \begin{document}     text     \end{document}      I understand it's the command `\widering` being defined in two different packages at the same time, but I don't know how to get around the problem. How could I fix the issue?


title: Putting Serial Numbers in References

text: I wish to have a citation in the text as follows: > However with growing sustainability concerns (Madu, 2001), organizations > need to undertake suitable measures to improve their sustainability aspects > (Amrina & Yusof, 2011). And in respective references, I need a list of references along with the serial numbers in such a manner that in text full citation is restored as such. >   1. Amrina, E., & Yusof, S. M. (2011). Key performance indicators for > sustainable manufacturing evaluation in automotive companies. 2011 IEEE > International Conference on Industrial Engineering and Engineering > Management, (pp. 1093 - 1097). > >   2. Madu, C. (2001). Handbook of environmentally conscious manufacturing. > Kluwer Academic Publishers. > > I have been using following code:               \bibliographystyle{apa-good} % for last name as references     \bibliography{total}      Please help.


title: unable to label a line in \align* environment with tag being a matrix

text: I try to do this               \begin{align*}     \label{labelname}\tag{$\begin{smallmatrix}0\\1\end{smallmatrix}$}a=b\\     c=d     \end{align*}      But it does not allow me to add the label and pops up an error message saying > Use of \math@cr@@ doesn't match its definition. \new@ifnextchar ...ved@d = > #1\def \reserved@a {#2} \def \reserved@b {#3}\futu... If I use a more normal tag, such as               \tag{$e_2(x)$}      Then the label works. Can anyone help? Thanks!


title: Book Proposal Template

text: Are there any templates to help produce a nonfiction book **proposal**? My book idea is moderately technical, on the topic of e-commerce, but my audience will be executives. Based on some research, a nonfiction book proposal generally follows this format:               # Cover Page         Title         Name         Contact Info          # Header/Footer (every page)         Title         Last Name          # Introduction         1-3 page hard pitch          # Contents         Table of contents          # Biography         About the author         Previous publications          # Audience/Market         Market segment         Sales channels          # Competition         Competitive and comparative titles          # Publicity and Promotion          # Chapter Summaries         1-2 paragraphs per chapter          # Sample Chapter      References [1] http://wolflit.com/how-to-write-a-nonfiction-book-proposal/   [2] http://www.huffingtonpost.com/2013/07/10/nonfiction-book- proposal_n_3569043.html I am relatively new to LaTeX, and discovered the _memoir_ class yesterday. I don't know if that can be tweaked to meet my needs though.


title: Argument in the end of an environment trick is not working

text: I was trying to define a new environment in which I needed to have an argument in the end code. Thanks to this post, I got that it is not possible without a trick. That is why I defined a command in the beginning containing the argument to use it in the end, but in vain... Can someone explain me why and/or fix this?               \newenvironment{newappendix}[2]%     {\def\headername{#1}%     \phantomsection%     \refstepcounter{section}%     \addcontentsline{toc}{section}{Appendix \thesection~- #1}%     \label{app:#2}}     {\fancyhead[R]{Appendix \thesection~- \headername}}      Without the command `\headername` on the last line it works fine but I need this argument here so... What to do? **EDIT** Here is a MWE (by uncommenting the last line of the end of the definition of the environment you should get an error...               \documentclass{report}          \usepackage[demo]{graphicx}     \usepackage{hyperref}     \usepackage{fancyhdr}     \pagestyle{fancy}          \fancyhead[L]{{\bfseries Appendices}}%     \setcounter{section}{0}%     \renewcommand{\thesection}{\Alph{section}}%          \newenvironment{newappendix}[2]%     {\def\headername{#1}%     \phantomsection%     \refstepcounter{section}%     \addcontentsline{toc}{section}{Appendix \thesection~- #1}%     \label{app:#2}}     {\fancyhead[R]{Appendix \thesection~-}}% \headername}}          \begin{document}          \begin{newappendix}{first}{1}     \includegraphics[width=12cm,height=15cm]{test}     \end{newappendix}          \end{document}


title: Circles at the ends of arrows

text: Consider four kinds of "arrow" symbols: 0. A horizontal line 1. A leftarrow 2. A rightarrow 3. A doublearrow I'd like to add circles to each end of these arrows, allowing for all possible combinations of "filled" and "unfilled," for a total of sixteen combinations in total. As an example, one may consider the "spoons" offered by the MnSymbol package for reference, as in `\leftspoon` and `\leftfilledspoon`. Any ideas as to how to achieve this? EDIT: So to clarify, I want circles on BOTH ends of the arrows. As in O-->O.


title: automatic flushleft/flushright for section headings (book class)

text: I'm preparing a large document using the `book` class. I want my chapter, section, subsection, etc headings to appear either flushed left or right depending on whether they appear on an even or odd page, respectively. What I'm looking for is a way of doing this automatically, as the document is rather large and a minor addition/substraction of content could change the pages where many headings fall.


title: BibTeX cannot find .bib file

text: I am using TeXworks version 0.4.5 with MiKTeX 2.9 64-bit on Windows 7. When I try to typeset the code               \documentclass{amsart}     \begin{document}     Blah blah \cite{grimm}     \bibliographystyle{plain}     \bibliography{diss}     \end{document}      Latex warns that there were undefined references, and in the pdf there is a bolded question mark instead of the reference, and the references section at the end is empty. When I run BibTeX by itself I get the error "I couldn't open the database file diss.bib" diss.bib looks like this               @article{grimm,       title= "A theorem about random fields"     }      Things I have tried which haven't worked:   * Saving the .bib file in the same place as the .tex file   * Savind the file in a TDS-compliant root directory C:\tex-biblio\bibtex\bib\mybiblios\diss.bib and adding this as a root directory in MiKTeX (it accepts it as a new root directory, but BibTeX still can't find the .bib file)   * Creating a BIBINPUTS environmental variable and adding a path to where the .bib file is saved   * Writing a path to the .bib file when defining which bibliography to use: \bibliography{C:/Users/Sacrebleurgh/Documents/Latex/diss} - i've also tried diss.bib.   * I originally downloaded MiKTeX with LyX so I tried uninstalling them both and then installing MiKTeX by itself, but the problem persisted. Any suggestion as to what might be wrong or other things to try would be greatly appreciated. EDIT: the bibtex log is               This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit)     The top-level auxiliary file: testdoc.aux     The style file: plain.bst     I couldn't open database file diss.bib     ---line 4 of file testdoc.aux      : \bibdata{diss      :              }     I'm skipping whatever remains of this command     I found no database files---while reading file testdoc.aux     Warning--I didn't find a database entry for "grimm"     (There were 2 error messages)


title: Custom enumeration with undesired kerning

text: The following code produces the desired result as shown below:               \documentclass[letterpaper]{article}     \usepackage{xcolor}     \usepackage{amsmath,amssymb,calc,bbding}     \usepackage{enumitem}          \newlist{objective}{enumerate}{2}     \setlist[objective]{label=\protect\raisebox{-1pt}{\textcolor{blue!15}{\CheckmarkBold}}\hspace{-0.75\checklength}\arabic*}          \newlength{\checklength}     \settowidth{\checklength}{\CheckmarkBold}          \begin{document}         % Desired result.          \begin{objective}           \item First           \item Second         \end{objective}         % Not really a desired result.     {\large         \begin{objective}           \item First           \item Second         \end{objective}}         % Even worse.     {\huge         \begin{objective}           \item First           \item Second         \end{objective}}          \end{document}      ![enter image description here](http://i.stack.imgur.com/5eqNC.png) If you notice at the first level everything seems fine and ok but as the font size increases, there is the issue of proper kerning. Probably if the enumeration can be fixed or scaled it would help a lot.


title: Shadow title-like box in beamer

text: I'd like to have the same box as the title one. I try an imitation, but is there a direct way with `beamer` stuff ?               \documentclass[xcolor=dvipsnames]{beamer}     \RequirePackage{fontspec}     \usefonttheme{serif}     \RequirePackage{fourier}    % mettre serif dans les options Beamer          % Enlève les icônes de navigation     \beamertemplatenavigationsymbolsempty     \RequirePackage{graphicx}     \RequirePackage{amsmath,amsfonts,amssymb,mathrsfs}     \RequirePackage{tikz}       % Tikz and Co     \usetikzlibrary{shadows.blur}          \RequirePackage{polyglossia}    % pas de babel sinon problème     \setdefaultlanguage{french}     % avec : et !          \usetheme{Warsaw}               % thème     \usecolortheme{wolverine}       % variante de couleur          \setbeamersize{text margin left=.4cm}     \setbeamersize{text margin right=.4cm}          \newcommand{\Sablier}{\fontspec{Symbola}^^^^231b}          \title{\textbf{\textsc{La Boîte à Questions}}}     \author{Mathématiques}     \date{6$^{e}$}     \institute{2014 -- 2015}          \newcounter{Q}     \setcounter{Q}{0}          \begin{document}     \begin{frame}[plain]     \titlepage     \end{frame}              \stepcounter{Q}         \begin{frame}[plain]             \transduration{2}             \frametitle{%                 \textbf{Question \theQ}}             \centering\Huge             \usebeamercolor{frametitle}             \tikz\node[fill=bg,text=fg,rounded corners=5pt,blur shadow] {\Sablier{} : 3 sec.} ;         \end{frame}          \end{document}


title: Hide the LaTeX output after importing PDF files generated by mathematica version 10

text: \documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{graphicx}     \begin{document}     \begin{figure}     %\vspace{-5cm}     \centering     \includegraphics[scale=.5]{efficiencyindex}     \caption{f}     \end{figure}     \end{document}      But not generating output pdf file in the log file is written: _Error 1 (driver return code) generating output; file d.pdf may not be valid._ I haven't this problem with pdf file by producing with older version of mathematica.


title: Double line for header/footer rules

text: I want to create a fancy header/footer rule in Exam document class. I have tried what is at http://tex.stackexchange.com/questions/89569/custom-header- footer-rules-fancyhdr and Custom header/footer rules (fancyhdr?) but they seem not to work in Exam document class. Any help please


title: Plotting functions and denoting equation on the figure

text: How can I plot the functions > P=20-1/5*Q and P=5+1/9*Q so as to find the equilibrium point? The figure I need is like the following: ![enter image description here](http://i.stack.imgur.com/9dnST.png) Furthermore, how could I put the equation on each line? My unfinished so far code is:                   \documentclass{article}     \usepackage[english,greek]{babel}     \usepackage{ucs}      \usepackage[utf8x]{inputenc}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage{tikz}     \usepackage{tkz-tab}          \usepackage{latexsym}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amsthm}          \usepackage{graphicx}          \usepackage[usenames,dvipsnames]{xcolor}          \usepackage{color}     \usepackage{tkz-euclide}     \usetikzlibrary{shapes.geometric}         \usepackage{tkz-fct} \usetkzobj{all}     \usetikzlibrary{calc,decorations.pathreplacing}     \usetikzlibrary{decorations.markings}     \usepackage{pgfplots}     \usepackage{verbatim}     \usepackage{smartdiagram}     \usesmartdiagramlibrary{additions}     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{intersections}          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}[ axis x line=bottom, xtickmax=100, ytickmin=0, ymin=0, enlargelimits=false ]      \addplot[blue,mark=none, domain=-4:4,samples=20] {20-x/5};      \end{axis}     \end{tikzpicture}     \end{center}     \end{document}