title: Curly braces don't preserve capitals

text: First of all, thanks to everybody who posts on this site. This is my first time asking a question, since I have always been able to figure out my problems before thanks to others' questions + answers. I am using JabRef and TeXworks. **Using curly braces doesn't work to preserve capitals in my references** and I'm looking for a solution. My preference would be a solution that simply allows me to use the curly braces as they are intended. I have tried all versions of curly braces I could think of or find: i. {Report on the Status of B.C. First Nations Languages 2010}   ii. Report on the {S}tatus of {B}.{C}. {F}irst {N}ations {L}anguages 2010   iii. {Report on the {S}tatus of {B}.{C}. {F}irst {N}ations {L}anguages 2010}   iv. Report on the {{S}}tatus of {{B}}.{{C}}. {{F}}irst {{N}}ations {{L}}anguages 2010 I have also tried to change the preferences in JabRef to store certain fields with braces around capital letters, and this didn't work. To generate the references in my document I typed:               \bibliographystyle{apacite}          \bibliography{ReferencesJabRef}      Here's an example that's giving me problems:               Author = Hannah Amrhein and Suzanne Gessner       Title = Report on the Status of B.C. First Nations Languages 2010       Institution = First Peoples’ Heritage, Language and Culture Council       Year = 2010       Bibtex Key = FirstPeoples2010       Address = Brentwood Bay, B.C.       URL = http://www.fpcc.ca/language/status-report/      And it prints like this: > Amrhein, H. & Gessner, S. (2010). Report on the status of b.c. first nations > languages 2010 (Tech. Rep.). Brentwood Bay, B.C.: First peoples Heritage, > Language and Culture Council. Retrieved from > http://www.fpcc.ca/language/status-report/ The problems are:   * In the title, I'd at least like "B.C." and "First Nations" capitalized.   * For the institution, the word "Peoples" should also be capitalized.


title: Get rid of the word "equation" in cross references

text: I'm using the thesis template that comes with LyX and whenever I make a cross reference for an equation it comes along with the word "Equation XX.YY" and I just want the number "XX.YY". The document class is `book(KOMA-Script)`               options = intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn      and the preamble               % increases link area for cross-references and autoname them     % if you change the document language to e.g. French     % you must change "extrasenglish" to "extrasfrench"     \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}     \@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}     \addto\extrasenglish{%      \renewcommand*{\equationautorefname}[1]{}      \renewcommand{\sectionautorefname}{sec.\negthinspace}      \renewcommand{\subsectionautorefname}{sec.\negthinspace}      \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}      \renewcommand{\figureautorefname}{Fig.\negthinspace}      \renewcommand{\tableautorefname}{Tab.\negthinspace}     }          % in case somebody want to have the label "Equation"     %\renewcommand{\eqref}[1]{Equation~(\negthinspace\autoref{#1})}          % that links to image floats jumps to the beginning     % of the float and not to its caption     \usepackage[figure]{hypcap}          % the pages of the TOC is numbered roman     % and a pdf-bookmark for the TOC is added     \let\myTOC\tableofcontents     \renewcommand\tableofcontents{%       \frontmatter       \pdfbookmark[1]{\contentsname}{}       \myTOC       \mainmatter }          % makes caption labels bold     \setkomafont{captionlabel}{\bfseries}     \setcapindent{1em}          % enables calculations     \usepackage{calc}          % fancy page header/footer settings     \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}          % increases the bottom float placement fraction     \renewcommand{\bottomfraction}{0.5}          % avoids that floats are placed above its sections     \let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}          % para organizar la nomenclatura     \usepackage{ifthen}     \renewcommand{\nomgroup}[1]{%     \ifthenelse{\equal{#1}{B}}{\item[\textbf{Símbolos latinos}]}{%     \ifthenelse{\equal{#1}{C}}{\item[\textbf{Símbolos griegos}]}{%     \ifthenelse{\equal{#1}{A}}{\item[\textbf{Abreviaturas}]}{%     \ifthenelse{\equal{#1}{D}}{\item[\textbf{Sub y superíndices}]}          {}     }% cierra sub y superíndices     }% cierra abreviaturas     }% cierra griegos     }% cierra latinos          % para ponerle unidades     \newcommand{\nomunit}[1]{%     \renewcommand{\nomentryend}{\dotfill#1}}          % Numerar ecuaciones por sección     \numberwithin{equation}{section}


title: How to draw a layered architecture using Latex?

