title: Lyx: Error message due to JabRef entry

text: I am using JabRef with Lyx with the jurabib-style. Everything worked fine, but lately I get error messages when inserting new literature citations. I am not sure what the problem is. The error message is:                \usepackage[format=plain, font = scriptsize]{caption}      \usepackage{rotating} \usepackage{url} \usepackage{eso-pic}      \usepackage{wallpaper} \usepackage{fancyhdr} \usepackage{pdfpages}      \usepackage{nomencl} \usepackage{graphicx}      \usepackage[nottoc]{tocbibind} \usepackage{appendix}      \usepackage{hyperref} \usepackage{float}           \jurabibsetup{ authorformat={smallcaps, abbrv}, oxford={true},      titleformat={italics} }                \setcounter{chapter}{0}           \AtBeginDocument{ \renewcommand{\bibname} {References}      \renewcommand{\nomname} {List of Abbreviations} \let\ref\autoref }           % wenn pdflatex benutzt wird: \usepackage{ifpdf} \ifpdf           % Fonts fuer huebschere PDF-Ansichten      \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}           \fi % Ende von: wenn pdflatex benutzt wird      And the JabRef entry looks like this (but I've had the problem with other entries and solved it by copying everything in an older version of my document, don't know why that worked): type: Master thesis title: Habitat Observation of the White-winged Guan - Internship Report author: Elena Wenz School: Hochschule fuer Nachhaltige Entwicklung Eberswalde Year: 2013 Sorry if it's a stupid question, I'm quite new to all this and didn't find a solution.


title: Sweave.sty causing error in verbatim environment?

text: folks-- The following throws an error, shown below               \documentclass{book}       \usepackage{Sweave}            \begin{document}            \begin{verbatim}       data ds;          infile 'dir_location\filename.csv" delimiter=",";          input varname1 ... varnamek;       run;       \end{verbatim}            \end{document}        **Error:**               ! Undefined control sequence.       infile '                       dir_location\filename.csv' delimiter=",";       l.362 \end{verbatim}        Occurs with any ' or ` character in verbatim environments. Any idea what could be causing this? Or a workaround? Thanks!


title: Problem with \setmathfont and siunitx

text: I have some problem with the following code.               \documentclass{minimal}     \usepackage{fontspec,luatextra,unicode-math}     \usepackage{icomma}     \usepackage[noload=abbr]{siunitx}     \sisetup{decimalsymbol=comma, detect-all}     \let\nbu\SI          \setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}          \begin{document}     \nbu{7.8}{m} or $7,8 = \nbu{7.8}{m} = \mathscr{A}$ in math mode.\par     \end{document}      ![enter image description here](http://i.stack.imgur.com/MCwEC.png) I don't want `\itshape` for the `m`. With the following code, the result is good, but I don't want to put the `\setmathfont{}` inside the document environment (but in sty file). How is it possible ?               \documentclass{minimal}     \usepackage{fontspec,luatextra,unicode-math}     \usepackage{icomma}     \usepackage[noload=abbr]{siunitx}     \sisetup{decimalsymbol=comma, detect-all}     \let\nbu\SI          \begin{document}     \setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}     \nbu{7.8}{m} or $7,8 = \nbu{7.8}{m} = \mathscr{A}$ in math mode.\par     \end{document}      ![enter image description here](http://i.stack.imgur.com/0oHYI.png) Thanks to all.


title: problem with a header (not like the others)

text: i'm a new member in the community and a general user of latex which i find really awesome, even if sometimes he drives me crazy, i have a little problem with a file i want to re-write, i know how to use the fancyhdr package etc but i found nothing with this one, i want to do a header like this: ![enter image description here](http://i.stack.imgur.com/4K3oT.png) i searched a lot on google without any results, thanks for your help -EDIT:sorry i forgot about my code:               \documentclass[12pt]{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{ulem}     \usepackage[francais]{babel}     \usepackage{url} % Pour écrire des adresses cliquables.     \usepackage{mathptmx}     \usepackage{newcent} % Pour changer le pack de police.     \usepackage[top=3cm, bottom=3cm, left=4cm, right=3cm]{geometry} % Les marges.     \usepackage{amsmath,amssymb}     \usepackage{fancyhdr}     \pagestyle{fancy}      \renewcommand\headrulewidth{0.6pt}     \fancyhead[R]{1}                         \begin{document}               fffff          \end{document}


title: JPEG images changed to black and white

text: All my jpg images in LaTeX are coming out in black and white. Similar question here, but it doesn't seem to answer my question. I am using Texmaker and latex + dvips + sp2pdf + ViewPDF Here is an example of my code:                \documentclass[12pt,oneside,openany,a4paper,%..... Layout                afrikaans, english,%.............. Global language selection                ]{memoir}      \usepackage{babel}%.............................. Language setup     \usepackage{graphicx}%........................... Graphicx loaded in usthesis               \begin{document}     \begin{figure}[!htb]     \centering     \includegraphics[width=0.8\textwidth,natwidth=831,natheight=812]{FourHeliostatsTry3.jpg}     \caption{Intersection and transformation of four heliostats}     \label{Ffourheliostats}     \end{figure}     \end{document}


title: Outline text using TrueType fonts

text: I'd like to write outlined text. Here is a minimal example, what I'd like to achieve. ![Outline text](http://i.stack.imgur.com/QZVDS.png)               \documentclass[a4paper]{minimal}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{xcolor}     \usepackage{pdfrender}     \usepackage{anyfontsize}          \usepackage[active, tightpage]{preview}     \setlength{\PreviewBorder}{10pt}          \newcommand{\outline}[1]{%         \textpdfrender{%             TextRenderingMode=Stroke,%             FillColor=gray,%             LineWidth=0.1pt,%         }{#1}%     }          \begin{document}     \begin{preview}     \fontsize{500}{500}\selectfont%     \outline{a}     \end{preview}     \end{document}      The only problem is, that I need to use TrueType fonts. So that means that I have to use `fontspec` and `xelatex`, but the `pdfrender` package – which I used in this example – does not support `xelatex`. Can anyone help me, how to make outlined text using TrueType fonts? (Something like in the example.)


title: Subcaption with Beamer

text: I am trying to use `subcaption` with `beamer`, but I get a series of error messages concerning `subcaption.sty` when I attempt to do so. This doesn't happen in the `article` document class. Here is a MWE               \documentclass{beamer}          \usepackage{caption}     \usepackage{subcaption}          \begin{document}     \begin{frame}     \begin{figure}       \begin{subfigure}[b]{.45\linewidth}         \centering         \caption{First subfigure}         \label{fig:a}         \textcolor{blue}{\rule{3cm}{3cm}}       \end{subfigure}\hfill       \begin{subfigure}[b]{.45\linewidth}         \centering         \caption{Second subfigure}         \label{fig:b}         \textcolor{blue}{\rule{3cm}{3cm}}       \end{subfigure}\    \caption{A figure}\label{fig:1}     \end{figure}     \end{frame}     \end{document}                    Package caption Warning: \caption will not be redefined since it's already     (caption)                redefined by a document class or package which is     (caption)                unknown to the caption package.     See the caption package documentation for explanation.               ! Package caption Error: The `subcaption' package does not work correctly     (caption)                in compatibility mode.          See the caption package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7 \begin{document}          ?      ! Emergency stop.      ...                                                        l.7 \begin{document}      Any tips?


title: Footnote label in pgfplot

text: I can't find an answer to this problem. My problem is similar to this Footnote on graph title but I would like to have a footnote netxt to one of my x axis labels. Like this               symbolic x coords={America,Asia\footnotemark}      But this crashes my program. Is it possible to have this footnote to appear just below the pgfplot because when I try to do like in 1 I get my footnote on the wrong page (not same page as my figure)?


title: Change font size enumeration

text: I have the following LaTeX code to format page numbers:               \pagestyle{fancy}     \fancyhf{}     \fancyhead[R]{\thepage}          \fancyheadoffset{0mm}     \fancyfootoffset{0mm}     \setlength{\headheight}{17pt}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     \fancypagestyle{plain}{          \fancyhf{}         \rhead{\thepage}}     \setcounter{page}{5}       They work well with using the default font size. I want to change the font size (using `\Large`) with the following code:               \pagestyle{fancy}     \fancyhf{}     \fancyhead[R]{\Large\thepage}            \fancyheadoffset{0mm}     \fancyfootoffset{0mm}     \setlength{\headheight}{17pt}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     \fancypagestyle{plain}{          \Large         \fancyhf{}         \rhead{\thepage}}     \setcounter{page}{5}       The changes in size are only visible on pages following the starting page of the chapter.


title: Indents of section*{} name in TOC

text: I have some sections (e.g. References) that don't have a section number. However, I'd like to include them in the TOC with \addcontentsline{toc}. But how can this manually added section be aligned to all other sections in the TOC. So probably I need the indentatoin space that is reserved for the section numbers and at it to \addcontentsline{toc}{section}{\hspace{definedspace}Test Section One Three}.               \documentclass{scrreprt}          \begin{document}          \tableofcontents          \chapter{Test Chapter One}     \section{Test Section One One}     \section{Test Section One Two}          \addcontentsline{toc}{section}{Test Section One Three}     \section*{Test Section One Three}          \end{document}


title: Chaotic billiard with TikZ

