title: 2D and 3D vectors in Tikz

text: I would like to draw some 2D and 3D vectors in Tikz with certain properties. The following primitive graph sums what I desire: ![g](http://i.imgur.com/WLtxnRv.png?1)   * I just need the first quadrant of the Cartesian coordinate system for my representation.   * I need the vector to be connected to the respective values on the distinct dimensions(not a projection, just orthogonal dashed lines). The code segment below does what I want to achieve in 3D with two exceptions:   * The projections on the xy plane and z dimension are given instead of connecting the head of the vector to the corresponding value in each dimension.   * Numerical values are missing in dimensions. ## Code:               \documentclass[tikz]{standalone}     \usepackage{tikz-3dplot}     \begin{document}          \tdplotsetmaincoords{60}{120}     \begin{tikzpicture}         [scale=3,         tdplot_main_coords,         axis/.style={->,blue,thick},         vector/.style={-stealth,red,very thick},         vector guide/.style={dashed,red,thick}]          %standard tikz coordinate definition using x, y, z coords     \coordinate (O) at (0,0,0);          %tikz-3dplot coordinate definition using r, theta, phi coords     \tdplotsetcoord{P}{.8}{55}{60}          %draw axes     \draw[axis] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};         \draw[axis] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};         \draw[axis] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};          %draw a vector from O to P     \draw[vector] (O) -- (P);          %draw guide lines to components     \draw[vector guide] (O) -- (Pxy);     \draw[vector guide] (Pxy) -- (P);     \end{tikzpicture}     \end{document}


title: How to determine current page number?

text: I am adding entries to bookmarks and I want one entry to point to a specific page. However, I don't want to provide it's number, because it may change depending on contents modification before that page. The command to add an entry using the bookmark package is:               \bookmark[page=X,level=0]      where X is the page number. How can I determine at compile time the current page number to replace X with it? I've tried using `\thepage` in X's place but it didn't work. In the package documentation I found out there are named actions to PrevPage, NextPage, FirstPage and LastPage but there is no CurrentPage. How to fix this? Thanks.


title: How to change font in description environment?

text: How to change font in description environment, for term word (First, Second...) and for its definition (The first item, The second item...)? How to restore paragraph indentation after environment in whole document? How to change distance between items inside environment? How to change distance between environment and paragraphs (after and before)?               \documentclass{article}     \usepackage{lipsum}          \begin{document}     \lipsum     \begin{description}         \item[First] The first item         \item[Second] The second item         \item[Third] The third etc \ldots     \end{description}     \lipsum[1-3]     \end{document}      Can you help me? And sorry for my bad English


title: Single quotes in csquotes

text: I'm using the `csquotes` package with the modifications recommended by this answer, to detect quotation marks in my text (pasted from Microsoft Word) and make them look good in the output. Is there any way to have it also detect single quotes, so that they are oriented the correct way and not treated as apostrophes, without messing up the existing apostrophes? (I don't want to have to manually find all of the quote-within-quotes and replace `'` with ```.)               \documentclass{article}          \usepackage{csquotes}     \usepackage[american]{babel}     \DeclareQuoteStyle[american]{english}% verified       {\textquotedblleft}       [\textquotedblleft]       {\textquotedblright}       [0.05em]       {\textquoteleft}       {\textquoteright}     \MakeOuterQuote{"}          \begin{document}     I say: "These quotes look nice, but 'if I quote someone else within a quote like this,'     or 'like this,' they don't."     \end{document}      ![quote screenshot](http://i.stack.imgur.com/jAVpI.jpg)


title: Make array data structures in LaTeX

text: Is there a way to make an array in LaTeX. I want to write a function that does this (here the array has only 2 elements but I want to be able to have many as I want).               \foo{\MakeArray{foo,bar}}      > foo|bar-foo&bar I could have done this like that               \newcommand\foo[2]{\1-\2}     \foo{foo|bar}{foo&bar}      But I need to enter the elements twice which is not very neat... **EDIT:** Sadly, even if your answer solve my question, it doesn't work with my exact case so I'll tell it exactly. I currently have               \newcommand{\authors}[2][e ]{       \usepackage[pdfauthor={#1}]{hyperref}       \author{#2}     }      that I use that way               \authors{John Doe, Dark Vador and Yoda}{John Doe \and Dark Vador \and Yoda}      and I would like to have the same result without specifying it twice. However, the `\and` doesn't work with the proposed solution.


title: vertical-align of cells of an array and double left vertical line

text: How to make the D and F chars in the tabular appears on top of cell using this code ?               \documentclass[french]{beamer}     \usepackage{babel}          \usepackage{array}     \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}     \begin{document}             \begingroup     \defbeamertemplate{enumerate item}{image}{\small\includegraphics[height=1.8ex]{images/gofor}}     \makeatletter     \def\@listii{\leftmargin\leftmarginii                   \topsep    2ex                   \parsep    0\p@   \@plus\p@                   \itemsep   \parsep}     \makeatother     \begin{frame}{Conclusion}     \begin{table}     \centering     \caption{Comparatif entre ATL et MFC}     \vspace{0.4cm}     \begin{tabular}{|C{0.07\textwidth}*{4}{|C{\dimexpr0.22\textwidth-2\tabcolsep\relax}}|}     \hline     & {\fontsize{9}{9}\selectfont Gestion avancée des threads} & {\fontsize{9}{9}\selectfont Gestion de la mémoire} & {\fontsize{9}{9}\selectfont Vitesse d'exécution} & {\fontsize{9}{9}\selectfont Difficulté} \\     \hline     MFC & \includegraphics[height=1.8ex]{images/danger} & \includegraphics[height=1.8ex]{images/danger} & \includegraphics[height=1.8ex]{images/danger} & {\color{green} F} \\     \hline     ATL & \includegraphics[height=1.8ex]{images/func_ok} & \includegraphics[height=1.8ex]{images/func_ok}\includegraphics[height=1.8ex]{images/func_ok} & \includegraphics[height=1.8ex]{images/func_ok}\includegraphics[height=1.8ex]{images/func_ok}\includegraphics[height=1.8ex]{images/func_ok} & {\color{red} D} \\     \hline     \end{tabular}     \end{table}     \end{frame}     \endgroup     \end{document}      And, how to make the last column gets another vertical line on its left ? Thanks in advance!


title: Appendix numbering with combine class not working

text: The MWE demonstrates that the appendix number is 1 instead of A when using the combine class. Both imported documents have an appendix.               \documentclass[book]{combine}     \usepackage{amsmath,amssymb,amsfonts,amsthm,times}     \usepackage{filecontents}     \usepackage{appendix}     \usepackage{blindtext}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % Prints section numbers without leading 0.     \makeatletter     \let\oldimport\import     \renewcommand*{\import}{         \setcounter{section}{0}\renewcommand*\thesection{\arabic{section}}         \setcounter{subsection}{0}\renewcommand*\thesubsection{\thesection.\arabic{subsection}}         \oldimport}     \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \makeatletter     \begin{filecontents*}{inputDoc1a.tex}     \documentclass{article}     \usepackage{amsmath,amssymb,amsfonts,amsthm,times}     \usepackage{appendix}     \usepackage{blindtext}     \makeatletter     \@ifclassloaded{combine}       {\let\@begindocumenthook\@empty         }       {}     \makeatother     \begin{document}     \title{First article}     \author{Author of first article}     \maketitle     \section{first section}     This solves a problem.\index{problem}     \blindtext[1]     \section{Second section}     \blindtext[1-2]     \appendix     \section{An appendix}     \blindtext[1]     \end{document}     \end{filecontents*}          \begin{filecontents*}{inputDoc2.tex}     \documentclass{article}     \@ifclassloaded{combine}       {\let\@begindocumenthook\@empty         }       {}     \makeatother     \begin{document}     \title{Second article}     \author{Author of second article}     \maketitle     \section{Section of second article}     \blindtext[1]     \appendix     \section{Appendix for second article}     \blindtext[2]     \end{document}     \end{filecontents*}          % The main document     \begin{document}     \title{The collection}     \author{A. N. Editor}     \date{\today}     \maketitle          \chapter{First chapter}     \section{Introduction}     \ldots     \begin{papers}[]         \coltoctitle{First article}\label{coltitle}         \coltocauthor{Author of first article}         \import{inputDoc1a}     \end{papers}          \chapter{Second chapter}     \section{Introduction}     \ldots     \index{some dots}     \begin{papers}[]         \coltoctitle{Third article}         \coltocauthor{Author of third article}         \import{inputDoc2}     \end{papers}     \end{document}


title: Setcounter not working in appendix

text: I would like all my tables and figures in the Appendix to be prefaced by A and to reset the counter for tables and figures. I have searched this forum and have found examples to do this. However, when I follow the examples, it doesn't do as I would like. In particular, it does not reset the counter (i.e. it just continues after the last table in the text) AND it sets ALL tables and figures in the entire document to begin with "A", not just those in the appendix. Not sure if I have too many packages or need another. I would appreciate any help. Here is my MWE:               \documentclass[11pt]{article}     \usepackage{graphicx}     \usepackage{url}     \usepackage{morefloats}     \usepackage{setspace}     \usepackage{multirow}     \usepackage{longtable}     \usepackage{listings}     \usepackage{array}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{pdflscape}     \usepackage[flushleft]{threeparttable}     \usepackage{subcaption}     \usepackage[nomarkers,nolists]{endfloat}     \DeclareDelayedFloatFlavor{sidewaysfigure}{figure}     \DeclareDelayedFloatFlavor{sidewaystable}{table}               \begin{document}          \begin{table}[htbp]       \centering       \caption{Table 1}         \begin{tabular}{r}         \toprule         test \\         \bottomrule         \end{tabular}%     \end{table}                         \appendix          \setcounter{table}{0}     \setcounter{figure}{0}     \renewcommand*{\thetable}{A\arabic{table}}     \renewcommand*{\thefigure}{A\arabic{figure}}     \input{Appendix.tex}  %\file with the written appendix          \begin{table}[htbp]       \centering       \caption{Table 2}         \begin{tabular}{r}         \toprule         test \\         \bottomrule         \end{tabular}%     \end{table          \end{document}


title: Pgfplots - Labeling Regions

text: I'm trying to draw chart which indicates different regions of stability/instability in all the areas demarcated by the different curves. How can I manually put in Roman numerals or letters on different parts of the graph?               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{tkz-euclide}     \usetikzlibrary{intersections}     \usetikzlibrary{patterns}     \begin{document}     \begin{tikzpicture}     \begin{axis}[ticks=none,             xtick={-10,-9,...,10},                xmin=-2,             xmax=2,             xlabel={$\alpha$},             axis x line=middle,             ytick={-10,-9,...,10},             ymin=0,             ymax=10,             ylabel={$s$},             axis y line=middle,             no markers,             samples=100,             domain=-10:10,             restrict y to domain=-20:20,             width = 6in ]         \addplot[green,samples=400] (x,{-1/x});         \addplot[blue,samples=400, domain=-1:1] (x,{1/(1+2*x)});        \addplot[red,samples=400, domain=-1:1] (x,{-4*x/(1+x)^2}) node[pos=0.5, pin=-135:{$\frac{-4\alpha}{(1+\alpha^2)}$}] {};     %       \end{axis}         \draw[cyan] (axis cs:1,0) -- (axis cs: 1,10) node[pos=1, pin = -30: {\tiny $\alpha=1$}] {};         \draw[cyan] (axis cs:-1,0) -- (axis cs: -1,10) node[pos=1, pin = -120: {\tiny $\alpha=-1$}] {};         \draw [draw=black, fill=white, thin] (axis cs: -0.5, 8) circle (1.0pt);     \end{axis}      \end{tikzpicture}     \end{document}


title: Shorthand Adjustment

text: How to combine the two lists below into one list, sorted, with the elements of the first in italics. Also, what is the code to modify the blank space separating abbreviations and definitions? I am new to biblatex, using the report document class               \DeclareBibliographyDriver{shortjournal}{%     \printfield{journaltitle}}     \DeclareBibliographyDriver{shortseries}{%     \printfield{series}}          \printbiblist[title={List of Abbreviations}]{shortjournal}     \printbiblist[title={List of Abbreviations}]{shortseries}


title: Centering table header with \multicolumn and intercolumn space

text: A previous answer directs that, when using `\multicolumn` in a tabular, subsequent intercolumn space added in the tabular column spec should be repeated in the `\multicolumn` column spec. However, this does not always work for me:               \documentclass{article}          \begin{document}          \begin{tabular}{@{}lr@{~~}r@{~~}r@{\hspace{10pt}}r@{\hspace{10pt}}r@{}}     \hline     configuration & \multicolumn{1}{c@{~~}}{$M$}  & \multicolumn{1}{c@{~~}}{$w$} & \multicolumn{1}{c@{\hspace{10pt}}}{$x$} & \multicolumn{1}{c@{\hspace{10pt}}}{$y$} & \multicolumn{1}{c}{H} \\     base model  & 5 & \multicolumn{1}{c@{~~}}{$w$} & 00000 & $y$ & 00000 \\     \hline     \end{tabular}          \end{document}      ![Table with misaligned column header](http://i.stack.imgur.com/sicwm.png) Note that the _x_ is not quite centered. Any suggestions?


title: Making a probability tree using tikzpicture / forest

text: I want to create a probability tree using either `tikzpicture` or forest. I have experimented a little bit with both, but I'm running into some trouble with both of the programs. First, I have my code for `tikzpicture` that I want to create:               ![\begin{tikzpicture}\[grow=right, sloped\]     \node\[bag\] {(1, 1)}     child {         node\[bag\] {($\frac{1}{2}$, $\frac{1}{2}$)}                     child {                 node\[\] {($\frac{1}{4}$, $\frac{1}{4}$)}                 edge from parent                 node\[above\] {$T$}                 node\[below\]  {$\frac{1}{2}$}             }             child {                 node\[\] {(1, 1)}                 edge from parent                 node\[above\] {$H$}                 node\[below\]  {$\frac{1}{2}$}             }             edge from parent              node\[above\] {$T$}             node\[below\]  {$\frac{1}{2}$}     }     child {         node\[bag\] {(2, 2)}                 child {                 node\[\] {(1, 1)}                 edge from parent                 node\[above\] {$T$}                 node\[below\]  {$\frac{1}{2}$}             }             child {                 node\[\] {(4, 4)}                 edge from parent                 node\[above\] {$H$}                 node\[below\]  {$\frac{1}{2}$}             }         edge from parent                      node\[above\] {$H$}             node\[below\]  {$\frac{1}{2}$}     };     \end{tikzpicture}][1]      Next, I have my forest code:               \begin{forest}        for tree={grow=0,l=3cm,anchor=west,child anchor=west}         [{$(1, 1)$}           [{$(\frac{1}{2}, \frac{1}{2})$}             [{$(\frac{1}{4}, \frac{1}{4})$}]             [{$(1,1)$}]           ]           [{$(2, 2)$}             [{$(1,1)$}]             [{$(4,4)$}]           ]         ]     \end{forest}      I like the `tikzpicture` style and spacing very much, except I would love to be able to have labels along the bottom that say "$t=0$", "$t=1$", "$t=2$", etc. that are in a single horizontal line? Is there a way to do this in `tikzpicture`? I want the labels like in the answer to this question. Regarding the forest code, I think that the diagram is too condensed and squished together. Is there a way to make it more spread out, like the `tikzpicture`? Also, is there a method to create labels "$t=0$", "$t=1$", "$t=2$", etc. as above? ![](http://i.stack.imgur.com/6nkns.jpg) The above graph is my `tikzpicture` and the below is my forest.


title: pstool stopped working

text: In some figures I create for my thesis I want to replace the labels and such using the same font and size as in the rest of the thesis. A couple of month ago I already used psfrag and pstool (with pdflatex). But now I cannot get it working. I did not changed any files (using a version control system, so I'm pretty sure). The following mini example produces the same error as in my thesis:               \documentclass{article}      \usepackage{pstool}          \begin{document}        \begin{figure}          \centering       \psfragfig*{Inverses_Pendel}      \end{figure}     \end{document}      In the same directory are the files `Inverses_Pendel.eps` and `Inverses_Pendel.tex`. `Inverses_Pendel.tex` contains the following content:               \psfrag{T}[cc][cc]{$Test$}      And here is the error: > Package pstool Warning: Execution failed during process: ps2pdf > "-dAutoFilterColorImages=false" "-dAutoFilterGrayImages=false" "-dColo > rImageFilter=/FlateEncode" "-dGrayImageFilter=/FlateEncode" > "-dPDFSETTINGS=/pre press" "Inverses_Pendel-pstool.ps" "Inverses_Pendel.pdf" > This warning occurred on input line 7. > > ! Missing $ inserted. $ l.7 \end {figure} ? ! Emergency stop. $ l.7 \end > {figure} End of file on the terminal! It's such a generic error, I don't even know where to start searching. I'm using MikTeX 2.9. I'm passing the `-shell-escape` option.


title: How do you make \Rightarrow and \Leftarrow aligned parallel under \begin{proof}?

text: Here is what I'm trying to type.               \begin{proof}          \begin{enumerate}          \item[$\Rightarrow$] bla bla bla          \item[$\Leftarrow$] bla bla bla          \end{enumerate}          \end{proof}      But, if I try that, I can't get $\Rightarrow$ and $\Leftarrow$ parallel to make them look nice, if you know what you mean,,,;; (the $\Rightarrow$ is just on the right of the title "proof", while $\Leftarrow$ is not aligned vertically with $\Rightarrow$ since $\Leftarrow$ is aligned vertically with "proof"...) How, do I make them parallel to make them look nice?


title: Beamer text and image on the same slide

text: I am new to beamer and LaTex itself. Right now I want to make a simple slide with image on the right and text and sidebar (of Hannover theme) on the left. I cannot figure out how to do that. Any suggestions?


title: longtable caption formatting

text: I'm having some troubles with captions in longtable tables. I'm trying to typset for a thesis (so am using a class that I didn't write) and my school requires double spacing for body text but single spacing for caption text. To the best that I can determine via google, longtable formats its captions with the formatting specified in the class. I'm using some normal tables and some longtable tables, so the caption formatting is different between tables, which looks odd... I've found an answer to my almost exact question here but when I try to utilize the answer suggested there, I get an error saying that the "caption" package is not recommended for use and unsupported. That answer was published a few years ago so I'm not really sure what has changed since then. Anyways, any help would be much appreciated! I'm a pretty basic latex user so appreciate any examples that I can cut/paste/fiddle so I can learn. Thanks!


title: Appendix not numbered- minimal document

text: I'm trying to put appendices in my PhD thesis, and I'd expected them to be labelled A,B, etc. However, instead it's not producing a title for the appendix at all, and it's giving me sections to my final chapter marked .1, .2 etc. I've looked around this site, and seen lots of problems about poorly placed \backmatter etc. but I'm getting this problem even with the following minimal code:               \documentclass[a4paper,10pt]{book}     \begin{document}     \chapter{Introduction}     This is my testbed.     \appendix     \section{What's this?}     This is an appendix.     \end{document}      This is everything- I've not omitted any packages or anything. This produces a single page: > Chapter 1 > > Introduction > > This is my testbed. > > .1 What's this? > > This is an appendix. I'm using TeXShop 3.39 (the latest version).


title: Alignment of multiple variables in a linear system

text: I am trying to lay out a few linear equations, but with the different variables aligned in columns like this:               x + y       = 1  }   x = 0         y + 2z  = 1  }   y = 1     x     +  z  = 0  }   z = 0      (with a single big left } ) I have tried everything, but cannot accomplish this elegantly (without tables). Any ideas what I might try? Here is a picture of what I am trying to achieve: ![enter image description here](http://i.stack.imgur.com/yIAGE.jpg)


title: Center body and left margin in page

text: I'm using the `titlesec` package to put `section` titles to the left of their body, but I'd like for the entire page to appear centered. That is, I'd like for the space from the far left of the page to the beginning of the title equal the space from the end of the text body to the far right of the page. How can I accomplish this? Relevant WIP code:               \titleformat{\section}[leftmargin]{\raggedright\scshape}{}{0pt}{}     \titlespacing*{\section}{2.5cm}{*2.5}{0.5cm}     \titleformat{\subsection}{\bfseries}{}{0pt}{}     \titlespacing*{\subsection}{0pt}{*2}{*1}      Edit: As @cmhughes pointed out, I can manually adjust the margins with the `geometry` package to align the page properly. However, things like the title of the page look skewed, since they are centered with respect to the body. Is there any way I can center a different element with respect to the page?


title: Landscape, A3/A4 paper with XeTeX

text: With `pdflatex`, it seems easy to get a landscape document, on A3 paper. One only needs to add `[landscape,a3paper]` or `[landscape,a4paper]` to the document class options. With `xelatex`, however, these options do not seem to work. How can I get a landscape mode document, on A3 or A4 paper, with 2 cm margins and no page numbers, headers, or footers in XeTeX for all of the pages of a document?


title: CSVTools and Lines Every Fifth line

text: > **Possible Duplicate:**   >  Checking if a number is a multiple of 4 First, let me apologize for probably a dumb question. I'm trying to make a table, but I want to use CSVTools because, well mostly because its a lot of data and at a personal level I find intermixing all of this stuff kinda ugly. What I need to is create a long table where every fifth line has a horizontal line. I'm looking at examples 7 and 8 from this document: http://mirror.hmc.edu/ctan/macros/latex/contrib/csvtools/doc/csvtools.pdf I know the key to this is somehow modifying this line from example 8:               \ifthenelse{\isodd{\value{csvrownumber}}}{%     \\\rowcolor{green}}{\\\rowcolor{blue}}     }      But what I need (instead off odd) is a remainder term (ie `if(remainder(csvrownumber/5)==0){ line }).` Does such a thing exist, is there a better way? Thanks!


title: How to avoid text overlap when using `multirow` in `longtable`?

text: I have a two column table. The first column contains (for eg) name and designation and second column has lots of text. I want the name and designation to stay close but on separate lines. For this I enter them on separate rows. However when I use `multirow` on second column, the text from one row starts overlapping text from subsequent rows. How can I avoid text from different rows from overlapping? The following code show some things I have been trying. I was trying to get to the contents formatted as on second page (last 2-3 rows) but want to avoid the text overlap.               \documentclass[oneside]{memoir}          % \usepackage[cm]{fullpage}     % \usepackage{showframe}     % showframe does not show proper frame     \usepackage[margin=0.5in, showframe]{geometry}          \usepackage{lipsum}     \usepackage{longtable}     \usepackage{calc}     \usepackage{multirow}          \begin{document}          \newlength{\tablecolwidth}     \setlength{\tablecolwidth}{0.6\textwidth-2\tabcolsep}          \begin{longtable}{@{}lp{\tablecolwidth}@{}}         \caption{Contents}\\         \textbf{Col 1} & \textbf{Col 2} \\         \midrule[0.25ex]     \endfirsthead         \multicolumn{2}{c}{\tablename\ \thetable{}: continued}\\[1ex]         \textbf{Col 1} & \textbf{Col 2} \\         \midrule[0.25ex]     \endhead         \midrule         \multicolumn{2}{r}{Continued \ldots}\\     \endfoot         \bottomrule[0.25ex]     \endlastfoot          Name       & \lipsum[2] \\     Designation & \lipsum[1] \\     \midrule          % Contents overflow on right     Name       & \multirow{2}{*}{\lipsum[2]} \\     Designation \\                & \lipsum[1] \\     \midrule          % Contents of next row overlap subsequent rows and over flow page boundary     Name       & \multirow{2}{\tablecolwidth}{\lipsum[1-2]} \\     Designation \\                & \lipsum[1] \\     \midrule          % Another way of limiting column width but overlap remains     Name       & \multirow{2}{*}{\parbox{\tablecolwidth}{\lipsum[2]}} \\     Designation \\                & \lipsum[1] \\          \end{longtable}     \end{document}      Also when I use `fullpage` and `showframe`, I get incorrect frame. I was able to fix it using `geometry` package, but still wondering what the reason for the wrong frame is? Edit, I was able to get the right formatting this way,               Name       & \multirow{1}{*}{\parbox{\tablecolwidth}{\lipsum[2]}} \\     Designation \\ \\ \\ \\ \\ \\ \\                & \lipsum[1] \\      However I am still trying to find a better way to do this.


title: Float erroneous placement in two column document

text: First of all, I need to apologize to transcript the almost the whole document here. But without it I could not present what I wanted to show. If you compile the document, there is one table that goes to the last page, and stays in the middle of it. I know that if I change margins, font size, etc., I can avoid that to happen, but I would like to keep those settings. As such, I can I prevent the table to go to the middle of last page? I mean, can I place it at top of page as the other page? Moreover, I could also make table fit `\columnwidth`, however it does not work very well because I am using verbatims on it.               % arara: pdflatex     % arara: pdflatex     % arara: clean: { files: [ rules.aux, rules.log, rules.out ] }          %\documentclass[a4paper,twocolumn,10pt]{article}     %\documentclass[a4paper,twocolumn,10pt,DIV=15]{scrartcl}     %\documentclass[a4paper,twocolumn,10pt]{scrartcl}     \documentclass[paper=a4,twocolumn,10pt,DIV=calc]{scrartcl}          \setlength{\columnsep}{7.5mm}     %\usepackage[hmargin=15mm,columnsep=7.5mm]{geometry}     \usepackage{microtype}     \usepackage{type1ec}     \usepackage{enumitem}     %\setlist{noitemsep}     \usepackage{tabularx}     \usepackage{booktabs}     \usepackage{listings}     \lstset{%         language=[LaTeX]TeX,         basicstyle=\ttfamily,         breaklines=true,         columns=fullflexible,     }     \usepackage{caption}     \usepackage{floatrow}     \floatsetup[table]{capposition=top}     \floatplacement{figure}{ht}     \floatplacement{table}{ht}     \usepackage[colorlinks]{hyperref}     \usepackage{bookmark}     \usepackage{cleveref}     %\usepackage[obeyall,per=slash]{siunitx}[03/05/2012]     \usepackage[detect-all,per-mode=symbol]{siunitx}[03/05/2012]     \usepackage{relsize}          \renewcommand*{\verb}{\lstinline}     \newcommand{\unit}[2]{\mbox{\ensuremath{#1\,\mathrm{#2}}}}     \newcommand*{\TikZ}{\mbox{Ti\emph{k}Z}}     \newcommand*{\pkg}[1]{\texttt{#1}}     \newcommand*{\mail}[1]{\textsmaller{\textless\href{mailto:#1}{\texttt{#1}}\textgreater}}               \begin{document}          \title{Practical and Harmonization Rules for GTEL Book}     \author{Carlos F.~M.~e Silva\\ \mail{cfms@gtel.ufc.br}}     \date{\today}     \maketitle               \section{Introduction}          Since we are in the last kilometers for the book, which are also the most important ones, it seemed to me reasonable to write some set of \emph{rules} to follow for the book (and for the upcoming books). This will be probably unfinished document, since some rules only come when new situations arrive.          \noindent \textbf{Disclaimer}: These \emph{rules} are not strict. Many aspects are left out of the scope of this document. The author knows that others may have better ways to achieve the same (or even better) result. These also follow the \emph{Contributor's Guide v.2.0}.               \section{Use of em-dash, en-dash, an minus}          In \textsc{Wikipedia} a definition may be found for all kind of uses. The one may want to check out its uses in \url{http://en.wikipedia.org/wiki/Dash}. To be brief, see~\cref{tab:dash_use} for usage examples.          \begin{table*}     \centering     \begin{tabular}{lccl}     \toprule     Sign name & Input      & Looks like & Example of use \\     \midrule     em-dash   & \verb|---| & ---        & The BS---known in LTE as eNB---has its coverage\dots \\     en-dash   & \verb|--|  & --         & The range 1--10 is better to\dots \\     minus     & \verb|-|   & -          & Inter-interference, or in math $1-2=-1$ \\     \bottomrule     \end{tabular}     \caption{Different dash usages}     \label{tab:dash_use}     \end{table*}               \section{Reference chapters, sections, figures, tables, and algorithms}          In preamble, it may be defined some commands as the following, and then use them all over the document.          \begin{lstlisting}     % in preamble     \newcommand*{\ie}{i.e.}     \newcommand*{\eg}{e.g.}     \newcommand*{\ChapRef}[1]{Chapter~\ref{#1}}     \newcommand*{\SecRef}[1]{Section~\ref{#1}}     \newcommand*{\FigRef}[1]{Fig.~\ref{#1}}     \newcommand*{\TabRef}[1]{Table~\ref{#1}}     \newcommand*{\EqRef}[1]{Eq.~\ref{#1}}     \end{lstlisting}               \section{Font for drawings}          The indication from the book's editor is to use Arial font at 10pt. However, if the author wants to use sophisticated tools like: PGF\slash \TikZ, or generate plots via Gnuplot, or even use Inkscape (separating drawing from text) and include then later in the document, there is no easy way to use it in \LaTeX. My suggestion is to use Helvetica and scale it down.          \begin{lstlisting}     % in preamble     \documentclass[10pt]{svmult}     \usepackage[scaled=.8]{helvet}     \end{lstlisting}               \section{Algorithms}          Algorithms are included as figures. It more visual attractive to include a frame around the algorithm and put numbers in the lines.          \begin{lstlisting}     % in preamble     \usepackage{varwidth}     \usepackage{algorithmic}     \usepackage{etoolbox}     %\AtBeginEnvironment{algorithmic}{\normalsize}     \newsavebox{\mybox}     \newenvironment{algbox}     {%       \begin{lrbox}{\mybox}%       \begin{varwidth}[b]{\textwidth}%     }{%       \end{varwidth}%       \end{lrbox}%       \fbox{\usebox{\mybox}}%     }          % in document     \begin{figure}     \begin{algbox}     \begin{algorithm}[1]     ...     \end{algorithm}     \end{algbox}     \caption{...}     \label{...}     \end{figure}          \end{lstlisting}          The font in algorithms is scaled down to \verb|\small|, however if required to use the text font, the \pkg{etoolbox} provides an easy way to do it: \verb|\AtBeginEnvironment{algorithmic}{\normalsize}|, where now font will be at \verb|\normalsize| for all algorithms.               \section{Use of acronyms}          In technical documents, we often use lots of acronyms. There are some packages in \LaTeX that deal with them. The one that is often used is \pkg{acronym}.          \begin{lstlisting}     % in preamble     \usepackage[printonlyused]{acronym}     \renewcommand{\bflabel}[1]{#1\hfill}     \end{lstlisting}          Lists of acronyms are defined as usual.          \begin{lstlisting}     \begin{acronym}[3GPP ] % write the widest acronym inside '[]'       \acro{3GPP}{Third Generation Partnership Project}       \acro{BS}{Base Station}       \acro{D2D}{Device-to-Device}     \end{acronym}     \end{lstlisting}          Everyone is familiar with \verb|\ac|, \verb|\acs|, \verb|\acl|, and \verb|\acf| commands (there many are others, namely for plurals). However, some rules shall be considered.     %     \begin{itemize}         \item At chapter, section headings, and captions (figures, tables, and algorithms) use \verb|\acs| for short version and \verb|\acl| for long version, but not \verb|\ac|;         \item Keep the acronym list manually \textsc{sorted} (\pkg{acronym} cannot do it for us).     \end{itemize}               \section{Use of units}          The use of mathematical units in our documents is very frequent. The \emph{correct} way to display units is to guarantee that there is a thin space between the number and the unit, like \verb|\,|. The one may use \verb|\mbox{30\,m/s}|, or define a command for that \verb|\newcommand{\unit}[2]{\mbox{\ensuremath{#1\,\mathrm{#2}}}}|. However, the better way is to use the \pkg{siunitx} for that, see~\cref{tab:disp_units}.          \begin{lstlisting}     % in preamble     \usepackage[detect-all,per-mode=symbol]{siunitx}[03/05/2012] % TeXLive 2012, Ubuntu 12.04     \end{lstlisting}          \begin{table*}[b]     \centering     \begin{tabular}{llc}     \toprule     & Input & Looks like \\     \cmidrule{2-3}     Plain \LaTeX  & \verb|\mbox{30\,m/s}|              & \mbox{30\,m/s} \\     With command  & \verb|\unit{30}{m/s}|              & \unit{30}{m/s} \\      \pkg{siunitx} & \verb|\SI{30}{\meter\per\second}|  & \SI{30}{\meter\per\second} \\     \bottomrule     \end{tabular}     \caption{Display units}     \label{tab:disp_units}     \end{table*}               \section{Table widths}               \section{Miscellaneous}               \subsection{Labels for chapters, sections, figures, tables, and algorithms}          One of the real advantages of \LaTeX over other text processors is its capabilities to handle references. As suggestion, a label shall be defined for each      chapter, section, figure, table, and algorithm. Also, label shall be defined only after the main command is given: \verb|\chapter|, \verb|\section|, or \verb|caption|.          \begin{lstlisting}     \label{chp:chpname} % chapters     \label{sec:secname} % sections      \label{fig:figname} % figures     \label{tab:tabname} % tables     \label{alg:algname} % algorithms     ...     \end{lstlisting}          An example of usage for a table could be as follows.          \begin{lstlisting}     \begin{table}     ...     \caption{...}     \label{tab:table1}     \end{table}     \end{lstlisting}          \end{document}


title: xtable in pgfSweave (on lyx) : output=tex is invalid?

text: Many tutorials online say that to include a table in `Sweave` one should write something like this:               <<output=tex>>=     require(xtable)     stuff     xtable(stuff)     @      That makes sense. But when I do that in `LyX 2.1` on `Ubuntu 10.04` with `texlive-full 2011` installed (and `pgfSweave 2.10`), I get the following error:               invalid value for 'output' : tex


title: pgfplots error using matlab2tikz

text: I am trying to plot a matlab figure in latex file. so i use this matlab2tikz function. It works really well, until I try to add some customised text on the figure before converting it to tikz file, and when I try to build my latex file, it say error something like               Package pgfplots Error: the arguments of [mesh/rows=2,mesh/cols=0] assume 0 p      oints, but I got actually N = 1 points! The data matrix appears to be incomplete      The problem is gone when I remove the text from the matlab file. Can anyone help me? I can't provide the real data here since it's too long, but I can give you an example. Imagine I am plotting this               syms x     ezplot(sin(6*x))      Then, once it is plotted in the matlab, I go to `Insert>Text Box` and add some text on the figure. Then, I will run this code               matlab2tikz('test.tikz', 'height', '\figureheight', 'width', '\figurewidth')      However, when I put this code in latex               \begin{figure} [H]     \centering     \input{Chapter4/Figs/test.tikz}     \caption[Surface force calibration]{Surface force calibration with small loads (100g, 200g and 300g)}      \label{fig:irfan}      \end{figure}      it is saying the error.


title: How do I use the 'interfaces' package?

text: How do I use the `interfaces` package? I tried to use the command `\sectionformat` but it didn't work:               \documentclass[a4paper]{report}     \usepackage[utf8]{inputenc}     \usepackage{interfaces}     \sectionformat\section[hang]{       font=\bfseries\Large     }     \usepackage{lipsum}          \begin{document}          \section{Section One}     \lipsum[1-5]     \end{document}      And how to use `\changefont`.               \documentclass[a4paper]{report}     \usepackage[utf8]{inputenc}     \usepackage{interfaces}       \changefont{         shape=\itshape       }     \usepackage{lipsum}          \begin{document}          \lipsum[1-5]     \end{document}


title: Square roots not on same height

text: This part `C\frac{1}{\sqrt{G}}\sqrt{\rho}` doesn't seem to be on the same height as this part `\sqrt{b}\sqrt{l}` when compiled. What am I doing wrong?               \begin{flalign*}     T=C\frac{1}{\sqrt{G}}\sqrt{\rho}\sqrt{b}\sqrt{l} &&     \end{flalign*}


If you use a right square bracket at the end of an item label, then space is added before it. The problem occurs in all the standard list environments (`itemize`, `enumerate` and `description`). How can this be avoided? ![Right square bracket at the end of an item label adds space before it](http://i.stack.imgur.com/qNAZe.png)               \documentclass{article}          \begin{document}          \begin{enumerate}       \item[[Vpv]] For any\dots       \item[[V\(\lnot\)]] For any\dots     \end{enumerate}          \end{document}


title: Remove "chapter #" from the chapter title but keep chapter number in the table of contents

text: I am using `report` document class. I want to remove word "Chapter" and "chapter number" from chapter title, so when new chapter starts I will get only chapter title. I can do it using:               \renewcommand{\chaptername}{}     \renewcommand{\thechapter}{}      It looks ok, but it breaks the table of contents. I want numbered chapters on table of contents, e.g. >   1. Function name one > > > 1.1 Parameters > > 1.2 Returned value but the table of contents looks like this: > Function name one > > .1 Parameters > > .2 Returned value I know I can do it using the package `titlesec`, but is there a way to do it without it?


title: Including a djVu files with pgf/pdfpages package

text: Is it possible to manipulate `.djVu` files with `pgf` and/or `pdfpage` packages; and produce a `pdf`?


title: Indexing by text instead of numbers in bibiliography in texlipse

text: How to get bibiliography indexed, not by numbers, by some given letters?. I want to refer to the book by a pneumonic, so that in the output file I would get, for example [AB], instead of some number, for instance [3], automatically given by texlipse. Thanks.


title: Vertically centre the title in mdframed

text: I wonder how I can vertically centre the argument of `\Title` inside the frame in the following MWE.               \documentclass[12pt]{report}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage[framemethod=TikZ]{mdframed}     \mdfdefinestyle{MyFrame}{%         outerlinewidth=0pt,         roundcorner=10pt,         innerbottommargin=0.5\baselineskip,         innertopmargin=0.5\baselineskip,         font=\Huge,         backgroundcolor=blue}          \newcommand{\Title}[1]{     \begin{mdframed}[style=MyFrame, frametitle={\color{white}#1}, frametitlealignment=\center]     \end{mdframed}     }               \begin{document}          \Title{Title of the text}          \end{document}


title: TikZ: Bins in the histogram are not displayed correctly

text: I am trying to create a tikzpicture similar to what I have made in MATLAB. MATLAB gives me the following result after running histogram:               myhistnorm = [ 0.1231   0   0   0   0   0   0   0.0001  0.0001  0.0004  0.001   0.0048  0.0313  0.1562  0.3464  0.2684  0.0645  0.0036  0 ]      I have used the following bin:               mybin = [ 1e-15 1e-14 1e-13 1e-12 1e-11 1e-10 1e-9 1e-8 1e-7 1e-6 1e-5 1e-4 1e-3 1e-2 1e-1 1e+0 1e+1 1e+2 1e+3 ]      The image of the figure, which is created in MATLAB, can be found in the following figure: ![Non-normalized histogram created in MATLAB](http://i.stack.imgur.com/fYSL6.jpg) Although I created a normalized histogram using TikZ, it differs from the non- normalized figure that MATLAB has created in some other aspects.               \begin{tikzpicture}     \begin{axis}[         width=\figurewidth,         height=\figureheight,         axis on top,         scale only axis,         xmode=log,         ymode=log,         ybar interval,         x tick label as interval=false,         xlabel = {$\boldsymbol{\nabla}\cdot{\bf u}_{int}$},         xtick={},         xtickten={-16,-14,-12,...,4},         yticklabel={},         xmin=1e-16, xmax=1e+4,         ymax=1,         grid=none,         ymajorgrids,     ]     \addplot [fill=gray!50] table [x=Lower, y=Count] {     Lower Upper Count     9.9e-15 1e-14    0.1231     1e-14 1e-13      0.0000     1e-13 1e-12      0.0000     1e-12 1e-11      0.0000     1e-11 1e-10      0.0000     1e-10 1e-9       0.0000     1e-9  1e-8       0.0000     1e-8  1e-7       0.0001     1e-7  1e-6       0.0001     1e-6  1e-5       0.0004     1e-5  1e-4       0.0010     1e-4  1e-3       0.0048     1e-3  1e-2       0.0313     1e-2  1e-1       0.1562     1e-1  1e+0       0.3464     1e+0  1e+1       0.2684     1e+1  1e+2       0.0645     1e+2  1e+3       0.0036     1e+3  1e+10      0.0000     };     \end{axis}     \end{tikzpicture}          The result of compiling the above code is shown in the following figure ![Normalized histogram created by TikZ](http://i.stack.imgur.com/oiqGj.jpg) My question is that why the bin between 1e-14 to 1e-8 are displayed differently than what I have entered in the table in the code? They should be all zero and only the first bin should have 0.1231 counts. Also, the bin (1e+2)-(1e+3) is also missing in the figure. Thanks.


title: How can I create new commands in TikZ?

text: I am new to the use of TikZ. I have been evaluating the TikZ-KTikZ combination, over the last 2 days, as an alternative to Xfig, which I have used for 17 years. I have managed to create a grid structure using the following code:               \begin{tikzpicture}     \newcommand{\GL}{5};     \draw [step=0.1, help lines,red!20] (-\GL,-\GL) grid (\GL,\GL);     \draw [step=1.0, help lines,red!40] (-\GL,-\GL) grid (\GL,\GL);     \draw [step=\GL.0, help lines,red!100] (-\GL,-\GL) grid (\GL,\GL);     \foreach \x in {-\GL,...,\GL} { \draw node at (\x,-\GL) [label=below:{\tiny $\x.0$}]{}; };     \foreach \x in {-\GL,...,\GL} { \draw node at (\x,\GL) [label=above:{\tiny $\x.0$}] {}; };     \foreach \y in {-\GL,...,\GL} { \draw node at (-\GL,\y) [label=left:{\tiny $\y.0$}]  {}; };     \foreach \y in {-\GL,...,\GL} { \draw node at (\GL,\y) [label=right:{\tiny $\y.0$}]  {}; };     \end{tikzpicture}      I like using the grid structure because it enables me to place my picture elements in the {tikzpicture} environment quickly. However, I have to comment it out after drawing my picture. I would like to package the above code into a single flexible command which I can insert into the {tikzpicture} and comment out quickly when I am done. Could someone with a lot of experience in TikZ advise me on how I could package the above code into a single command which could accept optional parameters such as Xmin, Xmax, Ymin, Ymax and grid color, with default values. Any help would be greatly appreciated.


title: mdframed with calculated innertopmargin

text: I would like to define my own `mdframed` style where the `innertopmargin` and `innerbottommargin` are the same. First I tried to get zero margin:               \newmdenv[     hidealllines=true,     innertopmargin=0em,     innerbottommargin=0em,     innerrightmargin=1em,     innerleftmargin=1em,     skipabove=1em,     skipbelow=1em,     frametitlerule=true,     frametitleaboveskip=1em,     frametitlebelowskip=1em,     frametitlefont=\normalfont\bfseries,     nobreak=true     ]{mymdframedstyle}      I expected to see a frame where the distance between the content (which is an `align` environment) to the frame on top is the same (namely zero) as to the bottom. But it turns out the top distance is always `-\baselineskip`, means I have to use `innertopmargin=-\baselineskip` to get exactly zero distance. Now I like to have a nonzero distance of lets say 2em, I now have to calculate the correct distance `innertopmargin=-\baselineskip+2em` but this does not work. Can anyone tell me how do I do this correctly? EDIT: I could of course add a `\vspace{2em}` manually in `\SF` but is it possible to do it the other way? MWE:               \documentclass[11pt]{article}     \usepackage{amsmath}     \usepackage{mdframed}          \newmdenv[         backgroundcolor=blue,         hidealllines=true,         innertopmargin=0em,         innerbottommargin=0em,         innerrightmargin=1em,         innerleftmargin=1em,         skipabove=1em,         skipbelow=1em,         frametitlerule=true,         frametitleaboveskip=1em,         frametitlebelowskip=1em,         frametitlebackgroundcolor=red,         frametitlefont=\normalfont\bfseries,         nobreak=true     ]{mymdframedstyle}          \makeatletter     \newcommand{\SF}[2]{         \begin{mymdframedstyle}[frametitle=#2]             \@fleqnfalse             #1         \end{mymdframedstyle}     }     \makeatother          \begin{document}          \SF{     \begin{align}     E     \end{align}     }{Wannier equation}          \end{document}


title: Color for one entry of the bibliography

text: How to add color to one entry of the bibliography ? I'm using BibTex. In my .bib file the following doesn't produce red :               {\color{red}     @article{FFT,         author = "FFT"     }     }


title: How do I prevent text after inserting a greek letter from being italicized?

text: I'm new to LaTeX, and I'm trying to write some relational algebra with it. When I put a `\sigma` or `\pi` into the code, all the text that comes after it becomes italicized. Here's a quick example:               \documentclass[11pt]{article}     \begin{document}          \sigma \ hello world          \end{document}      This produces: _σ Hello World_ What would be the correct way to get the "Hello World" to not be italicized?


title: Are packages siunitx and xfrac incompatible? - "redefsymbols"

text: Is this a bug? Where can this be reported? Can someone of you report this? Code:               \documentclass{article}     \usepackage{siunitx}     \usepackage{xfrac}          \begin{document}     bla     \end{document}      Output:               redefsymbols     bla      However, with this code:               \documentclass{article}     \usepackage{xfrac}     \usepackage{siunitx}          \begin{document}     bla     \end{document}      Output:               bla      Thanks! (Also, if you can reproduce this behavior can you please leave a comment?)


title: Help with multirow

text: I'm trying to get my table correctly displayed but I don't know why it's not working: ![enter image description here](http://i.stack.imgur.com/IakNS.png) Can someone please help me? Here is the code of the picture:                   \documentclass[a4paper,12pt,twoside]{book}     \usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}     \usepackage[utf8x]{inputenc}     \usepackage[spanish, es-tabla, es-noshorthands, es-nosectiondot]{babel}     \usepackage{multirow}% http://ctan.org/pkg/multirow     \usepackage{hhline}% http://ctan.org/pkg/hhline     \begin{document}     \begin{table}[ph]       \centering       \begin{tabular}{|c|c|c|c|}         \hline         \multicolumn{4}{ |c| }{Blah} \\         \hline     \multirow{1}{*}{C1F1} &  C2F1 & C3F1 & C4F1\\ \hline     \multirow{2}{*}{C1F2} & C2F2 \\& C2F2 &\multirow{2}{*}{C3F2} & \multirow{2}{*}{C4F2}\\ \hline     \multirow{1}{*}{C1F3} & C2F3 & C3F3 & C4F3 \\ \hline     \multirow{2}{*}{C1F4} & C2F4 \\& C2F4 &\multirow{2}{*}{C3F4}  & \multirow{2}{*}{C4F4}\\ \hline       \end{tabular}       \caption{blablabla}       \label{blabla}     \end{table}     \end{document}


title: Syntax Coloring in LaTeX

text: Is there any way to include Python code in a LaTeX file and automatically color its syntax? Is it possible to do syntax coloring with any other language? If yes what packages can I use to do that?


title: How to format a large text containing special Characters and breaklines?

text: I have this rather long text which is the output of a several console inputs. I'd like to have the text as it is as of right now. Here a link to the raw text since I didn't want to include it in this post: http://pastebin.com/9SZaw1ZP I tried replacing the special characters with the correspondending escape characters. But it still causes a lot of issues. I am fairly new to LaTeX too.


title: Displaying Linux commands in LaTeX

text: > **Possible Duplicate:**   >  Syntax Coloring in LaTeX   >  Unix Command Highlighting latex I am after some advice on how to display Linux terminal commands into LaTeX, so that they are indented and look different from normal text. I have tried to insert the following into LaTeX                 $\emph {wget http://etc...................}      this outputs the wget onto a single line and then the part starting http onto another line. I want it all to appear on one line. Can someone body please give me some advice.


title: How best to include programming source code in LaTeX documents?

text: > **Possible Duplicate:**   >  Syntax Coloring in LaTeX I'm relatively new to LaTeX, and am starting to use it for academic paper writing. I'm doing a lot of computer programming as part of my academic work, so need to be able to include code extracts easily. I know I can easily make them appear in a monospaced font, but what would you suggest for getting automatic syntax highlighting?


title: Unix Command Highlighting latex

text: Is there any what I can easily show commands in latex? I am currently using:               \indent\indent\footnotesize{\# apt-get --purge remove rubygems} \\      But this isn't showing a very good disctintion between commands and text. What else could I do to show it a little more.


title: Alternative way to print source code

text: > **Possible Duplicate:**   >  Syntax Coloring in LaTeX I want to add source code of my program in document but verbatim really bugs me. All that ugly fonts and stuff.


title: Package for displaying source code

text: > **Possible Duplicate:**   >  How best to include programming source code in LaTeX documents? What is a good way to display program source like c++/lisp code in a latex document?


title: What is the simpliest way to make a documentation from code

text: > **Possible Duplicate:**   >  How best to include programming source code in LaTeX documents? suppose a file with code (*.cpp, *.php, or whatever). There's a lot of symbols like '$', '{', '}' what will definetely be disliked by TeX. I want to make a documentation from a code file. Maybe you heard of some templates for working with code? Thank you in advance!


title: IEEEtran not showing book title for @inbook or @incollection entry

text: For some reason my bibliography is not showing the title of the book for my INBOOK entry. I am trying to use `crossref` to cross reference the book, but the bibliography only shows the chapter title. I've also tried using title for the chapter title and booktitle for the book's title, but not no avail. The referenced book entry is also after the inbook entry (an apparent requirement) This is my bibtex source:               @INBOOK{sweetser04,       pages = {627-637},       title = {How to Build Evolutionary Algorithms for Games},       author = {Sweetser, Penny},       crossref = {aigpw2}     }          @BOOK{aigpw2,       title = {AI Game Programming Wisdom 2},       publisher = {Charles River Media},       year = {2004},       editor = {Rabin, Steve},       address = {Hingham, Massachusetts},       edition = {1}     }      The cross reference seems to work but `inbook` is missing the book title and editor: > Sweetser, Penny, _How to Build Evolutionary Algorithms for Games_ , 1st ed. > Hingham, Massachusetts: Charles River Media, 2004, pp. 627-637. and `incollection` is missing the edition and book title: > Sweetser, Penny, "How to Build Evolutionary Algorithms for Games", S.Rabin, > Ed. Hing- ham, Massachusetts: Charles River Media, 2004, pp. 627-637. I was expecting: > Sweetser, Penny, "How to Build Evolutionary Algorithms for Games" in _AI > Game Programming Wisdom 2_ , 1st ed. Hingham, Massachusetts: Charles River > Media, 2004, pp. 627-637. Has anyone else run into this issue using IEEEtran? I am using BibTex v0.99d with pdfTeX v3.1415926-2.4-1.40.13 (MikTex 2.9 64bit) with the newest IEEEtran.bst from http://www.ctan.org/tex- archive/macros/latex/contrib/IEEEtran/bibtex/


title: pgfplots: Changing horizontal spacing in the legend

text: I'm drawing a simple scatter plot with pgfplots, which also includes a legend as shown in the upper part of the picture next. ![enter image description here](http://i.stack.imgur.com/273je.png) However, I find the horizontal spacing odd because the distance between the symbol and the corresponding description is the same as to the next description. I would like to have it like "faked" in the lower part of the picture. A simple example is produced by the following code. Here, the descriptions are _a,b,c,d_.               \documentclass{scrartcl}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}         \begin{axis}[legend columns=-1, legend pos=outer north east]             \addplot+ coordinates {(0,0) (0,1)};             \addplot+ coordinates {(1,0) (0,0)};             \addplot+ coordinates {(0,0) (1,1)};             \addplot+ coordinates {(1,1) (0,0)};             \legend{a,b,c,d};         \end{axis}     \end{tikzpicture}          \end{document}      If I understand the manual correctly, the legend is composed of a matrix. However, I could not figure out how to change the spacing accordingly. Your help is much appreciated ;)


title: Floating a sidebar into the margin with ConTeXt

text: I would like to use `\framedtext` to create a grey sidebar that floats to the right of the text. While I've discovered framedtext, I haven't figured out how to place it such that it floats with text wrapping and without a caption. I suspect that some theme on placeframedtext will be necessary. Here's what I have so far:               \setupframedtexts[bodyfont=small, location=right hanging, width=3 cm]          \framedtext{     In this section, the steps towards creating a \SDFN\ will be described in the main text, while specific examples from my experience will be revealed in sidebars like this one. These will be reflective on the lessons I learned while creating the \SDFN\ in contract with the prescriptive tone of the main text. }      I suspect my arguments to location are lacking. Edit: There's a suggestion that flowing places is possible from "starthangingaround" but it's an undocumented feature...


title: Make every other page a float page (or empty)

text: I would like to be able to make every other page in a double-sided document be a float page or empty (apart from header w/page number). Ideally this would be the verso page and all floats (unless there are too many, of course) of the facing recto page would be there. If this works, what is the best way to make the margin of these pages smaller? (This is for course notes: the empty pages can be used by students for their own notes.)


title: Reverse a glyph?

text: > **Possible Duplicate:**   >  Rotating a letter Given any printable glyph, is there some way to reverse it along the vertical (or any other) axis? So that, for instance, a sans-serif **d** would appear something like a **b**? (But for more complex glyphs than that.)


title: Centering a gnuplot figure properly

text: I use gnuplot and its `epslatex` terminal. When I include a gnuplot-generated figure in my document and center it as usual, it often appears shifted right — because the labels on the left contribute to the LaTeX-calculated figure width:               \documentclass[12pt]{article}          \usepackage{lipsum}     \usepackage{graphicx}          \begin{document}          \lipsum[1]          \begin{figure}       \caption{I am visually shifted right!}       \centering       \input{myplot}            % Plot source:       %        % set terminal epslatex color       % set output 'myplot.tex'       % set format '$%g$'       % set ylabel 'A label'       % plot 100000 * sin(x) title '$100000 \sin x$'       %      \end{figure}          \end{document}      The result: ![Result](http://i.stack.imgur.com/Vcaxg.png) The question is: how does one _properly_ align such a plot, so that the center of the plot matches the center of the page horizontally? (Inserting a matching negative horizontal space manually doesn't count. `(-:`)


title: Visual Equation Editor to LaTeX Code

text: I'm looking for a Windows based visual equation editor which produces LaTeX code. I need the functionality like in those online equation editors such as the LaTeX Equation Editor site It should be an open source/freeware software (Portable installation preferred).


title: ConTeXt: Change the default text colour for entire document

text: # Background I am looking to change the text colour for a document from black to a different dark colour. # Problem The documentation shows how to change individual colours for a text document, but does not show how to change the base black colour. This includes body text, page numbers, footnotes, headings, table of contents, indices, bibliographies, and so forth. However, changing the base text colour should not preclude overriding the text colour later on (e.g., to change the heading colour). I would like to override _every_ aspect that uses the default black without having to _know_ or _program_ each aspect individually. # Code The following fails to set the footnote colour and the table border colour -- and there might be other aspects that use the default black that I don't know about:               \setupcolors[textcolor=red]     \setupinmargin[color=red]           \starttext     \completecontent          \section{A test}     \inmargin{a test}          \placetable{Caption}     {\bTABLE     \bTR \bTD One \eTD \bTD two \eTD \eTR     \bTR \bTD One \eTD \bTD two \eTD \eTR     \eTABLE}          \input tufte          \section{Another test}     \index{test}Test footnotes\footnote[f]{A footnote test.} and \seeindex{test}{index}indexes.          \page     \placeindex          \stoptext      # Question How do you change the default base black colour throughout the entire document, without having to configure all aspects individually? # Note ConTeXt should use a single colour that all text inherits. It should then be possible to change that single instance to ensure the new base colour is applied consistently throughout the document. # Related   * https://www.mail-archive.com/ntg-context@ntg.nl/msg71123.html   * http://wiki.contextgarden.net/Color


title: Artifacts in TikZ picture when using scale option

text: When compiling the example code below with pdflatex Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX), I observe an artifact (horizontal line starting from the start point of the objects) in the scaled- down version of the tikzpicture. Any help on how to fix this would be appreciated.               \documentclass{article}     \usepackage{tikz}          \begin{document}            \def\myFig{           +(0,0) to [out=90,in=270]  +(0,1)                  to [out=90,in=270]  +(1,3)                  to [out=90,in=270]  +(-0.3,1)                  to [out=90,in=180]  +(1,1)                  to [out=0,in=90]    +(1,-1)                  to [out=270,in=90]  +(-0.3,-1)                  to [out=270,in=90]  +(1,-3)                  to [out=270,in=90]  +(0,-1)                  to [out=270,in=0]   +(-0.3,-0.3)                  to [out=180,in=0]   +(-2.8,0)                  to [out=180,in=270] +(-0.3,0.3)                  -- cycle;       }             scale=1: figure looks ok            \begin{tikzpicture}[scale=1]         \draw[step=1,lightgray] (-5,0) grid (5,10);         \draw[gray,thick,fill=gray!10] (-4.2,2.5) \myFig;         \draw[thick,fill=gray!40,rotate=-18] (0.7,1.1) \myFig;       \end{tikzpicture}            \vspace{1cm}       scale smaller than 1:  figure contains additional lines            \begin{tikzpicture}[scale=0.4]         \draw[step=1,lightgray] (-5,0) grid (5,10);         \draw[gray,thick,fill=gray!10] (-4.2,2.5) \myFig;         \draw[thick,fill=gray!40,rotate=-18] (0.7,1.1) \myFig;       \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Lq1BP.jpg)


title: How to draw just the arrow tip in TikZ

text: How can one draw "just the arrow tip" from one of the arrows in the arrow tip library in TikZ? The problem is that if you try a brute-force solution, eg.               \tikz \draw[-triangle 90] (0,0) -- +(.1,0);      you run into trouble because this produces a small line, the (0,0) to (.1, 0) part, which cannot be removed (a remnant remains no matter if you change .1 to .00001). This is a problem when one wants to rotate the arrow for use in "dropping arrow tips" along a path, as in Andrew Stacey's solution from this question.


title: Loop conditions in multiple lines using algorithmic package

text: I am working on a paper in double-column format, and I am using the `algorithmic` package to typeset my algorithms. One of my while loops' condition is a bit long hence doesn't fit into the column. When I try to split the condition into several lines, it is not properly indented, as in `\WHILE{this is the first line which barely fits into the column \\\ this is the second line`}. I have also tried the following:               \WHILE{this is the first line which barely fits into the column \\       \hskip\algorithmicindent this is the second line}      However, it indents the second line of the condition only as much as the body of the `WHILE`, it needs to be aligned with the first line of the loop condition. How can I achieve this? MWE is as follows:               \documentclass[twocolumn]{article}          \usepackage{algorithmic}          \begin{document}          \begin{algorithmic}       \WHILE{There is an element which satisfies \\              \hskip\algorithmicindent properties which are long}         \STATE{while-body}       \ENDWHILE     \end{algorithmic}          \end{document}


title: The spacing of `\to`

text: Let's say I use `\def\searrow{\mathbin{\text{\rotatebox[origin=c]{-33}{$\to$}}}}` instead of the `\searrow`. But `\mathbin` doesn't seem to provide the spacing that `\to` has; what should it be? Other suggestions are welcome.


title: Set global options for \inputminted

text: I am using the `minted` package to highlight source code. How can I set the options parameter globally for `\inputminted`? I want to do this because I have a lot of php code files that I will include in my document and I do not want to lose time to specify the options each time. I have tried to define the default values for mint with the command:               \newmint{php}{      %options      }      and after that tried:               ....     \inputminted{php}{foo.php}     ....      and after compile the settings that I have done with `\newmint` are ignored. Is there a way to solve this problem? L.E: This is what i got until now:               \documentclass[a4paper,12pt,fleqn,twoside,openright]{article}     %php syntax highlight     \userpackage[chapter]{minted}     \definecolor{mintedbackground}{rgb}{0.95,0.95,0.95}     \newmint{php}{     bgcolor=mintedbackground,     fontfamily=tt,     linenos=true,     numberblanklines=true,     numbersep=12pt,     numbersep=5pt,     gobble=0,     frame=leftline,     framerule=0.4pt,     framesep=2mm,     funcnamehighlighting=true,     tabsize=4,     obeytabs=false,     mathescape=false     samepage=false, %with this setting you can force the list to appear on the same page     showspaces=false,     showtabs =false,     texcl=false,     }          \begin{document}          \inputmined{php}{foo.php}     \end{document}     % The settings for php are ignored.      L.E: I have found in the documentation of minted that i can use `\newmintedfile` Finally, define a new language-specific alias for `\inputminted`. The problem is that I do not understand from the example in doc how can I define the global settings.


title: Macro sequence generalization (with bashful)

text: I'm trying to take a script-based approach to my standing question Automatic calculation of error in pgfplots, and I have something of a workable solution. Using Python, I transform a given dataset and 'digest' it to something that is meaningful to my friend's field. If you're interesting in the script, it is reproduced below. I'm able to acceptably simplify its use within LaTeX using a series of commands that, ideally, I'd like to turn into a macro itself using `\newcommand` or similar macro. Unfortunately, I'm getting errors that I can neither explain nor solve. I'm using packages `tikz`,`pgfplots`, and `bashful`. `bashful` is the one giving me problems. **`error.py`** (works perfectly)               def sqrt(n):         return n**.5          def avg(nums):         return sum(nums)/len(nums)          def stddev(nums):         s = sum(nums)         a = avg(nums)         s2 = sum([(n - a)**2 for n in nums])         return sqrt(s2/len(nums))          def stderr(nums):         return stddev(nums)/sqrt(len(nums))          lines = list()          import sys          with open(sys.argv[1],'r') as f:         lines = f.readlines()          data = list()          for i in range(len(lines)):         if lines[i][0].isdigit():             toks = lines[i].split()             data.append(map(int,toks))          data = [(data[0][i], [l[i] for l in data[1:]]) \                 for i in range(len(data[0]))]     for (val, nums) in data:         print val, avg(map(float,nums)), stderr(map(float,nums))      **Manual commands**               \bash[stdoutFile=plots/mydata.table.digest]     python error.py plots/mydata.table     \END          \newsavebox{\myplot}     \savebox{\myplot}{%       \begin{tikzpicture}         \begin{axis}[grid=major]           \addplot+[smooth,                     error bars/.cd,                     y dir=both,                     y explicit]           table[x index=0,                 y index=1,                 y error index=2]           {plots/mydata.table.digest};         \end{axis}       \end{tikzpicture}     }          \newcommand{\plotmyplot}{\usebox{\myplot}}          \begin{document}     stuff2 \plotmyplot     \end{document}      **Attempt at generalization**               \newcommand{\prepareplot}[2]{     \bash[stdoutFile=#2.digest]     python error.py #2     \END            \expandafter\newsavebox\csname #1\endcsname       \expandafter\savebox\csname #1\endcsname{%         \begin{tikzpicture}           \begin{axis}[grid=major]             \addplot+[smooth,                       error bars/.cd,                       y dir=both,                       y explicit]             table[x index=0,                   y index=1,                   y error index=2]             {#2.digest};           \end{axis}         \end{tikzpicture}}       \expandafter\newcommand\csname plot#1\endcsname\expandafter\usebox\csname #1\endcsname}      **Error**               ! Use of \bashIII doesn't match its definition.     \prepareplot #1#2-> \bash [stdoutFile=#2.digest]                                                       python error.py #2 \END \pa...     l.27 \prepareplot{myplotB}{plots/mydata.table}          ?      ! Emergency stop.     \prepareplot #1#2-> \bash [stdoutFile=#2.digest]                                                       python error.py #2 \END \pa...     l.27 \prepareplot{myplotB}{plots/mydata.table}          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on plots.log.      Full MWE (requires python 2.7 and `error.py`)               \documentclass{article}     \usepackage{pgfplots,tikz,bashful}          \newcommand{\prepareplot}[2]{     \bash[stdoutFile=#2.digest]     python error.py #2 | \preparedplotname.digest     \END            \expandafter\newsavebox\csname #1\endcsname       \expandafter\savebox\csname #1\endcsname{%         \begin{tikzpicture}           \begin{axis}[grid=major]             \addplot+[smooth,                       error bars/.cd,                       y dir=both,                       y explicit]             table[x index=0,                   y index=1,                   y error index=2]             {#2.digest};           \end{axis}         \end{tikzpicture}}       \expandafter\newcommand\csname plot#1\endcsname\expandafter\usebox\csname #1\endcsname}          \pgfplotsset{compat=1.7}          \prepareplot{myplotB}{plots/mydata.table}          \bash[stdoutFile=plots/mydata.table.digest]     python error.py plots/mydata.table     \END          \newsavebox{\myplot}     \savebox{\myplot}{%       \begin{tikzpicture}         \begin{axis}[grid=major]           \addplot+[smooth,                     error bars/.cd,                     y dir=both,                     y explicit]           table[x index=0,                 y index=1,                 y error index=2]           {plots/mydata.table.digest};         \end{axis}       \end{tikzpicture}     }          \newcommand{\plotmyplot}{\usebox{\myplot}}          \begin{document}     stuff2 \plotmyplotB     \end{document}


title: What does <++> signify when using Vim LatexSuite?

text: I have a LaTeX editing environment that does some assistive stuff such as auto-indenting, closing parentheses, etc. However, one of the things that it does is unknown to me, and is difficult to search for. If I type an empty set of braces, it replaces them with               {}<++>      If I type two empty sets, for example when I'm setting up a fraction `\frac{}{}` what I actually get is               \frac\left\{ } \right\}<++>}<++>      Is this a problem? What does `<++>` do? Edit: This is using Vim-LaTex / LaTeX-Suite


title: What are the <++> in Vim latex-suite after typing in a bracket pair?

text: > **Possible Duplicate:**   >  What does <++> signify? In typing bracket pairs while coding, I usually type the opening and closing bracket before typing in the contents like so: `\documentclass{}` `←` `article` In Vim latex-suite, whenever I type in a matching pair, `<++>` shows up automatically. Picking up from the previous example, I'd get the following `\documentclass{}<++>` What are the `<++>` for? They also show up when I use `()`, `{}`, and `[]`.


title: Why does '<++>' appear every time I use vim-latex suite?

text: > **Possible Duplicate:**   >  What does <++> signify? e.g. Using TeX-Environments to insert an enumerate will cause a strange symbol '<++>' at the end of `\end{enumerate}`. Anyone knows why and what's the meaning of this.? ![enter image description here](http://i.stack.imgur.com/6NBWn.png)


title: Problem with defining shortcuts for TikZ matrices.

text: For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a `tikzpicture`. As a minimal example, consider               \newcommand\mymatrix[1]{         \begin{tikzpicture}             \matrix[matrix of math nodes] {#1};         \end{tikzpicture}%     }      which would then be used as               \mymatrix{         a & b \\         e & f \\     }      But LaTeX complains about `Package pgfbasematrix Error: Single ampersand used with wrong catcode` at the line with the closing brace of `\amatrix{}`. Why does it do that and how can I avoid it?


title: How to use tikz matrix in a LaTeX command?

text: > **Possible Duplicate:**   >  Problem with defining shortcuts for TikZ matrices. I tried to use a tikz Matrix in a LaTeX document as the following:               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}         \matrix{         \node{a}; & \node{b}; \\         \node{c}; & \node{d}; \\         };     \end{tikzpicture}     \end{document}      Everything is ok. But when I tried to use it in a LaTeX command as the following:               \documentclass{article}     \usepackage{tikz}          \newcommand{\Foo}{     \begin{tikzpicture}         \matrix{         \node{a}; & \node{b}; \\         \node{c}; & \node{d}; \\         };     \end{tikzpicture}     }          \begin{document}     \Foo     \end{document}      It will report the following error:               !Package pgfbasematrix Error: Single ampersand used with wrong catcode.      Does anyone know how to solve this? thanks.


title: Error using Tikz matrix inside of subfloat

text: > **Possible Duplicate:**   >  Problem with defining shortcuts for TikZ matrices. I'm getting a the following error using subfloat and tikz matrix together: ERROR: Package pgfbasematrix Error: Single ampersand used with wrong catcode. Commenting out the subfloat lines results in no errors. Thanks in advance for any suggestions.               \documentclass{article}     %% For drawing     \usepackage{tikz}     \usetikzlibrary{arrows,positioning}          %% For subfloat     \usepackage{subfig}          %% Drawing     \def\linkaba{stealth'-stealth'}     \def\linkab{-stealth'}     \def\linkba{stealth'-}     \newcommand{\directedtriangle}[4]{       \node (A) at (0,0) [nd] {}; % Lower Left       \node (B) at +(1,0) [nd] {}; % Lower Right       \node (C) at +(0.5,0.75) [nd] {}; % Top       \draw[#1] (A)--(B);       \draw[#2] (A)--(C);       \draw[#3] (B)--(C);       \node [below] at +(0.5,-0.1) {\footnotesize (#4)};     }     \newcommand{\directedwedge}[3]{       \node (A) at (0,0) [nd] {}; % Lower Left       \node (B) at +(1,0) [nd] {}; % Lower Right       \node (C) at +(0.5,0.75) [nd] {}; % Top       \draw[#1] (A)--(C);       \draw[#2] (B)--(C);       \node [below] at +(0.5,-0.1) {\footnotesize (#3)};     }               \begin{document}     \begin{figure}[t]     \subfloat[Wedges]{       \begin{tikzpicture}[nd/.style={circle,draw,fill=black!50,inner sep=2pt}]             \matrix[column sep=0.4cm, row sep=0cm]         {           \directedwedge{\linkba}{\linkba}{i} &           \directedwedge{\linkab}{\linkba}{ii} &           \directedwedge{\linkab}{\linkab}{iii} \\           \directedwedge{\linkaba}{\linkab}{iv} &           \directedwedge{\linkaba}{\linkba}{v} &           \directedwedge{\linkaba}{\linkaba}{vi} \\         };       \end{tikzpicture}}          \subfloat[Triangles]{       \begin{tikzpicture}[nd/.style={circle,draw,fill=black!50,inner sep=2pt}]             \matrix[column sep=0.4cm, row sep=0cm]         {           \directedtriangle{\linkab}{\linkba}{\linkba}{a} &           \directedtriangle{\linkab}{\linkba}{\linkab}{b} &           \directedtriangle{\linkaba}{\linkba}{\linkba}{c} &           \directedtriangle{\linkaba}{\linkab}{\linkba}{d} \\           \directedtriangle{\linkaba}{\linkab}{\linkab}{e} &           \directedtriangle{\linkaba}{\linkaba}{\linkba}{f} &           \directedtriangle{\linkaba}{\linkaba}{\linkaba}{g}\\         };       \end{tikzpicture}}       \vspace{-0.5cm}       \caption{All different directed wedges and triangles}       \label{fig:dwedge}     \end{figure}               \end{document}


title: How to vertically align two pgfplots in subfigures?

text: I want to have two subfigures in a figure. Each subfigure contains a simple pgfplot. Here is what I have:               \documentclass[12pt]{article}          \usepackage{subcaption}     \usepackage{pgfplots}          \begin{document}          \begin{figure}         \begin{subfigure}[a]{0.48\textwidth}             \begin{tikzpicture}[scale=0.6, baseline]                 \begin{axis}[ybar]                        \addplot+ coordinates {                          (1,2)                     };                   \end{axis}             \end{tikzpicture}         \end{subfigure}         \begin{subfigure}[b]{0.48\textwidth}             \begin{tikzpicture}[scale=0.6, baseline]                 \begin{axis}[ybar]                        \addplot+ coordinates {                          (1,2)                     };                   \end{axis}             \end{tikzpicture}         \end{subfigure}     \end{figure}          \end{document}      The problem is that the second image is higher than the first one... I want to have both images at the same height. Is there a way to do that ?


title: Position two stacked tikz matrices

text: I would like to take two `TikZ` `matrix`, possibly of different dimensions and stack them. My demo code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix}     \begin{document}     \begin{tikzpicture}     \matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]     {     0   & 6 \\     };     \matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]     {     1   & 3 \\     };     \end{tikzpicture}     \end{document}      There should be some space between the matrices and they should be aligned. I've tried to use `below of` but it doesn't seem to work... ![enter image description here](http://i.stack.imgur.com/SqsjC.png)


title: Change the contents of footline in a beamer presentation

text: For my presentation, I am using Madrid theme; however, I'd like to change the contents of the footline. Currently, the footline shows, "short author" in the left, "short title" in the middle, and "date and framenumber/total number of frames" in the right side. I need to change these contents as follows: Left side: Section name Center: Subsection Right: The same which is Date and frame number/total number of frames I really appreciate if someone help me.


title: Change bibtex in-text citation reference

text: I'm using this bst file which provides the unified style sheet for linguistics style as my bibliography style for my term paper http://comments.gmane.org/gmane.comp.tex.linguistics/1047 but it's citation reference in the text which links to the full source in the bibliography does not fulfill the requirements set by the department. When I use, for example, `\cite[p.194]{Biber.1999}` it shows as `(Biber, 1999, p.194)`. I would like to change it to this `(Biber 1999: 194)`. Edit: Tried to do a minimal example as requested:               \begin{document}     \begin{titlepage}             % setup for my title page           \end{titlepage}          % Table of Contents     \tableofcontents \thispagestyle{empty} \setcounter{page}{2}     %           % List of Tables/Figures     \listoffigures     \begingroup     \let\clearpage\relax     \listoftables     \endgroup     \addcontentsline{toc}{section}{List of Figures / Tables}     %           %some more sections here     \newpage \section{textbody}       ....  \cite[p.194]{Biber.1999} ...     \newpage \section{Biblography}     \bibliography{bibly}          %some more sections here          \bibliographystyle{unified}               \end{document}


title: tikz and polar plot

text: I am completely lost with this problem : I want to plot some polar curve. Here is something that works :               \begin{center}       \begin{tikzpicture}[xscale=1,yscale=1]       \draw[thick,->,>=latex] (-2,0)--(2.5,0) node[above] {$x$};       \draw[thick,->,>=latex] (0,-2)--(0,2) node[left] {$y$};       \draw[domain=0:540,scale=1.5,samples=500] plot (\x:{cos(\x/3)*cos(\x/3)*cos(\x/3)});       \end{tikzpicture}       \end{center}      But if I do almost the same, namely :               \begin{center}       \begin{tikzpicture}[xscale=1,yscale=1]       \draw[thick,->,>=latex] (-2,0)--(2.5,0) node[above] {$x$};       \draw[thick,->,>=latex] (0,-2)--(0,2) node[left] {$y$};       \draw[domain=0:3*pi,scale=1.5,samples=500] plot (\x:{cos(\x/3 r)*cos(\x/3 r)*cos(\x/3 r)});       \end{tikzpicture}       \end{center}      or even :               \begin{center}       \begin{tikzpicture}[xscale=1,yscale=1]       \draw[thick,->,>=latex] (-2,0)--(2.5,0) node[above] {$x$};       \draw[thick,->,>=latex] (0,-2)--(0,2) node[left] {$y$};       \draw[domain=0:3*pi,scale=1.5,samples=500] plot (\x:{cos(\x/3*180/pi)*cos(\x/3*180/pi)*cos(\x/3*180/pi)});       \end{tikzpicture}       \end{center}      the last two don't work. I have no clue why Tikz cannot accepet the radian with the previous two. Also, if anyone can tell me how to avoid to write three times the cosine to make it as cube, that'd be great. I tried several syntaxes, but none of them worked. What is for me very strange is that I ploted some polar curve before, and for example this syntax worked fine :               \begin{center}     \begin{tikzpicture}[xscale=0.5,yscale=30]     \fill[pattern=north east lines]       plot [domain=-pi/4:0,scale=3,samples=500] (\x:{-2*cos(2*\x r)/cos(\x r)})%      -- plot [domain=0:pi/4,scale=3,samples=500] (\x:{-2*cos(2*\x r)/cos(\x r)})%      -- cycle ;     \draw[thick,->,>=latex] (-8,0)--(8,0) node[above] {$x$};     \draw[thick,->,>=latex] (0,-0.05)--(0,0.15) node[left] {$y$};     \draw[thick,dotted] (6,-0.12)--(6,0.13);     \draw (-6,0) node[below left] {$-a$};     \draw (6,0) node[below right] {$a$};     \draw[domain=-pi/2.4:pi/2.3,scale=3,samples=500] plot (\x:{-2*cos(2*\x r)/cos(\x r)});     \end{tikzpicture}     \end{center}      I would appreciate any comment !


title: Can I disable underfull \hbox messages for a specific line?

text: The line `\sbox{\mybox}{\parbox{2cm}{\lipsum[1]}}` causes some of the above messages (59):               \documentclass{article}          \usepackage{lipsum}          \newsavebox{\mybox}          \begin{document}          \sbox{\mybox}{\parbox{2cm}{\lipsum[1]}}          \end{document}      Do I need to fix them? If not: is it possible disable these messages for that line?


title: How can I disable the border around the email address in moderncv?

text: I am trying to remove the red border around the email address, I tried to use the following code, but the border is still there. How can I remove it?               \usepackage[hidelinks=true]{hyperref}          \hypersetup{         colorlinks=false,         pdfborder = {0 0 0}     }


title: fitting side by side figures with floatrow

text: I'm trying to fit two figures side by side (with the same size) in the width of the text, using the `floatrow` package. I use the `showframe` option and the `\fbox` in mwe for better visualization. how to fit perfectly on text width?               \documentclass[]{report}     \usepackage[a4paper,showframe]{geometry}     \usepackage{subcaption}     \usepackage{lipsum}     \usepackage{graphicx}     \usepackage{floatrow}           \begin{document}               \lipsum[1]     \begin{figure}[htb!]     \ffigbox[\textwidth]     {\begin{subfloatrow}[2]\setlength\fboxsep{0pt}\setlength\fboxrule{0.75pt}\fbox{\ffigbox[0.49\textwidth]     {         \caption{sidewalk perforation}         \label{subfig:furadeira}     }     {   \setlength\fboxsep{0pt}         \setlength\fboxrule{0.75pt}         \fbox{\includegraphics[width=0.48\textwidth]{image1.jpg}}}         \setlength\fboxsep{0pt}         \setlength\fboxrule{0.75pt}}         \fbox{\ffigbox[0.49\textwidth]     {     \caption{volatile organic compounds measurement}     \label{subfig:medicaomalha}     }     {         \setlength\fboxsep{0pt}         \setlength\fboxrule{0.75pt}         \fbox{\includegraphics[width=0.48\textwidth]{image2.jpg}}     }}     \end{subfloatrow}     }     {         \caption{Hot spot investigation}         \label{fig:hotspot}     }     \end{figure}%     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/xZrOa.jpg)


title: pgfplots plot marks vanish when I change colors

text: I have created two overlapping plots (thanks to Drawing curves and multiple y-axes in one plot with pgfplots): ![enter image description here](http://i.stack.imgur.com/ZiIZM.png) When I change the color in the second one, the plot marks vanish: ![enter image description here](http://i.stack.imgur.com/85heV.png) Here's my MWE:               \documentclass{standalone}     \usepackage{tikz,pgfplots}     \usepackage{pgfplotstable}          %deal with warning message in log     \pgfplotsset{compat=1.8}          \usepackage{helvet}     \usepackage[eulergreek]{sansmath}          \begin{document}          \pgfplotstableread[col sep=comma]{     year, number, cost     2006, 8.6, 103     2007, 7.1, 118     2008, 5.3, 75      2009, 3.2, 52      2010, 3.5, 62      2011, 4.3, 103     2012, 5.8, 116     }\pennies          \newcommand{\mywidth}{10cm}     \newcommand{\blueheight}{5cm}     \newcommand{\redheight}{6cm}          \begin{tikzpicture}[font=\sffamily\sansmath]     % number, blue     \begin{axis}[            title={Many Pennies},            width=\mywidth, height=\blueheight,            ymin=0,           axis y line*=left,           ylabel={\color{blue}number minted},           yticklabel style={color=blue},           yticklabels={,0b,2b,4b,6b,8b}, % why do I need empty first label?           axis x line*=bottom,           xlabel={year},           xtick=data,           xticklabel style={align=center},           xticklabels from table={\pennies}{year},           nodes near coords align={anchor=south,yshift=-6mm},           nodes near coords={\pgfmathprintnumber{\pgfplotspointmeta}b},         ]       \addplot table [x expr=\coordindex, y=number]{\pennies};     \end{axis}      % cost, red     \begin{axis}[            width=\mywidth, height=\redheight,            ymin=0,           axis y line*=right,           yticklabels={,\$0m, \$50m, \$100m},           ylabel={\color{red}production cost},           yticklabel style={color=red},           hide x axis,           nodes near coords={\color{red}\$\pgfmathprintnumber{\pgfplotspointmeta}m},         ]     %  \addplot table [x expr=\coordindex, y=cost]{\pennies};       \addplot [color=red] table [x expr=\coordindex, y=cost]{\pennies};     \end{axis}     \end{tikzpicture}     \end{document}      (I know that some of the formatting code is hacked and inelegant, but I didn't want to ask questions I managed to answer, however crudely.)


title: Properly align numbers with units in table

text: I need to typeset a table comparing, among other things, the temporal resolution of certain datasets. Ordinarily, I would put the common unit into the table header, and only list the values in the table body. However, in this case, some datasets have a resolution of 5 minutes, others of 1 day, which makes the use of the same units awkward (they would either be `5 min` and `1440 min`, or `0.00347222 d` and `1 d`). I'd like to align these values along the space between the values and units, and ideally I'd like to keep the unit/value pairs as logical entities (i.e. to type `\SI{1}{\day}` or `\SI{5}{\minute}`, as I would in other contexts). It seems the `S` column type provided by `siuntix` doesn't align unit/value pairs provided using the `\SI` command, but centres them. MWE (I'd like the entries to be aligned along the space between values and units): ![](http://i.stack.imgur.com/QRUvm.png)               \documentclass{article}     \usepackage{siunitx}          \begin{document}     \begin{tabular}{S}     \SI{1}{\day}\\     \SI{30}{\minute}\\     \SI{5}{\minute}     \end{tabular}          \end{document}


title: Contextual Substitution with LuaLateX

text: Contextual substition doesn't seem to work with LuaLateX, while it works fine with XeLateX. Am I doing something wrong or is this a bug?               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Linux Libertine O}          \begin{document}     \textvbaraccent{i} fä f?     \end{document}      **XeLaTeX** ![enter image description here](http://i.stack.imgur.com/AmIgW.png) **LuaLaTeX** ![enter image description here](http://i.stack.imgur.com/6fk9p.png) (notice the spacing between the upper part of the 'f' and the first dot of the 'ä' and the space between the 'f' and the '?')


title: Draftwatermark with inserted PDF

text: I have included a watermark (using `\usepackage{draftwatermark}`) for draft copies of my document, several pages of which are inserted from a PDF. The watermark behaves just fine on most pages - the watermark is obscured by text and inline images, as expected/desired - but on the inserted PDF, the watermark obscures the data. Is this just due to how Latex inserts PDFs? Is there a way to make the inserted PDF show above the draftwatermark?


title: Hiding a part of a plot

text: Is there a way to hide a part of a plot, possibly by specifying the interval numerically? I have a plot with `xmin`, `xmax`, `ymin` and `ymax` defined and I need to move it from the _y_ axis without using `enlarge x limits`. In this case, I would like to keep everything as it is and just hide the part of the plot between -0.5 and 0 on the _x_ axis. Minimal working example:               \documentclass[border=2pt]{standalone}     \usepackage[utf8]{inputenc}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[         xmin=-0.5,         xmax=5.5,         ymin=-1.54,         ymax=16.96,     ]          \addplot[style=loosely dashed, thick] gnuplot{0.261*x+8.073};          \end{axis}     \end{tikzpicture}     \end{document}      The aim is to correctly align two axes, one of them with symbolic coordinates and automatic padding, hence unable to plot this function. Should someone think of covering it by using an overlaying shape, it is unacceptable because the background varies in colour.


title: loading lineno changes spacing in document

text: I loaded `lineno` to number the lines on my resume for critique by a professor. Doing so changed the spacing after the headers. I would like to number the lines and retain the original formatting, if possible.               \documentclass{article}     \usepackage{fullpage}     \pagestyle{empty}     \raggedright          % Uncommenting lineno changes spacing below \header     %\usepackage{lineno}          \newcommand{\area}[2]{\vspace*{-9pt} \begin{verse}\textbf{#1}   #2 \end{verse}  }     \newcommand{\lineunder}{\vspace*{-8pt} \\ \hspace*{-18pt} \hrulefill \\}     \newcommand{\header}[1]{{\hspace*{-15pt}\vspace*{6pt} \textsc{#1}} \vspace*{-6pt} \lineunder}          \newcommand{\schoolwithcourses}[4]{     \textbf{#1} #2 $\bullet$ #3 $\bullet$ #4\\     Selected Coursework:\\     \vspace*{5pt}     }          \begin{document}          \header{Education}          \schoolwithcourses{Bachelor of Science}{$\bullet$ Georgia Gwinnett College}{May 2013 $\bullet$ Magna cum Laude}     {GPA: 3.874/4.000}     \area{Biology}{Microbiology $\cdot$ Immunology $\cdot$ Human Anatomy $\cdot$ Human Physiology $\cdot$ Biomechanics $\cdot$ Organic~Chemistry $\cdot$ Biotechnology $\cdot$ Biochemistry $\cdot$ Cell Biology }     \end{document}


title: PDF bookmark going to the bottom of the previous page in case when caption header is on the top of a page

text: \documentclass[12pt,a4paper]{mwrep}     \usepackage{lipsum}     \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.3}     \usepackage[hidelinks,unicode,pdfencoding=auto]{hyperref}     \usepackage[all]{hypcap}     \begin{document}     \tableofcontents     \chapter{Chapter A}     \section{Section AA}     \lipsum     \section{Section AB}     \lipsum     Text          Text          Text          Text          Text          Text          \subsection{Subsection ABA}     \lipsum     \chapter{Chapter B}     \section{Section BA}     \lipsum     \subsection{Subsection BAA}     \lipsum     \end{document}      Try to click on PDF bookmark or hyperlink in table of contents (Section AB, Subsection ABA, Subsection BAA). It leads to the bottom of the previous page in case when appropriate [sub]section header is at the top of a page. This is annoying when reading PDF documents in "full page mode" as it goes to the wrong page (the previous one). For some reason the problem does not affect chapter headers. How can it be fixed?


title: How to put a formula into a table cell

text: I need to insert into a table cell a formula that requires the summation sign and I apparently do something wrong and the compiler just throws me back errors and I really don't know how to solve this.               \begin{tabular}{ c || c c c }     \hline      Linea & Costo & Esecuzioni & Totale \\ \hline                             1 & $1$ & $1$ & $1$ \\     2 & $n+1$ & $2$ & $2(n+1)$ \\     3 & \begin{equation} \sum_{n=1}\nolimits' C_n \end{equation} & $2$ & $2(n+1)$ \\     \hline       \end{tabular}


title: \rule command constructing line not extending far enough left

text: I am trying to put a horizontal line between homework problems, like this:               \begin{description}     %stuff . . .     \rule{\linewidth}{0.4mm}     \item[Exercise 1]     %stuff     \rule{\linewidth}{0.4mm}     \end{description}      If I knew how to get this to display on this website, you would see that the line begins over the second 'e' of 'Exercise', and looks off, as one would like the line to be exactly aligned over the capital 'E'. Does anyone know how to do this?


title: Changing the table of contents width

text: In setting up a table of contents, by default the TOC spans the entire width of the page, regardless of the length of the section titles. I would like to have the entire TOC be only as wide as it needs to be, with the option of including a small additional space (1-4em) between the longest section title and the page number. I would also like to have all the page numbers on the right lined up (i.e. not ragged). Is there a way to do this? I have to imagine this is possible with tocloft, but I can't seem to find the right settings. I am doing my best to avoid package bloat (which is getting hard to manage), so I would be extra appreciative of solutions using tocloft. Edit: Here is a MWE               \documentclass[12pt]{article}     \usepackage{setspace, tocloft}          %Modifies line spacing of the ToC     \setlength\cftparskip{-1.2pt}     \setlength\cftbeforesecskip{1.3pt}     \setlength\cftaftertoctitleskip{2pt}          %Makes dots after sections/subsections: Sections 1., 2.1., etc     \makeatletter     \renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}     \makeatother          %Makes the dots (above) appear in ToC     \let \savenumberline \numberline     \def \numberline#1{\savenumberline{#1.}}          \begin{document}     \tableofcontents     \begin{section}{Section 1}     \begin{subsection}{Section 1.1}\end{subsection}     \begin{subsection}{Section 1.2}\end{subsection}     \end{section}     \begin{section}{Section 2}\end{section}     \end{document}      Which produces:![enter image description here](http://i.stack.imgur.com/Qqs3m.png) As mentioned above, I would like to control the width between the end of the section titles and the beginning of the page numbers, keeping the page numbers vertically aligned.


title: Custom Enumeration

text: I have a problem with enumerating a list of axioms in a custom style. For instance, if I wanted to write down the axioms that a function will have to satisfy for it to be a homomorphism of rings, I'd prefer to call the axioms (HOM1) and (HOM2). I learnt that this is achievable by using this:               A map $f$ between two rings $R$ and $S$ is called a ring homomomorphism if     they respect the algebraic structure in both of them. More precisely,      \begin{itemize}     \item[HOM1] $f(r_1+r_2)=f(r_1)+f(r_2)$     \item[HOM2] $f(r_1 \cdot r_2)=f(r_1) \cdot f(r_2)$     \end{itemize}      But the problem is, I have absolutely no way of referring to exactly one of these axioms, say in a proof, without having to "brutally" type in the (HOM1) to refer to the axiom. This looks slightly like not knowing how to refer to an equation when there are several of them, say, in an align construct. Any help in achieving this will be appreciated.


title: warning with hyperref package

text: I have met warning:"Package hyperref Warning: Composite letter `\textdotbelow+u'" when i use this code to create a bookmark               \pdfbookmark{\contentsname}{Contents}      I don't know the reason for this warning, how to avoid and fix the warning.


title: Use \mathrm by default

text: How can I get roman font by default in math mode?


title: Centering Text using multirow that overflows onto multiple lines

text: I am trying to create a table where one column has multiple rows. This is very easy to do using the `multirow` package. However, if I specify a width for this `\multirow` and my text overflows, the second line of the multirow loses its centering. Here is an example of what I'm doing:               \usepackage{multirow}     \begin{table}[!h]         \begin{tabular}{ | c | c |}             1 & \multirow{4}{100pt}{This one works} \\             2 & \\             3 & \\             4 & \\             1 & \multirow{4}{100pt}{This one doesn't work and loses its centering because the text is too long}\\             2 & \\             3 & \\             4 & \\         \end{tabular}     \end{table}