title: Polar Plots - layout and extraction of crucial parameters

text: Let S be some sort of function, depending on direction and frequency, for example: envir. background noise. I have S defined on a rectangular grid and I wanted it plotted on a polar grid. So far I could achieve plotting it topography (contour lines).               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{polar}          \begin{document}          \begin{tikzpicture}     \begin{polaraxis}[     title=\texttt{Station 1 (quunatity [units])},     ymax=.15,  grid=major, xmin=30,     yticklabels={0,,0.1,,0.2},     xlabel={\texttt{quantity (units)}$\rightarrow$},     colorbar     ]         \addplot[ contour prepared={labels=false}, contour prepared format=matlab]     file {curvelivello.sp2};     \end{polaraxis}     \end{tikzpicture}          \end{document}      Here are my questions:   1. I wish to place my zlabel on top (right on top of it) of the colorbar, placed on the right of the polar plot. ylabel can stay at the bottom, but xlabel should then be aligned and next to one of the rays departing from the center of the polar plot. How can I do that?   2. Instead of drawing contour lines, I would like to fill the insterspaces with some color. What I have in mind is some sort of shading. just like "plain" surface plots defined on rectangular grids.    3. Now the most important part: given the data read in by PGFplots, in addition to plotting, I also with to extract some basic statstics from plotted data. For instance: locating the peak attained by S on both axis (fo peak frequency and peak direction in this specific case) and drawing that (like an arrow steaming out from circle's center, thick, red...) and having its on legend.  Feasible? Thank you in advance for your help and comments. Marco P.S. what follows are the matlab-based-format used to generate my contour lines (as requested)               0.006   35.000     99.347  0.062     120.000 0.059     150.000 0.056     180.000 0.055     210.000 0.055     240.000 0.056     270.000 0.059     290.917 0.062     300.000 0.064     320.125 0.071     330.000 0.077     337.057 0.081     346.617 0.092     347.017 0.106     332.627 0.120     330.000 0.122     300.000 0.136     291.482 0.138     270.000 0.144     240.000 0.148     210.000 0.150     180.000 0.150     150.000 0.148     120.000 0.144     98.788  0.138     90.000  0.136     60.000  0.122     57.587  0.120     43.064  0.106     43.467  0.092     53.117  0.081     60.000  0.077     70.094  0.071     90.000  0.064     99.347  0.062     0.012   31.000     165.383 0.062     180.000 0.061     210.000 0.061     224.441 0.062     240.000 0.063     270.000 0.066     289.722 0.071     300.000 0.074     316.253 0.081     327.294 0.092     327.761 0.106     311.104 0.120     300.000 0.126     270.000 0.134     240.000 0.137     226.737 0.138     210.000 0.139     180.000 0.139     163.077 0.138     150.000 0.137     120.000 0.134     90.000  0.126     79.189  0.120     62.394  0.106     62.865  0.092     73.998  0.081     90.000  0.074     100.535 0.071     120.000 0.066     150.000 0.063     165.383 0.062     0.018   27.000     129.729 0.071     150.000 0.068     180.000 0.066     210.000 0.066     240.000 0.068     260.302 0.071     270.000 0.072     298.620 0.081     300.000 0.082     315.003 0.092     315.702 0.106     300.000 0.117     291.759 0.120     270.000 0.128     240.000 0.132     210.000 0.134     180.000 0.134     150.000 0.132     120.000 0.128     98.513  0.120     90.000  0.116     74.552  0.106     75.257  0.092     90.000  0.082     91.703  0.081     120.000 0.072     129.729 0.071     0.024   27.000     170.180 0.071     180.000 0.070     210.000 0.070     219.672 0.071     240.000 0.072     270.000 0.077     282.910 0.081     300.000 0.090     302.713 0.092     303.644 0.106     300.000 0.108     273.691 0.120     270.000 0.122     240.000 0.128     210.000 0.130     180.000 0.130     150.000 0.128     120.000 0.122     116.443 0.120     90.000  0.108     86.710  0.106     87.649  0.092     90.000  0.091     107.293 0.081     120.000 0.077     150.000 0.072     170.180 0.071     0.030   21.000     123.324 0.081     150.000 0.076     180.000 0.074     210.000 0.074     240.000 0.076     266.766 0.081     270.000 0.082     291.525 0.092     292.553 0.106     270.000 0.116     253.470 0.120     240.000 0.123     210.000 0.126     180.000 0.126     150.000 0.123     136.499 0.120     120.000 0.116     97.724  0.106     98.744  0.092     120.000 0.082     123.324 0.081     0.036   21.000     141.306 0.081     150.000 0.079     180.000 0.077     210.000 0.077     240.000 0.079     248.619 0.081     270.000 0.087     280.650 0.092     281.881 0.106     270.000 0.111     240.000 0.119     227.611 0.120     210.000 0.122     180.000 0.122     162.193 0.120     150.000 0.119     120.000 0.111     108.314 0.106     109.536 0.092     120.000 0.087     141.306 0.081     0.043   19.000     165.937 0.081     180.000 0.080     210.000 0.080     223.888 0.081     240.000 0.083     269.740 0.092     270.000 0.094     271.210 0.106     270.000 0.106     240.000 0.115     210.000 0.119     180.000 0.119     150.000 0.115     120.000 0.106     118.903 0.106     120.000 0.095     120.377 0.092     150.000 0.083     165.937 0.081     0.049   13.000     132.787 0.092     150.000 0.087     180.000 0.083     210.000 0.083     240.000 0.087     257.216 0.092     259.102 0.106     240.000 0.111     210.000 0.115     180.000 0.115     150.000 0.111     130.918 0.106     132.787 0.092     0.055   13.000     145.197 0.092     150.000 0.091     180.000 0.086     210.000 0.086     240.000 0.091     244.692 0.092     246.810 0.106     240.000 0.108     210.000 0.112     180.000 0.112     150.000 0.108     143.098 0.106     145.197 0.092     0.061   9.000     163.076 0.092     180.000 0.090     210.000 0.090     226.734 0.092     230.718 0.106     210.000 0.109     180.000 0.109     159.069 0.106     163.076 0.092      **EDIT** : What I want is to draw **filled** contour patches, in polar coordinates, instead of mere contour **lines** (not filled). Drawing that, would correspond to draw some kind of speckle (on a radial coordinate system) which end to be delimited in a certain sector (direction) and confined between two circles (frequency min and max). You can have a look at the following image to get a clearer idea of what I have in mind: ![enter image description here](http://i.stack.imgur.com/k14sc.jpg) After this is achieved, and based on the data plotted, I wish to draw _on the same plot_ the according statistical indicator regarding the sector on which the plot is drawn. For instance: frequency and direction corresponding the the peak, i.e. corresponding to the highest value attained by my plotted function (say by drawing the corresponding freq and dir thick in red colour). Hope the explanation was clear.


title: How to locate the verbatim text in centre of the page?

text: Here is an code that i want to display in verbatim mode. But the displayed code is locate at the left of the page.                \begin{singlespace}       \begin{verbatim}      Imread('filename');      \end{verbatim}      \end{singlespace}      How too locate it in the centre of the page?


title: How to typeset variation of vector function?

text: In variational calculus, the first variation is written as `\delta F` for some functional F. Vectors are often typeset with boldface, i.e. `\vec{x}` becomes `\mathbf{x}`. If I want to typeset the first variation of a vector, would I make the Delta bold as well? I.e, which is "correct"? `\delta \mathbf{x}` or `\mathbf{\delta x}`? Edit: The functional itself is scalar, but some constituents may not be. ![Functionals](http://i.stack.imgur.com/VweGa.png)


title: How to hide grid labels without redefining the grid style?

text: I want to hide the grid labels without redefining the grid style, is it possible? Note: Redefining the grid style only for hiding the grid labels seems to be an overkill solution.               \documentclass[pstricks,border=12pt]{standalone}     \begin{document}     %\newpsstyle{gridstyle}{gridlabels=0,% other redefinition goes here!}     \begin{pspicture}[showgrid=bottom,gridlabels=0](8,6)          \end{pspicture}     \end{document}      I know the following can be the answer, but how to do it without using `\psgrid`?               \documentclass[pstricks,border=12pt]{standalone}     \begin{document}     \begin{pspicture}(8,6)     \psgrid[style=gridstyle,gridlabels=0]        \end{pspicture}     \end{document}


title: How to resove "job aborted, file error in nonstop mode" error in Texmaker (64-bit)?

text: First post here. Hope it's not ignorant. I am using Texmaker on Ubuntu 12.10 with PDFlatex. I am running a 64-bit machine. Fresh install of Linux and Texmaker, I am quite used to Texmaker, not sure why I am getting this error. I am able to compile other documents, so (to my knowledge) is not necessarily texmaker. Here is my log file:               This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2014.2.14)  14 FEB 2014 18:18     entering extended mode      %&-line parsing enabled.     **"Book Corrections for Dr.tex"          ! Emergency stop.     <*> "Book Corrections for Dr.tex"          *** (job aborted, file error in nonstop mode)               Here is how much of TeX's memory you used:      3 strings out of 495061      126 string characters out of 1182621      45108 words of memory out of 3000000      3282 multiletter control sequences out of 15000+50000      3640 words of font info for 14 fonts, out of 3000000 for 9000      28 hyphenation exceptions out of 8191      0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,50000s     !  ==> Fatal error occurred, no output PDF file produced!      I am attaching relevant parts of my file:               \documentclass[12pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \author{Jeffrey Wubbenhorst}     \title{Book Errors}     \usepackage [english]{babel}     %\usepackage [autostyle, english = american]{csquotes}     %\MakeOuterQuote{"}     \usepackage{listings}     \usepackage{color}          \definecolor{dkgreen}{rgb}{0,0.6,0}     \definecolor{gray}{rgb}{0.5,0.5,0.5}     \definecolor{mauve}{rgb}{0.58,0,0.82}          \lstset{       language=Python,       aboveskip=3mm,       belowskip=3mm,       showstringspaces=false,       columns=flexible,       basicstyle={\small\ttfamily},       numbers=none,       numberstyle=\tiny\color{gray},       keywordstyle=\color{blue},       commentstyle=\color{dkgreen},       stringstyle=\color{mauve},       breaklines=true,       breakatwhitespace=true       tabsize=3     }     \begin{document}          \maketitle     \section*{Introduction}     I really appreciate this book, and am honored to help contribute to it. Here are most of the errors I have found. Hopefully, this will help bring the book one step closer to publication.           Thanks!     \section*{Python}     \begin{itemize}     \subsection*{Recurring}     \item One recurring error in code examples is the {\tt print} option, which often does not contain parentheses.      \subsection*{c3}          \item Page 7/9: ``...  $\vee$ (simQ):..." I think there's a forgotten $\backslash$.     \subsection*{c6}     \item Page 13: ``...copy ofeach element..."     \item Page 13: ``...range iterator ylelds up the integers 0-9..."     \item Page 18: ``...function in Pyton 2, but.."      \item Page 20: ``I will walk through a collection, such as a list, because listss, strings and tuples     all have built in iterators that walk throug them in order.."     \item Page 21: Example does not run- perhaps the author meant to define k? Possible code is shown below:     \begin{lstlisting}     >>> groceries = ["milk", "eggs", "caviar", "foie gras"]     >>> k=0     >>> while k <= 4:     ... print groceries[k]     ... k += 1     \end{lstlisting}          does not run straight out of the box.                \end{itemize}          \end{document}      Thanks for any help you can offer.


title: Extra "Contents", "Glossary" and "Acronyms" pages, when using \usepackage[acronym]{glossary}

text: I'm currently playing around with the LaTeX template for my thesis, but am at a loss as to why extra pages appear between the generated "Contents", "Glossary" and "Acronyms" lists? Is this a problem with interference between the loaded packages, or have I forgotten something important? Can I manually suppress the creation of these extra pages by tweaking the `\tableofcontents` and `\printglossaries` commands? I am running this project on Windows 7, using the TeXmaker front end... Cheers. * * *               %% Define document class and load required packages     \documentclass{book}     \usepackage[british]{babel}      \usepackage{commath, amsmath, amsfonts, amssymb, setspace}     \usepackage{graphicx, pgfplots} \pgfplotsset{compat=newest}      \usepackage[colorlinks=true,linkcolor=red,citecolor=green, urlcolor=blue]{hyperref}     \usepackage[xindy, toc, acronym, nonumberlist, translate=babel]{glossaries} \makeglossaries          %% Define example glossary entry     \newglossaryentry{exampleglossary}{         name={Example Glossary},         description={An example glossary entry},         sort=exampleglossary     }          %% Define example acronym entry     \newacronym{exampleacronym}{EA}{Example Acronym}          %% Begin document     \begin{document}          %% Generate table of contents and glossary pages     \tableofcontents     \glsaddall \printglossaries           %% Define example chapter with hyperref links     \chapter{Chapter Title}     Example Bibliography reference \cite{examplebibliography}.\\     Example Glossary reference \gls{exampleglossary}.\\     Example Acronym reference \gls{exampleacronym}.\\          %% Define example bibliography entry and construct bibliography     \addcontentsline{toc}{chapter}{Bibliography}         \begin{thebibliography}{9}              \bibitem{examplebibliography}              author,              title,              publisher,             year.          \end{thebibliography}                 %% End document     \end{document}


title: Figure placed on a separate page is centered and not on top

text: I have multiple figures placed in my document (all of which are using [htbp], [ht] etc. and are placed correctly). The last figure receives a separate page (which is alright) but it's centered on this page, which looks weird as the figure is quite small. Is there any way to get this figure on top of this page? As written above, its a separate page and the last one in this chapter. I can't really provide a minimal example (since I guess that the position depends on my previous figures), but here's the code I use for the figure (I've tried [ht], [ht!], [htbp] etc but none of them work - I've also deleted the .aux files before compiling):               \begin{figure}[t!]     \centering     \begin{tabularx}{\columnwidth}{cc}     \subfloat[Results 1]     { \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot1}     }     &     \subfloat[Results 2]     { \centering    \includegraphics[width=0.47\textwidth,height=0.47\textheight,keepaspectratio]{images/plot2}     }     \end{tabularx}     \caption{Blabla}     \end{figure}      Thanks in advance!


title: Word count in LyX which does not include Figure captions

text: Is they a way of obtaining a word count in LyX that does not include text inside captions (Figures, tables etc.)?


title: Definition of PSTricks constant (again) and improvement of code

text: Consider the following example. (This is either the last one or the second to last.) **Code**               % pdflatex -shell-escape test.tex          \documentclass{article}          \usepackage{auto-pst-pdf,pstricks-add}     \usepackage[locale=DE]{siunitx}          \begin{document}          \begin{figure}     \def\radius{19.2}     \def\lige{33.3}     %\edef\bredde{\dimexpr2*\radius\relax\space}     \pstFPmul\bredde{2}{\radius}     %\edef\laengde{\dimexpr\bredde+\lige\relax\space}     \pstFPadd\laengde{\bredde}{\lige}      \centering      \psset{unit=0.168cm}     % \psset{unit=\psunit}       \begin{pspicture}(\laengde,\bredde)        \pcline(\radius,0)(!\radius\space \lige\space add 0)        \psarc(!\radius\space \lige\space add \radius\space){\radius}{270}{90}        \pcline(!\radius\space \lige\space add 2 \radius\space mul)%         (!\radius\space 2 \radius\space mul)        \psarc(\radius,\radius){\radius}{90}{270}       \psset{linestyle=dotted,arrows=|*-,offset=0pt}        \pcline(\radius,\radius)(0,\radius)        \ncput*{\SI{\radius}{\cm}}        \pcline[arrows=|*-|*](\radius,\radius)(!\radius\space \lige\space add \radius\space)        \ncput*{\SI{\lige}{\cm}}        \pcline(!\radius\space \lige\space add \radius\space)%         (!2 \radius\space mul \lige\space add \radius\space)        \ncput*{\SI{\radius}{\cm}}        \pcline(\radius,\radius)(\radius,0)        \pcline(\radius,\radius)(!\radius\space 2 \radius\space mul)        \pcline(!\radius\space \lige\space add \radius\space)%         (!\radius\space \lige\space add 0)        \pcline(!\radius\space \lige\space add \radius\space)%         (!\radius\space \lige\space add 2 \radius\space mul)       \end{pspicture}     \end{figure}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/WDkH5.jpg) **Question** I have the desired output but the code is not very elegant. Furthermore, I still don't get how to use the `\psunit` (see this answer).


title: Drawing a Reuleaux Triangle

text: A Reuleaux triangle is a shape of constant width sort of like a rounded equilateral triangle. ![Reuleaux Triangle from Wikipedia](http://i.stack.imgur.com/lHFbq.png) (Reuleaux triangle - Wikipedia, the free encyclopedia) It can be formed by the intersection of three circles like in a three set Venn diagram. ![Reuleaux Triangle from MathWorld](http://i.stack.imgur.com/8LOMM.gif) (Reuleaux Triangle -- from Wolfram MathWorld) What is the best way to draw a Reuleaux triangle using TikZ, Asymptote, or some language that is embeddable into LaTeX? Perhaps by drawing the three circles of a Venn diagram and cutting off the rest?


title: Mathematica code into TikZ code

text: In my search to understand the creation of a guilloche and in relation to my post Recreating a guilloche with TikZ, I came about the code below,                Guilloche[a_, b_, c_, d_, e_, f_] :=       PolarPlot[Evaluate[Flatten[{ Table[(c + Sin[a x + d]) + ((b + Sin[b x + e]) - (c + Sin[a x + d]))(f + Sin[a x + n/ Pi])/2, {n, 0, 19}] }] ], {x, 0, 2 Pi}, PlotPoints -> 200, Axes -> None, Frame -> False]           Guilloche[4, 8, 20, 4.7, 1.8, 1];      Written in Mathematica which should produce the following image:![enter image description here](http://i.stack.imgur.com/jatGw.gif) My attempt below compiles but with no image.                \documentclass[11pt]{scrartcl}      \usepackage[dvipsnames]{xcolor}           \usepackage{tkz-fct}                \begin{document}      \noindent\begin{tikzpicture}      \foreach \i in {1,...,19}{%      \tkzFctPolar[color=MidnightBlue,thick,domain=0:2*pi,samples=400]{(4 + sin(4*t + 4.7)) +((8 + sin(8*t + 1.8)) - (20 + sin(4*t + 4.7)))      (1 + sin(4*t + \i/ Pi))/2}}         \end{tikzpicture}            \end{document}      Any assistance on how to convert the code appropriately will be highly appreciated. In general, the Mathematica code should produce different guilloches but I don't know how I would be able to implement it into `TikZ` to generate different guilloches from one piece of code.


title: Displaying `\begin{verbatim}...\end{verbatim}` inside the environment verbatim

text: I would like to display `\begin{verbatim}...\end{verbatim}` inside the environment verbatim like in the folowing piece of code. Is it possible ?               \begin{verbatim}     Bla, bla,     \begin{verbatim}...\end{verbatim}     Bla, bla,...     \end{verbatim}


title: Can I detect whether a footnote has been split?

text: Title sez it all: Can I detect, hopefully by inspecting `\box\footins`, whether a footnote has been split at page-breaking? I found the package fnbreak but it uses labels, which is much too delayed for my purpose. I thought about a mark, but where would I put `\splitbotmarks`? Of course I could put a special penalty after every footnote and try to detect that with `\lastpenalty`, but it seems like a cheap trick and furthermore, maybe it would be discarded? What would you do?


title: Different background colors for lstinline

text: In the following code, I've decided to use the code from Colored background in inline listings so as to redefine `\verb` to have the possibility to use colors for the text and the background of the verbatim text. The problem I meet is that only one color for the background can be used by page and I would like to have different background colors in the same page. This is surely the consequence of the use of the style:               \tikzstyle{highlighter} = [%         \bck@color, %         line width = 0.9\baselineskip%     ]      What are the changes to do in the following code? Another question: is it possible to have a border rule with also a customizable color?               % Two compilations must be done !     \documentclass{article}         \usepackage[utf8]{inputenc}              % == EXTRA == %              \setlength{\parindent}{0cm}              % == PACKAGES USED == %              \usepackage{xargs}         \usepackage{etoolbox}         \usepackage{atbegshi}         \usepackage{ifthen}              \usepackage[svgnames,x11names]{xcolor}         \usepackage{tikz}              \usepackage{listings}              % == DEF : Verbatim with color option == %              \definecolor{colorCodeNormal}{named}{black}         \definecolor{colorCodeBack}{named}{Snow2}              \lstset{backgroundcolor=\color{colorCodeBack}}%              \makeatletter             \newcounter{highlight}[page]             \newcommand{\tikzhighlightanchor}[1]{%                 \ensuremath{%                     \vcenter{%                         \hbox{%                             \tikz[remember picture, overlay]{                                 \coordinate (#1 highlight \arabic{highlight});                             }%                         }%                     }                 }%             }             \newcommand{\bh}[0]{\stepcounter{highlight}\tikzhighlightanchor{begin}}             \newcommand{\eh}[0]{\tikzhighlightanchor{end}}             \AtBeginShipout{%                 \AtBeginShipoutUpperLeft{                     \ifthenelse{\value{highlight} > 0}{\tikz[remember picture, overlay]{\foreach \stroke in {1,...,\arabic{highlight}} \draw[highlighter] (begin highlight \stroke) -- (end highlight \stroke);}}{}                 }             }                  \newtoggle{@InInlineListing}%             \togglefalse{@InInlineListing}%                  \renewcommand\lstinline[1][]{%                 \leavevmode\bgroup\toggletrue{@InInlineListing}\bh % \hbox\bgroup --> \bgroup                 \def\lst@boxpos{b}%                 \lsthk@PreSet\lstset{flexiblecolumns,#1}%                 \lsthk@TextStyle                 \@ifnextchar\bgroup{\afterassignment\lst@InlineG \let\@let@token}%                     \lstinline@}%                  \def\lst@LeaveAllModes{%                 \ifnum\lst@mode=\lst@nomode                     \expandafter\lsthk@EndGroup\iftoggle{@InInlineListing}{\eh{}}{}%                 \else                     \expandafter\egroup\expandafter\lst@LeaveAllModes                 \fi%             }                  \renewcommand\verb{%                 \@ifstar{%                     \lstset{%                         showspaces=true,%                         showtabs=true%                     }%                     \@verbItInColor%                 }{%                     \lstset{%                         showspaces=false,%                         showtabs=false%%                     }%                     \@verbItInColor%                 }%             }             \newcommandx\@verbItInColor[2][%                 1=colorCodeNormal,%                 2=colorCodeBack             ]{%                 \ifx\relax#1\relax                     \edef\txt@color{colorCodeNormal}%                 \else                     \edef\txt@color{#1}%                 \fi                 \ifx\relax#2\relax                     \edef\bck@color{colorCodeBack}%                 \else                     \edef\bck@color{#2}%                 \fi                 \lstset{basicstyle=\ttfamily\color{\txt@color}}%                 \tikzstyle{highlighter} = [%                     \bck@color, %                     line width = 0.9\baselineskip%                 ]                 \lstinline%             }         \makeatother          \begin{document}     % On this first page there is a problem.     \verb+NORMAL+          \verb[blue]+BLUE+          \verb[green][DarkViolet]+GREEN ON DARK VIOLET+           \verb[white][cyan]+WHITE ON CYAN+              \newpage     % Here the background color is correct.     \verb[white][red]+WHITE ON RED+          \newpage     % Here again the backgorund color is the good one.     \verb[green][DarkViolet]+GREEN ON DARK VIOLET+          \end{document}


title: LaTeX Loops in \newcommand

text: I have used LaTeX for about a year now and every time I write a paper I try to improve on my knowledge so recently I've been creating my own commands to help save time. I am interested if it is possible to use "for-loops" in LaTeX to create `\newcommand` in the following way:               \newcommand{idmatrix}[1]      where my parameter is the size say `n` and then it will print an `n` x `n` identity matrix. This would be useful for equations where I want to show the matrix calculations but don't have to do the mundane work of using `\bmatrix` etc and creating a 3x3 or a 2x2 matrix every single time.


title: Kindly explain use of framezoom in beamer

text: I want to use `framezoom` to zoom in on India in this map. How can I do it? Can someone explain in a simple language (non-technical) the use of `\framezoom` function in `beamer`? ![prevalence of dyspepsia](http://i.stack.imgur.com/Hxoyy.png)


title: PSTricks: Wrong axis labels

text: Consider the following example:               \documentclass{article}          \usepackage{pstricks-add}          \def\sandsynlighed#1#2{%       \psframe[         linecolor=red,         fillstyle=solid,         fillcolor=blue!50       ](#1,0)(!#1 \bredde add #2 4 div)     }          \psset{unit=0.75}          \begin{document}          \def\bredde{1.5 }     \begin{pspicture}(-0.9,-0.5)(14.3,11.3)       % Akserne.       \psaxes[         xlabelOffset=-0.75,         Ox=-1,         dx=1.5,         xLabels={0,1,2,3,4,5,6_{+0},6_{+1},7},         Dy=2,         dy=0.5       ]{->}(0,0)(-0.25,-0.25)(14,10.75)[$X$,0][$100 \cdot P(X)$,90]       % Sandsynlighederne.       \sandsynlighed{0}{18.70}     \end{pspicture}          \end{document}      ![output](http://i.stack.imgur.com/R3TJX.jpg) As can be seen, the labels on the _x_ -axis is all wrong and I have no idea what I have done wrong. I would like to have the labels as specified by `xLabels`; how do I get this?


title: About TikZ and decoration (accent in text)

text: I use the command:               \path [shift={(-2.75,0)},decorate, decoration={text along path, text={Plan meridien}}]           (165:2.8) arc (165:90:2.8) ;      to draw a text on the circular arc path. This work well. But I use French language, and I try to put correct accentuation on the word "méridien". The problem is then the LaTeX compilation stop, the result is not rendered. It is not possible to put any accent. So, can I wrote French text along a path on TikZ figure? or any accent and/or special accent by this way (text decoration by TikZ)?


title: Change "FIGURE 1:" color, but not caption color

text: I would like to change the color of the "FIGURE 1:" portion of my caption to blue (including the number & colon), but I want the remainder of the caption to be black. I have tried the following in my preamble, however, the whole caption is blue:               \documentclass{article}     \usepackage{color}     \renewcommand{\figurename}{\color{blue}{FIGURE}}     \usepackage{graphicx}          \begin{document}          \begin{figure}             \includegraphics[width=\linewidth]{../ubmFigures/exampledoc}              \caption{An example figure}     \end{figure}     \end{document}


title: print cited page range in bibliography

text: I have to print the actually cited page range of cited books in the bibliography. ![example](http://i.stack.imgur.com/sVqKy.jpg) The suffix `[10-- 20]` should be compressed to `10 f.` or `10 ff.`, but in the bibliography printed as `p. 10--20` I've got no clue how to achieve it, I searched for commands but without result. compress page range gives only an example how to compress page ranges from `10-19` to `10-9` One possible pathway to the solution could be via this MWE:               \documentclass{scrreprt}     \usepackage[latin1]{inputenc}     \usepackage[      bibstyle=test, citestyle=test      ]{biblatex}          \begin{filecontents*}{books.bib}     @BOOK{scrubs,       author = {John Dorian},       title = {How to endure girls names},       year = {2009},       edition = {8}       publisher = {Cox publishing}     }          \end{filecontents*}          \bibliography{books.bib}          \begin{document}     \cite[10--20]{scrubs}          \printbibliography     \end{document}      and my bbx-file               \newbibmacro*{begentry}{}     \newbibmacro*{finentry}{\finentry}          \DeclareBibliographyDriver{book}{%       \usebibmacro{bibindex}%       \usebibmacro{begentry}%       \usebibmacro{author/editor+others/translator+others}%       \setunit{\labelnamepunct}\newblock       \usebibmacro{maintitle+title}%       \newunit\newblock       \usebibmacro{byauthor}%       \newunit\newblock       \usebibmacro{byeditor+others}%       \newunit\newblock       \printfield{edition}%       \newunit       \iffieldundef{maintitle}         {\printfield{volume}%          \printfield{part}}         {}%       \newunit       \printfield{volumes}%       \newunit\newblock       \usebibmacro{series+number}%       \newunit\newblock       \printfield{note}%       \newunit\newblock       \usebibmacro{publisher+location}%       \newunit\newblock       \usebibmacro{p.}       \usebibmacro{chapter+pages}%       \newunit\newblock       \usebibmacro{date}%       \usebibmacro{addendum+pubstate}%       \setunit{\bibpagerefpunct}\newblock       \usebibmacro{pageref}%       \usebibmacro{finentry}}                    \newbibmacro*{maintitle+title}{%       \iffieldsequal{maintitle}{title}         {\clearfield{maintitle}%          \clearfield{mainsubtitle}%          \clearfield{maintitleaddon}}         {\iffieldundef{maintitle}            {}            {\usebibmacro{maintitle}%         \newunit\newblock         \iffieldundef{volume}           {}           {\printfield{volume}%                \printfield{part}%                \setunit{\addcolon\space}}}}%       \usebibmacro{title}%       \newunit}          \newbibmacro*{maintitle+booktitle}{%       \iffieldundef{maintitle}         {}         {\usebibmacro{maintitle}%          \newunit\newblock          \iffieldundef{volume}            {}            {\printfield{volume}%             \printfield{part}%             \setunit{\addcolon\space}}}%       \usebibmacro{booktitle}%       \newunit}          \newbibmacro*{volume}{%       \printfield{volume}%       \setunit*{\adddot}%       }               \newbibmacro*{series+number}{%       \printfield{series}%       \setunit*{\addspace}%       \printfield{number}%       \newunit}          \newbibmacro*{publisher+location}{%         \iflistundef{publisher}         {}       \printlist{publisher}%       \setunit*{\addcomma\space}       \printlist{location}%       \setunit*{\addcomma\space}%       \newunit}          \newbibmacro*{chapter+pages}{%       \printfield{chapter}%       \setunit{\bibpagespunct}%       \printfield{pages}%       \newunit}          \newbibmacro*{addendum+pubstate}{%       \printfield{addendum}%       \newunit\newblock       \printfield{pubstate}}                    \newbibmacro*{p.}{%       \printtext{p. }}     \endinput      and my cbx-file               % $Id: test.cbx,v 1.7 2011/11/13 19:09:07 lehman stable $          \ProvidesFile{test.cbx}     [\abx@cbxid $Id: verbose-inote.cbx,v 1.7 2011/11/13 19:09:07 lehman stable $]          \providebool{bbx:subentry}          \DeclareFieldFormat{entrysetcount}{\mknumalph{#1}}     \newbibmacro*{cite}{%       \printtext[bibhyperref]{%         \printfield{prefixnumber}%         \printfield{labelnumber}%         \ifbool{bbx:subentry}           {\printfield{entrysetcount}}           {}}}          \DeclareCiteCommand{\cite}[\mkbibbrackets]       {\usebibmacro{prenote}}       {\usebibmacro{citeindex}%        \usebibmacro{cite}}       {\multicitedelim}       {\usebibmacro{postnote}}     \AtEveryBibitem{\clearfield{month}}     \endinput


title: Using \author and \thanks for authors with common affiliations

text: What is the correct way to use `\author` and `\thanks` when I want to have multiple authors having common affiliations? For instance, using               \author{ABC\thanks{XYZ} \and DEF\thanks{UVW} \and GHI\thanks{XYZ}}      produces the following output ![enter image description here](http://i.stack.imgur.com/rL17a.png) at the top of the page and the following output at the bottom of the page ![enter image description here](http://i.stack.imgur.com/vzeO3.png) I would like to get rid of `XYZ` repeating twice at the bottom of the page since authors `ABC` and `GHI` have same affiliation.


title: In \bibliographystyle{alpha}, can I sort references by the first author's last name instead of by the marker?

text: I'm creating a bibliography using `\bibliographystyle{alpha}`. Consider the following three references. > [Gab72] Peter Gabriel... > > [GJ09] Paul G. Goerss and John F. Jardine... > > [GR92] Peter Gabriel and Andrei V. Roiter... They are automatically being displayed in my LaTeX file in the ordering above. This is alphabetical order by the marker: [Gab72] < [GJ09] < [GR92]. Is it possible to instead have the ordering based on alphabetical ordering of the first author's last name? This would instead give the following ordering: > [Gab72] Peter Gabriel... > > [GR92] Peter Gabriel and Andrei V. Roiter... > > [GJ09] Paul G. Goerss and John F. Jardine... I would prefer this latter ordering because then Peter Gabriel's references are adjacent.


title: moderncv - non marvosym symbols

text: When i use the `moderncv` package i get the typical `marvosym` symbols. The following image shows the file `examples\template_banking_red.pdf` that comes with my moderncv package. When you take a look at the `template_banking_red.pdf` from this host it features different symbols for mobile/phone/mail and also additional github/linkedin/twitter symbols. I just updated my texlive yet i still obtain the old symbols. What do i have to change in `moderncv` to obtain the latter result? ![enter image description here](http://i.stack.imgur.com/7lOpc.png)


title: Create a new environment that uses a verbatim environment

text: Consider the following:               \documentclass{article}     \usepackage{environ}     \usepackage{verbatim}     \usepackage{color}     \NewEnviron{vred}{%     \color{red}     \begin{verbatim}       \BODY     \end{verbatim}     }     \begin{document}     \begin{vred}     test     \end{vred}     \end{document}      Compiling with `pdflatex` gives the error:               Runaway argument?     \end {document}      ! Paragraph ended before \next was complete.     <to be read again>                         \par      l.16


title: Combining diagonal table cell lines with minimum row clearance

text: So, yeah, it just never ends I guess. I'm fully aware that the following table is not exactly going to win an award for its stunning beauty no matter what. But the most important problem is that in Column 2, the two rows are looking like one long paragraph instead of two separate table cells. ![example table without clearance](http://i.stack.imgur.com/7CdMH.png) There's an automatic fix for cases like this which is the `\minrowclearance` length from the `colortbl` package: ![example table with clearance](http://i.stack.imgur.com/qyFL6.png) Much better … except now the diagonal line is broken because the cell height was changed by some amount. I was using the Best Code Currently Out There™. Also, the column headers now seem off-center to me but maybe that's just my eyes and in any case I guess one can't have everything, especially with LaTeX tables. But the diagonal line thing is _really_ ugly so if anybody knows how to fix this without having to manually space the table cells, that'd be incredibly great.               \documentclass[a5paper]{article}     \usepackage{tikz,calc,array,pbox,ragged2e,xcolor,colortbl}     \renewcommand{\familydefault}{\sfdefault}     \newcommand\diag[6]{%       \multicolumn{1}{p{#3}|}{\hskip-\tabcolsep       $\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,inner sep=#2,color=#1]       \path[use as bounding box] (0,0) rectangle (#3+2\tabcolsep,#4);       \node[minimum width={#3+2\tabcolsep-\pgflinewidth},             minimum  height=#4+\extrarowheight-\pgflinewidth] (box) {};       \draw[line cap=round] (box.north west) -- (box.south east);       \node[anchor=south west] at (box.south west) {#5};       \node[anchor=north east] at (box.north east) {#6};      \end{tikzpicture}}$\hskip-\tabcolsep}}     \setlength{\minrowclearance}{.25\baselineskip}     \begin{document}     \begin{table}     \arrayrulecolor{white}     \newlength{\firstcolumnwidth}\settowidth\firstcolumnwidth{Diagonal \hspace{1em} Upper}%     \newlength{\othercolumnwidth}\setlength{\othercolumnwidth}{ ( \tabcolsep * \real{-6.0} + \textwidth - \firstcolumnwidth ) / \real{2.0}}%     \begin{tabular}{>{\color{white}\columncolor{blue}\centering\arraybackslash}m{\firstcolumnwidth}|>{\RaggedRight\arraybackslash}m{\othercolumnwidth}|>{\RaggedRight\arraybackslash}m{\othercolumnwidth}}\hline     \rowcolor{blue}\diag{white}{.1em}{\firstcolumnwidth}{3\baselineskip}{\pbox{\firstcolumnwidth}{Left of\\Diagonal}}{\pbox{\firstcolumnwidth}{Upper\\Half}}&\color{white}Column 1&\color{white}Column 2\\\hline     Row 1&There is lots of text in these table cells&So much in fact, that it's hard to see where one cell ends and the next one begins     \\\hline     Row 2&This can be kinda fixed&But that breaks the diagonal line thing which in turn breaks my sanity\\\hline     \end{tabular}     \caption{Broken Diagonal Table Cell}     \end{table}     \end{document}


title: How do I order references by appearance in Latex?

text: > **Possible Duplicate:**   >  how make the reference in order of occurance? I want to order my references based on their appearance in the text, and I have tried several styles like `\bibliographystyle{unsrt.bst}` `\bibliographystyle{unsrt}` `\bibliographystyle{IEEEtran}` I'm using `bibTex` But none of them is working! what should I do?


title: Side-by-side source and output when documenting a style file

text: When documenting a style file, it would be nice to be able to easily put side by side different examples of code, side-by-side with the output they produce. What recommendations to people have to do this efficiently, and aesthetically?


title: Displaying Examples Side By Side

text: I am currently learning LaTeX from 'The Not So Short Introduction To LaTeX' and in that book many examples are displayed side by side: $a^2$ 'Left side of page' --------------------------------- 'right side of page' a^2 I would like to do the same in the paper I am writing, but can not seem to find the command to this?


title: Reference to List Items in Theorem Environment with Label Type “Theorem”

text: I'm trying to set up references to list items in theorem environments. Using the _thmtools_ and the _cref_ -package I am able to reference theorem environments, such that the theorem type, e.g. theorem, lemma, corollary, is displayed in the reference (see Exam. 1). Using the _enumitem_ -package I refer to list items in theorem environments, such that the number of the theorem is displayed together with the item number in a reference (see Exam. 2). Now to my question: Is there an elegant way to combine these two techniques, which would return the theorem type of the environment the list item is in as well as the combination of theorem and item number?   When I'm using the `\autoref{•}` command the label type _item_ is displayed (see Exam. 3). Which makes sense since my list environment _thmlist_ is derived form the _enumerate_ environment. Using `\cref{•}` just produces two question marks (see Exam. 4). At the moment I assign the type directly to the `\label` command as a optional parameter (see Exam. 5). But this solution requires me to hard code the theorem type plus _TexMaker_ won't recognize the labels. Since I like separating my theorems into parts an elegant solution for this problem would be very handy. I shall be grateful for any hint or answer.               \documentclass[10pt,a4paper]{article}          % Input Type and AMS-Packages      \usepackage[utf8]{inputenc}     \usepackage{amsmath,amsfonts,amssymb,amsthm}          % Typography     \usepackage{enumitem}          \newlist{thmlist}{enumerate}{1}     \setlist[thmlist]{label=(\roman{thmlisti}), ref=\thethm.(\roman{thmlisti}),noitemsep}          % Math, Operators and Theorems     \usepackage{thmtools}          \declaretheorem[         name=Theorem,         %refname={theorem,theorems},        %Lower Case Versions of Theorem Type         Refname={Theorem,Theorems},         numberwithin=section]{thm}     \declaretheorem[         name=Lemma,         %refname={lemma,lemmas},         Refname={Lemma,Lemmas},         sibling=thm]{lem}          % References     \usepackage{nameref,hyperref}     \usepackage[capitalize]{cleveref}          \Crefname{thm}{Theorem}{Theorems}     \Crefname{lem}{Lemma}{Lemmas}          \begin{document}          \begin{thm}\label{thm:A}     \begin{thmlist}     \item Statment 1\label{thm:A1}     \item Statment 2\label[thm]{thm:A2}     \end{thmlist}     \end{thm}          \begin{lem}\label{thm:B}     \begin{thmlist}     \item Statment 1\label{thm:B1}     \item Statment 2\label[lem]{thm:B2}     \end{thmlist}     \end{lem}          \begin{description}     \item[1:] That's how I refer to theorems and their like: \cref{thm:A} and \cref{thm:B}.     \item[2:] That's how I refer to parts of theorems but without the label type: \ref{thm:A1} and \ref{thm:B1}.     \item[3:] This happens when using \verb+\autoref{•}:+ \autoref{thm:A1} and \autoref{thm:B1}.     \item[4:] This happens when using \verb+\cref{•}:+ \cref{thm:A1} and \cref{thm:B1}.     \item[5:] My current work around: \cref{thm:A2} and \cref{thm:B2}.     \end{description}     \end{document}      ![Result](http://i.stack.imgur.com/P7omq.png)


title: how to get PSTricks QR codes to handle tildes properly?

text: I am getting bitten by the same problem from one of my previous questions: tildes are not handled properly. But now it's the PSTricks QR code package that's not working, and none of the suggestions from the other question are working. Here's an example:               \documentclass{article}     \usepackage{pstricks}     \usepackage{pst-barcode}     \begin{document}     \begin{pspicture}(2cm,2cm)     \psbarcode{http://example.com/~user}{}{qrcode}     \end{pspicture}     \end{document}      When I put the result into a QR decoder, I get               http://example.com/protect unhbox voidb@x penalty @M  {}user      ...which is exactly the problem I had before. But neither `\textasciitilde` nor `\~` works; both insert weird extra bits into the file. I can work around this instance by using a URL shortener, but really I'd like to know how to teach PSTricks the same tilde-handling magic that hyperref knows.


title: How to create a weekly based schedule (for a complete year)?

text: I want to create a simple week-based schedule in some automatic fashion. Like a cleaning schedule among roommates, a winter-service schedule among neighbors etc. Basically I want to transfer a simple case distinction rule like               x % n == 0   -> party_1 in charge     x % n == 1   -> party_2 in charge     ...     x % n == n-1 -> party_n in charge      (where x is the current week-number) into a DIN-A4 calendar like schedule. Where e.g. each month is a block, each weak is a line in that block which is annotated with the assigned party and week-number (and possibly colorized). The calendar library of tikz looks promising, but I can't find a command to access the weeknumber (for use in if/ifdate clauses). Sure, I can always autogenerate 52 if-clauses for a tikz-calendar command, but perhaps there is a more elegant way?


title: Is there a way to avoid short lines?

text: Is there a universal setting to tell TeX that the last line of a paragraph can not have just one word? For instance, instead of this: > This is a sample paragraph and there is one word   >  here. you would have that: > This is a sample paragraph and there is   >  one word here. Also, is there something comparable to InDesign's Balance Ragged Lines? Instead of this: > With centered text it would be better if more words were   >  on this line. you would get that: > With centered text it would be better   >  if more words were on this line. For information, I'm currently using LuaLaTex, the `memoir` class and the `fontspec`, `microtype` packages.


title: Open-source TeX fonts visually similar to FF Fago or Neo Sans Intel

text: Are there open-source TeX fonts visually similar to FF Fago or Neo Sans Intel (used on intel.com website and also Intel manuals (small example))?


title: Table subnumbering 1a, 1b, etc

text: I have a table that is too big to fit on a page without shrinking the text to unreadable sizes. As a result, I have split it in to two. I can't use longtable to do this automatically as I am also using `\resizebox` to control the text size. Is it possible to set the table numbers to 1a and 1b rather than 1 and 2?


title: Tikz Edge Label Positioning mid anchor

text: I would like to place labels below edges such that the letters don't wobble. I can place them _on_ the edge using the `mid` anchor, but when I use `below` some other anchor is used to calculate the distance.               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{positioning}     \begin{document}     \begin{tikzpicture}     \tikzstyle{vertex}=[circle, draw, inner sep=0.5ex]     \node [vertex] (0) {};     \foreach \n/\e in {1/a,2/b,3/c,4/d,5/e,6/f,7/g,8/h} {       \pgfmathtruncatemacro{\left}{\n-1}       \node [vertex] (\n) [right=of \left] {};       \draw  (\left) -- node[anchor=mid] {\e} (\n); %on the edge, no wobble       \draw (\left) -- node [below] {\e} (\n); % below the edge, wobble     };     \end{tikzpicture}     \end{document}


title: Including transformed XML

text: I need to include a transformed XML document into my LaTeX source. Transformation is specified inside the XML via XSLT. I recently started using LaTeX and I have bib database in XML. However, this XML file contains a lot more information than a `.bib` file can contain (or should contain). Therefore, it looks like one of these will do the trick:   * Including transformed XML text directly (which will produce well formed `.bib` file)   * Including a program output (which will output well formed `.bib` file) I have seen options like running application before and obtaining results using `.bat` or makefiles. However, I will consider these as last resort because it will not be portable. Other people receiving my file should change their editor settings to be able to compile it.


title: Indentation with beamer fontspec and alltt

text: The following document mangles the indentation of the second line of the alltt (the pipe/bar character does not occur under the equals of the previous line).               \documentclass[14pt]{beamer}          \usepackage{fontspec}     \setmainfont{Hoefler Text}     \renewcommand\ttdefault{lmtt}     \usepackage{alltt}     \begin{document}          \begin{frame}[fragile]{Title}     This is some preliminary text          \begin{alltt}       Hol_datatype`ord = End of num                        | Plus of ord \(\times\) num \(\times\) ord`     \end{alltt}     \end{frame}          \end{document}      If I do not scale to 14pt as the beamer option, or if I do not use fontspec, the problem goes away. I do want to use fontspec, but would happily consider some other way of scaling the size of everything in the presentation


title: bibtex: URL and DOI line breaks on different characters

text: In my references, I want to allow DOI's to break on a slash '/' character (or as a last resort on any character) to avoid underfull lines like the third reference below. Note that URL's are already breaking on slashes, and DOI's are already breaking on dashes. ![image with problematic entry](http://i.stack.imgur.com/svnmK.jpg)               \documentclass{article}          \usepackage[left=1.5in,right=1.5in]{geometry}          \usepackage{natbib}     \usepackage[colorlinks,breaklinks,urlcolor=blue]{hyperref}     \usepackage{doi}     \urlstyle{rm}     \bibliographystyle{sp}          \begin{document}     \nocite{Endriss:09} \nocite{Evans:80} \nocite{Szabolcsi:10}     \bibliography{references}     \end{document}      Here are some .bib entries:               @article{Evans:80, Author={Gareth Evans}, Journal={Linguistic Inquiry}, Number={2},         Pages={337--362}, Title={Pronouns}, Url={http://www.jstor.org/stable/4178164},         Volume={11}, Year={1980}}          @book{Szabolcsi:10, Author={Anna Szabolcsi}, Doi={10.1017/CBO9780511781681},         Publisher={Cambridge University Press}, Title={Quantification}, Year={2010}}      The bibliography style file can be downloaded as part of a zip file (containing also the actually used class file) here: Instructions for S&P authors using LATEX 2ε | von Fintel | Semantics and Pragmatics.


title: Reversing the effect of a \newline with the next command?

text: I'm using the `harvard` package and the `agsm` bibliography style. I'm aware that there are alternatives, e.g., `natbib` plus `har2nat`, and I will be looking into those in the not-too-distant future, but at the present I'm just trying to tidy up a bibliography that I've already got. When the entry in the bibtex file contains a URL field, it's included in the bibliography entry in the document using `\newline\harvardurl{...}`, e.g.:               \harvarditem[Baader et~al.]{Baader, Calvanese, McGuinness, Nardi \harvardand\       Patel-Schneider}{2003}{DLH:2003}     Baader, F., Calvanese, D., McGuinness, D.~L., Nardi, D. \harvardand\       Patel-Schneider, P.~F., eds  \harvardyearleft 2003\harvardyearright , {\em       The Description Logic Handbook: Theory, Implementation and Applications},       Cambridge University Press, New York, NY, USA.     \newline\harvardurl{http://dx.doi.org/10.2277/0521781760}      Now, I've often redefined the `\harvardurl` command in order to format the URL differently. Now I want to remove all the URLs from the bibliography entirely. I can remove all lines matching `\newline\harvardurl{...}` from the `.bbl` file, but I'd have to do that after every `bibtex` run. The `\newline` is actually getting inserted by `agsm.bst`:               FUNCTION {write.url}                                                                                { URL empty$                                                                                { skip$ }                                                                                { "\newline\harvardurl{" URL * "}" * write$ newline$ }                                                                                if$                                                                                }      It looks like the only way I could avoid the `\newline` is by making `URL` somehow be empty. So, as the quick workaround, is there something I can do with the definition of `\harvardurl` to remove the effect of `\newline`? As a minimal example that doesn't require the `harvard` package, here's a list with two entries and a `\newline\harvardurl{...}` in each one:               \documentclass{article}          % Don't display the URL text.  How      % can we also counteract the previous     % \newline?     \newcommand{\harvardurl}[1]{}          \begin{document}          \begin{list}{}{}     \item Baader, F., Calvanese, D., McGuinness, D.~L., Nardi, D. \&     Patel-Schneider, P.~F., eds (2003) , {\em The Description Logic       Handbook: Theory, Implementation and Applications}, Cambridge     University Press, New York, NY, USA.     \newline\harvardurl{http://dx.doi.org/10.2277/0521781760}          \item Baader, F., Calvanese, D., McGuinness, D.~L., Nardi, D. \&     Patel-Schneider, P.~F., eds (2003) , {\em The Description Logic       Handbook: Theory, Implementation and Applications}, Cambridge     University Press, New York, NY, USA.     \newline\harvardurl{http://dx.doi.org/10.2277/0521781760}     \end{list}          \end{document}      ![bibliography with too much space](http://i.stack.imgur.com/YlrY2.png) One quick approach that produces initially acceptable results is to define as `\\[-2\baselineskip]`, but this feels pretty hacky:               \newcommand{\harvardurl}[1]{\\[-2\baselineskip]}      It looks OK, at least intially; I'm not confident that this doesn't have some edge case where things break. ![better using a negative baselineskip](http://i.stack.imgur.com/h7ycR.png)


title: Linkstyle in pdflatex

text: What are the different styles to mark a link within the document (not necessarily limited to `hyperref`) What I have till now:   * Ugly box around : `\usepackage{hyperref}`   * Different color : `\usepackage[colorlinks=true]{hyperref}` It should be for pdflatex and if platform dependent then for Linux. It should produce links for at least:   * `\tableofcontents`   * glossaries   * bibtex


title: Latex Tables in ipe

text: I'm making a presentation in ipe. I have a table from a .tex document that I would like to include in ipe document. Is there any way to use the tabular environment or something similar in ipe?


title: Dividing Long Equation using Split

text: I have a long equation as below, ![enter image description here](http://i.stack.imgur.com/5snVi.png) As the equation is too long, I am working to split it. Unfortunately it was not successful. Confused where could be the mistake. Could you assist to point it. MWE:               \documentclass{article}     \usepackage{dsfont}     \usepackage{amsmath}     \begin{document}          \begin{equation} \label{eq:1b}     \begin{split}     Index & = \sum_{\forall a,b \in set, a \neq b}{\left[ \\       & 5*k_{X}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{X}\right]} + \\       & 3*k_{Y}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{Y}\right]} + \\       & 2*k_{Z}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{Z}\right]}\right]}     \end{split}     \end{equation}          \end{document}      Update1: Thanks to all for your help. I tried all and the below works like a charm.               \begin{equation} \label{eq:1c}      \begin{split}      Index = \sum_{\forall a,b \in set, a \neq b}     &\Bigg[ 5*k_{X}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{X}\right]} + \\      &\mbox{ }\hspace{0.35in} 3*k_{Y}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{Y}\right]} + \\      &\mbox{ }\hspace{1in} 2*k_{Z}\left(i_{a,b}\right)*\mathds{I}_{\left[i_{a,b} \in E_{Z}\right]}\Bigg]      \end{split}      \end{equation}       Update2: Thanks Bernard and Egreg. I learnt many news ways to succinctly write an equation. Sorry if I had abused \left and \right. I am bookmarking this page for future reference. I do not have enough reputation to Vote Up the answers. Will revert back to this soonest once I have enough reputation. As I am using 2 columns per page and if `i(a,b)` has to fulfill additional conditions such that for example,               [i_{a,b} \in E_{Z}\ \&\ i_{a,b} \notin E_{Y}\ \&\ i_{a,b} \notin E_{X}]      Hope it is ok to divide those line if too long. MWE:               \documentclass{article}     \usepackage{dsfont}     \usepackage{amsmath}     \begin{document}          \begin{equation} \label{eq:1b}     \begin{split}     \mathit{Index} = \smash[b]{\sum_{\substack{a,b \in \mathit{set}\\a\neq b}}}     \;\bigl[       & 5k_{X}(i_{a,b})\mathds{I}_{[i_{a,b} \in E_{X}]} +{} \\       & 3k_{Y}(i_{a,b})\mathds{I}_{[i_{a,b} \in E_{Y}\ \&\ i_{a,b} \notin E_{X}]} +{} \\       & 2k_{Z}(i_{a,b})\mathds{I}_{[i_{a,b} \in E_{Z}\ \&\ i_{a,b} \notin E_{Y}\ \&\ i_{a,b} \notin E_{X}]}     \bigr]     \end{split}     \end{equation}          \end{document}


title: neither TexShop nor TexWorks compile

text: I just bought a new macbook pro and transferred everything from my previous laptop here. Neither TexShop nor TexWorks can even compile the basic tex templates (such as article or amsart, the error is: **File`article.cls' not found. OR: File`amsart.cls' not found**.). I reinstalled TexLive and I checked specifically and it includes these cls files in texlive.tlpdb. But for some reason TexShop cannot find them. I have set this path: `PATH=/usr/local/texlive/2013/bin/x86_64-darwin/:$PATH` but still nothing. I have also reinstalled TexShop (both versions) but had no success.


title: What is the "#" for in TikZ?

text: I am a newbie and I asked in How to create rectangles like in this example? about how to make some rectangles. I am trying to read the code and understand it as I need rectangles rather than squares. But I cannot find in the net what this #1 to #4 are? As the notation is short I can't even search it up. So I would be happy if somebody helps me with it.               \newcommand\catalannumber[3]{       % start point, size, Dyck word (size x 2 booleans)       \fill[cyan!25]  (#1) rectangle +(#2,#2);       \fill[fill=lime]       (#1)       \foreach \dir in {#3}{         \ifnum\dir=0         -- ++(1,0)         \else         -- ++(0,1)         \fi       } |- (#1);       \draw[help lines] (#1) grid +(#2,#2);       \draw[dashed] (#1) -- +(#2,#2);       \coordinate (prev) at (#1);       \foreach \dir in {#3}{         \ifnum\dir=0         \coordinate (dep) at (1,0);         \else         \coordinate (dep) at (0,1);         \fi         \draw[line width=2pt,-stealth] (prev) -- ++(dep) coordinate (prev);       };     }


title: Problem with bibliography. Double quotes appear around title

text: “Samsung’s “3D vertical” NAND crams a terabit on         a single chip,” http://arstechnica.com/gadgets/2013/08/         samsungs-3d-vertical-nand-crams-a-terabit-on-a-single-chip/.      This is how it appears in my bibliography. I am using cite and url packages. My code looks like this                   \bibliographystyle{IEEEtran}         \bibliography{IEEEabrv,mybib}      My entry in bib file is                   @article{samsung_1TB_SSD2,           title={Samsung's ``3{D} Vertical'' {NAND} crams a terabit on a single chip},           note = {\url{http://arstechnica.com/gadgets/2013/08/samsungs-3d-vertical-nand-crams-a-terabit-on-a-single-chip/}}                 }      I do not want double quotes around title and it should maintain the case. I tried biblatex package but that does not work with IEETran. Please help


title: Should I use \mathsmaller with superscripts and subscripts in \frac?

text: I am stuck with how to best format this equation and would love if you stylish tex-heads could help me out. It looks like this: ![before](http://i.stack.imgur.com/2Jg1u.png) I am happy with it except for the: ![k](http://i.stack.imgur.com/JPv5Q.png) I think the 2 and 0 are too big and close to the k. On first glance for me it looks messy. So I changed it so any superscript or subscript uses \mathsmaller{}. It looks like this: ![after](http://i.stack.imgur.com/YNRVc.png) I much prefer the k_0^2 now, but I am not sure the rest of the equation is as good. But If I remove /mathsmaller{} from the e^{ikr}, then it looks too big and not lined up with the 2. Should I just mix and match, or is there a better more consistent way I should approach this? MWE:               \documentclass{article}     \usepackage{relsize,amsmath}     \begin{document}          \newcommand{\vecr}{{\bar{r}}}     \newcommand{\vecq}{{\bar{q}}}     \newcommand{\vecE}{{\bar{E}}}     \newcommand{\veck}{{\bar{k}}}     \newcommand{\ee}{\mathrm{e}}     \newcommand{\ii}{\mathrm{i}}     \newcommand{\II}{\mathrm{I}}     \newcommand{\kk}{\mathrm{k}}     \renewcommand{\ss}{\mathrm{s}}          \begin{equation} %without mathsmaller     \vecE_{s}(\vecr,t) = \frac{k_{0}^2}{4 \pi} \frac{\ee^{\ii kr}}{r} \left( \hat{\II} - \hat{\kk}_{\ss} \hat{\kk}_{\ss} \right) \int_{V} \ee^{\ii \veck^{\prime} \cdot \vecr^{\prime}} \vecE (\vecr^{\prime},t)     \end{equation}          \begin{equation} %with mathsmaller     \vecE_{s}(\vecr,t) = \frac{k_{\mathsmaller{0}}^\mathsmaller{2}}{4 \pi} \frac{\ee^{\mathsmaller{\ii kr}}}{r} \left( \hat{\II} - \hat{\kk}_\mathsmaller{\ss} \hat{\kk}_\mathsmaller{\ss} \right) \int_{V} \ee^{\ii \veck^{\mathsmaller{\prime}} \cdot \vecr^{\mathsmaller{\prime}}} \vecE (\vecr^{\mathsmaller{\prime}},t)      \end{equation}          \end{document}


title: ExSheets fancy headings breaks

text: # Remarks From the `exsheets` documentation I grabbed a piece of code to produce fancy headings for questions and solution, but it breaks. It is the `fancy` heading style on page 49 and 50 in the current CTAN documentation (2013-12-07). # Implementation               \documentclass{article}     \usepackage{exsheets}          % From the documentation page 49 and 50     \DeclareInstance{exsheets-heading}{fancy}{default}{         toc-reversed  = true,         indent-first  = true,         vscale        = 2,         pre-code      = \rule{\linewidth}{1pt},         post-code     = \rule{\linewidth}{1pt},         title-format  = \large\scshape\color{exsheetsred},         number-format = \large\bfseries\color{exsheetsblue},         points-format = \itshape,         join          = { number[r,B] title[l,B] (.333em,0pt) },         attach        = {             main[hc,vc]number[hc,vc](0pt,0pt);             main[l,vc]points[r,vc](-\marginparsep,0pt)         }     }          \SetupExSheets{headings=fancy}     \begin{document}          \begin{question}         What does the following code do?     \end{question}          \end{document}      # Output It seems to break inside `title[l,B]` in the line `join = { number[r,B] title[l,B] (.333em,0pt) }`.               Runaway argument?     B] (.333em,0pt)\s_obj_end \__prg_break_point:Nn \seq_map_break: {\__seq_pop_ite     m_def: \ETC.     ! File ended while scanning use of \__exsheets_join_coffin_sequence:w.     <inserted text>                      \par      <*> sheet1.tex          ?


title: Center subequation of multiple lines

text: I would like to keep my style of subequations but I also would like to center these subequation, which is on multiple lines (because it's length). So that means, the second part/line of the subequation must be in the center of the first one. Anyone has an idea?               \begin{subequations}     \begin{equation}     \ddot{x}=R\cdot\left(\underbrace{-2\cdot\dot{\theta}\cdot\dot{\phi}\cdot cos(\theta)\cdot sin(\phi)}_\text{Coriolisversnelling} - \underbrace{ (\dot{\theta}^2+\dot{\phi}^2)\cdot sin(\theta)\cdot cos(\phi)}_\text{Middelpuntzoekende versnellingen} \right. \\+ \left.\underbrace{\ddot{\theta}\cdot cos(\theta)\cdot cos(\phi) - \ddot{\phi}\cdot sin(\theta)\cdot sin(\phi)}_\text{Hoekversnellingen}\right)     \end{equation}     \begin{equation}     ---     \end{equation}     \end{subequations}


title: Listings line numbers and figure

text: I'm using `listings` to typeset some C inside a `figure` environment next to a diagram, and I have the numbers on the left. My problem is in `two-column` mode the line numbers appear in what should be the margin, outside the text area (i.e., numbers are not justified with the left-hand side of the column, but instead slightly to the left of the justification). The code I'm using is:               \begin{figure*}       \begin{minipage}{.45\textwidth}        \begin{lstlisting}[numbers=left]         i = 0;         j = 1;        \end{lstlisting}       \end{minipage}\hfill       \begin{minipage}{.45\textwidth}          \includegraphics{figure}       \end{minipage}      \caption{My caption}      \label{fig:blah}     \end{figure*}      Is there a way to keep the line numbers from `lstlisting` inside the text area?


title: How to make the bracket smaller?

text: The two big brackets are the same big, I dislike that. I want to keep the second one smaller, and let the space between the equation a little bit smaller. How could I do that? Thanks! ![enter image description here](http://i.stack.imgur.com/Wj57e.png)               \documentclass[CJK]{beamer}      \usepackage{beamerthemesplit}      \usepackage{CJK,CJKnumb}     \usepackage[english]{babel}     \begin{document}     \begin{CJK*}{GBK}{song}     \begin{frame}     \frametitle{      Set\\$D=\left\{(x,y)\Big|,\begin{cases}      2x-y=1 \\      x+4y=5\\      \end{cases}\right\}$      }      \end{frame}      \end{CJK*}      \end{document}


title: Why should some TeX primitives never be set directly in LaTeX?

text: In an earlier question More economic and robust command for abstract at the beginning of chapters, David Carlisle told that one should never use directly some TeX primitives. How can I distinguish which primitives are safe to use?


title: Longtable spread too wide

text: I've created some tabular output through Python (pandas database). However, it leaves a too wide space between columns 2,3 (for which I cannot detect the reason), and actually overflowing the page width. Sample code is below               % !TEX encoding = UTF-8 Unicode     % !TEX TS-program = pdflatexmk     \documentclass[11pt]{article}     \usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.     \geometry{letterpaper}                   % ... or a4paper or a5paper or ...           \usepackage{booktabs}          \usepackage{longtable}          \begin{document}          \begin{longtable}{lrrrrrrrrrrrrrr}     \toprule     {} &     $\underline Y$ &   $\bar Y $ &  $\epsilon$ &   $\bar p$ &    $\underline s$ &  $\bar s$ &   $\theta$ &  $\underline\theta$ &  $\bar\theta$ &      u &     $\underline v$ &   $\bar v$ &     $\underline w$ &   $\bar w$ \\     \midrule     \endhead     \midrule     \multicolumn{3}{r}{{Continued on next page}} \\     \midrule     \endfoot          \bottomrule     \endlastfoot     0 &  0.532 &  0.394 &      1.0 &  1.349 &  0.20 &  0.40 &  32.223 &  12.978 &    19.245 &  0.074 &  0.960 &  1.424 &  0.423 &  0.458 \\     1 &  0.603 &  0.317 &      1.0 &  1.901 &  0.15 &  0.65 &  38.459 &  11.728 &    26.731 &  0.079 &  0.928 &  2.115 &  0.485 &  0.576 \\     2 &  0.566 &  0.361 &      0.5 &  1.253 &  0.20 &  0.40 &  30.642 &  13.475 &    17.167 &  0.073 &  0.986 &  1.256 &  0.407 &  0.433 \\     3 &  0.504 &  0.422 &      2.0 &  1.428 &  0.20 &  0.40 &  33.573 &  12.558 &    21.015 &  0.075 &  0.937 &  1.568 &  0.437 &  0.479 \\     \end{longtable}               \end{document}      ![table screenshot](http://i.stack.imgur.com/0SzI8.png)


title: Adding the figures to a `draft` pdf

text: Suppose you have a `draft` pdf, and the only difference with a desired `final` version of it is the lack of figures. And suppose too you have the original figures, but not the source code of the document. What would be your best trick to achieve the document with its figures on place?


title: Scaling External Asymptote File within the Current Document

text: I have diagrams generated in Asymptote stored in external files. Is it possible to input the files into my current LaTeX document and to choose the scale factor within the current document? The following naive approach does not work:               \documentclass{article}     \usepackage{asymptote}     \begin{document}          A unit sphere, 1/4 size:     \begin{asy}[width=0.25\textwidth]     \input{asyfile}     \end{asy}           \end{document}      Contents of asyfile:               import solids;     draw(unitsphere,gray);      (I use these diagrams in different contexts, so I do not want to pick the scaling within the Asymptote file.)


title: How to change the font of a cross reference made using \ref

text: I am using the Cambridge University Press book class cambridge7A (available at http://authornet.cambridge.org/information/productionguide/laTex_files/ and much used by CUP authors) A minimal example both describes and illustrates the problem if you run it:               \documentclass{cambridge7a}          \begin{document}          Suppose we introduce a footnote here\footnote{\label{myfootnote}      And here's the note text!}, and then we later refer want to refer to the note,      as fn.~\ref{myfootnote}.           Then the number in the latter cross-reference is superscripted,      when we of course will want a simple inline reference, like this: fn. 1.           \end{document}      So the question is: preferably without hacking into the class file, is there simple way of forcing the cross-reference produced \ref{my footnote} to return a number in the normal font (for the context it is occurring in) rather than a superscripted script sized number. Thanks in advance!


title: Hanging indents for \section headings

text: Sometimes, I do have long section headings that take more than one line. **I would like to make second and each subsequent line of`\section` heading indented** (so called 'hanging indent'). I know I can produce hanging indent for paragraphs with `hanging` package:               \documentclass[final]{book}     \usepackage{lipsum}     \usepackage{hanging}          \begin{document}          \hangpara{3em}{1} \lipsum[11]          \end{document}      However, I have no idea how to do the same for `\section` heading as `hanging` package works only for paragraphs and not headings. My code for section heading so far:               \documentclass[final]{book}     \usepackage{lipsum}          \begin{document}          \section*{\large{Very long section heading that takes two or more lines when it is typeset on page}}          \end{document}


title: How can I prettyprint a URL of a http-request in this particular way?

text: I have a URL for a HTTP-Request as the only content of an `lstlisting` environment, and I want to prettyprint it as follows:   * `color1` for the first line, and for `?`, `&`, and `|`,   * `color2` for parameter names,   * `color3` for the parameter values (both characters and numbers). I tried the to use the `PHP` language predefined by `listings`, but the way the base URL was typeset didn't satisfy me. See my attempt below. As you can see, I colored the "keys" manually, which is probably not a good idea... What should I do? ![enter image description here](http://i.stack.imgur.com/xQ7tG.png)               \documentclass[12pt,a4paper,oneside]{scrreprt}     \usepackage{listings}     \usepackage{xcolor}          \definecolor{color1}{rgb}{0.0,  0.0,0.6}     \definecolor{color2}{rgb}{0.29, 0,  0.29}     \definecolor{color3}{rgb}{0.25, 0.5,0.5}               \lstset{         basicstyle=\ttfamily,         columns=fullflexible,         showstringspaces=false      }          \lstdefinelanguage{url}{         moredelim=**[is][\color{color1}]{@}{@},         showstringspaces=true,         identifierstyle=\color{color2},         keywordstyle=\color{color3},         morekeywords={param1,param2,params,L},     }          \begin{document}             \lstset{language=url}         \begin{lstlisting}             http://domain.com/version/xyz.exe/abc             ?L=sysname             &param1=512             &param2=1024             &params=abc             |paramA             |a             |paramB             |b         \end{lstlisting}     \end{document}


title: Glossaries 'unknown option' Error

text: In the following, I create a separate glossary that I do not want to have hyperlinked (in my actual document, the glossary without links will not be displayed). The following MWE generates an error: > Unknown option 'nohypertypes' for package 'glossaries'               \documentclass{report}          \usepackage{hyperref}     \usepackage[nohypertypes={common}]{glossaries}          \newglossary{common}{cacr}{cacn}{Common Acronyms}     \newglossaryentry{unlinkedtest}{         type={common},         name={test glossary entry},         description={should not be linked}}     \newglossaryentry{linkedtest}{         name={test glossary entry},         description={should be linked}}     \makeglossaries%          \begin{document}         This should be linked: \gls{linkedtest}\par%         This should not be linked: \gls{unlinkedtest}         \printglossary[type=common]%         \printglossary[type=main]%     \end{document}      The `nohypertypes` option is detailed as a new change in v3.04 and the log file shows `glossaries` v3.04 is being loaded. Without the `nohypertypes` option, the MWE works, except that both `\gls` are linked to their glossary entries.


title: Error using tkz-euclide and \tkzIntersectionCC[R]

text: The `tkz-euclide` and `\tkzIntersectionCC[R]` produces: `FP error #1: "Logarithm of negative value!"` The code:               \begin{tikzpicture}         \tkzDefPoint(0,14.5){centerClip}         \tkzDrawCircle[R,color=red](centerClip,4.5 cm)         \tkzClipCircle[R](centerClip,4.5 cm)         \foreach \y in {1, ..., 8}  {             \tkzDefPoint(0,\y){O\y}             \tkzDrawCircle[R](O\y, 10 cm)         }         \tkzDefPoint(-14.5, 14.5){newOrigin}         \begin{scope}[shift = (newOrigin)]             \foreach \x in {1, ..., 14}  {                 \tkzDefPoint(0.7*\x, 0){Q\x}                 \tkzDrawCircle[R](Q\x, 9 cm)             }         \end{scope}         \tkzInterCC[R](O5, 10 cm)(Q7, 9 cm)         \tkzGetPoints{I}{I'}         \tkzDrawPoints[color = red, size = 12, fill = red](I, I')         \foreach \o in {1, ..., 8}             \foreach \q in {1, ... 14}{%                 \tkzInterCC[R](O\o, 10 cm)(Q\q, 9 cm)}     \end{tikzpicture}


title: How can I automatically typeset a list of (theorem-like) definitions?

text: I've defined two custom types of theorem-like environments: _definition_ and _example_. I now want to automatically typeset a list of such environments present in my document. The output I'd like to get would be similar to that obtained with `\listoffigures` and `\tableofcontents`. How can I automatically typeset a list of such theorem-like environments? Edit: Added a mwe:               \documentclass{article}     \newtheorem{defi}{Definition}     \newtheorem{bsp}{Beispiel}     \begin{document}     \begin{defi}[Definition1]     foo foo foo     \end{defi}     \begin{bsp}[Example 1]     foo foo foo     \end{bsp}     \end{document}


title: Biblatex: footnote citations. Two references to footnote in same slide

text: I'm putting references at the bottom of Beamer slides. I'm referring to the same footnote twice in one slide, but latex is create a duplicate footnote: the label/ref is not working. I found a version of this problem for natbib: References at the end of beamer slides However, I'm doing this in Biblatex as I need to format the citations. How can I refer to the same footnote twice, but avoid having a duplicate footnote created? I need the counter to reset for each slide and start from 1 every frame. How can I reset the counter for every slide?               \documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress,professionalfonts]{beamer}          \usepackage[backend=bibtex,style=verbose,citestyle=authoryear]{biblatex}     \addbibresource{biblatex-examples.bib}          \DeclareCiteCommand{\citejournal}         {\usebibmacro{prenote}}         {\usebibmacro{citeindex}%             \usebibmacro{journal}}         {\multicitedelim}         {\usebibmacro{postnote}}     \renewcommand{\footnotesize}{\tiny}     \newcommand{\customcite}[1]{(\citeauthor{#1}, \citeyear{#1})}     \newcommand{\customfootcite}[1]{\footnote{\citeauthor{#1} (\citeyear{#1}), \emph{\citetitle{#1}.} \citejournal{#1}}}          %\newcommand\foootcite[1]{\footnote{\tiny\bibentry{#1}}\label{\thepage:#1}}     %\newcommand\secondcite[1]{\textsuperscript{\ref{\thepage:#1}}}%This worked in Natbib, but is commented out because I'm using Biblatex now. . .          \DeclareFieldFormat[article]{citetitle}{#1}     \DeclareFieldFormat[article]{title}{\mkbibemph{#1}} %Removes quotiation marks, puts italics     \DeclareFieldFormat[article]{journaltitle}{#1} % italic journal title with comma     \renewbibmacro{in:}{\hspace{-2pt}}     \AtEveryCitekey{\clearfield{pages}\clearfield{volume}}          \include{formatting}     \begin{document}          \begin{frame}{Motivation}     \begin{itemize}         \item Individual investor behaviour: Household finance         \item Rationality in individual preference models vs behavioural finance         \item Rational learning vs biased learning~\customcite{murray}~\customfootcite{murray}         \item Learning by doing vs learning about ability~\customfootcite{murray}         \item Experimental studies: immediate outcomes~\customfootcite{augustine} \& well-structured feedback~\customfootcite{cotton}     \end{itemize}     \end{frame}     \end{document}


I want to make a macro to import all TeX input files in a directory in which the input file containing the macro exists. When reading an external file, TeX appends a blank line to the last iteration. In the following code I use a bad algorithm because there are two loops. The first one is used to find the total file, and the other one is used to do the main job.               \documentclass{article}     \usepackage{listings}          \lstset{language={[LaTeX]TeX},breaklines=true}               \def\X     {%         \immediate\write18{cmd /c dir /b *.tex > \jobname-temp.txt}%         \newread\myfile         \openin\myfile=\jobname-temp.txt         \newcount\counter         \counter=0         \loop             \unless\ifeof\myfile             \read\myfile to\mydata             \advance \counter by 1         \repeat         \closein\myfile         \openin\myfile=\jobname-temp.txt         \advance \counter by -1         \loop             \ifnum \counter > 0             \read\myfile to\mydata             \section\mydata             \lstinputlisting{"\mydata"}\newpage             \advance \counter by -1         \repeat         \closein\myfile     }               \begin{document}     \X     \end{document}      I want to use a single loop to increase the performance. How to detect a blank line inserted by TeX when reading an external file line by line?


title: Table (page width) in multicol?

text: I'm writing a scientific article (two-column style), and I need to show some results in a table with lots of columns, so I have to put a page-width table in the bottom of the page. How can I do?


title: Which package is using \includegraphics?

text: Which package is using `\includegraphics`? I have a issue in my installation package, I need to know which package is using `\includegraphics`. The issue is picture showing like a DOT . If we zoom (6400%) that place the picture can see some what TeX image in top.               \documentclass[12pt]{article}     \usepackage{graphicx}     \usepackage{placeins}     \usepackage{float}     \usepackage{subfigure}     \begin{document}          \begin{figure*}[htp]       \centering       \subfigure[random caption 1]{\includegraphics[scale=0.38]{pic1.jpg}}\quad       \subfigure[random caption 2]{\includegraphics[scale=0.38]{pic2.jpg}}     \end{figure*}          Text     \begin{figure}[h!]         \centering         \includegraphics[width=10\textwidth]{pic1.jpg}         \caption{IDEF0sss}     \end{figure}          \begin{figure}[h!]     \includegraphics[width=30mm, height=20mm]{pic1.jpg}     \end{figure}          \end{document}


title: How to forbid LaTex from placing floats in the middle of sentences?

text: I'm finding image floats being placed in a paragraph... OK this is normal. But they're being placed inside sentences which looks terrible. So I have been fishing a round for some time but haven't had people complain about this. This type of answer usually comes up: How to protect text from being split by a float? I'm using:               \usepackage{placeins}     \usepackage{flafter}      **eg**. ![enter image description here](http://i.stack.imgur.com/i5z2E.png) Any thoughts?


title: Problem with tabular and npnoround

text: When I compile the table below (I tried to edit the code so that it shows well on this site, but that too doesn't seem to work), I get very strange results:   * I want all numbers to be in the {3}{1} format but this is not the case for the number in the third and 6th column.    * How can I remove the large space between the first digit and the opening parenthesis in the second and third column?   * I want a vertical line after the second and fourth column (and no vertical line after the third). This is the code:               \usepackage{numprint}     \npdecimalsign{.}     \nprounddigits{1}     \begin{table}[ht]     \centering     \begin{tabular}{|r| n{3}{1}  n{3}{1} l| n{3}{1} n{3}{1} l| n{3}{1} n{3}{1} l|}     \hline         & \multicolumn{2}{c|}{\textbf{e1}}&\multicolumn{2}{ c| }{\textbf{e2}} &\multicolumn{2}{c|}{\textbf{e3}}\\        \hline     \textbf{e1}&&&1.712682&(0.9381452)&2.768738&(1.646461)\\     \textbf{e2}&0.5613594&(0.4711274)&&&1.959158&(1.001164)\\     \textbf{e3}&185.9336662&(2.1302318)&140.417800&(1.797353)&&\\        \hline     \end{tabular}     \label{tab:tab1}     \caption{this data table}     \end{table}     \npnoround


title: create header using package fancyhdr - Mirror Page

text: How to create header using package fancyhdr like the below format? It is like mirror page. ## LO PN | PN RE                        |              |       LO - Left ODD PN - Pagenumber RE - RightEven I want a output in latex. Thanks in advance. and Can anyone send example for this code? \fancyhead[LE]{\leftmark} \fancyhead[RO]{\rightmark} \fancyhead[CE,CO]{\thepage} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt}


title: Algorithm as figure and without italic and bold formatting?

text: I want to include an algorithm in my latex document, however without printing most of it in italic and all the keywords in bold font like it's done by default by e.g. the algorithmicx package. I like this simple style: ![enter image description here](http://i.stack.imgur.com/dNxfQ.png) (screenshot of a part of page 3 of http://research.microsoft.com/pubs/68869/naacl2k-proc-rev.pdf) The only thing I'd like to add to this style are line numbers. Can anyone help me, how I get the formatting of the screenshot and the line numbers? Thanks :-) So, here is what I have until now:               \documentclass{article}     \usepackage{algorithm}     \usepackage{algpseudocode}     \usepackage{algpascal}     \begin{document}               \alglanguage{pascal}     \begin{algorithm}     \caption{Paull's algorithm}     \begin{algorithmic}[1]     \State Assign an ordering $A_{1}, ..., A_{n}$ to the nonterminals of the grammar.     \For{i = 1}{n}     \Begin         \For{j = 1}{i-1}         \Begin         \State for each production of the form $A_{i} \rightarrow A_{j} \alpha$         \End          \End          \end{algorithmic}     \end{algorithm}     \end{document}      This ends up as ![enter image description here](http://i.stack.imgur.com/hdRYB.png) Based on this I want the following changes:   * do and begin shall be on the same line   * end shall be vertically aligned to it's associated for (see first screenshot of this post).   * Integration as a figure or at least without a black border and with a caption below the algorithm would be prefered   * bold formatting for keywords should be turned off


title: Reproduce the beamer miniframes environment

text: I would like to reproduce the `miniframes` features of beamer, with the bullets per section even though it would concern the chapters per part. I need a counter counting the total number of chapters in each part of the document. Based on `beamerbasicmisc` there is probably some code to be taken from the following lines:               \def\headcommand#1{\global\advance\beamer@totalheads by1\relax%       \expandafter\gdef\csname @@head\the\beamer@totalheads\endcsname{#1}}     \def\dohead{\beamer@headcounter=0\relax\loop\ifnum\beamer@headcounter<\beamer@totalheads%       \advance\beamer@headcounter by1\relax%       \csname @@head\the\beamer@headcounter\endcsname\repeat}      but later, needed information is written in the .aux file. Is there a simpler way to achieve this?


title: Begin Array in LaTex

text: ![enter image description here](http://i.stack.imgur.com/lrtcV.jpg) Tried the equation in the image below with the following codes, but was encountering errors. Please can anybody be kind enough to help. Thanks.               \begin{array}     {p^'}_0\left( t \right) =  - \lambda {p_0}\left( t \right) + \mu {p_1}\left( t \right),\\     {p^'}_j\left( t \right) = \lambda {p_{j - 1}}\left( t \right) - \left( {\lambda  + j\mu } \right){p_j}\left( t \right) + \mu \left( {j + 1} \right){p_{j + 1}}\left( t \right)     \end{array}


title: Making charts using alternative tools?

text: I would like to create some charts including bar and pie in my LaTex file, so far I found some useful packages in order to make them such as pgfplots. I have also looked into some science papers and seen cool graph design. I wonder how can I do my own charts like the following charts shown in two images respectively? Is there any well-known tools for that? Or the existing packages still provide to make cool graphs? ![enter image description here](http://i.stack.imgur.com/sP02n.png) ![enter image description here](http://i.stack.imgur.com/n32Wi.png)


title: How to achieve this chapter style without using the memoir class?

text: As `fncychap` has no such chapter style, and using the `memoir` class will cause a lot conflicts with my current settings (`book` class), how to make this style (perhaps using the `titlesec` package)? Table of contents and Chapter style: ![enter image description here](http://i.stack.imgur.com/7qoys.png) and ![I](http://i.stack.imgur.com/yeTjN.png) Here are my setting for chapters:               \usepackage[ ]{titlesec}       \titleformat{\chapter}[display]     {\normalfont\LARGE\bfseries }{\chaptertitlename\  \thechapter}{10pt}{\huge}     \titlespacing*{\chapter}{0pt}{40pt}{40pt}  % left, vertical, skip


title: Shuffle symbol breaks footnotes?

text: I am currently recompiling a draft monograph with Springer's "svmono" class. When compiling the file, everything seems to work fine, but the first time TeX encounters a footnote, it throws the error message               ! LaTeX Error: Font U/shuffle/m/n/4.25 not found.      Here is a minimal example generating the error:               \documentclass{svmono}     \usepackage{shuffle}          \begin{document}     This is a footnote.     \footnote{This generates an error message.}     \end{document}      If the "footnote" line is commmented out, it works fine. In case anyone wants to try, here is a Dropbox link to the svmono class: https://dl.dropboxusercontent.com/u/2623632/svmono.cls. Does anyone have an idea how to fix this? While I need the shuffle symbol in the main text, I don't ever need it inside a footnote, so I would be happy with a solution that fixes the error message at the expense of breaking the \shuffle command inside the \footnote command. In case it helps, I am using TeX Live 2013 on OS X. Thank you very much in advance for any hints!


title: Graphing algebraic functions and converting to image (PNG)

text: My goal is to be able to generate, _on-the-fly_ , a small variety of graphs-- linear functions, quadratics, inequalities, multiple plots of each. Nothing more complex than what you'd see in a high school Algebra I course. I'd also like to be able to shade the graphs of inequalities. Let me know if I should open different questions for each type of function. **Let's start this question with how to graph`y = 2x + 1`** and convert to PNG. I don't need much detail in the graph--labeled axes, number markings and the function. A background grid would be a bonus. I'd also like to convert to PNG images. Right now, the closest process I have is _text_ ( **Let me be clear, I need graphs** ) in TeXWorks (Windows) generating a `{standalone}` PDF that I have to ultimately convert using the _ImageMagick_ `convert` command.               \documentclass[preview]{standalone}     \begin{document}     Hello, World!     y = 2x + 1     \end{document}      I select `pdfLaTeX` and this generates a PDF. I follow this with the ImageMagick conversion:               convert myfile.pdf myimage.png      This process does work, but it's clunky. These images will be used in a web application, so is generating them on the fly with all this file I/O really the best way? ## tex2png I've tried `tex2png` but it hangs on the _PostScript File Generation..._ step.               e:\downloads\tex2png>tex2png "\sum_{i=1}^N{i}=\frac{N(N+1)}{2}" result.png     [>] LaTeX File Generation...     [>] LaTeX File Compilation...     [>] PostScript File Generation...


title: Problem with probability tree

text: I am trying to make in LaTeX this probability tree: ![Probability tree](http://i.stack.imgur.com/09Rss.png) I tried using the `tikz` package but I keep having some issues. This is the best I got so far (link: https://www.writelatex.com/855538qcgkps#/1917915/):                   \documentclass{article}              \usepackage{tikz}         \usetikzlibrary{trees}              \begin{document}         \pagestyle{empty}              \tikzstyle{level 1}=[level distance=3cm, sibling distance=3cm]         \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]              \tikzstyle{bag} = [circle, minimum width=10pt, inner sep=2pt]         \tikzstyle{end} = [circle, minimum width=3pt, fill, inner sep=0pt]              \begin{tikzpicture}[grow=right, sloped]              \node[bag]{}         child {                 node[bag] {O}                             child {                         node[end, label=right:{O}] {}                         edge from parent                         node[above] {}                         node[below]  {$1-\lambda$}                         child {                         node[end, label=right: {O ...}] {}                         edge from parent                         node[above] {}                         node[below]  {$1-\lambda$}                     }                     child {                         node[end, label=right: {S ...}] {}                         edge from parent                         node[above] {$\lambda$}                         node[below]  {}                     }                     }                     child {                         node[end, label=right: {S}] {}                         edge from parent                         node[above] {$\lambda$}                         node[below]  {}                     }                     edge from parent                      node[above] {}                     node[below]  {$1-\lambda$}             }             child {                 node[bag] {S}                         child {                      edge from parent                         node[above] {1}                         node[below]  {}                         node[bag] {O'}                                    child {                                         edge from parent                                         node[above] {$1$}                                         node[below] {$$}                                         edge from parent                         }                         }                 edge from parent                              node[above] {$\lambda$}                     node[below]  {}             };                   \end{tikzpicture}         \end{document}      As you can see, they are quite different, but I can't seem to be able to progress any further, would you be able to help me? I can't seem to realize what are the errors. Best.


title: How can I get symbols to appear in the middle of commutative diagrams using tikz-cd?

text: I'd like to get question mark symbols in the center of my commutative diagrams, thus:               \documentclass{article}          \usepackage{tikz-cd}          \begin{document}          \[     \begin{tikzcd}[row sep=tiny]     A \arrow{d}[swap]{\beta} & K_h \arrow{l}[swap]{\pi'} \arrow{d}[swap]{\gamma} \arrow{r}{\pi} & A \arrow{d}{\alpha} & & \\     F(A) & F(K_h) \arrow{l}{F(\pi')} \arrow{r}[swap]{F(\pi)} & F(A) & \hspace{-14em}\raisebox{2.25em}{?} & \hspace{-32em}\raisebox{2.25em}{?}     \end{tikzcd}     \]          \end{document}      What I've done here is a hack to show you what I mean, it doesn't work for more complex diagrams. I guess some kind of absolute positioning functionality would do, but I can't unearth it. I'm happy with tikz-cd and don't want to switch to another package. Any ideas? Many thanks!


title: LyX: author-year not compatible with natbib package with custom bst

text: I have a problem with LyX and citation. I would like to use the option Natbib : Author-Year to display the citation like "(Gebel _et al_., 2009)" but I keep getting the error `author-year not compatible with natbib package`. I am using a custom ".bst" file. It works fine if I just want to show numbers as "[1]" Can anyone help me solve this problem ? Would it work better with TeXmaker ?


title: New line in a math block

text: > **Possible Duplicate:**   >  Linebreak in equations I am very new to latex, its been a super frustrating I spend almost close to two hours on getting a new line inside the math block               \[{P(g(X) \neq Y |X = x) = 1 − P (Y = g(X)|X = x)}     {= 1 - [P(Y=1,g(X)=1|X=x) + P(Y=1,g(X)=1|X=x)]}     {= 1 − E[1_{Y =1} 1_{g(X)=1}|X = x] + E[1_{Y =0} 1{g(X)=0}|X = x]}     \]      Also I used underscores to show the subscript but somehow that doesn't work either. It would be great if someone could give a pointer.


title: How to overcome limitations of \url{}?

text: One major limitation of the url package is that "the argument must not contain unbalanced braces.". However I have the problem that sometimes URLs I have to include in my document do not satisfy this rule like the following example:               http://example.org/abc?param=}      Because of the balanced braces rule you can not use: `\url{http://example.org/abc?param=}}` Neither can you escape the curly brace `\url{http://example.org/abc?param=\}}`. How can this URL be used in an LaTeX document? I need to have it clickable and I need the line-breaking behavior for long URLs.


title: biblatex: Single out specific bibliography entries

text: I'm writing a document and I want to split my bibliography into 3 or more sections, where the first sections single out specific entries in some specific order, and the last section shows all other entries which were cited in my paper and _do not_ appear already in the previous sections. How can I do this with `biblatex`? As a mockup, what I want to produce is something that looks like the following: > ## Bibliography > > ### Very important papers > > [1] Some person, and some one else. The most important paper which should > appear at the beginning of the list. > > [2] Someone else. Another important paper which should appear second. > > ### Some other papers > > [3] Yet another person. A paper which is not so important, but also deserves > a special section. > > [4] The same person maybe. Another paper which I want as second in this > section. > > ### All other papers > > [5] Person A. Other cited papers go here. > > [6] Person B. Perhaps sorted by author name. > > [7] Person C. And these papers do not appear in the previous lists.


title: font garamond without oldstylenumbers

text: I have to use Garamond for my publishing house. Is there a way to use the package garamond without having the numbers in the oldstyle? Here are the packages which I am using for pdflatex:               \documentclass[twoside,Numbers=Lining,3.5headlines,smallheadings,10.5pt,                    tocleft,idxtotoc,final]{scrreprt}     % Fonts for pdflatex:     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage{ngerman}     \usepackage{garamond}     \renewcommand{\refname}{Literatur}     \renewcommand{\bibname}{Literatur}     \usepackage{soul}     \usepackage{soulutf8}     \sodef\an{}{.1em}{.4em plus.1em}{.8em plus.1em minus.1em}     \newcommand{\mycohead}[1]{\cohead {\an{ #1}\parbox[t][2mm][t]{0pt}{}}}     \newcommand{\mycehead}[1]{\cehead {\an{ #1}\parbox[t][2mm][t]{0pt}{}}}     %----------------------     \usepackage{eurosym}     \usepackage{lscape}     \usepackage[dvipsdoc]{rotating}     \usepackage{rotating}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsmath, amssymb, graphics}     \usepackage{exscale,latexsym}     \usepackage{setspace}     %\usepackage[flushmargin]{footmisc}     \usepackage{pict2e}     \usepackage{graphpap}     %\usepackage{subfigure}     \usepackage{europs}     %\usepackage{natbib}     %\usepackage[small]{caption}     \usepackage{amssymb}     \usepackage{wasysym}     \usepackage[dvips]{epsfig}     \usepackage{graphicx}     %\usepackage{color}     \usepackage{scrpage2}     \usepackage{tocloft}     %\usepackage{verbatim}     \usepackage{titlesec}     % page format     \usepackage{geometry}     \geometry{verbose, twoside, paperheight=213mm, paperwidth=140mm, textwidth=108mm, textheight=172mm}     %----------------------     \usepackage{manyfoot}     \usepackage[nottoc]{tocbibind}     \usepackage{upgreek}     %\usepackage{array}     % caption italics     \usepackage[font={it}]{caption}     %----------------------     \usepackage[alwaysadjust]{paralist}     \begin{document}     \garamond     \addcontentsline{toc}{chapter}{1 Einleitung}     \mycohead{Einleitung}     \chapter*{1 Einleitung     \\     \vspace{6pt}     \mbox{}     \\\mbox{}     \\\mbox{}     }     This is the basic header. The font seems to be the garamond font.     The numbers are: 123456789. But should be without the old style.     \ungaramond     \\     \\     From here: the garamond is ignored.     This is the standard font and the numbers are: 123456789     \\     \\     But the book has more than 2 hundred pages with thousands of numbers and therefore I need a global routine for avoiding old-style-numbers.     \end{document}


title: Text section in right bottom of side

text: How can I write a text section in latex in the right bottom side of the page with a nice font ? It is for some thanks text. Now I have:                   \vfill     {\sffamily     \begin{flushright}         \begin{tabular}{l}         TEXTTEXTTEXTTEXTTEXT\\         \\         TEXTTEXTTEXTTEXTTEXT\\     \\     TEXTTEXTTEXTTEXTTEXT\\     \\     TEXTTEXTTEXTTEXTTEXTTEXT\\         \end{tabular}     \end{flushright}     }