text: I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards. Any idea? ![enter image description here](http://i.stack.imgur.com/gDVb2.gif)


title: Force latexdiff not to parse tikzpicture environments

text: Is it possible to force `latexdiff` not to parse TikZ figures? When I run `latexdiff` on a document where there is something like               \begin{figure}       \begin{tikzpicture}     ...       \end{tikzpicture}     \end{figure}  % corrected typo      It parses also the TikZ figure code and the diff is not a correct TikZ figure anymore.


title: Highlighting particular bibliography entries

text: I'm trying to create a bibliography in which certain items are highlighted as being more important. Ideally this would put an asterisk at the front of that particular item while leaving the sorting unchanged. I'm using `biblatex- chicago` with Biber as the backend. Say I have these two entries in my `.bib` file:               @article{cite1,       author = {Knuth, Donald},       title = {{Title One}},       journal = {Some Journal},       year = {2005},       volume = {1},       pages = {1--42},     }          @book{cite2,       author = {Knuth, Donald},       title = {{A Way More Important Title}},       publisher = {Oxford},       year = {2009},       address = {New York}     }      What I'd like to do is highlight the second one so that the sort order and repeated name dash stays unchanged. Ideally it would produce something like this: * * * Knuth, Donald. 2005. "Title One." _Some Journal_ 1: 1-42. *———. 2009. _A Way More Important Title_. Oxford: New York. * * * Is there some way to achieve this? Some additional key I could put in the important entries, perhaps? I've tried faking the name (like `name = {*Knuth, Donald}, sortname = {Knuth, Donald}`), but that breaks the 3-em dash replacement.


title: Sized delimiters (\left( \right)) are too tall for vertically aligned array (\begin{array}[t])

text: Please compile the below and the problem will be clear.               \documentclass{article}     \begin{document}     \noindent Compare     \[     \begin{array}{l}       \land ~a\\       \land \left(         \begin{array}[t]{l}           \lor ~a\\           \lor \left(             \begin{array}[t]{l}               \land ~a\\               \land ~b\\             \end{array}           \right)         \end{array}       \right)\\     \end{array}     \]     with     \[     \begin{array}{l}       \land ~a\\       \land         \begin{array}[t]{l}           \lor ~a\\           \lor             \begin{array}[t]{l}               \land ~a\\               \land ~b\\             \end{array}         \end{array}     \end{array}     .\]     I also don't want     \[     \begin{array}{l}       \land ~a\\       \land \left(         \begin{array}{l}           \lor ~a\\           \lor \left(             \begin{array}{l}               \land ~a\\               \land ~b\\             \end{array}           \right)         \end{array}       \right)\\     \end{array}     ,\]     although it's better than the first version.     \end{document}      I want the vertical layout in the second version, but with parentheses around the nested subformulas. ![enter image description here](http://i.stack.imgur.com/naszB.png)


title: Insert an image in LaTeX and create a pdf using: pdflatex file.tex

text: An image is (attempted to be) inserted using the following script in file.tex:               \begin{figure}     \includegraphics{/rdata/report/images/buckets.data.csv.png}     \end{figure}      Running the following code,               pdflatex file.tex      I receive this error               ! LaTeX Error: Unknown graphics extension: data.csv.png.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.     ...                                                        l.39 .../rdata/report/images/buckets.data.csv.png}      Is there another way to create a pdf from file.tex that would allow for the image file to remain as buckets.data.csv.png? Thank you for any help.


title: problem with bib file

text: I write my report in TeXnicCenter and uses a bib file to create my references. I have problem with creating the list of references. The error that occurs is:               Warning -- It didnt find a database entry      Adding the bib file in the tex file:               \addcontentsline{toc}{section}{References}     \bibliographystyle{plain}          % uses file "plain.bst"     \bibliography{References4Marsklar} % expects file      Below is how I write in the bib file:               @TECHREPORT{Anomaly detection1,       author = {J. Ekman and A. Holst.},       title = {Incremental stream clustering and anomaly detection},       institution = {SICS Technical Report T2008:01},       year = {2008},       number = {},       owner = {Swedish Institute of Computer Science, Kista, Sweden}     }               @PHDTHESIS{Bayesian neural network model2,       author = {Anders Holst},       title = {The Use of a {Bayesian} Neural Network Model for Classification Tasks},       school = {Dept.\ of Numerical Analysis and Computing Science.          Royal Institute of Technology. Stockholm, Sweden.},       year = {1997},       pages = {16--17}     }               @ARTICLE{Metod1,       author = {R. Steinert and D. Gillblad},       title = {Long-Term Adaptation and Distributed Detection of Local Network Changes},       journal = {Global Telecommunications Conference (GLOBECOM 2010). Ind.\          Applic.~\& Methods Lab.\ (IAM), Swedish Inst.\ of Comput.\ Sci.\ (SICS),          Kista, Sweden},       year = {2010},       pages = {1--5},     }      Can you help me? What is wrong?


title: Converting LaTeX commands in BibTeX title field to UTF-8?

text: I've been Googling and downloading different software for the last two days and I'm not getting very far. I was referred to this site and it looks like a great resource. Hopefully I can get the answer I need. I'm working on a publication collection for a major research university. The project has oriented around the collection of CVs and extracting each citation to a parser. Our objective is to have a database with all this content by the end of August. We've run into a problem when processing publications of some of our faculty members who have the majority of their publications on external databases. We've been successful with extracting the majority of these publications (using BibTeX --> JabRef and exporting to a particular citation format), however we've hit a brick wall with getting those LaTeX characters to display properly. For example: We find this publication: http://prd.aps.org/abstract/PRD/v83/i9/e091101 We grab the BibTeX, which would look like:               @Article{PhysRevD.83.091101,        title = {Searches for the baryon- and lepton-number violating decays $B\rightarrow{}\Lambda{}c+l-$, $B-\rightarrow{}\Lambda{}l-$, and $B-\rightarrow{}\Lambda{}\ifmmode\bar\else\textasciimacron\fi{}l-$},        collaboration = {<emph type="italic">BABAR</emph> Collaboration},        author = {del Amo Sanchez, P. and others},        journal = {Phys. Rev. D},        volume = {83},        number = {9},        pages = {091101},        numpages = {8},        year = {2011},        month = {May},        doi = {10.1103/PhysRevD.83.091101},        publisher = {American Physical Society}     }      The BibTeX is imported to our database on JabRef and is exported through a customized filter. The problem is that the title still contains the LaTeX character encodings and thus will not suffice our accuracy standards. I've read documentation on BibTeX that states no conversion process occurs in BibTeX, so for citations that contain LaTeX, I'm curious of a method that we can use to ensure accuracy for each citation. Additionally, we would need each character written in LaTeX to be converted to usable UTF-8 (since our database won't recognize anything that is not UTF-8). Will something like Biber work for this? Will we need to abandon JabRef for citations that contain LaTeX encodings? I've tried just adding the BibTeX as references in a `.tex` document and then uploading the final PDF, but it hasn't been working well. Any suggestions?


title: How to keep the paragraph and subsequent image on one page?

text: I have a text, where pictures are interleaved with descriptions for them. And since pictures are quite big, sometimes picture moves to next page, but the description for it stays on the previous page, which is ugly. The code:               Some description for the following image:     \begin{center}       \includegraphics[width=\textwidth]{../path/to/image.png}     \end{center}      I tried using `\nopagebreak`, but LaTeX just ignored me. And using `samepage` also did not help - it started to pull the text from under the previous image down the page. What can I do to keep the description and the image on the same page?


title: French typography: space before percent sign

text: I have come across another specific typography rule in French: one must put a non-breaking space before the percentage sign (see this handy cheat-sheet). This is also true for colons, semi-colons, exclamation and interrogation signs. The babel package documentation states that this is taken into account and that it does this spacing automatically so that the forgetful users do not need to write this space before these symbols. It seems, however, that the percentage sign is not considered among these. **Question:** why is the percentage sign not _actively spaced_ in french babel? This is easy to resolve with a redefinition of `\%` like:               \let\oldpercent=\%     \renewcommand{\%}{\ifmmode\oldpercent\else\thinspace\oldpercent\fi}      it just seems weird that babel did not do it automatically. Moreover, the spanish option does the separation. Maybe this is a bug of the frenchb/french language option or it is me who is misinformed? * * * Related questions: Paragraph spacing in other languages


title: LaTeX3: \ProcessKeysOptions hangs while processing global (class) option

text: The code of the trivial package `mypkg.sty` below defines key `draft`. If `draft` is given as a class option, LaTeX hangs at the command `\ProcessKeysOptions`. This seems to be a bug. Or is there something wrong with my code? Package file `mypkg.sty`:               \RequirePackage{expl3}     \RequirePackage{l3keys2e}     \ProvidesExplPackage{mypkg}{2011/05/06}{0.1}{triv. example pkg.}          \newcommand\isdraft{no}     \keys_define:nn{mypkg}{       draft .choice:,       draft / true .code:n = {\renewcommand\isdraft{yes}},       draft / false .code:n = {\renewcommand\isdraft{no}},       draft .default:n = {true}     }     \ProcessKeysOptions{mypkg}      Test file:               \documentclass[draft]{article} %LaTeX hangs at \ProcessKeysOptions{...}     \usepackage{mypkg}          \begin{document}     Draft mode: \isdraft.     \end{document}


title: Tikz for generating pdfs and using in latex, compiling problems

text: I tried using the advices online for implementing tikz into the texmaker and Miktex combiantion. The Miktex is updated and the texmaker runs normally. The tikz version from a flow example runs properly but creates a lot of white space. I have two problems, first that my simple code does not generate any pdf, the compilation goes on and on and ddoes not end unless i end it manually I have already changed the texmaker settings for latex and pdf latex to               latex -interaction=nonstopmode --shell-escape %.tex      pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex      I would like to make the tikz pictures seperately into pdfs and save them and include them later into the main tex file. I have some experience with latex but not so much with tikz, so wondering if someone would help me out understand more about my problem. below is the code               \documentclass{article}     \usepackage[utf8]{inputenc}          %\usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric, arrows}          \usetikzlibrary{external}     \tikzexternalize[prefix=tikz/]     % \pgfplotsset{compat=1.8}      % \pgfrealjobname{trial}          \tikzsetnextfilename{raju1}                   % code for defining the flow diagram controls     \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]     \tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]     \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]     \tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]     \tikzstyle{arrow} = [thick,->,>=stealth]                         \begin{document}     \begin{tikzpicture}%[node distance =2cm]          % Process informatioan and flow     %\node (start) [startstop] {Atmosphere}     \node (in1) [io] {Atmosphere}     \node (pro1) [process, below of =in1] {Sensor/Transducer}     \node (pro2) [process, below of =pro1] {Signal Conditioning circuits}     \node (pro3) [process, below of =pro2] {Low Pass Filter}     \node (dec1) [decision, below of =pro3,yshift=0.5cm] {Sample and Hold - Clock timing}     \node (pro4) [process, below of =dec1] {Analog to Digital converter}     \node (pro5) [process, below of =pro4] {Processor}     \node (out1) [io, below of= pro5] {Observation}               % Drawing of arrows     \draw [arrow] (inl) -- (pro1)     \draw [arrow] (pro1) -- (pro2)     \draw [arrow] (pro2) -- (pro3)     \draw [arrow] (pro3) -- (dec1)     \draw [arrow] (dec1) -- (pro4)     \draw [arrow] (pro4) -- (pro5)     \draw [arrow] (pro5) -- (out1)                    \end{tikzpicture}          \end{document}      Thanks Ashim


title: Moving the page number in a table of contents to the left of the titles with tocloft