text: I have a layered architecture to be drawn in a paper. The architecture looks similar to the one below. ![enter image description here](http://i.stack.imgur.com/FBPVy.png) How to draw something like this? What I have so far:               \begin{tikzpicture}[stack/.style={rectangle split, rectangle split parts=#1,draw, anchor=center}]     \node[stack=5]  {     \nodepart{two}a     \nodepart{three}a     \nodepart{four}c     \nodepart{five}d     };     \end{tikzpicture}      How do I split a layer to have two boxes?


title: Draw molecule charge in latex using chemfig?

text: I've got a lewis dot structure diagram as seen in the following image: ![H3O](http://i.stack.imgur.com/74Zt3.png) However, I would like to have brackets on the outside to indicate the positive charge, since this is supposed to represent H3O 1+. Any suggestions would be appreciated. Here's my current code:               % Preamble     {\color[rgb]{0.500000,0.500000,0.500000}\documentclass[10pt]{article}     \usepackage[usenames]{color} %used for font color     \usepackage{amssymb} %maths     \usepackage{amsmath} %maths     \usepackage[utf8]{inputenc} %useful to type directly diacritic characters     \usepackage{chemfig}     \newcommand{\pol}[1]{\rlap{${}^{^{\color{red} \delta #1}}$}}     \newcommand{\ind}[0]{\text{ }}}     % ========================= end preamble ============================          \chemfig{\lewis{,H}\pol{+}-\lewis{2:,O}\pol{-}(-[6]\lewis{,H}\pol{+})-\lewis{,H}\pol{+}}


title: Isn't there any other way of doing double quotes in LaTeX besides `` +  ''?

text: The standard way of writing quotes and double quotes in LaTeX is with ```` and `''`, but I find them quite ugly. Isn't there something similar to `\emph{}`, but for quotes? I mean something like `\quotes{quoted text goes here}`. I've been looking but couldn't find any, maybe you guys can.


title: Uneven space between bibliography entries using flushend

text: I'm having problems with uneven spacing between bibliography entries. As seen in the attached screenshot, the space between entry 4 and 5 is much smaller than the rest of the distances. This makes the layout very unbalanced. The problem goes away if I remove text in the left column (or earlier) pushing the references section to begin in the left column. It also goes away if I increase the text in one of the references. I use the `flushend` package to make the last columns have equal length. The uneven space appears at the space where the column break would be, had `flushend` not been used (thanks to David in the comments for pointing this out). How would I go about fixing this without editing the text? **Minimum working example**               \documentclass[DIV=calc, paper=a4, fontsize=11pt, twocolumn]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[round]{natbib}     \usepackage{csquotes}     \usepackage[format=plain,small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats          \usepackage{flushend}          % Package for typesetting URL:s     \usepackage[hyphens]{url}     \urlstyle{same}          \usepackage[english]{babel}          \usepackage[pdftex]{graphicx}     \usepackage{epstopdf}          %%% Begin document     \begin{document}          \section*{Conclusion}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean et congue velit \citep{WHO2004}. Fusce eget lacus at ipsum vestibulum semper in eleifend eros \citep{wilson2013}. Pellentesque metus velit, placerat vel aliquam quis, mattis varius nisi. \citet{sarmah2006} Sed interdum neque dui, quis rhoncus est iaculis sit amet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; \citet{Andersson2012} Phasellus malesuada felis enim, non adipiscing urna placerat et. Ut venenatis \citep{hughes2011} pretium est eu tempus. Maecenas ornare magna imperdiet viverra commodo. Sed posuere mattis nisl, in interdum ligula \citet{butler2013}.          Donec augue quam, tincidunt at pharetra eu, venenatis eu metus. Nam aliquet imperdiet dolor, ac sollicitudin quam elementum sit amet. In hac habitasse platea dictumst. Nunc vulputate, magna vitae adipiscing interdum, orci velit pellentesque neque, non accumsan purus nunc vel velit. Nulla consectetur, dui sit amet fermentum consectetur.          Donec in euismod massa. Mauris sit amet condimentum magna. Donec dolor dui, consequat in ligula nec, consequat egestas justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla ac suscipit sapien, id euismod sem. Sed varius pharetra libero.          \raggedright     \small     \bibliographystyle{plainnat}     \bibliography{ref-antibiotics}          \end{document}      **Bibliography**               @article{Butler2013,     author = {Butler, Mark S and Blaskovich, Mark A and Cooper, Matthew A},     doi = {10.1038/ja.2013.86},     issn = {0021-8820},     journal = {The Journal of antibiotics},     month = oct,     number = {10},     pages = {571--91},     pmid = {24002361},     publisher = {Japan Antibiotics Research Association},     shorttitle = {J Antibiot},     title = {{Antibiotics in the clinical pipeline in 2013.}},     volume = {66},     year = {2013}     }          @article{WHO2004,     author = {{World Health Organisation}},     file = {:Users/per/Dropbox/University/Molecular and Cellular Aspects of HIV Infection/Essay/Reports/GBD\_report\_2004update\_full.pdf:pdf},     journal = {The global burden of disease 2004},     year = {2004},     note = {\url{[http://www.who.int/healthinfo/global_burden_disease/GBD_report_2004update_full.pdf]}}     }          @article{Hughes2011,     author = {Hughes, James M},     doi = {10.1001/jama.2011.279},     file = {:Users/per/Dropbox/University/Biotechnology 3/Essay/Papers/Hughes - 2011 - Preserving the lifesaving power of antimicrobial agents.pdf:pdf},     issn = {1538-3598},     journal = {JAMA : the journal of the American Medical Association},     month = mar,     number = {10},     pages = {1027--8},     pmid = {21343545},     publisher = {American Medical Association},     title = {{Preserving the lifesaving power of antimicrobial agents.}},     volume = {305},     year = {2011}     }          @article{Wilson2013,     author = {Wilson, Daniel N},     doi = {10.1038/nrmicro3155},     file = {:Users/per/Dropbox/University/Biotechnology 3/Essay/Papers/Wilson - 2014 - Ribosome-targeting antibiotics and mechanisms of bacterial resistance.pdf:pdf},     issn = {1740-1534},     journal = {Nature reviews. Microbiology},     month = dec,     number = {1},     pages = {35--48},     pmid = {24336183},     publisher = {Nature Publishing Group, a division of Macmillan Publishers Limited. All Rights Reserved.},     shorttitle = {Nat Rev Micro},     title = {{Ribosome-targeting antibiotics and mechanisms of bacterial resistance.}},     volume = {12},     year = {2013}     }          @article{Sarmah2006,     author = {Sarmah, Ajit K and Meyer, Michael T and Boxall, Alistair B A},     doi = {10.1016/j.chemosphere.2006.03.026},     issn = {0045-6535},     journal = {Chemosphere},     month = oct,     number = {5},     pages = {725--59},     pmid = {16677683},     title = {{A global perspective on the use, sales, exposure pathways, occurrence, fate and effects of veterinary antibiotics (VAs) in the environment.}},     volume = {65},     year = {2006}     }          @article{Andersson2012,     author = {Andersson, Dan I and Hughes, Diarmaid},     doi = {10.1016/j.drup.2012.03.005},     file = {:Users/per/Dropbox/University/Biotechnology 3/Essay/Papers/Andersson, Hughes - 2012 - Evolution of antibiotic resistance at non-lethal drug concentrations.pdf:pdf},     issn = {1532-2084},     journal = {Drug resistance updates : reviews and commentaries in antimicrobial and anticancer chemotherapy},     month = jun,     number = {3},     pages = {162--72},     pmid = {22516308},     title = {{Evolution of antibiotic resistance at non-lethal drug concentrations.}},     volume = {15},     year = {2012}     }      ![Last page with right column with uneven paragraphs in bibliography.](http://i.stack.imgur.com/N9SgC.png)


title: drawing cellulose and aligning monomers in chemfig

text: The problem I had to face yesterday was related to draw a cellulose molecule with chemfig. In particular I'm not familiar with tikz, so I had problems in aligning the monomers. I was used to xymtec, but when I moved to debian wheezy I soon discovered that it is going to be obsolete. So here I am trying to re-learn things again. Here a example on how I tried to solve the problem. It was a trial and error process. I'm sure there are a more elegant solutions. It took me almost half a day to find this rough code, so I would like to know if it can be improved. I'm writing this here, since this site was very helpful, so I would like to give something back.               \documentclass{minimal}     \usepackage{chemfig}          \definesubmol{glucoBeta}{            ?(4-[:190,0.7])             -[:-50](-[:170]HO)             -[:10](-[:-55,0.7]OH)             -[:-10]1(-[6,0.7]H)(-[:10]O)             -[:130]{\color{red}{O}}             -[:190]?(-[:150,0.7]-[2,0.7]OH)     }          \begin{document}          FIRST EXAMPLE \\     \chemfig[][scale=0.85]{!{glucoBeta}}     \vflipnext      \chemfig[][scale=0.85]{!{glucoBeta}}     \chemfig[][scale=0.85]{!{glucoBeta}}     \vflipnext      \chemfig[][scale=0.85]{!{glucoBeta}}\\     \bigskip          SECOND EXAMPLE\\          \chemfig[][scale=0.85]{!{glucoBeta}}     \vflipnext      \chemfig[yshift=-7mm][scale=0.85]{!{glucoBeta}}     \chemfig[][scale=0.85]{!{glucoBeta}}     \vflipnext      \chemfig[yshift=-7mm][scale=0.85]{!{glucoBeta}}               \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/6dNTj.jpg)


title: Keep first column on every page of long sideways-table

text: I have a table with a lot of columns, so I am going to make it landscape.The very first column is a sort of header, so I would like to repeat it on every page. Is there a way to do that?


title: amsthm: Theorems, Lemmas numbered backwards

text: ## What I want               \newtheorem{thm}{Theorem}          \begin{thm} A \end{thm}     \begin{thm} B \end{thm}     \begin{thm} C \end{thm}      Ends up generating               Theorem 1 A.     Theorem 2 B.     Theorem 3 C.      What I want instead:               Theorem 3 A.     Theorem 2 B.     Theorem 1 C.      ## Why would anyway want this insanity? I'm logging ideas I'm considering in LaTeX. I want everything appear in reverse chronological order (i.e. newest ideas first; oldest idea last.) Now, I want the numberings to remain valid across versions -- i.e. when I add a new theorem, I want old theorem 20 to remain as theorem 20 [thus all the discussions about theorem 20 do not suddenly become mislabeled.]


title: How to draw gradient arrows with Tikz

text: I want to combine the two figures below into one. That is having an arrow with colors going from red at the bottom to blue at the top. Could anyone show me how to do it? ![enter image description here](http://i.stack.imgur.com/vHjnP.png)


title: LaTeX with Sublime Text 2

text: I recently (2 days back) started using LaTeX, I use Sublime Text 2 (ST2) for most of the programming. I found that ST2 has LaTeX package. So what I am doing is write the document with ST2 and run it with TeXWorks to see any errors/debugging. Is there a way I can run/debug the tex file directly from ST2? Is there any better practice than what I am doing currently?


title: How to switch citation style from author-year to author-number using biblatex?

text: Have been using `biblatex` apa-style of author-year citation for a while, now i want to change the style to author-number style: For example: as with `\cite{Loh:1992}` Before:                ...      Loh (1992)      ...      References:               Loh, N. C. (1992). High-resolution micromachined interferometric accelerometer (Master’s thesis,Massachusetts Institute of Technology, Cambridge, Mass.)      How to achieve Author [num] style like:                ...      Loh [1] ...      ...      References:               [1] Loh, N. C. (1992). High-resolution micromachined interferometric accelerometer (Master’s thesis,Massachusetts Institute of Technology, Cambridge, Mass.)      I have searched the forum and found most of the solution are based to `bibtex` and they can't be applied to `biblatex`. So how to figure this out. PS: the`biblatex` setting is attached:               \usepackage{filecontents}     \usepackage{csquotes}     \usepackage[         style=apa,         backend=biber,         refsection=chapter,         uniquename=true,         uniquelist=false,         maxcitenames=2,          natbib=true ]{biblatex}      \DeclareLanguageMapping{british}{british-apa}     \LetLtxMacro{\cite}{\citet}  % year in ()          \DefineBibliographyStrings{english}{%       bibliography = {References}  }


title: Tables: Centering multicolumn when using inter-column spacing

text: I would like to center a `multicolumn` cell, usually done via `\multicolumn{2}{c}{...}`. However, when using extra inter-column spacing via `@{\hspace{...}}`, the centering includes this extra space and ends up being misaligned. Example:               \documentclass{article}     \usepackage{multirow}     \usepackage{multicol}          \begin{document}       \begin{tabular}{c@{\hspace{15mm}}rr@{\hspace{15mm}}rr@{\hspace{15mm}}rr}         \multirow{2}{*}{Front} &            \multicolumn{2}{c}{Group 1} &           \multicolumn{2}{c}{Group 2} &           \multicolumn{2}{c}{Group 3}\\         &           Value 1.1 & Value 1.2 &           Value 2.1 & Value 2.2 &           Value 3.1 & Value 3.2 \\         \end{tabular}     \end{document}      How can I fix this?


title: Is there any way to remove mesh lines completely in a pgfplots faceted 3d plot?

text: I can not seem to find the way to remove the lines in the surface mesh in a 3d faceted plot. I need a solution that does not use the "shader=interp" (i.e. gradient filling) so that the faces are constant in color. For example the following code generates white lines in Acrobat (see at the end). I tried all sorts of tricks, such as "faceted color = none, draw opacity=0., line width=0., draw=none". I made the surface semitransparent so the effect is evident.               \documentclass{article}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}     \addplot3[surf, opacity=0.8, shader=faceted, faceted color = none, draw opacity=0., line width=0.,draw=none] %shader interp offends lualatex     coordinates {     (-3, -3, 3.57005)(-2.8125, -3, 3.50682)(-2.625, -3, 3.4438)\par     (-3, -2.8125, 3.5075)(-2.8125, -2.8125, 3.44005)(-2.625, -2.8125, 3.37252)\par     (-3, -2.625, 3.4453)(-2.8125, -2.625, 3.37336)(-2.625, -2.625, 3.301)\par     (-3, -2.4375, 3.38377)(-2.8125, -2.4375, 3.3071)(-2.625, -2.4375, 3.22959)\par     };      \end{axis}     \end{tikzpicture}     \end{document}      Look at the white lines: ![whitelines as mesh](http://i.stack.imgur.com/rRJ1i.png) (Is this perhaps a bug in Acrobat?, evince shows the desired result for example) EDIT: one of the comments states that flat should give a flat color and no lines around the patches. The result with               \addplot3[surf, opacity=0.8, shader=flat]      is that lines still appear in the borders, here with Acrobat and evince ![Acrobat flat](http://i.stack.imgur.com/LHSFp.png) ![evince flat](http://i.stack.imgur.com/OAJNT.png)


title: How to make eps file imported in .tex , un-cropped?

text: I have a eps file with a very high resolution. Now when I am trying to import it in my tex file using include graphics I am only able to see part of it, i.e. its cropped. I already played with width, height, keepaspectratio which didn't help. Here is my simplified tex file:               \documentclass [11pt,a4paper] {article}     \usepackage{graphicx}     \begin{document}     \begin{figure}[!htb]     \centering     %   \advance\leftskip-3cm     %   \advance\rightskip-3cm         \includegraphics[width=500pt]{Uniform.eps}             \label{fig:Uniform}     \end{figure}     \end{document}      And here is the output: ![enter image description here](http://i.stack.imgur.com/UwwA0.jpg)


title: How to install vim-latex?

text: Can someone please help with installing vim with the latex plugin? I've tried searching online for easier instructions, but I can't find anything. I have very little experience with terminal and I have no idea how to do this. What I've done is just download the file. I created a ~/.vim directory, but beyond that, I'm completely lost. **Update:** I'm running Mac OSX 10.7.5.


title: Customise \textvisiblespace

text: The accepted answer in this question shows a neat redefinition of `\textvisiblespace`, which I like to use because it doesn't produce a warning in math mode. However, I use it with monospace in an equation, and it doesn't look perfect: the symbol is too close to its right neighbour. Here's an MWE:               \documentclass{article}          \newcommand\vartextvisiblespace[1][.3em]{%       \mbox{\kern.1em\vrule height.3ex}%       \vbox{\hrule width#1}%       \hbox{\vrule height.3ex}     }          \begin{document}          A formula with visible space in it:     \begin{equation}       s = \mathtt{a\vartextvisiblespace string\vartextvisiblespace sequence}     \end{equation}          \end{document}      What is a clean way to make it look better?


title: Insert page before each chapter

text: I would like to insert a page before each chapter with the tile of the chapter. How we can accomplish this in latex...? The structure of my latex document is as below:               documentclass[a4paper,11pt]{report}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amsmath,graphicx,color,algorithm,float,caption,mathtools}     \usepackage{url,rotating,multirow}     \usepackage{algpseudocode,pdfpages}     \usepackage[normalem]{ulem}     \usepackage{breqn}     \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}          \usepackage{lipsum}     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[HL]{\leftmark}     \fancyfoot[C] {\thepage}               \renewcommand{\headrulewidth}{1pt}     \begin{document}          \cleardoublepage     \pagenumbering{gobble}     \includepdf[pages={-}]{certificate/certi.pdf}     \tableofcontents     \listoffigures     \listoftables          \cleardoublepage     \pagenumbering{arabic}          \include{abstract/abstract}     \include{introduction/intro}     \include{survey/survey}     \include{chapter1/chapter1}     \include{chapter2/chapter2}     \include{chapter3/chapter3}     \include{chapter4/chapter4}     \include{chapter5/chapter5}     \include{results/results}     \include{conclusion/conclusion}     %references will go here     \renewcommand{\bibname}{References}     \bibliographystyle{plain}          \bibliography{References/references}     \end{document}      I want a page before each chapter starts consisting the title of the chapter...For example, if the chapter one named "Some Chapter Name" is starting from page number 10, then I would like to insert a page before page number 10 having the text " Chapter 1 Some Chapter Name


title: PGFPlots colored regression legend

text: how can i have this legend? ![enter image description here](http://i.stack.imgur.com/WtHfv.png) in this plot:               \documentclass[a4paper,12pt]{article}     \usepackage{pgfplots,pgfplotstable}        % Grafici     \pgfplotsset{/pgf/number format/use comma,compat=newest,%                 width=12cm,%                 height=9cm%                 }               %*********************************************************************************     % Impostazioni Pgfplots     %*********************************************************************************          \pgfplotstableread{     X Y     0.05 0.17     0.05 0.041     0.05 0.023     0.1 0.332     0.1 0.089     0.1 0.041     0.15 0.5     0.15 0.132     0.15 0.06     }\tableA          \pgfplotstablecreatecol[linear regression]     {regression}     {\tableA}          \xdef\slope{\pgfplotstableregressiona} %<-- might be handy occasionally     \xdef\intercept{\pgfplotstableregressionb}          \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[/pgf/number format/fixed,     legend pos=outer north east,     grid=major,     xmin=0, xmax=0.2,     ymin=0, ymax=0.6,     point meta min={0},     point meta max={0.2},     yticklabel shift=2pt,     xticklabel shift=2pt,     legend pos=north west,     legend cell align=left,     minor tick num=4,     xticklabel style={text height=1.5ex},     xtick={0,0.05,...,0.3},     minor xtick={%     0.01,0.02,0.03,0.04,%     0.06,0.07,0.08,0.09,%     0.11,0.12,0.13,0.14,%     0.16,0.17,0.18,0.19},%     extra x ticks={0,0.05,...,0.3},     extra x tick style={         xticklabel pos=right,         xticklabel style={text depth=0pt}     },     extra y ticks={0,0.1,...,0.7},     extra y tick style={         yticklabel pos=right     },     tick style={thin,black},     xlabel=\large $m$,     ylabel=\large $\Delta l$,     colorbar horizontal,     colorbar style={         /pgf/number format/fixed,         xticklabel shift=2pt,         xtick={0,0.05,...,0.3},         xticklabel style={text height=1.5ex}     },     axis line style={draw=none}, after end axis/.append code={\draw (rel axis cs:0,0) rectangle (rel axis cs:1,1);},     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}     ]     \addplot [point meta=explicit,         scatter,         mark=*,         draw=none]         table[meta=X] {\tableA};          \addplot [mesh,point meta=x,domain=0.025:0.175,very thick,samples=10] {\slope*x+\intercept};     \addlegendentry{%     $\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x     \pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$}     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}      UPDATE at Jake's answer:               \documentclass[border=0.5mm,12pt]{standalone}          \usepackage{pgfplots,pgfplotstable}        % Grafici          \pgfplotsset{%                 mesh line legend/.style={legend image code/.code=\meshlinelegend#1},%                 /pgf/number format/use comma,%                 compat=newest,%     %            height=9cm,%                 width=12cm%     }                    %*********************************************************************************     % Impostazioni Pgfplots     %*********************************************************************************          \pgfplotstableread{     X Y     0.05 0.17     0.05 0.041     0.05 0.023     0.1 0.332     0.1 0.089     0.1 0.041     0.15 0.5     0.15 0.132     0.15 0.06     }\tableA          \pgfplotstablecreatecol[linear regression]     {regression}     {\tableA}          \xdef\slope{\pgfplotstableregressiona} %<-- might be handy occasionally     \xdef\intercept{\pgfplotstableregressionb}                    %% Code for the coloured line legend     \makeatletter     \long\def\meshlinelegend#1{%         \scope[%             #1,             /pgfplots/mesh/rows=1,             /pgfplots/mesh/cols=4,             /pgfplots/mesh/num points=,             /tikz/x={(0.44237cm,0cm)},              /tikz/y={(0cm,0.23932cm)},             /tikz/z={(0.0cm,0cm)},             scale=0.4,         ]         \let\pgfplots@metamax=\pgfutil@empty         \pgfplots@curplot@threedimtrue              \pgfplotsplothandlermesh         \pgfplotstreamstart              \def\simplecoordinate(##1,##2,##3){%             \pgfmathparse{1000*(##3)}%             \pgfmathfloatparsenumber\pgfmathresult             \let\pgfplots@current@point@meta=\pgfmathresult             \pgfplotstreampoint{\pgfqpointxyz@orig{##1}{##2}{##3}}%         }%              \simplecoordinate(0,0,0)         \simplecoordinate(0.25,0,0.125)         \simplecoordinate(0.5,0,0.25)         \simplecoordinate(0.75,0,0.375)         \simplecoordinate(1,0,0.5)         \simplecoordinate(1.25,0,0.625)         \simplecoordinate(1.5,0,0.75)         \simplecoordinate(1.75,0,0.875)         \simplecoordinate(2,0,1)              \pgfplotstreamend         \pgfusepath{stroke}         \endscope     }%     \makeatother     %% End code for the coloured line legend                    \begin{document}     \thispagestyle{empty}     %\begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[%     /pgf/number format/fixed,     legend pos=outer north east,     grid=major,     xmin=0, xmax=0.2,     ymin=0, ymax=0.6,     point meta min={0},     point meta max={0.2},     yticklabel shift=2pt,     xticklabel shift=2pt,     legend pos=north west,     legend cell align=left,     minor tick num=4,     xticklabel style={text height=1.5ex},     xtick={0,0.05,...,0.3},     minor xtick={%     0.01,0.02,0.03,0.04,%     0.06,0.07,0.08,0.09,%     0.11,0.12,0.13,0.14,%     0.16,0.17,0.18,0.19},%     extra x ticks={0,0.05,...,0.3},     extra x tick style={         xticklabel pos=right,         xticklabel style={text depth=0pt}     },     extra y ticks={0,0.1,...,0.7},     extra y tick style={         yticklabel pos=right     },     tick style={thin,black},     xlabel=\large $m$,     ylabel=\large $\Delta l$,     colorbar horizontal,     colorbar style={         /pgf/number format/fixed,         xticklabel shift=2pt,         xtick={0,0.05,...,0.3},         xticklabel style={text height=1.5ex}     },     axis line style={draw=none}, after end axis/.append code={\draw (rel axis cs:0,0) rectangle (rel axis cs:1,1);},     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}     ]     \addplot [%         point meta=explicit,         forget plot,         scatter,         scatter/use mapped color={draw=mapped color,fill=mapped color},         mark=*,         draw=none]table[meta=X] {\tableA};          \addplot [mesh,mesh line legend,point meta=x,domain=0.02:0.18,thick,samples=10] {\slope*x+\intercept};%     \addlegendentry{%     $\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x     \pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$}     \end{axis}     \end{tikzpicture}     %\end{figure}     \end{document}      * * * UPDATE this is an update to the percusse's answer ![enter image description here](http://i.stack.imgur.com/WtHfv.png)               \documentclass[border=0.5mm,12pt]{standalone}          \usepackage{pgfplots,pgfplotstable}        % Grafici          \pgfplotsset{%                 colormap legend/.style={legend image code/.code={\path[draw=none,shading=tempshading,shade] (0cm,0mm) rectangle (0.5cm,0.8pt);}},                 /pgf/number format/use comma,%                 compat=newest,%     %            height=9cm,%                 width=12cm%     }               %*********************************************************************************     % Impostazioni Pgfplots     %*********************************************************************************          \pgfplotstableread{     X Y     0.05 0.17     0.05 0.041     0.05 0.023     0.1 0.332     0.1 0.089     0.1 0.041     0.15 0.5     0.15 0.132     0.15 0.06     }\tableA          \pgfplotstablecreatecol[linear regression]     {regression}     {\tableA}          \xdef\slope{\pgfplotstableregressiona} %<-- might be handy occasionally     \xdef\intercept{\pgfplotstableregressionb}          \begin{document}     \thispagestyle{empty}     %\begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[%     /pgf/number format/fixed,     legend pos=outer north east,     grid=major,     xmin=0, xmax=0.2,     ymin=0, ymax=0.6,     point meta min={0},     point meta max={0.2},     yticklabel shift=2pt,     xticklabel shift=2pt,     legend pos=north west,     legend cell align=left,     minor tick num=4,     xticklabel style={text height=1.5ex},     xtick={0,0.05,...,0.3},     minor xtick={%     0.01,0.02,0.03,0.04,%     0.06,0.07,0.08,0.09,%     0.11,0.12,0.13,0.14,%     0.16,0.17,0.18,0.19},%     extra x ticks={0,0.05,...,0.3},     extra x tick style={         xticklabel pos=right,         xticklabel style={text depth=0pt}     },     extra y ticks={0,0.1,...,0.7},     extra y tick style={         yticklabel pos=right     },     tick style={thin,black},     xlabel=\large $m$,     ylabel=\large $\Delta l$,     colorbar horizontal,     colorbar style={         /pgf/number format/fixed,         xticklabel shift=2pt,         xtick={0,0.05,...,0.3},         xticklabel style={text height=1.5ex}     },     axis line style={draw=none}, after end axis/.append code={\draw (rel axis cs:0,0) rectangle (rel axis cs:1,1);},     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}     ]     \pgfplotscolormaptoshadingspec{new}{2cm}\result     \def\tempb{\pgfdeclarehorizontalshading{tempshading}{3cm}}%     \expandafter\tempb\expandafter{\result}%     \addplot [mesh,point meta=x,domain=0.02:0.18,thick,samples=1000,colormap legend] {\slope*x+\intercept};     \addlegendentry{%     $\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x     \pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$}     \addplot [%         point meta=explicit,         scatter,         scatter/use mapped color={draw=mapped color,fill=mapped color},         mark=*,         draw=none]table[meta=X] {\tableA};          \addplot [mesh,point meta=x,domain=0.02:0.18,thick,samples=1000] {\slope*x+\intercept};     \end{axis}     \end{tikzpicture}     %\end{figure}     \end{document}


title: compute position of each symbol

text: I've created a program that generates clickable areas on images with HTML5, taking as input a series of coordinates. Now what I'd like to do is send to that program a `.png` of a LaTeX expression (anything, for instance an equation or a sentence) along with the coordinates of the centers of each and every symbols of that expression. The end goal is to make each symbol clickable separately from one another. So I've been experimenting for a while to create an algorithm that would, given a latex expression, output the list of the coordinates of the centers of each of its symbols (that's the last piece I need to complete my program). Unfortunately, I couldn't come up with a nice solution. However, this algorithm has to exist, since those symbols are indeed all properly located when one compiles a latex expression into a `.png`. I've been searching in the TeX source code, with no success.


title: How to add new packages to TeXStudio

text: I'm completely new to writing in `LaTeX` and am therefore starting up with a pre-made `report` template. However when I just try to compile the template I get the message that following file is required.               tex\latex\natbib\natbib.sty       So I've downloaded the `natbib` package but where do I save the files? Appreciate any help and advice to get started with `TeXStudio` and how to add packages. Thanks a lot!


title: How to place pictures inside parcolumns

text: I would like to display pictures inside \colchunk of parcolumns. This works just fine, but it produces a vertical space in the oppposite column. How can I prevent this from happening?               \begin{parcolumns}[rulebetween,colwidths={1=0.4\linewidth}]{2}          \colchunk{%     \lipsum[1]     \lipsum[1]     }          \colchunk{%     \lipsum[1]          \begin{minipage}{1\linewidth}     \centering     \includegraphics[width=0.5\linewidth]{Image}\captionof{figure}{Caption}     \end{minipage}          \lipsum[1]     \lipsum[1]     \lipsum[1]     }          \end{parcolumns}      This code gives the follwoing output: ![enter image description here](http://i.stack.imgur.com/QtVN7.png)


title: How to preserve hyperlinks in included PDF?

text: I have generated PDFs with figures that have hyperlinks (hyperref to websites, `\href`) in them. When I compile these figures standalone the hyperlinks work. But when I try to include these PDFs (as figures, not the sources) with `\includegraphics` the links are lost and only the image is inserted in the document. Is there a way to include (`\includegraphics`?) a PDF such that its original links work in the master document? This question has to do with the externalization (e.g. TikZ or PGFPlots), which also suffers from these drawbacks, i.e. hyper-references are lost.


title: Can't click hyperlinks in the \includepdf included pdfs

text: > **Possible Duplicate:**   >  How to preserve hyperlinks in included pdf? I am having a problem getting `hyperref` links work in document that is assembled from other documents that have been `\includepdf` included. Here is a minimal example that reproduces the problem: I have two documents - `doc.tex` and `otherdoc.tex`. `doc.tex` includes the `otherdoc.pdf`, which contains a `\href`. When the final document `doc.pdf` is produced, I can't click on the links in it. doc.tex:               \documentclass[11pt]{memoir}     \usepackage{pdfpages}     \begin{document}           \includepdf{otherdoc.pdf}          \end{document}      otherdoc.tex:               \documentclass{article}     \usepackage[pdftex]{hyperref}     \hypersetup{colorlinks}     \hypersetup{linkcolor=blue}          \begin{document}          \clearpage          \Large \href{http://twitter.com/pkrumins}{@pkrumins}          \end{document}      I can click the link in the `otherdoc.tex` but as soon as I compile `doc.tex`, which produces `doc.pdf`, I can no longer click links. Any ideas how to get it working?


title: URL-s are broken after merging PDF files

text: > **Possible Duplicate:**   >  How to preserve hyperlinks in included pdf? After I merge PDF documents with `pdflatex` and `pdfpages` as described here, the URL-s are either broken (PDF files from OpenOffice), or their colorbox is missing (`hyperref`), or if they span over two lines only the information from the first line is kept (the original PDF was correct). Can this be fixed? Or is it a known issue?


title: Saving hyperref when inserting pdf in LaTeX

text: I am trying to insert a pdf document in LaTeX using `\includepdf[pages={1}]{myfile.pdf}` But the inserted `.pdf` loses all its hyperreferences. Is there a way to retain hyperrefs while doing so? ## `myfile.tex`               \begin{document}     \tableofcontents     \chapter{a}     \section{a}     \chapter{b}     \section{b}     \end{document}      Now when generated, `myfile.pdf` has clickable links to chapters and sections ## `maindoc.tex`               \begin{document}     \tableofcontents          \chapter{abc}     \includepdf[pages={-}]{myfile.pdf}          \end{document}      But when included as `.pdf`, the links are lost.


title: Changing Template Header for Appendices

text: I am using a modified BYU Thesis Template for my thesis. I want to be able to change the page header for the the appendices to read "Appendix A Data & Display" instead of "Chapter A Data & Display" where "Data & Display" is the name of one of my appendices. Here is the relevant code from the class file:               % The fancyhdr package allows you to easily customize the page header.     % The settings below produce a nice, well separated header.     \usepackage{fancyhdr}       \fancyhead{}       \fancyhead[LO]{\slshape \rightmark}       \fancyhead[RO,LE]{\textbf{\thepage}}       \fancyhead[RE]{\slshape \leftmark}       \fancyfoot{}       \pagestyle{fancy}       \renewcommand{\chaptermark}[1]{\markboth{\chaptername \ \thechapter \ \ #1}{}}       \renewcommand{\sectionmark}[1]{\markright{\thesection \ \ #1}}      I suppose I should be using an if statement, but my appendices (in their individual tex files) start with `\chapter{Data \& Display}`


title: Preventing automatic Hy@writebookmark in \addcontentsline

text: As a result of my (yet to be published ;-) package with questions and solutions I came across some problems, that are connected to sectioning of a document, say, a book with chapters/sections/subsections etc. As such, in the way I was finding a solution, there is a _cloning_ of sectioning commands with titles etc. to an external file and reading it at the end of the compilation run, via `\input`. The, say, `\chapter` command has to be redefined to this, and it will first produce the ordinary chapter and later on the cloned chapter, via `\immediate\write\LaTeXStandardChapter` (see MWE for definitions please). As long as the delayed chapters have accumulated chapter numbers, there is no problem. `\addcontentsline` adds them nicely to the toc and generates a bookmark, when `hyperref` package is used. Well, I do not want to have accumulated chapter numbers, I rather want to start them over again, such as > Question part: Chapter First ----> Section First of First > > Cloned part: Cloned Chapter First --> Cloned Section First of First etc. i.e. the chapter numbers have to be reset before reading the cloned content file. Now the `\LaTeXStandardChapter{...}` command will add a content line --> this is fine. But the bookmarks are wrong, since they are created from the chapter number 1 etc, which is present twice --> the click on the bookmark will go to the wrong place! Obviously, I have to disable the automatic generation of the bookmark made by `\addcontentsline`, i.e. dropping `\Hy@writebookmark` in a group and add the bookmark 'manually'. All this works, but is there some nicer way to this? Here is my code: (Part of a larger framework, only the relevant parts are shown or shortened to quick usage)               \documentclass[12pt,paper=a4]{scrbook}               \RequirePackage{etoolbox}%     \RequirePackage{xcolor}%     \RequirePackage{morewrites}     \RequirePackage[bookmarksopen=true,bookmarksopenlevel=2]{hyperref}%     \RequirePackage{bookmark}%               \newwrite\CloneChapter%          \let\LaTeXStandardChapter\chapter%     \makeatletter     \newrobustcmd{\unstarredchapter@noopt}[1]{%     \unstarredchapter[#1]{#1}%  Call the version with the optional first arg%     }% End of \unstarredchapter@noopt                    \newrobustcmd{\unstarredchapter@opt}[2][]{%     \LaTeXStandardChapter[#1]{#2}% Normal Chapter, the source of the clone%     \immediate\write\CloneChapter{%     \string\LaTeXStandardChapter[]{\unexpanded{Explanation -- #2}}%  Prevent an entry to the toc from the cloned chapter     \string\phantomsection%     \string\begingroup     \string\renewcommand{\unexpanded{\Hy@writebookmark}}[5]{}%   Drop this "wrong" bookmark     \string\addcontentsline{toc}{chapter}{\unexpanded{\protect\numberline{\thechapter}}{\unexpanded{Explanation -- #1}}}%     \string\endgroup     \string\pdfbookmark[0,color=red]{\unexpanded{Explanation #1}}{cloned::chapter::bookmark::\thechapter}% Manually write the bookmark     }% End of \immediate\write     }% End of \unstarredchapter@opt               % 'Rewrite' the starred chapter, to cool down `\tableofcontents` ;-)     \newrobustcmd{\starredchapter}[1]{%     \LaTeXStandardChapter*{#1}%     }%          \newrobustcmd{\unstarredchapter}{%     \@ifnextchar[{\unstarredchapter@opt}{\unstarredchapter@noopt}     }%               \renewcommand{\chapter}{%     \@ifstar{\starredchapter}{\unstarredchapter}%     }%                    \makeatother          \AtBeginDocument{%     \immediate\openout\CloneChapter=\jobname.clone%     \immediate\write\CloneChapter{%       \string\makeatletter%       \string\setcounter{chapter}{0}%     }%     }%          \AtEndDocument{%     \immediate\closeout\CloneChapter%     }%          \newrobustcmd{\CollectClonedChapter}{%     \part{Explanations}%     \setcounter{chapter}{0}%     \IfFileExists{\jobname.clone}{\input{\jobname.clone}}{%     }%     }%               \newcounter{somecounter}[chapter]          \newrobustcmd{\MyCommand}[2]{%     \refstepcounter{somecounter}%     \textbf{Example \thesomecounter:}          \noindent#1     \hrule%     \immediate\write\CloneChapter{%     \expandafter\string\unexpanded{\textbf{Explanation to Example \number\value{chapter}.\number\value{somecounter}}}          }%     \immediate\write\CloneChapter{%     \noindent     }%     \immediate\write\CloneChapter{%     \expandafter\string\unexpanded{#2}%     }%     }               \begin{document}     \tableofcontents          \part{Questions}%          \chapter{Original Chapter Number One}          \MyCommand{Foo}{Well, this was foo}%               \chapter[Short Original 2]{Original Chapter Number Two}          \MyCommand{And now for something completely different}{Who used that line very often?}          \CollectClonedChapter%          \end{document}      ![enter image description here](http://i.stack.imgur.com/UqRw9.jpg) **Edit** The repeated write of `\renewcommand{\Hy@writebookmark}` is a little overstressing -- in my original framework, I wrapped `\addcontentsline` in another command which does the redefinition. I omitted it for simplicity here.


title: Cyrillic text in symbolic x coords

text: I make bar plot with pgfplots:               \documentclass{report}          \usepackage[T2A]{fontenc} % Поддержка русских букв     \usepackage[utf8]{inputenc} % Кодировка utf8     \usepackage[english, russian]{babel} % Языки: русский,          \usepackage{pgfplots}     \pgfplotsset{     every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left},     tick label style={font=\tiny\scriptsize},     legend style={font=\scriptsize},     axis lines=left,     legend style={draw=none},     }     \begin{document}          \begin{figure} [H]     \centering     \begin{tikzpicture}     \begin{axis} [     ylabel={$T$},     ybar,     enlarge x limits=.15,     symbolic x coords={wer,good,neutral,not good,poor},     xtick=data,     bar shift=0pt     ]          \addplot coordinates {(wer,1) (good,8)     (neutral,2) (not good,0) (poor,10)};          \end{axis}     \end{tikzpicture}     \caption{Прочность металлоизделий}     \end{figure}          \end{document}      And it works. ![enter image description here](http://i.stack.imgur.com/E7CJ7.png) But when I use Cyrillic characters in `symbolic x coords`: `symbolic x coords={сейчас,good,neutral,not good,poor},`, I get an error when compiling.               \documentclass{report}          \usepackage[T2A]{fontenc} % Поддержка русских букв     \usepackage[utf8]{inputenc} % Кодировка utf8     \usepackage[english, russian]{babel} % Языки: русский,          \usepackage{pgfplots}     \pgfplotsset{     every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left},     tick label style={font=\tiny\scriptsize},     legend style={font=\scriptsize},     axis lines=left,     legend style={draw=none},     }     \begin{document}          \begin{figure} [H]     \centering     \begin{tikzpicture}     \begin{axis} [     ylabel={$T$},     ybar,     enlarge x limits=.15,     symbolic x coords={сейчас,good,neutral,not good,poor},     xtick=data,     bar shift=0pt     ]          \addplot coordinates {(сейчас,1) (good,8)     (neutral,2) (not good,0) (poor,10)};          \end{axis}     \end{tikzpicture}     \caption{Прочность металлоизделий}     \end{figure}          \end{document}      Errors:               Missing \endcsname inserted ]     Missing \endcsname inserted (neutral,2) (not good,0) (poor,10)};     Missing \endcsname inserted (neutral,2) (not good,0) (poor,10)};     Use of \pgfp@symb@coords@x@ doesn't match its definition (neutral,2) (not good,0) (poor,10)};     Missing \endcsname inserted (neutral,2) (not good,0) (poor,10)};     Missing \endcsname inserted (neutral,2) (not good,0) (poor,10)};     Extra \endcsname (neutral,2) (not good,0) (poor,10)};     Extra \endcsname (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     Illegal parameter number in definition of \pgfmathresult (neutral,2) (not good,0) (poor,10)};     running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing \pgfplotsset{compat=1.8} into your preamble.      Elsewhere Cyrillic text does not cause errors. How can this be solved?


title: Latex, Tabular TeX

text: How does one force all the entries, assuming there is ample space, in a table within the tabular environment to have the same row width? Thank you!


title: How to store tcolorbox's (multiple) settings in a macro?

text: I'd like to store `tcolorbox`' (multiple) settings in a (single) macro (in fact, a `xkeyval`'s `\cmdKV@fam@key` macro) and use them afterwards via this macro (I know I should use `pgfkeys` instead, but my whole class is using `xkeyval`). Probably because of a `pgfkeys` expansion trouble, I can't succeed: for instance, `colback=red` is a regular option of the `tcolorbox`'s `tcolorbox` environment, but it can't be stored in a macro, as pointed out by the following MWE (which involves only a single setting for simplicity):               \documentclass{article}     \usepackage{tcolorbox}     %     \newcommand*\foo{colback=red}     %     \begin{document}     \begin{tcolorbox}[\foo]     Test.     \end{tcolorbox}     \end{document}      which leads to the following error:               ! Package pgfkeys Error: I do not know the key '/tcb/colback=red'      How could I circumvent this problem?


title: colortbl rowcolor overtop of @{decl}

text: I have tables with many `$\pm$` values that I was using the `@{decl}` command to have nice alignment. However, I wanted to add some row colors. Trying to use colortbl I found that the cell/row color was on top of my `$\pm$`. I tried playing with the overhang, but then the color wasn't behind the `$\pm$`. MWE is below.               \documentclass{article}     \usepackage{color}     \usepackage{colortbl}          \begin{document}     \begin{tabular}{l@{$\pm$}r}     \multicolumn{2}{c}{value} \\     \hline     1 & 2 \\      \rowcolor{white}[0pt] 2&3 \\     \rowcolor{yellow}[0pt] 3&4\\     \end{tabular}               \begin{tabular}{l@{$\pm$}r}     \multicolumn{2}{c}{value} \\     \hline     1 & 2 \\      \rowcolor{white} 2&3 \\     \rowcolor{yellow} 3&4\\     \end{tabular}     \end{document}      Is there any nice/simple way to do this LaTeX? I'm sure there is something complicated, but I thought this would be a relatively simple use case. If it possibly matters, I'm making a Poster in Beamer. ![Latex Table Results](http://i.stack.imgur.com/AuVGr.png)


title: Editing the Minitoc to include the word Page above the page numbers

text: I have browsed through the manual for the minitoc and I haven't been able to find whether there is a way to do the following: For the TOC it is possible to add the word `Page` above the page number column using:               \addtocontents{toc}{~\hfill\textbf{Page}\par}      Is there a way to do the same for a minitoc at the beginning of `\chapter` that doesn't end up writing something also in the general TOC? Please find an MWE below               \documentclass[     DIV=11,     twoside,     headinclude=false,     titlepage=firstiscover,     abstract=true,     headsepline=true,     footsepline=true,     chapterprefix=true, %this allows for editing of the chapter titles     headings=big,     bibliography=totoc,%adds unnumbered Bibliography chapter to toc     captions=tableheading     ]{scrreprt}          %%% Packages     \usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage{minitoc}      \usepackage{notoccite}     \usepackage{kpfonts}     \usepackage[T1]{fontenc}     \usepackage{tensor}     \usepackage{siunitx}     \usepackage{wasysym}     \usepackage{wasysym}          \linespread{1.5} %imperial uses 1.5      \flushbottom          %%%%%%%%%%% ToC DEPTH LEVEL     \setcounter{secnumdepth}{4} % number subsubsection     \setcounter{tocdepth}{4} % list subsubsection     \setcounter{minitocdepth}{4}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Entry of TOC LOF LOT     \def\body{         \pagenumbering{roman}         \cleardoublepage     \linespread{1.25}         %%% MINITOC         \dominitoc         % MINITOC styling         \renewcommand{\mtcfont}{\normalsize\fontfamily{jkpss}\selectfont}         \renewcommand{\mtcSfont}{\normalsize\bf\fontfamily{jkpss}\selectfont}              %%% TOC         \tableofcontents         \addtocontents{toc}{~\hfill\textbf{Page}\par} %Adds the word Page         \cleardoublepage              %%% LOF         \listoffigures \addcontentsline{toc}{section}{List of Figures}         \addtocontents{lof}{~\hfill\textbf{Page}\par} %Adds the word Page         \cleardoublepage              %%% LOT         \listoftables \addcontentsline{toc}{section}{List of Tables}          \addtocontents{lot}{~\hfill\textbf{Page}\par} %Adds the word Page         \cleardoublepage                   \pagestyle{headings}         \pagenumbering{arabic}     }          \begin{document}          \body          \chapter{First Chapter}     \linespread{1}     \dictum[Neil deGrasse Tyson]{The good thing about science is that it's true whether or not you believe in it.}          \minitoc          Here is some introduction          \section{Here is a section for the minitoc}     Bla bla.          \subsection{And why not a subsection too}     Just to spice things up a bit.          \end{document}


title: TikZ: circle split vertical

text: I want to split a TikZ node into a left and a right part, just like `circle split` does in upper and lower part, e.g. `\node [circle split,draw] (x){$a$ \nodepart{lower} $b$}` Is there a vertical equivalent, e.g. `\node [circle split vertical,draw] (x){$a$ \nodepart{right} $b$}`? * * * Here is an example of a node which is split **horizontally** , however I would like the split to be **vertical** :               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{shapes,snakes}     \begin{document}          \begin{tikzpicture}     \node [circle split,draw] (z){$a$ \nodepart{lower} $b$};     \end{tikzpicture}          \end{document}


title: How to generate the date in portuguese?

text: TexStudio will generate the date like "December 8, 2012", and I need it to generate in Portuguese, like "8 de Dezembro de 2012". How can I configure that? (`isodate` package doesn't contain Portuguese) **Related:** Date format in LaTeX


title: Problem typesetting a Prisoner's Dilemma table

text: I am going to create a table, which should look like The Prisoner's Dilemma, but I can't create it. It should look like this: ![enter image description here](http://i.stack.imgur.com/mK6hM.png) My preamble look like this:               \documentclass[a4paper,12pt,oneside]{article}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{shapes,arrows,positioning,calc}      \usepackage{tabu}     \usepackage{hyperref}     \usepackage{longtable}     \usepackage{array}     \usepackage{siunitx,multirow,tabularx,booktabs}     \renewcommand{\arraystretch}{1.5}     \def\mathbi#1{\textbf{\em #1}}     \newcommand{\transp}{^{\mathsf{T}}}          \begin{document}          \begin{table}[h]          \begin{center}           \caption{The Prisoner’s Dilemma}          \begin{tabular}{c | c | c |}          &Factor1&Defect\\\hline%          Factor2&5&4\\          Defect&2&2\\\hline          \end{tabular}          \end{center}          \end{table}          \end{document}      And the table look like this: ![enter image description here](http://i.stack.imgur.com/kYDgs.png) Can someone tell me how to make the first table with AND without the extra box? The cells should be the same size.


title: Beamer uploads graph but not labels

text: I'm new to `beamer` and am trying to make a basic presentation. I have some graphs (generated in STATA) that I want to upload to my presentation. The graphics are pdfs. Beamer generates a presentation including the graphic, but omits my labels and tick lines. How can I upload my graphs with labels?               \begin{frame} {inserting a graphic}     \begin{figure}     \begin{center}         \includegraphics[height=3in]{graph.pdf}     \end{center}     \end{figure}     \end{frame}


title: Tikz nodes moves after double building

text: I want to plot 4 graphs in one tikzpicture in a 2x2 grid, using groupplot. Also I want to put some arrows from nodes in the first three plots to nodes in the last one. To do this, I try to use `remember picture` and `overlay`, but probably I set it incorrectly. When I build the output, after one compilation I got the plots and arrows correctly, but if I compile twice, the arrows move to some other coordinates. In addition, if I make some changes, for example in the nodes coordinates, with just a compilation the output is not updated, but I have to delete the temporary files created during the building process and then compile. Why is this happening? I'd like to avoid this manual deletion process and to get the arrows right after multiple compilations. Here's the MWE. Probably some packages are useless/redundant.               \documentclass{article}     \usepackage[dvips]{graphicx}     \usepackage[usenames,dvipsnames]{xcolor} % in order to use color names     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{latexsym}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{color}     \usepackage{psfrag}     \usepackage{rotating}     \usepackage{pgf,pgfsys,pgffor}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \usepackage[caption=false]{subfig}     \usepackage{tikz}     \usetikzlibrary{intersections,arrows,decorations.pathmorphing,backgrounds,fit,mindmap,calc,through,scopes,fadings,positioning,automata,calendar,shapes,er,matrix,folding,patterns,petri,plothandlers,plotmarks,shadows,topaths,through,trees,pgfplots.units,shapes.gates.logic.US,shapes.gates.logic.IEC,positioning}      \usepgfplotslibrary{groupplots,units}          \begin{document}          \begin{tikzpicture}[remember picture, overlay]     \begin{groupplot}[             /pgfplots/group/horizontal sep=1.75cm,             /pgfplots/group/vertical sep=1cm,         group style={                     group size=2 by 2},                     yticklabel style={/pgf/number format/fixed,/pgf/number format/precision=3},                     xlabel=$\tau$,             axis y line=left,                     axis x line=bottom,                     xlabel style={below},height=4cm, width=4cm             ]     \nextgroupplot[remember picture,line width=1pt, ylabel=$\lambda_1$, ylabel style={rotate=-90},ymin=0.9,ymax=1.5]     \addplot[line width=1pt,no markers,cyan] function{x};     \draw[line width=0.5pt] (axis cs:0.1,0.9) -- (axis cs:0.1,1.19449) node (y1) {};     %     \nextgroupplot[remember picture,line width=1pt, ylabel=$t_1$, ylabel style={rotate=-90},ymin=-0.7,ymax=0.1]     \addplot[line width=1pt,no markers,cyan,domain=-0.7:0.1] function{-2*x};     \draw[line width=0.5pt] (axis cs:0.1,-0.7) -- (axis cs:0.1,-0.212258) node (t1) {};     %     \nextgroupplot[remember picture,line width=1pt, ylabel=$\lambda_2$, ylabel style={rotate=-90},ymin=1.35,ymax=1.75]     \addplot[line width=1pt,no markers,cyan] function{x};     \draw[line width=0.5pt] (axis cs:0.1,1.35) -- (axis cs:1,1.39089)  node (y2) {};     %     \nextgroupplot[name=step,remember picture,line width=1pt, ylabel=$\lambda(t)$, xlabel=$t$,xtick={-0.6,-0.3,0}, ylabel style={rotate=-90},xmin=-0.8,xmax=0.1,ymin=0.9,ymax=1.75]      \draw[cyan, solid] (axis cs:-0.8,1.19449) -- (axis cs:-0.212258,1.19449) -- (axis cs:-0.212258,1.39089) -- (axis cs:0,1.39089);     \node[draw, line width=0.5pt] at (axis cs:-0.3,1.6) {$\tau=0.1$};     \node[inner sep=0pt] (y1end) at (axis cs:-0.5,1.19449) {};     \node[inner sep=0pt] (y2end) at (axis cs:-0.212258,1.39089) {};     \node[inner sep=0pt] (t1end) at (axis cs:-0.212258,1.2) {};     \end{groupplot}          \draw[->] (y1) .. controls +(-20:1) and +(120:1) ..  (y1end);     \draw[->] (y2) .. controls +(80:1.5) and +(160:2) .. (y2end);     \draw[->] (t1) .. controls +(-20:2) and +(15:2)  ..  (t1end);     \end{tikzpicture}          \end{document}


title: xyz coordinates rotation

text: is it possible to set a different orthonormal base for the xyz coordinate space? for example, the default one is x=(1,0,0) y=(0,1,0) and z=(0,0,1). I would want to set this base: x=(1,0,0) y=(0,0,1) and z=(0,1,0) so that when i draw a line from (0,0,0) to (0,1,0) it will be rendered as a line from (0,0,0) to (0,0,1) using default xyz coordinates. i tried setting                   \begin{tikzpicture}[x={(1,0,0)},y={(0,0,1)},z={(0,1,0)}]      but it seems only to distort the drawing. I would like to avoid using pgfplots, if possible. thank you in advance for your attention


title: Sorting references - last names' alphabetical order

text: I'd like to sort my references alphabetically by last name of the author (firstly Art, then Fart). There's one more thing - I want to have the last names put in the front. I guess the latter can be solved simply by               \bibitem{art} ART, John.     \bibitem{fart} FART, Jack.      I don't know about the former. I'm still new to libraries, so I don't mind using any package. I prefer the simplest code possible though. (I'm using the TeXworks editor.) My code is below               \documentclass{article}          \begin{document}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.~\cite{fart} Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.~\cite{art}          \begin{thebibliography}{99}     \addcontentsline{toc}{chapter}{Bibliography}          \bibitem{art}     ART, John.          \bibitem{fart}     FART, Jack.          \end{thebibliography}          \end{document}      Picture with intention included:![enter image description here](http://i.stack.imgur.com/irYQl.jpg) Thank you!


title: How to modify TEXMFHOME in texmaker on Mac when running a command?

text: I have got a complex latex document that we are meant to compile using make. It works fine but I would prefer to use texmaker. However, in the Makefile I can see that I need to modify TEXMFHOME and TEXINPUTS before running pdflatex : `TEXMFHOME=misc//:$(TEXMFHOME) TEXINPUTS=.//:$(TEXINPUTS) "/usr/texbin/pdflatex" -synctex=1 -interaction=nonstopmode master.tex` I tried to configure the command in texmaker to do the same but it seems just to ignore the variables and of course doesn't find all necessary files. Is there a way to modify TEXMFHOME in texmaker ?


title: Chapter colorized in different colors

text: Is it possible to give to each chapter a different color coming from something like a color array? I basically know how to colorize text, but for that purpose the color value is fixed. What I want to do is build up something like an array of colors and then use the color specified in cell 1 for chapter 1, second chapter color in cell 2, etc. Is something like that doable in Latex?


title: dvisvgm wrong colors

text: I'm using `dvisvgm` to convert a `tikz` picture to an `svg`. However, the `svg` messes a few colors. All math text appears in black while I have it in red in the original tex file. Also, some circles have a black border line instead of the filling color. Has any of you encountered these problems? **Later edit:** It fails only when dvisvgm is called as:               dvisvgm -n filename      `-n` means fonts are converted to paths.


title: Smaller membership symbol

text: To mean that x is an element of X, we can write `x \in X`. However, in the standard packages, the membership symbol that results is too big; it draws too much attention to itself. This is especially evident when we're doing set theory and writing sets as lowercase, as in `x \in y`. Does anyone one how to draw a less attention-seeking membership symbol?


title: Using simple quotes "" instead of \text{}

text: Is there a way to use `newcommand` or some other nice technique to transform any occurence of               "bla"      in _math mode_ into               \text{bla}      The reason I ask is because it is easy, and doesn't interrupt the flow of reading the (La)TeX code as much. I would like to keep Xe(La)TeX's nice quote behavior (ie it can use the regular "" instead of backticks to quote some text outside math mode).


title: Short form for textup in math mode

text: > **Possible Duplicate:**   >  Using simple quotes “” instead of \text{} For subscripts I usally use `\textup` but if you have many of them it's much to write and read.               \documentclass{article}          \usepackage{siunitx}     \usepackage{amsmath}          \begin{document}     The density of water is $\rho_{\textup{Water}} = \SI{1.0}{kg\per d\cubic m}$.     \end{document}      So instead of that, similar to the new formular editor of Word, I'd like to write:               $\rho_"Water"$      or               $\rho__{Water}$      But I prefer the first version because it is more flexible you could also write:               $x_{"Person",i}$      Is there a package that provides something like that? I have seen this question: Redefine underscore to produce roman subscript without breaking file names, but I don't want to change the default behavior for indices/subscripts.


title: Center text in a single table cell

text: Suppose I have simple table. While I want the columns in general to be flush both right and left, there are certain cells that I want to be centered.               \documentclass[12pt,a4paper]{book}          \def\x{This is a paragraph of text that should be flush both right and left. Centering an adjacent cell should not cause this cell to be centered.}     \def\y{Centered text}          \begin{document}     \centering     \begin{tabular}{p{2in}|p{2in}}     \x & \y \\     \y & \x \\     \x & \x     \end{tabular}          \end{document}      This has the output that I expected. ![enter image description here](http://i.stack.imgur.com/0OyA7.png) But what do I do when I want to center the cells that say "Centered text"? I tried to do it with the `\centering` command,               \def\y{\centering Centered text}      but it comes up with the following error:               ! Extra alignment tab has been changed to \cr.      How can I center individual cells?


title: How to reduce Program-Listing line spacing in LyX

text: Using LyX 2.06. I have a standard document with 1.5 line spacing, but I want my program listings to use 1.0 line spacing. Is there a simple way to do this?


title: Using 10pt fonts with the fourier package actually gives me 9.17pt

text: I am using the `fourier` package to produce output (containing math) that I can insert into another document using the same (Utopia) font and have matching text styles. But when I set the font size to 10pt, LaTeX actually gives me 9.17pt (as verified with Acrobat)! Why does this happen? How can I force the font size to the "true" value, 10 points? If I choose 12pt, I only get 11pt. The point is that it doesn't match the other document I'm inserting the LaTeX-generated PDF into. Minimal example:               \documentclass[10pt]{article}     \usepackage{fourier}     \usepackage[T1]{fontenc}          \begin{document}     text here     \end{document}


title: Removing or changing table border spacing

text: I'm requiring the use of a tabular environment within each item of an itemize environment. However, owing to the default table border spacing, there exists some extra amount of spacing between the item label and the first column of the table. The same applies between the rightmost column and the right margin of my document. ![enter image description here](http://i.stack.imgur.com/SxMPS.png) Notice how the left table border in the first item is aligned with the letter 'T' of the word "This" from the second item. I wish to remove the spacing between the left table border and the text "Column 1 Text" so that 'C' starts from the same point as 'T'. The same applies for the rightmost column as well. The horizontal rule demonstrates the actual text width.


title: I want to plot several curves in pgfplots and I have problem with markers

text: I want to skip some of markers, but not skip Coordinates. For example if we have 24 Coordinates I dont need 24 marker, I need 12 marker with 24 Coordinates.   How can I do it?               \documentclass{report}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{semilogxaxis}     \addplot file{ar0.dat};     %ar0 is a file with 24 coordinates     \end{semilogxaxis}     \end{tikzpicture}     \end{document}


title: Creating playing cards using TikZ, part 2

text: This is a follow up from this other post.. Thanks to the aid of some people I'm almost done, this is what I have now:               \documentclass[parskip]{scrartcl}     \usepackage[margin=15mm]{geometry}     \usepackage{tikz}     \usepackage{pifont}     \usepackage{anttor}     \usepackage[utf8]{inputenc}     \begin{document}     \pgfmathsetmacro{\cardwidth}{5}     \pgfmathsetmacro{\cardheight}{8}     \pgfmathsetmacro{\stripwidth}{0.6}     \pgfmathsetmacro{\strippadding}{0.1}     \pgfmathsetmacro{\textpadding}{0.1}     \pgfmathsetmacro{\ruleheight}{0.15}     \begin{tikzpicture}         \draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);         \fill[lime,rounded corners=0.1cm] (\strippadding,\strippadding) rectangle (\strippadding+\stripwidth,\cardheight-\strippadding) node[rotate=90,above left,black,font=\large] {INTER ARMA \rotatebox[origin=c]{-90}{\ding{52}}};         \node[text width=(\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3)*1cm,below right] at (\strippadding+\stripwidth+\textpadding,\cardheight-\textpadding) {             {\Large KEEPER}\\             \vspace{0.15cm}             {\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}\\             \vspace{0.25cm}             {\large Inter Arma}\\             \tikz{\fill (0,0) rectangle (\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3,\ruleheight);}\\             \vspace{0.2cm}             {\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit.\\     Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}         };     \end{tikzpicture}     \end{document}      ![output card](http://i.stack.imgur.com/z90CA.png) The problems are:   1. the line below "Inter Arma" should be closer to it, like an underline.   2. if the text has multiple paragraphs, the spacing becomes bad (look the image). How can I control it?   3. I intend to use Poker card sizes, should I change width and heigth to 6.3 and 8.8?   4. ~~The calculation of the main area's width in the answer to my previous question was bad, so I substracted 0.3 to it. Why is that? it seemed ok as it was.~~ Solved.


title: Arabic bibliography with biblatex

text: I haven't found any mention of the possibility of inserting a bibliography entry with `biblatex` in Arabic script (Arabic in this case). Is there any way I can do it?


title: pdfinfo doesn't appear to be working

text: I'm compiling my LaTeX using pdflatex and would like to have some pdfinfo integrated into the resulting file. Alas, this doesn't seem to be working, though I am using the same code which has worked in the past. The header of my source is below:               \documentclass[twocolumn]{article}     \usepackage{tikz}     \usepackage[numbers]{natbib}     \newcommand{\final}{1}     \usepackage[colorlinks,linkcolor=black,anchorcolor=black,citecolor=black]{hyperref}     \usepackage{fancyhdr}     \usepackage{abstract}          \title{Zombie Paranoia in the Bronx: A Study in Psychosocial Perceptions \\ Draft}          \author{{\bfseries John Smith$^a$} \\     {\footnotesize $^a$Ecology, Evolution, \& Behavior, University of Queens, USA \emph{smith@uoq.edu}}\\     }     \date{}          \pdfinfo     { /Title (Zombie Paranoia in the Bronx: A Study in Psychosocial Perceptions)       /Author (John Smith)     %  /CreationDate (D:YYYYMMDDhhmmss) % this is the format used by pdf for date/time     %  /Subject (...)     %  /Keywords ()     }      Any thoughts?


title: Beamer frametitle separator

text: I'm wondering why this minimal example is not doing great when there is no framesubtitle content...               \documentclass[t]{beamer}          \setbeamertemplate{frametitle}{%           \nointerlineskip%          \begin{beamercolorbox}[wd=\paperwidth,ht=3.75ex,left]{frametitle}%               \hspace*{2ex}\strut{\insertframetitle}\strut           \ifx\insertframesubtitle\@empty%           \else           {%\usebeamerfont{framesubtitle}%            \usebeamercolor[fg]{framesubtitle}%           \strut{ - \insertframesubtitle}\strut\par}%           \fi       \vskip-1ex     \end{beamercolorbox}}          \begin{document}     \begin{frame}{Frame title}{frame subtitle}          \end{frame}          \begin{frame}{Frame Title}          \end{frame}          \end{document}


title: Centering item along several nodes in bmatrix

text: How can I position `X` exactly in the middle of space between `a` and `d` column?               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \[     \begin{bmatrix} a & b & c & d & e \\                     a & b & c & d & e \\                       &   & X &   & e     \end{bmatrix}     \]     \end{document}


title: Vertical loop/block lines in algorithmicx with 'noend' option

text: I am using the `algorithmicx` package to write an algorithm. However I am using the `noend` option:               \usepackage[noend]{algpseudocode}      Is there anyway to get vertical lines for each block of code? This question has been answered here: http://tex.stackexchange.com/a/52778/37056 However, it does not work when using the `noend` option. EDIT: I'm looking for something like the algorithms here: http://www.isg.rhul.ac.uk/~kp/dtls.pdf


title: Suppress output for a group

text: I have an `\item` style command where I need to be able to suppress output for the following text. I can do this with `\nullfont`, but that seems like a poor hack. Is there a declaration that will suppress all output, along the lines of an `\sbox0` but that is a declaration and not a command? Here's a minimal working example (the real `\myitem` and the context in which it is used are more complicated).               \documentclass{report}          \newcommand{\myitem}[1]{%       \nullfont% <-- want a better way to do this     }          \begin{document}       \begin{enumerate}         \item[foo] show this         \myitem{bar} suppress this         \item[foobar] show this too       \end{enumerate}     \end{document}      Note that this is similar to this question but I can't modify the original tex source and thus don't have a handler for the end of the text associated with the item. There aren't paragraph skips between items.


title: From LyX to LaTeX and back without losing information

text: I work in LyX but my colleagues work in LaTeX. If I export from LyX to LaTeX, then send them the tex file, then receive the tex file with their editions and then import it back to LyX, will I have all my information there? I.e., suppose their edit involves only the text, will my new LyX file will indeed be identical to the previous LyX file with only the text changes? I ask because with other software (such as Word), information might be lost during export and import.


title: Remove header and footer lines in newlfm

text: I'm trying to write a cover letter using the newlfm document class. It's okay for the letter but every page introduces a hideous top and bottom rule line. Has anyone used this and knows how to remove? The example code I'm using is here: http://tex.stackexchange.com/a/15534


title: powerdot/pstricks for local typesetting mode in Texpad iOS?

text: I use `powerdot` to typeset my presentations. Has anybody got experience with running `powerdot`/PStricks on the local (Ker)TeX environment coming with Texpad (local typesetting mode)? Is this possible, to begin with? If so, how would I proceed then: Install `powerdot`/PStricks into the Texpad- Custom-Packages dir? Besides: I use my own `powerdot` styles. In my regular TeX environment, I provide the style files in my working dir. Trying to have my `powerdot` presentation assembled using cloud typesetting, `powerdot` fails in picking up the style files (one `.sty` \+ some `.ps`) from my project dir. I then tried to store them in the Texpad-Custom-Packages dir; no luck either. I'd appreciate any hint, both on my local and cloud typesetting issue!


title: Upside-down triangle as node shape

text: How to give a node the shape of an upside-down triangle (base at top)? I tried the following:               triangle/.style = { regular polygon, regular polygon sides=3, rotate=180}      But I don't want the text rotated.


title: ctable decimal alignment

text: I'm trying to replicate `siunitx`'s decimal alignmnent in tables, using ctables.               \documentclass{article}     \usepackage{ctable}     \begin{document}     \ctable[] {rc} {}{       \FL \textbf{Data} & \textbf{Distance}       \ML one & 1.1       \ML ten & 10.1       \ML hundred & 100.1       \LL     }     \end{document}      which results in: ![this is what I get](http://i.stack.imgur.com/lh5xN.png) And I'm looking to get somethign that looks closer to this answer.


title: pdflatex indenting first paragraph after section

text: I am having an issue where the first paragraph is being indented after a section heading. For instance               \section{My Section}\label{sec:my-section}     This is my section, and I have no idea why it's being indented      I am using the article class:               \documentclass[10pt]{article}      I have narrowed the issue down to this snippet of code:               \makeatletter     \renewcommand\section{\@startsection {section}{1}{0mm} % name, level, indent                                    {3pt} % before skip                                    {3pt} % after skip                                    {\normalfont\bfseries}}     \makeatother      These are the packages being imported:               \usepackage{float,latexsym,longtable,color}     \usepackage[pdftex]{graphics,graphicx}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{setspace}     \usepackage[small,compact]{titlesec}     \usepackage{bm}     \usepackage{fancyhdr}     \usepackage{hangcaption}     \usepackage{amsbsy}     \usepackage{floatflt}     \usepackage{epsfig}     \usepackage{wrapfig}            % wrap figures/tables in text     \usepackage{subfigure}          % subcaptions for subfigures     \usepackage{threeparttable}     % tables with footnotes     \usepackage{dcolumn,multirow}   % decimal-aligned tabular math columns     \usepackage{booktabs}     \usepackage{nomencl}            % nomenclature package     \usepackage{lscape}     \usepackage{times}     \usepackage[colorlinks=true, linkcolor=DarkBlue, citecolor=DarkBlue, urlcolor=DarkBlue]{hyperref}     \usepackage{array}     \usepackage{caption}     \usepackage[table]{xcolor}     \usepackage{import}     \usepackage{datetime}     \usepackage{flafter}     \usepackage{enumitem} % Better control over lists


title: Compatibility issues with WinEDT. How do I fix it?

text: I've been having compatibility issues when using MikTeX with WinEDT on a Windows 7 laptop. More particularly, when I go to open certain .tex documents that someone else has been working on with a different computer and editor, strange characters appear in the file where they shouldn't, e.g. the Â character occurring in the middle of "maximum" like this "maxiÂ-mum". And when I try to build the .tex document, it fails and gives errors such as:               ! Package inputenc Error: Keyboard character used is undefined     (inputenc)                in inputencoding `latin1'.      Looking on this site, I found this question which seems to be about the same problem I'm having Kile document doesn't work well in WinEdt. How do I convert it? However, I tried some of the suggestions mentioned there but I couldn't get them to work. First I tried downloading TeXStudio, which was mentioned in one of the comments as being able to work with UTF-8 encoding, but I still get problems with this. Specifically, the strange characters no longer appear in the .tex file when I open it in TeXStudio, but if I build a pdf, the strange characters now appear in the .pdf file. I also tried opening the .tex files in WinEDT using the UTF-8 option, and although the strange characters don't appear in the .tex document when I do this, it still won't build and returns the same errors that I get when I don't open it using the UTF-8 option. If anyone knows a TeX editor that is more compatible than WinEDT or has an idea of how I can fix the issues I've been having WinEDT or TeXStudio, it would be much appreciated!


title: TikZ: Random characters with tikz, fontenc and input

text: I am getting random characters displayed in my TikZ images: ![Random characters with TikZ](http://i.stack.imgur.com/5bkRQ.png) I have just noticed this recently. I am not sure what this might be caused by. I am using the latest TikZ build from TeXample. I only observe this behaviour, when I create the image by using `\input{}` on my TikZ code, like so:               \documentclass{minimal}          \usepackage[T1]{fontenc}          \usepackage{tikz}          \begin{document}         \input{test.tikz}     \end{document}      Where `test.tikz` is just:               \begin{tikzpicture}%         \draw (-1,0) -- (1,0);     \end{tikzpicture}      If I were to directly insert the TikZ code (without `input`ing an external file), everything works nicely: ![Normal TikZ](http://i.stack.imgur.com/ucHyX.png) Also, removing `\usepackage[T1]{fontenc}` "fixes" the problem. Any ideas what's going on there?


title: Define "block" and "connector" commands in TikZ?

text: How can I define two commands, `block` and `connector` in TikZ so that I could use them the same way as `umlpackage` and `umlimport` in uml-tikz. E.g. I want to be able to say something like:               \block[x=0,y=0]{UI}     \block[x=2]{Services}     \block[x=4]{Business Layer}     \block{x=6]{Database Layer}          \connector{UI}{Services}     \connector{Services}{Business Layer}     \connector{Business Layer}{Database Layer}      and have a diagram that looks like: ![enter image description here](http://i.stack.imgur.com/OpVAY.png) If there is an easy way to do this in TikZ (without doing all the node and draw commands - I want to do this declaratively) or if there is a library for making component diagrams like these, please let me know. P.S.: Ultimately, I would like to be a able to draw model diagrams like this: ![enter image description here](http://i.stack.imgur.com/jf5EW.png)


title: How to define HTML keywords in \listings

text:
I'm working on the implementation of a HTML5 code style for `\listings`. Currently I have the problem that there are different ways to define HTML tags. In my example, I don't get `/p` in `<p></p>` marked. **Screenshot:** ![enter image description here](http://i.stack.imgur.com/NReit.png) **My keyword definition looks like this:**               otherkeywords={>,><,</p,<p,
}      If I add `/p` to the list, then `</p>` is not marked anymore. **Here is my language definition:**               \lstdefinelanguage{HTML5}{       language=html,       sensitive=true,          alsoletter={<>=-},           morecomment=[s]{<!-}{-->},       tag=[s],       otherkeywords={>,><,</p,<p,
}     }      For a complete example I've created this document: https://www.writelatex.com/74567mmxwkw


title: Context: Placing float (figure) and text-top at same height

text: I would like my figures to be flush with the text line beside them if they are positioned left or right and top. Currently the top edge of the figures are roughly flush with the 2nd line. This seems to be the standard position for floats e.g. look at the images at this page Currently as: ![current State](http://i.stack.imgur.com/vwqmj.png) Should be: ![should-state](http://i.stack.imgur.com/dx5tD.png) How can I set the top of my figures to be flush with the X-height of the 1st line? Is there a way to define an offset to shift the figure top? Or an more elegant solution? (I tried several commands, but did not find an appropriate one) PS.: I use `\setuplayout[grid=yes]`


title: Environment with handwritten font with math support

text: Environment with handwritten font. I would like to customize an environment called solution as follows.   * that had the following characteristic proof environment: input " **\solution[of Jhon]** " output " **Solution of Jhon.** " with the same source document.   * who had a handwritten fonts such as those packages in The LaTeX Font Catalogue   * that the source of the document and other environments remain unchanged.   * As in the answer to question "Handwritten font with math support" I wish there was also support for the math mode. The intention is to use sources well in solving Calculus for my students. Thanks in advance.


title: beamer: making a slide transparent and superimposing the next slide

text: Here is a slide. The slide before was the one that we still see in the background. It then became blue and transparent, and the problem line showed up. ![enter image description here](http://i.stack.imgur.com/nCA7p.png) Is that possible to use `tikZ` to arrive at a _similar_ result? If so, can you provide a minimal example so that I can build on it?


title: Function arguments in algorithmicx

text: I have a question about function arguments in the _algorithmicx_ package. The following code works:               \documentclass{article}     \usepackage{algpseudocode}     \usepackage{algorithm}          \begin{document}          \begin{algorithm}     \begin{algorithmic}[5]       \Function{f}{$\tau$ , $\delta$}       %\Function{f}{$\overrightarrow{\tau}$, $\overrightarrow{\delta}$}       \State etc       \EndFunction     \end{algorithmic}     \end{algorithm}          \end{document}      But if I change the arguments to:                  \Function{f}{$\overrightarrow{\tau}$ , $\overrightarrow{\delta}$}      I get an apparently unrelated error:               ! Illegal parameter number in definition of \@gtempa.      Do you know any solutions or workarounds for this situation?


title: Making more easy the itemized of item with tabulation system

text: Actually, isn’t not really a question. (Since my examinations get close, I don't really have the time to search for a solution to my problems.) Rather than using the common `\item`, I'd like to use simple tabulation, with the possibility to indent. I know it isn't really the spirit of latex, but I want to fuse "Word" document with LaTeX one, to make them more pretty, and there are a lot of "itemized" item. And they ate a lot of time. I was thinking of the use of special environment, or may be the "WYSIWYG" mode of LaTeX (normally used to show LaTeX code, for example), the verbatim environment (but "what" for the "arrow", or point or what ever that show the element ?). ![It may be more cleare with this image ; upper part of the image = "in LaTeX", down part of the image = "PDF result"](http://i.stack.imgur.com/LTJXP.jpg) Please don't mind the underlingment in the picture. Edit : Here, I just play a little with the code, and it give this : ![After few test](http://i.stack.imgur.com/SXbbi.jpg) **The "new" code** (originally from _Peter Grill_ ) :               \documentclass{article}     \usepackage{pgf}     \usepackage{xstring}     \usepackage{listings}          \newcounter{NumOfContigousSpaces}%     \setcounter{NumOfContigousSpaces}{0}%          \newcommand{\Width}{1}%     \newcommand*{\AddApproriateBulletIfFirstChar}[1]{%         \pgfmathtruncatemacro{\BulletType}{\arabic{NumOfContigousSpaces}/4}%         \IfEqCase{\BulletType}{%             {0}{\gdef\Width{1}}             {1}{\gdef\Width{3}$\bullet$\hspace{1em}}             {2}{\gdef\Width{3}$\circ$\hspace{1em}}             {3}{\gdef\Width{3}$\star$\hspace{1em}}         }[\gdef\Width{3}$\bullet$\hspace{1em}]%         #1%         \setcounter{NumOfContigousSpaces}{0}%     }%     \newcommand*{\ProcessSpace}{%         \stepcounter{NumOfContigousSpaces}%         \hspace{4em}%     }%     \lstset{literate=%         {\ }{{{\ProcessSpace}}}1% Count contigous spaces         {a}{{{\AddApproriateBulletIfFirstChar{a}}}}\Width         {b}{{{\AddApproriateBulletIfFirstChar{b}}}}\Width         {c}{{{\AddApproriateBulletIfFirstChar{c}}}}\Width         {d}{{{\AddApproriateBulletIfFirstChar{d}}}}\Width         {e}{{{\AddApproriateBulletIfFirstChar{e}}}}\Width         {f}{{{\AddApproriateBulletIfFirstChar{f}}}}\Width         {g}{{{\AddApproriateBulletIfFirstChar{g}}}}\Width         {h}{{{\AddApproriateBulletIfFirstChar{h}}}}\Width         {i}{{{\AddApproriateBulletIfFirstChar{i}}}}\Width         {j}{{{\AddApproriateBulletIfFirstChar{j}}}}\Width         {k}{{{\AddApproriateBulletIfFirstChar{k}}}}\Width         {l}{{{\AddApproriateBulletIfFirstChar{l}}}}\Width         {m}{{{\AddApproriateBulletIfFirstChar{m}}}}\Width         {n}{{{\AddApproriateBulletIfFirstChar{n}}}}\Width         {o}{{{\AddApproriateBulletIfFirstChar{o}}}}\Width         {p}{{{\AddApproriateBulletIfFirstChar{p}}}}\Width         {q}{{{\AddApproriateBulletIfFirstChar{q}}}}\Width         {r}{{{\AddApproriateBulletIfFirstChar{r}}}}\Width         {s}{{{\AddApproriateBulletIfFirstChar{s}}}}\Width         {t}{{{\AddApproriateBulletIfFirstChar{t}}}}\Width         {u}{{{\AddApproriateBulletIfFirstChar{u}}}}\Width         {v}{{{\AddApproriateBulletIfFirstChar{v}}}}\Width         {w}{{{\AddApproriateBulletIfFirstChar{w}}}}\Width         {x}{{{\AddApproriateBulletIfFirstChar{x}}}}\Width         {y}{{{\AddApproriateBulletIfFirstChar{y}}}}\Width         {z}{{{\AddApproriateBulletIfFirstChar{z}}}}\Width         %--- now handle uppercase chars         {A}{{{\AddApproriateBulletIfFirstChar{A}}}}\Width         {B}{{{\AddApproriateBulletIfFirstChar{B}}}}\Width         {C}{{{\AddApproriateBulletIfFirstChar{C}}}}\Width         {D}{{{\AddApproriateBulletIfFirstChar{D}}}}\Width         {E}{{{\AddApproriateBulletIfFirstChar{E}}}}\Width         {F}{{{\AddApproriateBulletIfFirstChar{F}}}}\Width         {G}{{{\AddApproriateBulletIfFirstChar{G}}}}\Width         {H}{{{\AddApproriateBulletIfFirstChar{H}}}}\Width         {I}{{{\AddApproriateBulletIfFirstChar{I}}}}\Width         {J}{{{\AddApproriateBulletIfFirstChar{J}}}}\Width         {K}{{{\AddApproriateBulletIfFirstChar{K}}}}\Width         {L}{{{\AddApproriateBulletIfFirstChar{L}}}}\Width         {M}{{{\AddApproriateBulletIfFirstChar{M}}}}\Width         {N}{{{\AddApproriateBulletIfFirstChar{N}}}}\Width         {O}{{{\AddApproriateBulletIfFirstChar{O}}}}\Width         {P}{{{\AddApproriateBulletIfFirstChar{P}}}}\Width         {Q}{{{\AddApproriateBulletIfFirstChar{Q}}}}\Width         {R}{{{\AddApproriateBulletIfFirstChar{R}}}}\Width         {S}{{{\AddApproriateBulletIfFirstChar{S}}}}\Width         {T}{{{\AddApproriateBulletIfFirstChar{T}}}}\Width         {U}{{{\AddApproriateBulletIfFirstChar{U}}}}\Width         {V}{{{\AddApproriateBulletIfFirstChar{V}}}}\Width         {W}{{{\AddApproriateBulletIfFirstChar{W}}}}\Width         {X}{{{\AddApproriateBulletIfFirstChar{X}}}}\Width         {Y}{{{\AddApproriateBulletIfFirstChar{Y}}}}\Width         {Z}{{{\AddApproriateBulletIfFirstChar{Z}}}}\Width     }     \begin{document}     \begin{lstlisting}     Not indent one         What a want to indent         Others stuff             And subindent             Again other                 And even more subindent                 More and more         Another thing         Last one     \end{lstlisting}     \end{document}      I've added some `\hpsace`, and put one instead of a simple `\space`. It makes the word more clear. I don't know what is the `{\ }` for in the begining of `\lstset{literate=% {\ }{{{\ProcessSpace}}}1% Count contigous spaces`, but it seems (or may be the "bullet" part), that this is the cause of the first word splitting. When I add an \ in it, no bullet anymore, but the word were correctly put. Any idea ? (Again, thanks for the answers) Edit 2 : Thanks to _Peter Grill_ 's code, problem solved. **Note** : This system doesn't allow the use of macro inside the list. What about "enumerate" now ?


title: Continuing a TikZ animation with \onslide after a \foreach loop

text: I want to produce an animation in a tikzpicture environment in Beamer. The animation consists in a series of slides produced by combining `\foreach` and `\onslide`, which works fine. I then want to continue my animation with a few more slides produced by `\onslide` but not within the `\foreach` command. But the compilation gets stuck for some reason.               \documentclass{beamer}          \usepackage{tikz}          \begin{document}     \begin{frame}     \begin{tikzpicture}     \pgfmathsetmacro{\N}{3}     \foreach \n in {1,2,...,\N}{         \onslide<\n>{             \draw (0,0) node {node on slide \n};         }     }     \onslide<\N+1>{         \draw (0,0) node {node on slide {\N+1}};     }     \end{tikzpicture}     \end{frame}     \end{document}      The problem stems from `\onslide<\N+1>`. Substituting `\onslide<4>` for that works fine. For maintainability reasons, though, I don't want to hardcode the slide number. In order to solve the problem, I've tried to surround \N+1 with braces: `\onslide<{\N+1}>` to no avail; the following code also doesn't work:               \documentclass{beamer}          \usepackage{tikz}          \begin{document}     \begin{frame}     \begin{tikzpicture}     \pgfmathsetmacro{\N}{3}     \foreach \n in {1,2,...,\N}{         \onslide<\n>{             \draw (0,0) node {node on slide \n};         }     }     \pgfmathsetmacro{\n}{\N+1}     \onslide<\n>{         \draw (0,0) node {node on slide {\N+1}};     }     \end{tikzpicture}     \end{frame}     \end{document}      Any ideas?


title: Two backgrounds in a graph

text: How can I set two different backgrounds in a graph using `pgfplots`? In my case, I need a colored background for x<5 and a different background for x>5.


title: how to replace [*] with \command{*} in TeXworks?

text: I have the following lines in my document :               [Ctrl + r] : ..............     [Ctrl + u] : ..............     ...     [Ctrl + m] : ..............      What I want (using **TeXworks** replacement wizard) is to replace all the string matching the pattern **[*]** by **\mycommand{$1}** so the lines becomes :               \mycommand{Ctrl + r} : ..............     \mycommand{Ctrl + u} : ..............     ...     \mycommand{Ctrl + m} : ..............      _How should I proceed ?_