text: I would like to move the page number from the right-hand side of a table of contents to the left, using `tocloft`. The page number should still be right- aligned. The question has already been answered here for `titletoc`, but I would like to know if there is a way to achieve the same using `tocloft`. The question referred to suggests not, but I would like to check anyway. I start with a MWE:               \documentclass[a4paper]{article}          \usepackage{lipsum}     \RequirePackage[titles]{tocloft}          \makeatletter          \renewcommand{\cftsecpresnum}{\begin{lrbox}{\@tempboxa}}     \renewcommand{\cftsecaftersnum}{\end{lrbox}}     \setlength{\cftsecnumwidth}{0pt}     \makeatother          \begin{document}     \tableofcontents     \section{Section 1 title}     \lipsum[1-2]     \section{Section 2 title}     \lipsum[3-4]     \end{document}      That produces this: ![page numbers on right](http://i.stack.imgur.com/YxKma.png) I am trying to move the page numbers to the other side: ![page numbers on left](http://i.stack.imgur.com/3G8iv.png) And in case you're wondering, this is what I'm actually trying to achieve (without the blue lines). I've done the rest of the formatting successfully using `tocloft`, which is why I would prefer to continue using that package rather than switching to `titletoc`. ![picture of final aim](http://i.stack.imgur.com/qEtEP.png)


title: Change appearance of first acronym use if it falls into a composed word

text: I have a acronym for `GPU`, and start my text with `GPU-computing`. For now this is the first appearance, and this results in `graphic processing unit (GPU)-computing`, however I would rather like it to read `GPU-computing`. Since my next use of `GPU` does not appear before the next page I would like to explain `GPU` in a `footnote` if it is its first appearance and followed by a hyphen. I am _not_ looking for an automated solution (I appreciate one, but ease of implementation is key to me). I would like to use the standard acronym first use definition in general, and just switch to footnotes for the `\gls{gpu}-computing` part. I.E. `\acronymsAsFootnotes{\gls{gpu}-computing}`.               \documentclass{article}         \usepackage[acronym]{glossaries}          \makeglossaries      \newacronym{gpu}{GPU}{graphics processing unit}         \begin{document}       First use \gls{gpu}-computing\\       subsequent \gls{gpu}-computing and \gls{gpu}            GPU\footnote{graphics processing unit}-computing     \end{document}


title: How to put legend below the chart?

text: I have the following code that produces a line chart:               \begin{figure}[p]         \centering     \begin{tikzpicture}         \begin{axis}[         use units,         cycle list name=exotic, %This defines the color. It produces nicer colors             width=15cm, height=8cm,     % size of the image             grid = major,             grid style={dashed, gray!30},             %xmode=log,log basis x=10,             %ymode=log,log basis y=10,             xmin=0,     % start the diagram at this x-coordinate             ymin=0,     % start the diagram at this y-coordinate             %/pgfplots/xtick={0,5,...,60}, % make steps of length 5             %extra x ticks={23},             %extra y ticks={0.507297},             axis background/.style={fill=white},             ylabel=Time,             xlabel=Number of Datapoints (n),             y unit=s,y unit prefix=m,             tick align=outside]                % import the correct data from a CSV file           \addplot table [col sep=comma,trim cells=true,y=Best Case (Ascending)] {datasets/time_mergesort.txt};               \addplot table [col sep=comma,trim cells=true,y=Average Case (Random)] {datasets/time_mergesort.txt};                         \addplot table [col sep=comma,trim cells=true,y=Worst Case (Descending)] {datasets/time_mergesort.txt};                          \legend{Ascending,Random,Descending}         \end{axis}      \end{tikzpicture}         \caption{Mergesort Run Time for Sorting Random Data}         \label{fig:merge_sort_from_csv}     \end{figure}      And at the moment the legend appears on the chart on the upper right corner. I need to move that below the chart, or even to leave that on the chart but to move that on the upper left corner. I have tried the solution mentioned at this question, but it did not work for me. How can I move the axis in a different position?


title: subcaption: the subcaption documentation doesn't say anything about a short caption

text: When using `\subcaptionbox`, can the optional short caption be used? By this I mean,               \subcaptionbox[short]{long \label{}}{\includegraphics}      There is nothing in the documentation that mention the use of short caption with `\subcaptionbox`.


title: tikz-cd package on MacTex

text: I just updated by TeXShop using TeX Live utility yesterday, but I still get this error. All I am doing is the standard routine               \[\begin{tikzcd}       0 \arrow[hookrightarrow]{r}          & A\arrow[hookrightarrow]{r}{\varphi}\arrow[hookrightarrow]{d}{\eta_1}          & B\arrow{r}{\psi}\arrow{d}{\eta_2}          & C\arrow{r}\arrow{d}{\eta_3}          & 0 \\       0 \arrow[hookrightarrow]{r}          & A'\arrow[hookrightarrow]{r}[swap]{\varphi'}          & B'\arrow{r}[swap]{\psi'}          & C'\arrow{r}         & 0        \end{tikzcd}\]      but get this error and just cannot render. > ![enter image description here](http://i.stack.imgur.com/2BL5w.png) I also specifically updated `tikz-cd` package so I don't know why it still doesn't work.


title: Package to load in Lyx to use \quad?

text: I'm using Lyx software to typeset an algorithm. I'm trying to use the `\quad` command to indent in a loop I'm writing, yet the `\quad` command is not being recognized when I compile the page. I'm assuming I need to load a particular package to use the `\quad` command. Does anyone know what package I should load? Or if it's not a package loading problem, what do I need to do so that I can use `\quad`.


title: How to create attendance sheets?

text: Is there a package for creating sheets you fill out by handwriting? Like for example attendance sheets, a list of key borrowers, a sign-off sheet for dangerous stuff etc. Basically some sort of table with a caption, multiple columns and helper-lines to separate different entries. Rows large enough for Joe-handwriter. Perhaps a counter in the first column and some paragraph of text above/below.


title: Why will PDFs from TeXworks not print? Will this issue ever be fixed?

text: I am fairly new to LaTeX, TeX etc.(I have the latest MacTeX package) and I just recently tried to print out one of my documents made on TeXworks. It would not send any data to my printer. I copy and pasted all my code into TeXShop and it printed. Why is this?


title: Error File \endcsname when adding table to tex file

text: As my last question might show i have problems compiling my thesis with latex. I have thus started to rebuild the tex file part to part and have realised that the errormessages with missing \endcsname start when I'm adding a table to the tex file. My code is attached. any ideas how to resolve this? Any help is deeply appreciated and welcome Thanks               \documentclass[11pt,a4paper,english,oneside]{book}          \usepackage{etex}           \usepackage[left=1in, right=1in]{geometry}           \usepackage[Lenny]{fncychap}           \usepackage[utf8]{inputenc}           \usepackage[british]{babel}          \usepackage{dsfont}           \usepackage{fancyhdr}           \usepackage{booktabs}           \usepackage[hang,bottom,stable,multiple]{footmisc}           \usepackage{appendix}           \usepackage{amsmath}          \usepackage[pdftex]{graphicx}          \usepackage{amsfonts}          \usepackage{amsmath}          \usepackage{multirow}          \usepackage{amssymb}          \usepackage{mathtools}          \usepackage[margin=10pt, font=small, labelfont=bf, labelsep=endash]{caption}          \usepackage{chngcntr}           \usepackage{etoolbox}          \usepackage{amsthm}           \usepackage{thmtools}           \usepackage{setspace}           \usepackage{lipsum}           \usepackage{datetime}           \usepackage{graphicx,listings,xcolor,textcomp}           \usepackage{hyperref}           \usepackage{xparse}           \usepackage{cleveref}           \usepackage{arydshln}           \usepackage{array,hhline}           \usepackage{amssymb,amsmath}          \usepackage{rotating}           \usepackage{tabularx}           \usepackage{graphicx}          \graphicspath{{Images/}}          \usepackage{natbib}          \bibliographystyle{abbrvnat}          \setcitestyle{authoryear,open={((},close={))}}          \begin{table}[htbp]       \centering       \caption{blablabla}         \begin{tabular}{rrr}         \toprule         \textbf{ } & \textbf{blablabla} & \textbf{blab} \\         \midrule         \textbf{blubb} & d \\               & s & s \\               & s,s & kjasdsad \\               & Sasdas & /sS, f  \\         \textbf{j} & j& j\\               & jj& j\\               & j& j\\         \textbf{j} & j& j\\               & j& j\\         \bottomrule         \end{tabular}%       \label{Source:\citet{hg}}%     \end{table}%


title: Why can my infix-to-postfix operator not produce a correct result?

text: Why does               \pstGeonode(!{15/sqrt(25)} I2P 45 PtoC){B}      **NOT** produce the same output as               \pstGeonode(!15 25 sqrt div 45 PtoC){A}      where               \pstVerb{/I2P {exec AlgParser cvx exec} def}%      ? ## Minimal Working Example               \documentclass[preview,border=12pt,varwidth]{standalone}     \usepackage{pst-eucl}               \begin{document}          \pstVerb{/I2P {exec AlgParser cvx exec} def}%          \begin{pspicture}[showgrid](4,4)     \pstGeonode(!15 25 sqrt div 45 PtoC){A}     \psarc[linecolor=blue](0,0){3}{0}{90}     \end{pspicture}     %     \hspace{1cm}     %     \begin{pspicture}[showgrid](4,4)     \pstGeonode(!{15/sqrt(25)} I2P 45 PtoC){B}     \psarc[linecolor=blue](0,0){3}{0}{90}     \end{pspicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/82DSO.png)


title: TikZ: Mathematical calculations in node

text: I'm using               \documentclass{standalone}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}             %axis         \draw (0,0) -- coordinate (x axis mid) (10,0);             \draw (0,0) -- coordinate (y axis mid) (0,10);             \foreach \y in {0,1,...,10}                 \draw (1pt,\y) -- (-3pt,\y)                      node[anchor=east] {\y};                \end{tikzpicture}          \end{document}      to get ticks along y-axis. I want to get ticks label after multiplying be 10 something like this               \foreach \y in {0,1,...,10}                 \draw (1pt,\y) -- (-3pt,\y)                      node[anchor=east] {\y*10};      I wonder how I can get this. Any help will be highly appreciated. Thanks


title: CV in ConTeXt, correspondence - moderncv

text: How should a minimal example of a CV look when written using the `moderncv` interface from the `correspondence` module? I'm still a bit confused about modules and interfaces so some hints on how to check my environment including everything I need for this would be nice too (I'm using TeX Live 2010 on Gentoo Linux, no problems with rendering simple documents).


title: An easier way for capitalizing prenote in citations with biblatex?

text: In this post I got the advise to use `\autocap{s}ee` within a citation, e.g. `\autocite[\autocap{s}ee][5][ref]` to get context sensitive capitalizing of the letter ‘s’. So if I switch from inline citation to footnote citation the word ‘see’ would be written as ‘See’. But it is a bit cumbersome to write `\autocap` in all references. Is there a way to integrate this command into for example the `\usebibmacro{pre note}` or to create a new bibmacro like e.g. `prenotecap`? Then I would define:               \DeclareCiteCommand{\parencite}[\mkbibparens]         {\usebibmacro{prenotecap}}         {\usebibmacro{citeindex}%             \printtext[brackets]{\usebibmacro{cite} \usebibmacro{postnote}}}         {\multicitedelim}         {}      and I’m done. Would be nice if someone has a hint how to manage the `\newbibmacro`, because I don’t get the explanation in the biblatex user guide. **Edit:** So here is a MWE, which should make it clear what I want to achieve. The word 'see' should be printed as 'See' if I use `autocite=footnote` and 'see' if I use `autocite=inline`. But I don't want to use `\autocap` for each reference.               \documentclass{article}     \usepackage[style=alphabetic, autocite=footnote]{biblatex}          \DeclareCiteCommand{\footcite}[\mkbibfootnote]         {\usebibmacro{prenote}}         {\usebibmacro{citeindex}%             \printtext[brackets]{\usebibmacro{cite} \usebibmacro{postnote}}}         {\multicitedelim}         {}            \DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]%         {\footcite}{\multicitedelim}          \DeclareAutoCiteCommand{footnote}[l]{\footcite}{\footcites}          \begin{filecontents*}{bibliography.bib}     @BOOK{Cornelisse1979,       author = {Cornelisse, J. W. and Schöyer, H. Ferry R. and Wakker, Karel F.},       title = {Rocket Propulsion and Spaceflight Dynamics},       year = {1979},       publisher = {Pitman},     }     \end{filecontents*}          \bibliography{bibliography.bib}          \begin{document}     \null     \vfill          How the citation look like: \autocite[see][35]{Cornelisse1979}     How it should look like: \autocite[\autocap{s}ee][35]{Cornelisse1979}     \end{document}


title: Is there a ready solution to typeset a diff file?

text: In a text about Git I want to typeset diffs similar to this visualization: Commit details on GitHub. ![enter image description here](http://i.stack.imgur.com/ZNaIg.png) Is there any ready-made solution to that, especially the coloring of the diff lines? (In other commits there may be even an additional highlighting of the actual changed part of a line with a different background color. Of course I could 'roll my own' but don't want to reinvent the wheel. (Searching for `LaTeX` and `diff` only seems to mathematical symbols or how to diff LaTeX documents ...)


title: Increase algorithm distance to margin

text: I've been using `\vspace` to increase or decrease the vertical distance of figures to the margin, but I found out it doesn't work inside and `algorithm` evironment. Is there an alternative or workaround to this?


title: How to create a ball shading and to customize 3D lighting manually?

text: TikZ `shading=ball` will create a perfect 3D ball perspective, but it has no option to change the lighting angle, the contract, radius of light, etc (or I am not aware of). I tried to create a 3D ball by `radial` shading. However, I still do not know how to change the place of `inner color`.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes}     \begin{document}          \begin{tikzpicture}     \node[circle,shading=ball,minimum width=3cm] (ball) at (0,0) {};     \node[circle,outer color=blue!60!black,inner color=white,minimum width=3cm] (radial) at (4,0) {};     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/15EbK.png) Which is the standard method to customize the 3D lighting?


title: PGFPlots: strange behaviour

text: Look at the differences between the following two plots. I would like to have in plot "1" the same distances between the colorbar, axis labels and the ticks labels that I get in plot "2". How can this be achieved? ![enter image description here](http://i.stack.imgur.com/7PlIs.jpg)               \documentclass[a4paper,12pt]{article}     \usepackage{pgfplots,pgfplotstable}        % Grafici     \pgfplotsset{/pgf/number format/use comma,compat=newest,%                 width=12cm,%                 height=9cm%                 }          \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}     \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother     \pgfplotsset{axis line on top/.style={      axis on top=false,      after end axis/.append code={         \pgfplotsset{axis line style=opaque,           ticklabel style=opaque,           tick style=opaque,           grid=none}         \pgfplotsdrawaxis}       }     }     \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,     minor tick num=4,     axis line on top,     xticklabel style={text height=1.5ex},     xtick={0,0.05,...,0.3},     minor xtick={0,0.01,...,0.2},     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}     },     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)},     legend cell align=left]     \end{axis}     \end{tikzpicture}     \end{figure}               \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[     yticklabel shift=2pt,     xticklabel shift=2pt,     xmin=-6, xmax=6,     ymin=0, ymax=6,     point meta min={-6},     point meta max={6},     xlabel=\large $m$,     ylabel=\large $\Delta l$,     colorbar horizontal,     colorbar style={         /pgf/number format/fixed,         xticklabel shift=2pt,         xtick={-6,-4,...,6},         xticklabel style={text height=1.5ex}     },     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}     ]     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}


title: Stop memoir from making mathmode section names uppercase in header

text: I'm typesetting my thesis with `memoir` and in general I'm happy with the result. However, some of my section headers have math mode text like `\section{The $\phi_{ij}$ matrix}` which `memoir` comically turns into `$\phi_{IJ}$` in the header. I'm new to memoir so I don't really know my way around. Is there a way to tell it to leave mathmode in lower case when it prints the header? I'm using XeLaTeX with TeX live downloaded yesterday via tlmgr. Full example, including possibly interfering packages:               \documentclass[12pt]{memoir}      \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amssymb}     \usepackage{multirow}     \usepackage[margin=1.4in]{geometry}     \usepackage{graphicx}     \usepackage{changepage}     \usepackage{url}     \usepackage{hyperref}     \usepackage{subfig}     \usepackage{standalone}     \usepackage[section]{placeins}     \usepackage{longtable}     \usepackage{rotating}     \usepackage{pdflscape}     \usepackage{supertabular}     \usepackage{nth}     \usepackage[normalem]{ulem}     \linespread{1.5}     \begin{document}          \chapter{This is a chapter}          \section{The $\phi_{ij}$ Matrix}          \chapter{Another chapter}          \section{Density - $\omega^j_c$}          \end{document}      This is how it looks: ![Example of rendering](http://i.stack.imgur.com/MUnJ7.png)


title: How to create a symbol for LMB (left mouse clicking) or RMB (right mouse clicking) in LaTeX?

text: I'm searching now since 2 weeks for a LMB (left mouse click) or RMB (right mouse click) symbol in LaTeX. I saw it once in a manual, but I couldn't find it any more... Now I want to write a manual and for easier understanding how to use the software it would be great to integrate such easy symbols! I already designed the symbol in illustrator. but now I don't know how to import it into LaTeX or how to design with "special" packages the symbols?!? Picture is missing cause I'm new and I am not allowed to upload pictures. It should look like an oval. In the oval on the top there is a reversed T. if it should be the "left mouse click" the left side is black. If it should be the "right mouse click" then the right side is black. Hope the description is sufficient. If not, post and I'll send you the image.


title: How to change the font for biblatex acronyms

text: I have a bibliography in `biblatex` and I want to use different fonts than _Computer Modern_ , namely _Lato_ & _Bitstream Charter_. Here is a minimal example:               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage[defaultsans, scale=0.9]{lato}     \usepackage[bitstream-charter]{mathdesign}     \usepackage{filecontents}          \begin{filecontents*}{references.bib}     @article{       shannon,       author = {Shannon, C. E.},       title = {A mathematical theory of communication},       journal = {SIGMOBILE Mob. Comput. Commun. Rev.},       issue_date = {January 2001},       volume = {5},       number = {1},       month = jan,       year = {2001},       issn = {1559-1662},       pages = {3--55},       numpages = {53},       url = {http://doi.acm.org/10.1145/584091.584093},       doi = {10.1145/584091.584093},       acmid = {584093},       publisher = {ACM},       address = {New York, NY, USA},     }     \end{filecontents*}          \usepackage[backend=biber,style=alphabetic,natbib=true]{biblatex}     \addbibresource{references.bib}          \begin{document}          \nocite{*}     \printbibliography          \end{document}      This results in the following output after running `biber` and `pdflatex`: ![example](http://i.stack.imgur.com/NRUQs.png) The red arrows indicate my problem: Because _Bitstream Charter_ has no actual small caps, LaTeX simply shrinks the characters for acronyms like `ISSN` and I don't like how this looks. So my question is: How can I change the font such that acronyms are simply displayed regularly?


title: TeX capacity exceeded while parsing a date string

text: I'm trying to parse a date (say, a due date) in a DD-MMM-YYYY format, e.g., 06-May-2012 and create macros \dueday, \duemonth, and \dueyear. I use `xstring`'s commands to extract the substrings. Then I use `xstring'`s `\IfStrEqCase` to generate the numeric `\duemonth`:               \documentclass{article}          \usepackage{xstring}          \begin{document}     \newcommand{\duedate}{06-May-2012}          \newcommand{\dueday}{\StrBefore{\duedate}{-}}     \newcommand{\duemonthname}{\StrBetween[1,2]{\duedate}{-}{-}}     \newcommand{\dueyear}{\StrBehind[2]{\duedate}{-}}          Reconstruction: \dueday-\duemonthname-\dueyear.          %\renewcommand{\duemonthname}{May}   % This appears to solve the problem.          \IfStrEqCase{\duemonthname}{%         {Jan}{\newcommand{\duemonth}{1}}%         {Feb}{\newcommand{\duemonth}{2}}%         {Mar}{\newcommand{\duemonth}{3}}%         {Apr}{\newcommand{\duemonth}{4}}%         {May}{\newcommand{\duemonth}{5}}%         {Jun}{\newcommand{\duemonth}{6}}%         {Jul}{\newcommand{\duemonth}{7}}%         {Aug}{\newcommand{\duemonth}{8}}%         {Sep}{\newcommand{\duemonth}{9}}%         {Oct}{\newcommand{\duemonth}{10}}%         {Nov}{\newcommand{\duemonth}{11}}%         {Dec}{\newcommand{\duemonth}{12}}%         }          \duemonth   % This should output 5.          \end{document}      which fails with an error message `TeX capacity exceeded`. The `\IfStrEqCase` doesn't seem to be the problem, because if I issue `\renewcommand{\duemonthname}{May}` right before it, everything is fine. This suggests that the error is due to splitting commands, but their outputs are what I expect them to be (at least their "visible" outputs are). What is causing the error then?


title: dot2tex concentrate edges, bug fix or workaround

text: It is a known bug that dot2tex produces weird output when combining `concentrate=true` and _tikz_ code output. It creates multiple squiggly edges instead of one nice curved edges. However, we get semi-nice output when generating PGF code but still isn't quite right. Has someone found a fix to this bug? Or possibly a workaround to get the final result I'm getting at? I want two incoming edges to flow together nicely and have one label on the arrow head side. ![Example of PGF output](http://i.stack.imgur.com/ds84X.png) ![Example of Tikz output](http://i.stack.imgur.com/yvQhA.png)               \documentclass[12pt]{article}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes}     \usepackage{dot2texi}          \begin{document}     \tikzstyle{var} = [draw,shape=rectangle,minimum size=2em,                             inner sep=2pt,fill=white!20]               \begin{figure}     \centering     \begin{dot2tex}[dot,pgf,options=-tmath]     digraph G {         [concentrate=true, rankdir=LR]         node [style="var"]         x [label="x"]         y [label="y"]         i_1 [texlbl="i1 = 0"]         i_2 [texlbl="i2 = 1"]         o_1 [texlbl="o2 = 0"]         o_2 [texlbl="o2 = 1"]         x -> i_1;         x -> i_2;         i_1 -> o_1 [texlbl="fib", label="fib", rankdir="LR"];         i_2 -> o_2 [texlbl="fib", label="fib", rankdir="LR"];         o_1 -> y [rankdir="LR"]         o_2 -> y [rankdir="LR"]         }     \end{dot2tex}     \caption{PGF output}     \end{figure}          \begin{figure}     \centering     \begin{dot2tex}[dot,tikz,options=-tmath]     digraph G {         [concentrate=true, rankdir=LR]         node [style="var"]         x [label="x"]         y [label="y"]         i_1 [texlbl="i1 = 0"]         i_2 [texlbl="i2 = 1"]         o_1 [texlbl="o2 = 0"]         o_2 [texlbl="o2 = 1"]         x -> i_1;         x -> i_2;         i_1 -> o_1 [texlbl="fib", label="fib", rankdir="LR"];         i_2 -> o_2 [texlbl="fib", label="fib", rankdir="LR"];         o_1 -> y [rankdir="LR"]         o_2 -> y [rankdir="LR"]         }     \end{dot2tex}     \caption{TIKZ output}     \end{figure}          \end{document}


title: tlmgr stopped working -- seem to be "too old" for the repositories

text: `tlmgr` used to work fine, but now I am getting the following error message for whatever I try to do: > tlmgr: The TeX Live versions supported by the repository (2013--2013) do not > include the version of the local installation (2012). Any idea on how to resolve that?


title: Dotted line with prescribed density with TikZ

text: Is there a way to get a dotted line with prescribed density, for instance 10 dots per centimeter, instead of the default? With Jesse's comment :               \documentclass[10pt,a4paper,french]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{fourier}     \usepackage{tikz}     \usetikzlibrary{calc,intersections,through,backgrounds}          \tikzstyle{cm dotted}=[dash pattern=on \pgflinewidth off .85mm ]          \begin{document}     \begin{tikzpicture}          \draw[cm dotted,line width=.15mm,step=.5] (0,0) grid (5,4) ;          \end{tikzpicture}     \end{document}      Still an unwanted shift of half a linewidth. The horizontal and vertical crossing points are not on at the right place. I understand why, but I don't know how fix it.


title: Smooth pgfplots

text: I'm trying to draw the function $f(x,y) = -\log(x)-\log(y)$ as a surface with `pgfplots`. In order to get smooth level curves, I use a patch plot with `patch type=biquadratic`.               \documentclass{standalone}          \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.7}      \usepgfplotslibrary{patchplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[xmin=0, xmax=1, ymin=0, ymax=1.4, zmin=0, zmax=6,                   axis y line=center, axis x line=center, axis z line=center,                  view/h=70, xtick=\empty, ytick=\empty, ztick=\empty,                   clip=false, axis on top=false]          \node at (rel axis cs:1,0,0) [above, anchor=north west] {$x_1$};     \node at (rel axis cs:0,1,0) [above, anchor=west] {$x_2$};     \node at (rel axis cs:0,0,1) [above, anchor=south] {$f(x_1,x_2)$};          \addplot3 [patch,patch type=biquadratic,shader=flat,draw=black, draw opacity=0.15,z buffer=sort]          coordinates {               (0.02722593,0.15708631,5.45454545) (0.15708631,0.02722593,5.45454545) (0.14800676,0.01674756,6.00000000) (0.01674756,0.14800676,6.00000000) (0.06539740,0.06539740,5.45454545) (0.15204995,0.02141365,5.72727273) (0.04978707,0.04978707,6.00000000) (0.02141365,0.15204995,5.72727273) (0.05706089,0.05706089,5.72727273)          };     \end{axis}     \end{tikzpicture}          \end{document}      I've left out zillions of generated data points for clarity and the most obvious one of the "offending" patches. The data consist of 9-tuples as described in section 5.6.1 of the `pgfplots` manual. The code I wrote produces the following picture (amazingly beautiful -- Mr. Feuersänger: you rock!): ![enter image description here](http://i.stack.imgur.com/TEpin.png) This is what I want, except: the back of some of the patches is missing in the upper left (red) part. What to do? Is this a bug in `pgfplots` and/or is there an easy way to fix this? I don't care much about the particular type of shading, but I want to have clear lattice lines. * * * For anyone who is interested, here is my python code to generate the data:               from numpy import linspace, pi, sin, cos, log     from scipy.optimize import bisect          # Code to generate patches     # (x(r,theta), y(r,theta), z(r,theta)), where     #    x(r,theta) = 1 - r cos(theta),      #    y(r,theta) = 1 - r sin(theta),      #    z(r,theta) = -log(x(r,theta)) - log(y(r,theta)).          PATCH = [(0,0), (2,0), (2,2), (0,2), (1,0), (2,1), (1,2), (0,1), (1,1)]     N     = 21     zmax  = 6     zmin  = -log(1)-log(1)               # Determine the value such that z = -log(x(r,theta)) - log(y(r,theta)).     def zinv(theta, z):       f = lambda r: -log(1 - r*cos(theta)) - log(1 - r*sin(theta)) - z       maxr = min(1/cos(theta), 1/sin(theta)) - 1e-6       return bisect(f, 0, maxr)               P = dict()          # Generate lattice points     for i, theta in enumerate(linspace(1e-6, pi/2-1e-6, N)):       for j, z in enumerate(linspace(zmin, zmax, N)):          r = zinv(theta, z)          x = 1 - r * cos(theta)          y = 1 - r * sin(theta)          z = - log(x) - log(y)          P[i,j] = (x,y,z)          # Output patches     for j in range(0, N-1, 2):       for i in range(0, N-1, 2):         for (di, dj) in PATCH:            print "(%0.8f,%0.8f,%0.8f)" % P[i+di,j+dj],         print


title: Customize `\citeauthor*` to show full author name but UpperCase only the first letter

text: I'm using biblatex with the `verbose-trad1` style. When I use the command `\citeauthor*` I get the author's full name and the last name in SmallCaps. That is nice but I'd like to create a NEW command from `\citeauthor*` that would allow me to cite the author's full name with only the first letters in uppercase. Exemple : currently : `\citeauthor*` gives me John SKA (small caps) I wish : `\somenewcommand` that gives me John Ska BUT keeps all my other citations (`\autocite`) as they are, i.e.: names in small caps. EDIT: I've modified a little bit @moewe's answer to get precisely what I wanted. The final result is :                 \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{csquotes}                        \usepackage[style=verbose-trad1,     backend=bibtex,     bibencoding=inputenc,                language=french,                     natbib=true,                         sortcites=true,     autopunct=true,                          babel=hyphen,                            hyperref=true,                               block=space,     citetracker=true,     ibidpage=true,     ibidtracker=context,     idemtracker=true,     pagetracker=true,     url=false,     ]{biblatex}          \bibliography{/Users/lucianocouto/Documents/Chartres/bibliographie.bib}          \DeclareCiteCommand*{\citeauthor}     {\defcounter{maxnames}{99}%     \defcounter{minnames}{99}%     \defcounter{uniquename}{2}%     \boolfalse{citetracker}%     \boolfalse{pagetracker}%     \usebibmacro{prenote}}     {\ifciteindex{\indexnames{labelname}}{}%     \printnames{labelname}}     {\multicitedelim}     {\usebibmacro{postnote}}          \DeclareCiteCommand*{\citeauthornsc}     {\renewcommand*{\mkbibnamelast}[1]{####1}  % avoid SmallCaps for the name     \defcounter{maxnames}{99}%     \defcounter{minnames}{99}%     \defcounter{uniquename}{2}%     \boolfalse{citetracker}%     \boolfalse{pagetracker}%     \usebibmacro{prenote}}     {\ifciteindex{\indexnames{labelname}}{}%     \printnames{labelname}}     {\multicitedelim}     {\usebibmacro{postnote}}          \DeclareCiteCommand{\citeauthornsc}       {\renewcommand*{\mkbibnamelast}[1]{####1}  % avoid SmallCaps for the name        \boolfalse{citetracker}%        \boolfalse{pagetracker}%        \usebibmacro{prenote}}       {\ifciteindex          {\indexnames{labelname}}          {}%        \printnames{labelname}}       {\multicitedelim}       {\usebibmacro{postnote}}          \begin{document}          Standard small caps : \citeauthor{Milgrom:1991aa}          The new standard command : \citeauthornsc{Milgrom:1991aa}\autocite{Milgrom:1991aa}          Full name smallcaps : \citeauthor*{Milgrom:1991aa}          The new full name small caps : \citeauthornsc*{Milgrom:1991aa}\autocite{Milgrom:1991aa}          \enddocument      ![enter image description here](http://i.stack.imgur.com/NHwxf.jpg) Thanks a lot !!!


title: Is there a tool to make a complicated Table like this one ("Auswahlliste" from "Pahl/Beitz Konstruktionsmethodik")?

text: I’m developing a product as a part of my thesis for my university in Germany. We are supposed to use standard methodology for decision making. One of the tools is called “Auswahlliste”. (I don’t even know how to translate it. Maybe “choice list”.) It has a peculiar look, but it’s well accepted among academics in Germany. But just thinking about creating it in `tabular` environment scares me. What would you suggest? Would you try to make it with Tex-measures or would you just make a Table in Excel or any other WYSIWYG software and import it as PDF? Is there a suitable tool to draw such wicked tables in Tex- world? Here is what it looks like: ![Auswahlliste](http://i.stack.imgur.com/NTqub.png) This figure was taken from the book _Pahl/Beitz Konstruktionslehre_ , ISBN 978-3-642-29569-0. To clear any confusion: I don’t have to make this table look like this at all costs. It’s just a standard table design used in German industry. I acknowledge all the flaws of this design and its lack of readability. I myself had a hard time understanding it at first glance. But still it’s the broadly accepted standard here and I would like to know whether it is possible to draw it with LaTeX tools. If I was trying to change the shape of it to fit my taste, I wouldn’t post this question.


title: Generating 2d barcodes

text: Is there any package that generates 2d barcodes (QR code). I want to add a barcode on the front page of a manual I have written containing the URL where to download that manual. It would be nice if I could continue using pdflatex. Instead of converting each time. EDIT: [Reaction to Jake's answer] Is it possible one could only add one barcode. I've analyzed how this works. I think the compiler runs two times, one time rendering the pstricks images. A second time inserting the images in the LaTeX pdf. However if I add two different barcodes. It simply overides the file by the last barcode, and uses this file for both the barcodes. Is there any workaround for this problem?


title: natbib: Error when citing paper with similar authors and same year

text: I get a strange error when I try cite two certain papers in the same document, when I use the `natbib` package (with `numbers` option enabled). If I trim the author list or change the year of either paper, then it works. The error is:               ...     Document Class: article 2005/09/16 v1.4f Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo))     (/usr/share/texmf/tex/latex/natbib/natbib.sty) (./test.aux)     ! Missing = inserted for \ifnum.     <to be read again>                         \def      l.5 ...p{mieghem10assortativity,mieghem10rewiring}                                                        says      I've confirmed this happens with other people's installations too. So it's not specific to my machine. What am I doing wrong, or is this a bug in `natbib`? If a bug, is there a workaround? Here's a simple test-case: test.bib:               @article{mieghem10assortativity,             Month = {{Nov}},             Numpages = {{11}},             Publisher = {{American Physical Society}},             author = {Van Mieghem, P. and Ge, X. and Schumm, P. and Trajanovski, S. and Wang, H.},             title = {{Spectral graph analysis of modularity and assortativity}},             journal = {{Physical Review E}},             volume = {{82}},             number = {{5}},             pages = {056-113},             year = {{2010}},             doi = {{10.1103/PhysRevE.82.056113}},     }          @article{mieghem10rewiring,             author = {Van Mieghem, P. and Wang, H. and Ge, X. and Tang, S. and Kuipers, F. A.},             title = {{Influence of assortativity and degree-preserving rewiring on the spectra of networks}},             journal = {{European Physical Journal B}},             volume = {{76}},             number = {{4}},             pages = {643-652},             year = {{2010}},             doi = {{10.1140/epjb/e2010-00219-x}},     }      test.tex:               \documentclass[a4paper]{article}     \usepackage[numbers]{natbib}          \begin{document}     blah. \citep{mieghem10assortativity,mieghem10rewiring} says     blah blah          \bibliographystyle{plainnat}     \bibliography{test}          \end{document}


title: How to put side notes in available whitespace, not just in margins

text: I'm creating a document that shows a template of a documentation standard. I'd like to put in some miscellaneous notes for the template placeholders. Something like               [date1]   [COMMENT: Please use only dates obtained from     [date2]   the Center for Dates.]     [date3]      Since the date list will have lots of white space to its right, I'd like the comment to appear there. It's closer to home and conserves space. The closest I found to what I want is `\marginpar{}` but it doesn't quite do the trick. How can I do this in LaTeX?


title: Predictive mode: Only auto-complete LaTeX keywords

text: I typeset documents in French, and I don't really need auto-completion of the words that I type. I do, however, love the completions features that Predictive mode offers for LaTeX commands. Is there a way to tell Predictive mode to only do auto-completion on LaTeX keywords, and not for other words? I've tried this :   * `(custom-set-variables '(predictive-main-dict nil))` but I'm not sure whether it's the right solution. Can you confirm that it's correct to do it this way? If so, this post my serve as a reference for other searching for this (hopefully). Thanks!


title: How to show glossary entry name in bold when using long style?

text: I am using the `glossaries` package in order to create a glossary. If I use:               \printglossary[type=main,style=list]      I get entry names in bold, but the layout won't be the one I wish. If I use:               \setlength{\glsdescwidth}{\linewidth}     \printglossary[type=main,style=long]      I will get the wanted layout exhibited, but the entry names won't be in bold. So, how to set the entry names to be shown in bold when using long style?


title: soul's \ul{} breaks wrapfigure and textflow?

text: Please, I have a nice picture without that `\ul{...}`, but i need that.               \documentclass{article}          \usepackage{wrapfig}     \usepackage{soul}          \begin{document}          \begin{wrapfigure}[3]{l}{30mm}     \Huge 1     \end{wrapfigure}          \ul{Lorem ipsum dolor sit amet}, consectetur adipiscing elit.     Suspendisse nec dolor eget tortor iaculis molestie et ac diam.     Aliquam feugiat tempus orci et suscipit.     Morbi varius dignissim arcu, vitae facilisis metus imperdiet id.     Morbi non mi at neque mollis elementum.     Etiam mauris velit, accumsan in fringilla nec, auctor in eros.     Etiam porta fermentum pretium.           \end{document}      With that \ul{...} paragraph is being stretched to full width and figure goes away to the left. What is wrong? Thanks! ps. Actually there are graphics in `wrapfigure`s and i really need some words to be underlined. Yes, `ulem`'s `\emph` does the same as `\ul`. Well, yes, `\underline` does right thing here, but i am unhappy with `\underline`. **Update** : With this addition:               \usepackage{color}     ...     % instead of just \Huge 1:     \fcolorbox[gray]{0.59}{1}{\parbox{30mm}{\Huge 1}}      and after making "just too long word" `pdflatex` produces this picture: ![hyphenation does work!](http://i.stack.imgur.com/Iv2rj.png) So, paragraph is nicely stretched to \textwidth;


title: Positioning signature on left in letter

text: I have this letter template, I found online.               \documentclass[11pt,stdletter]{newlfm}     \usepackage{charter}          \widowpenalty=1000     \clubpenalty=1000          \newlfmP{headermarginskip=15pt}     \newlfmP{sigsize=25pt}     \newlfmP{dateskipafter=25pt}     \newlfmP{addrfromphone}     \newlfmP{addrfromemail}     \PhrPhone{Phone}     \PhrEmail{Email}          \namefrom{James Bond}          \addrfrom{Privet Drive}     \phonefrom{111-333-4422}     \emailfrom{abc@mnop.com}          \addrto{XYZ Inc.}          \greetto{To Whom It May Concern,}     \closeline{Sincerely,}          \begin{document}     \begin{newlfm}          \end{newlfm}     \end{document}      For some reason, I cannot get the `\namefrom` and `\closeline` to left indent. It keeps positioning on the right. I tried `\flushright` and `\flushleft`


title: Underful hbox badness 10000

text: A while back I ran across a web page that explained how to avoid this error by not using `\\` but hfill or hspace. I can't remember which one or find anything else about it. It was a very simple solution and solved the problem without extra packages or anything and simply filled the remaining horizontal space. Any ideas?


title: Left-alignment of table caption. Forced to center

text: I am trying to get the table caption left aligned (as the first table labeled "parameter estimates" using `tabularx`), but in tabular* environment (also happens to my tabularx in the original document) I am not able to left-align it. It just want to stay centered. This also happens to my figures (and I would like consistency, so both to figure and table). Also, if someone could tell me how I can add colon after "TABLE X" then that would be appreciated, but please mark what part of the code that does this, as I may want to remove it.                \documentclass{article}         \usepackage{float}% http://ctan.org/pkg/float         \makeatletter         \newcommand\fs@topruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled           \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%           \def\@fs@post{}%           \def\@fs@mid{}%           \let\@fs@iftopcapt\iftrue}         \makeatletter         \floatstyle{topruled}         \restylefloat{table}              \usepackage{tabularx,booktabs,caption}% http://ctan.org/pkg/{tabularx,booktabs,caption}         \captionsetup[table]{           labelsep = newline,           textfont = sc,            name = TABLE,            justification=justified,%this does not seem to work           skip = \medskipamount}         \begin{document}              \begin{table}[!htp]           \caption{Parameter estimates of the No-Arbitrage Yield only model}           \label{tab:parameter_estimates}           \begin{tabularx}{\linewidth}{@{} X r r @{}}             \toprule[0.5pt]             \toprule[0.5pt]             \small Parameters & \multicolumn{2}{c}{\small Full Sample} \\             \midrule[0.5pt]             $\delta_0$ & \multicolumn{2}{c}{6.2030} \\             & \multicolumn{2}{c}{Factor autoregressive parameters} \\             $\rho_{LL}$ & $1.000$ & $(0.342)$ \\             $\rho_{SS}$ & $0.999$ & $(0.233)$ \\             & \multicolumn{2}{c}{Risk pricing factors} \\             $\lambda_S^0$ & \multicolumn{2}{c}{$0$} \\             $\lambda_L^0$ & $-0.0174$ & $(0.041)$ \\             $\lambda_S^1$ & $ 0.0912$ & $(0.089)$ \\             $\lambda_S^1$ & $-0.1612$ & $(0.034)$ \\             & \multicolumn{2}{c}{Factor shock volatility parameters} \\             $\sigma_L$ & $0.0340$ & $(0.019)$ \\             $\sigma_L$ & $0.0795$ & $(0.010)$ \\             \bottomrule           \end{tabularx}                \medskip                \parbox{\linewidth}{\scriptsize%           \textsc{Note}:           The table shows the results from the market model estimations. Each column presents the mean and standard deviation for            all the companies' CAR in the designated event window period. The first column, (0, 2), reports~$\mu$ and~$\sigma$ for            the event window period spanning from day~0 to~2 days after the dividend announcement (3~day window). Where day~[0] is            the dividend announcement day. Columns~(2),~(3) and~(4) widens the event window to~5,~11 and~21 days. The $t$-values are            reported below in parentheses and calculated as $\mu / (\sigma / \sqrt{n})$. ***, ** and * denote significance at            the~1,~5 and~10\% levels, respectively.}         \end{table}              \begin{table}[!htp]         \small           \caption{Correlation matrix}           \label{tab:Correlation matrix}           \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l*5{c}@{}}             \toprule[0.5pt]             \toprule[0.5pt]            \small Maturity (months) &  1 &  3 & 12 &  36 &  60  \\               \midrule[0.5pt]               %            1 & 1 &  &   & \\         %         %              3 &  0.997 & 1 &   &  \\           %           %               12 & 0.978 & 0.983 &  1 &   \\             36 &  0.937 & 0.940 &  0.976 & 1 \\             60 & 0.915 & 0.914 &  0.949 & 0.993  & 1\\                \bottomrule           \end{tabular*}                \medskip                \parbox{\linewidth}{\scriptsize%           \textsc{Note}:           We present the correlation matrix for five (5) different maturities. The sample period is from 2000:01 to 2014:02.}         \end{table}                   \end{document}


title: Convert hours (as decimals) to fractions for billable-time invoice

text: I'm creating an invoice in LaTeX and I've entered the hours I've worked as decimals (for example, 1, 1.5, 0.75, 2.25), but I want to display those decimals as fractions (1, 1½, ¾, 2¼). (The reason I've entered the hours worked as a decimal is so I can perform simple invoice math with the fp package along the lines of this answer) For a little context, here's the synopsis of the macro I created that includes the number of hours worked:               \lineitem{DATE}{HOURS}{RATE}{PROJECT}{DESCRIPTION}      The conversions I have in mind are pretty simple: ![tex rendered](http://i.stack.imgur.com/XsJrd.png)               \documentclass{article}     \usepackage{xfrac}     \begin{document}     \begin{tabular}{r @{} l | r @{\hspace{0.1em}} l}     \multicolumn{2}{c}{Given...} & \multicolumn{2}{c}{Output} \\     \hline     1 & & 1 & \\     1 & .5 & 1 & \sfrac{1}{2} \\     0 & .75 & \sfrac{3}{4} & \\     2 & .25 & 2 & \sfrac{1}{4} \\     \end{tabular}     \end{document}      (I'm not married to `\sfrac` for displaying fractions, it's just the first package I reached for) Is there an off-the-shelf package that will do what I want? If not, can anyone give me a few pointers how I might go about implementing my own conversion/display logic?


title: stripe pattern tikz manual chapter 78

text: #  Interleaving two colors in a stripes pattern Aim: coloring a shape (rectangle, circle, etc.) in two interleaving colors with the aid of patterns. One solution would be the definition of four patterns. As you can tell from the the following there are two interleaving patterns defined in each direction. **southwest -- nordeast**   ![swne](http://i.stack.imgur.com/iUY1o.jpg) 1- `swnestripes`: (blue stripes) 2- `swneStripes`: (white stripes) **southeast -- nordwest**   ![senw](http://i.stack.imgur.com/OgvEr.jpg) 3- `senwstripes`: (red stripes) 4- `senwStripes`: (white stripes) Naturally, the other solution would be first filling the background in one color (e.g., white) and then applying a pattern on top of it (e.g.,blue). But I do like making things complicated ;) **Preamble:**               \documentclass[a4paper]{article}         \usepackage{graphicx}         \usepackage{subfig}         \usepackage{tikz}         \usetikzlibrary{patterns}      **Declarations:**                   \begin{document}         \def\boundb{(-3,2) rectangle (4,-2)}         \def\setAa{(-1,0) circle (1)}         \def\setBa{(2,0) circle (1)}         \def\setAb{(0,0) circle (1)}         \def\setBb{(1,0) circle (1)}      **Patterns:**                   \pgfdeclarepatternformonly{swnestripes}{\pgfpoint{0cm}{0cm}}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}         {             \foreach \i in {0.1cm, 0.3cm,...,0.9cm}             {              \pgfpathmoveto{\pgfpoint{\i}{0cm}}              \pgfpathlineto{\pgfpoint{1cm}{1cm - \i}}              \pgfpathlineto{\pgfpoint{1cm}{1cm - \i + 0.1cm}}              \pgfpathlineto{\pgfpoint{\i - 0.1cm}{0cm}}              \pgfpathclose%              \pgfusepath{fill}              \pgfpathmoveto{\pgfpoint{0cm}{\i}}              \pgfpathlineto{\pgfpoint{1cm - \i}{1cm}}              \pgfpathlineto{\pgfpoint{1cm - \i - 0.1cm}{1cm}}              \pgfpathlineto{\pgfpoint{0cm}{\i + 0.1cm}}              \pgfpathclose%              \pgfusepath{fill}             }         }         \pgfdeclarepatternformonly{swneStripes}{\pgfpoint{0cm}{0cm}}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}         {             \foreach \i in {0.1cm, 0.3cm,...,0.9cm}             {              \pgfpathmoveto{\pgfpoint{\i}{0cm}}              \pgfpathlineto{\pgfpoint{1cm}{1cm - \i}}              \pgfpathlineto{\pgfpoint{1cm}{1cm - \i - 0.1cm}}              \pgfpathlineto{\pgfpoint{\i + 0.1cm}{0cm}}              \pgfpathclose%              \pgfusepath{fill}              \pgfpathmoveto{\pgfpoint{0cm}{\i}}              \pgfpathlineto{\pgfpoint{1cm - \i}{1cm}}              \pgfpathlineto{\pgfpoint{1cm - \i + 0.1cm}{1cm}}              \pgfpathlineto{\pgfpoint{0cm}{\i - 0.1cm}}              \pgfpathclose%              \pgfusepath{fill}             }         }         \pgfdeclarepatternformonly{senwstripes}{\pgfpoint{0cm}{0cm}}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}         {             \foreach \i in {0.1cm, 0.3cm,...,0.9cm}             {              \pgfpathmoveto{\pgfpoint{0cm}{\i}}              \pgfpathlineto{\pgfpoint{0cm}{\i + 0.1cm}}              \pgfpathlineto{\pgfpoint{\i + 0.1cm}{0cm}}              \pgfpathlineto{\pgfpoint{\i}{0cm}}              \pgfpathclose%              \pgfusepath{fill}              \pgfpathmoveto{\pgfpoint{1cm}{\i}}              \pgfpathlineto{\pgfpoint{\i}{1cm}}              \pgfpathlineto{\pgfpoint{\i + 0.1cm}{1cm}}              \pgfpathlineto{\pgfpoint{1cm}{\i + 0.1cm}}              \pgfpathclose%              \pgfusepath{fill}             }         }         \pgfdeclarepatternformonly{senwStripes}{\pgfpoint{0cm}{0cm}}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}}         {             \foreach \i in {0.0cm, 0.2cm,...,0.8cm}             {              \pgfpathmoveto{\pgfpoint{\i}{0cm}}              \pgfpathlineto{\pgfpoint{0cm}{\i}}              \pgfpathlineto{\pgfpoint{0cm}{\i + 0.1cm}}              \pgfpathlineto{\pgfpoint{\i + 0.1cm}{0cm}}              \pgfpathclose%              \pgfusepath{fill}              \pgfpathmoveto{\pgfpoint{1cm}{\i}}              \pgfpathlineto{\pgfpoint{\i}{1cm}}              \pgfpathlineto{\pgfpoint{\i + 0.1cm}{1cm}}              \pgfpathlineto{\pgfpoint{1cm}{\i + 0.1cm}}              \pgfpathclose%              \pgfusepath{fill}             }         }      **Figure:**                   \begin{figure}[p]         \centering         \subfloat[Two separate Sets $\overline{A\cup B}$]{          \begin{tikzpicture}[scale=0.6, auto, swap]            \filldraw[pattern=senwStripes, pattern color=magenta!60]\boundb;            \filldraw[pattern=swnestripes, pattern color=blue!60]\boundb;            \filldraw[fill=white, draw=blue, line width=2pt]\setAa;            \filldraw[fill=white, draw=magenta, line width=2pt]\setBa;            \node at (-2,1) [above left] {$A$};            \node at (1,1) [above left] {$B$};          \end{tikzpicture}         }\qquad         \caption{Set Examples}         \label{fig:Sets}         \end{figure}     \end{document}      ##  Issues: `pdflatex` produces               ptptpt    pt    ptptpt    pt    ptptpt    pt    ptptpt    pt      (The desired figure is also created, on a separate page, as expected.) ###  Dominant Color When drawing two or more patterns on one shape (e.g., pattern shifted, different color, see interleaved stripes above, multiple possible combinations) in the end, one shape or color is overlapping the other, i.e., one color is more dominant in the whole figure.                  \filldraw[pattern=senwStripes, pattern color=magenta!60]\boundb;        \filldraw[pattern=swnestripes, pattern color=blue!60]\boundb;      blue is the dominant in the figure.                  \filldraw[pattern=swnestripes, pattern color=blue!60]\boundb;        \filldraw[pattern=senwStripes, pattern color=magenta!60]\boundb;      magenta is. You can have a look at the effect if you compile the following code:                   \begin{figure}[p]         \centering         \subfloat[blue dominant $\overline{A\cup B}$]{          \begin{tikzpicture}[scale=0.6, auto, swap]            \filldraw[pattern=senwStripes, pattern color=magenta!60]\boundb;            \filldraw[pattern=swnestripes, pattern color=blue!60]\boundb;            \filldraw[fill=white, draw=blue, line width=2pt]\setAa;            \filldraw[fill=white, draw=magenta, line width=2pt]\setBa;            \node at (-2,1) [above left] {$A$};            \node at (1,1) [above left] {$B$};          \end{tikzpicture}         }\qquad         \subfloat[magenta dominant $\overline{A\cup B}$]{          \begin{tikzpicture}[scale=0.6, auto, swap]            \filldraw[pattern=swnestripes, pattern color=blue!60]\boundb;            \filldraw[pattern=senwStripes, pattern color=magenta!60]\boundb; % swapped            \filldraw[fill=white, draw=blue, line width=2pt]\setAa;            \filldraw[fill=white, draw=magenta, line width=2pt]\setBa;            \node at (-2,1) [above left] {$A$};            \node at (1,1) [above left] {$B$};          \end{tikzpicture}         }\qquad         \caption{Set Examples}         \label{fig:Sets}         \end{figure}     \end{document}      Hypothetical question: is there a way to make them both "equal" dominant? Here is another example:                   \begin{figure}[p]         \centering         \subfloat[Set B overlapping set A $\overline{A\cup B}$]{         \begin{tikzpicture}[scale=0.6, auto, swap]                \node at (-3,1.5) [above left] {$\scriptstyle U$};           \begin{scope}[fill opacity=0.2]            \filldraw[pattern=swnestripes, pattern color=blue!80, ultra thin]\boundb;            \filldraw[pattern=senwStripes, pattern color=orange, ultra thin]\boundb;           \end{scope}                \begin{scope}            \clip\boundb;            \fill[fill=white]\setAb;           \end{scope}           \begin{scope}            \clip\boundb;            \fill[fill=white]\setBb;           \end{scope}                \begin{scope}            \clip\setAb;            \fill[fill=red!10]\setBb;           \end{scope}           \begin{scope}            \clip\setBb;            \fill[fill=red!10]\setAb;           \end{scope}                \draw[draw=blue, line width=1pt]\setAb;           \draw[draw=orange, line width=1pt]\setBb;                \node at (-1,1) [above left] {$\scriptstyle A$};           \node at (2,1) [above right] {$\scriptstyle B$};         \end{tikzpicture}         }\qquad         \caption{Set Examples}         \label{fig:Sets}         \end{figure}     \end{document}      In the following figure, orange circle is overlapping blue circle at intersection points. ![enter image description here](http://i.stack.imgur.com/L9A69.jpg) Since transparency does **not** "equally" distribute the dominance of colors in the overlapping parts (the lower color contributes less on the overall effect), one solution for "equal rights" for the colors is structured drawing. ![enter image description here](http://i.stack.imgur.com/7dhPZ.jpg) ![enter image description here](http://i.stack.imgur.com/Dqmak.jpg) Can you think of a "hack" to get there? How can I get rid of the "ptptpt"? Any help appreciated. Thanks. * * * _If this looks a bit strange to you, here is a compromise I decided on:_ ![compromise](http://i.stack.imgur.com/VfV8y.png) _One color may overlap in the upper part, and one in the lower!_                   \begin{figure}[p]         \centering         \subfloat[Set B overlapping set A and set A overlapping set B $\overline{A\cup B}$]{         \begin{tikzpicture}[scale=0.6, auto, swap]                \node at (-3,1.5) [above left] {$\scriptstyle U$};           \begin{scope}[fill opacity=0.2]            \filldraw[pattern=swnestripes, pattern color=blue!80, ultra thin]\boundb;            \filldraw[pattern=senwStripes, pattern color=orange, ultra thin]\boundb;           \end{scope}                \begin{scope}            \clip\boundb;            \fill[fill=white]\setAb;           \end{scope}           \begin{scope}            \clip\boundb;            \fill[fill=white]\setBb;           \end{scope}                \begin{scope}            \clip\setAb;            \fill[fill=red!10]\setBb;           \end{scope}           \begin{scope}            \clip\setBb;            \fill[fill=red!10]\setAb;           \end{scope}                \node at (-1,1) [above left] {$\scriptstyle A$};           \node at (2,1) [above right] {$\scriptstyle B$};                \begin{scope}             \clip (-2,0) rectangle (4,2);             \draw[draw=blue, line width=1pt]\setAb;             \draw[draw=orange, line width=1pt]\setBb;           \end{scope}           \begin{scope}             \clip (-2,0) rectangle (4,-2);             \draw[draw=orange, line width=1pt]\setBb;             \draw[draw=blue, line width=1pt]\setAb;           \end{scope}         \end{tikzpicture}         }\qquad         \caption{Set Examples}         \label{fig:Sets}         \end{figure}


title: Avoid right shift when starting a new line

text: I have included many figures with this code:               \begin{minipage}[b]{0.5\linewidth}     \makebox[\linewidth]{       %        to center the image     \includegraphics[keepaspectratio=true,scale=0.5]{stationary2_A75.eps}}     \captionof{figure}{$A=7.5$}     \end{minipage}      The problem is that the first row is shifted to the right compared with the rows below. I think it might have something to do with right shifting when I start a new line, so how can I avoid right hand shift with a new line? Or maybe it is something different?


title: Draw parallel lines each one with a fixed length

text: I am trying to create parallel lines in `tikz`. Although I can create those lines, I can't seem to be able to control the length of those lines, which I want them to stop in the red box's face. My code is               \documentclass{standalone}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}[scale=0.5]           %target           \draw[fill=gray!30,gray!30] (0,3)rectangle(2,-3);           %tracks           \draw[->,thick] (-2,2)--(0,2);           \draw[->,dashed] (0,2)--(-3,-3);           \draw[->,thick] (-2,1)--(2,1);           \draw[->,dashed] (2,1)-- +($(-3,-3)-(0,2)$);           \draw[->,thick] (-2,-1)--(2,-1);           \draw[->,dashed] (2,-1)-- +($(-3,-3)-(0,2)$);           \draw[->,thick] (-2,-2)--(0,-2);           \draw[->,dashed] (0,-2)-- +($(-3,-3)-(0,2)$);           %detector           \draw[red, rotate around={60:(-1,-3)}] (-3,0) rectangle (-2,-6);        \end{tikzpicture}     \end{document}      My output is ![enter image description here](http://i.stack.imgur.com/xrc9h.png) Any idea on how to control the length and end point of the parallel line?


title: TikZ: “Zig-Zag” lines

text: How to obtain easily the following red line in the code given just after? Is it possible to only give the start and end positions so as to obtain the two kinds of paths? The question is more about paths than about Sudoku. I give the code for the Sudoku so as to test one solution working in a “real life” example. ## First style ![enter image description here](http://i.stack.imgur.com/BTEYH.png) ## Second style ![enter image description here](http://i.stack.imgur.com/sbMLM.png) ## Code               \documentclass{article}         \usepackage{tikz}         \usetikzlibrary{backgrounds}         \usepackage{graphicx}          % Some customizable styles         \tikzset {             highlight/.style = {                 yellow,                 opacity = 0.3             },             digit/.style = {                 minimum height = 5mm,                 minimum width = 5mm,                 anchor = center             },             circle/.style = {                 draw = green!80!black,                 dotted,                 very thick             },             circle number/.style = {                 draw = #1,                 very thick             },             cross/.style = {                 red,                 opacity = .5,                 shorten >= 1mm,                 shorten <= 1mm,                 very thick,                 line cap = round             },             hint/.style = {                 blue,                 font = \sf,                 minimum width = 3mm,                 minimum height = 3mm             }         }          % Modified the \node to give a unique name to each one, which is the     % row number, a dash and the column number. E.g: 1-1, 4-5, etc.         \newcounter{row}         \newcounter{col}              \newcommand\setrow[9]{             \setcounter{col}{1}             \foreach \n in {#1, #2, #3, #4, #5, #6, #7, #8, #9} {                 \edef\x{\value{col} - 0.5}                 \edef\y{9.5 - \value{row}}                 \node[digit,name={\arabic{row}-\arabic{col}}] at (\x, \y) {\n};                 \stepcounter{col}             }             \stepcounter{row}         }          % New code -------------------------------------------------------------         \def\highlightcell#1#2{             \begin{scope}[on background layer]                 \fill[highlight] (#1-#2.north west) rectangle (#1-#2.south east);             \end{scope}         }              \def\circlecell#1#2{             \draw[circle] (#1-#2) circle(4mm);         }              \def\crosscell#1#2{             \draw[cross] (#1-#2.north west) -- (#1-#2.south east);             \draw[cross] (#1-#2.north east) -- (#1-#2.south west);         }              \def\highlightrow#1{             \begin{scope}[on background layer]                 \fill[highlight] (#1-1.north west) rectangle (#1-9.south east);             \end{scope}         }              \def\highlighcolumn#1{             \begin{scope}[on background layer]                 \fill[highlight] (1-#1.north west) rectangle (9-#1.south east);             \end{scope}         }              \def\highlightrectangle#1#2#3#4{             \begin{scope}[on background layer]                 \fill[highlight] (#1-#2.north west) rectangle (#3-#4.south east);             \end{scope}         }              \def\hintcell#1#2#3{             \node at (#1-#2) {\hintbox{#3}};         }               % Command to circle numbers:     % #1: optional -> circle color     % #2: mandatory -> cell identifier     % #3: mandatory -> name of the cell         \newcommand\circlenumber[3][red!80!black]{             \draw[circle number=#1, radius=5mm] (#2) circle node[outer sep=1mm] (#3){};         }          % UGLY code. Do not read :-)         \def\hintbox#1{             \resizebox{4.5mm}{4.5mm}{%                 \tikz[scale=0.3]{%                     \def\auxc{0}                     \foreach \m in {1,...,9} {                         \pgfmathparse{mod(\auxc,3)}                         \xdef\x{\pgfmathresult}                         \pgfmathparse{-floor(\auxc/3)}                         \xdef\y{\pgfmathresult}                         \xdef\hintprinted{0}                         \foreach \n in {#1} {                             \ifnum\n=\m                                 \node[hint] at (\x,\y) {\n};                                 \xdef\hintprinted{1}                             \fi                         }                         \ifnum\hintprinted=0                             \node[hint, opacity=0.1] at (\x,\y) {\m};                         \fi                         \pgfmathparse{\auxc+1}                         \xdef\auxc{\pgfmathresult}                     }                 }%             }         }               \begin{document}          \begin{tikzpicture}[scale=.5]         \begin{scope}             \draw (0, 0) grid (9, 9);             \draw[very thick, scale=3] (0, 0) grid (3, 3);                  \setcounter{row}{1}             \setrow { }{2}{ }  {5}{ }{1}  { }{9}{ }             \setrow {8}{ }{ }  {2}{ }{3}  { }{ }{6}             \setrow { }{3}{ }  { }{6}{ }  { }{7}{ }                  \setrow { }{ }{1}  { }{ }{ }  {6}{ }{ }             \setrow {5}{4}{ }  { }{ }{ }  { }{1}{9}             \setrow { }{ }{2}  { }{ }{ }  {7}{ }{ }                  \setrow { }{9}{ }  { }{3}{ }  { }{8}{ }             \setrow {2}{ }{ }  {8}{ }{4}  { }{ }{7}             \setrow { }{1}{ }  {9}{ }{7}  { }{6}{ }         \end{scope}     \end{tikzpicture}          \end{document}


title: How to define the following symbol to stock one element in one list?

text: I'm looking for one symbol to indicate that a value is stocked in one list. On way would be to use something like `myList.append(myValue)` but it os not very quick to see and to write. Indeed, I would like to define the following symbols that is a left arrow followed by one square. This symbol will be used in math formulas. ![enter image description here](http://i.stack.imgur.com/ckouA.png)


title: TikZ - Put two draws in the same TikZ environment and vertical spacing

text: In the following code, I would like to put the two lists displayed in the same environment with one vertical specified spacing. How can I do that ? ## Code               \documentclass{article}         \usepackage{tikz}         \usepackage{xstring}              \tikzset{             raw sort entry/.style={rectangle, thick, draw, node distance=1.5em},             sort entry black/.style={raw sort entry, black, fill=white},             sort entry blackgray/.style={raw sort entry, black, fill=gray!25},             s1/.style={raw sort entry, red, fill=yellow!30},             s2/.style={raw sort entry, blue, fill=green!20},             s3/.style={raw sort entry, violet, fill=orange!25}         }              \newcommand*{\List}[2][sort entry black]{%           \par\noindent%           \edef\listtoprocess{#2}%           \def\ListToProcess{}%           \begin{tikzpicture}[inner sep=2pt, outer sep=0]             \foreach \content in \listtoprocess{               \IfSubStr{\content}{/}{% true                 \xdef\ListToProcess{\ListToProcess,\content}               }{%                      false                 \xdef\ListToProcess{\ListToProcess,#1/\content}               }             }             \StrGobbleLeft{\ListToProcess}{1}[\ListToProcess]% removes the first comma (\listToProcess is empty at the start)             \foreach [count=\i] \Style/\Value in \ListToProcess {               \ifnum\i=1\relax                 \node [raw sort entry, \Style] (sortnode\i) {\Value};               \else                 \node [raw sort entry, right of=sortnode\number\numexpr\i-1\relax, \Style] (sortnode\i) {\Value};               \fi             }           \end{tikzpicture}%         }          \begin{document}          \List[sort entry blackgray]{1, 2, 3, s1/1, s1/2, s1/3, 1, 2, 3}          \bigskip          \List[sort entry blackgray]{1, 2, 3, s1/1, s1/2, s1/3, 1, 2, 3}          \end{document}


title: Using SortNoop in BibTeX produces different Biblabel

text: I use `@PREAMBLE{"\def\SortNoop#1{}"}` in my BIB file to get the sorting of `AUTHOR = {{\SortNoop{Bruijn}}de Bruijn, Nicolaas Govert}` right. But this changes the label of the bibitem: All other entries with only one author have a label where the last name of the author is abbreviated with three alphabetic characters. The one using `\SortNoop` has the label [B64], but I would expect something like [Bru64] or [deB64]. How do I get the label [Bru64]? * * * Here is a MWE:               \begin{filecontents*}{\jobname.bib}     @PREAMBLE{"\def\SortNoop#1{}"}          @INCOLLECTION{Bruijn1964,       AUTHOR = {{\SortNoop{Bruijn}}de Bruijn, Nicolaas Govert},       TITLE = {{P{\'o}lya's} {Theory} of {Counting}},       BOOKTITLE = {Applied combinatorial mathematics},       PUBLISHER = {John Wiley and Sons, Inc., New York-London-Sydney},       YEAR = {1964}     }          @ARTICLE{Harary1958,       AUTHOR = {Harary, Frank},       TITLE = {On the number of bi-colored graphs},       JOURNAL = {Pacific J. Math.},       YEAR = {1958}     }     \end{filecontents*}          \documentclass{article}     \begin{document}          The label of \cite{Harary1958} has three alphabetic characters in it.     But the label of \cite{Bruijn1964} has only one alphabetic character.     How do I get the label [Bru64] or [deB64]?          \bibliographystyle{alpha}     \bibliography{\jobname.bib}     \end{document}      ![wrong biblabel](http://i.stack.imgur.com/lbH0P.png)