title: How to modify line spacing in algorithm / algpseudocode?

text: I want to increase line spacing between statements in `algorithm` environment. I used the `setspace` package as here, but it also affects the space between line breaks that is not wanted. The following is a sample code               \begin{algorithm}     \begin{algorithmic}[1]     \State lines are long so I get line breaks. I want to increase space between statements, but not between different lines of the same statement.          \State lines are long so I get line breaks. I want to increase space between statements,  but not between different lines of the same statement.     \end{algorithmic}     \end{algorithm}      In preamble I have:               \usepackage{algorithm}     \usepackage[noend]{algpseudocode}     \algrenewcommand\alglinenumber[1]{{\sf\footnotesize#1}}     \usepackage{setspace}     \let\Algorithm\algorithm     \renewcommand\algorithm[1][]{\Algorithm[#1]\setstretch{1.2}}


title: How to manipulate font size "within" an align environment

text: I'm using the align package for multiple-row equations. Some rows the equations are just a bit longer than the textwidth (I'm using double column). I only want to reduce the fontsize of those particular rows, not the whole align environment. How do I do that?


title: Fine tuning parentheses inside chemfig

text: I have the following code:               \documentclass[12pt]{report}     \usepackage{chemfig}          %these for bonds in chemfig     \setdoublesep{0.35700 em}  % 'Bond Spacing'     \setatomsep{1.78500 em}    % 'Fixed Length'     \setbondoffset{0.18265 em} % 'Margin Width'     \newcommand{\bondwidth}{0.06642 em} % 'Line Width'     \setbondstyle{line width = \bondwidth}          %Drawing parentheses around polymers     \newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}          \def\makebraces(#1,#2)#3#4#5{%       \edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%       \edef\delimvshift{\the\dimexpr(#1-#2)/2}%       \chemmove{         \node[at=(#4),yshift=(\delimvshift)]           {$            \left\delimleft              \vrule height\delimhalfdim depth\delimhalfdim width0pt            \right.           $};         \node[at=(#5),yshift=(\delimvshift)]           {$             \left.               \vrule height\delimhalfdim depth\delimhalfdim width0pt             \right\delimright_{\rlap{#3}}           $};       }%     }          %     %----------------------------end of preamble---------------------------------     %     \begin {document}          \setpolymerdelim() \chemfig{[:-30]*6((-C(-[:240]Cl      [@{op,.25}]     )(=[:120]O))=-=(-C(-[:300]OCH_2CH_2-O-[@{cl,.25}]H)(=[:60]O))-=-)} \makebraces(35pt,15pt){$\!\!{\rm n}$}{op}{cl}               \end {document}      Which gives me this image: ![enter image description here](http://i.stack.imgur.com/7rOYG.png) If anyone is familiar with parenthesis in `chemfig`, please run the code and see if you could answer for me? I would be much obliged! Could I get some help tidying up the position of the left hand bracket and getting rid of the little box after the Cl? _**Thanks for the responses but to clarify,, what I am trying to achieve is the following_** ![enter image description here](http://i.stack.imgur.com/LIzxb.jpg)


title: enumitem: remove period from end of enumeration

text: I am writing a book with end-of-chapter-problems using the `enumitem` package. I inserted               \renewcommand{\theenumi}{\bf\thechapter.\arabic{enumi}}      in the preamble to generate the problem numbers, but I would like the exercises in chapter 1 for example to show up as just 1.1, not 1.1. with a period at the end.


title: Displaystyle fractions in a system of equations

text: I'm trying to define an environment to use with equations' systems. So far, the best solution was               \newenironment{eqsys}{\begin{equation}\begin{cases}}{\end{cases}\end{equation}}      but I noticed that if the equations had, say, partial derivative, which are fractions, those are squeezed. So I modified it, adding `\displaystyle` so the environment looked like this               \newenironment{eqsys}{\begin{equation}\begin{cases}\displaystyle}{\end{cases}\end{equation}}      but with this trick, only the _first_ equation in the system is correctly typeset. The code to get the results I get is               \documentclass{scrbook}          \usepackage{amsmath}     \usepackage{mathtools}          \newenvironment{eqsys}{\begin{equation}\begin{cases}\displaystyle}{\end{cases}\end{equation}}          \begin{document}     \begin{eqsys}         \tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)}\\         \text{cotan}(\theta) = \frac{\cos(\theta)}{\sin{\theta}}     \end{eqsys}     \end{document}      How can I make `\displaystyle` repeat for each equation in the set?


title: How to visualize the underfull box in final output PDF files

text: I am finalizing a document. There are a few underfull vbox I just cannot figure out where they are. Sometimes it is easy to figure out which page is underfull vbox from the log file, but sometimes it is not so easy. Is there any easy way to visualize the underfull vbox just like the visualized little bar for an overfull hbox?


title: Macro for handling placement of last quotation mark when setting quotes in text?

text: When including quotes in a text, there are some styles that need to be adhered to. One style is to always place the last quote where the actual quote ends, no matter the next character (e.g. `... and then he said, "This is a disgrace", which is uncommon even for him.`. Another style is to include punctuation marks inside the quote if such characters follow the quote (e.g. `... and then he said, "This is a disgrace," which is uncommon even for him.`). Once selected, a style should be consistent throughout the document. Thus, I figured it would be nice to use a macro which took care of this, like so:               ... and then he said, \quote{This is a disgrace}, which is uncommon even for him.      The macro should then be able to wrap the argument in quotation marks scan the next character and place the last quotation mark where appropriate, depending on the desired style. (I know that `\ifnextchar` can be used to scan the following character, but not how to move it inside the quote if necessary.)


title: TikZ-tree: edge-alignment in horizontal org-chart

text: I'm working on some sort of org-chart/hierarchy-tree and ran into issues with the edge-alignment. As a guideline I used the family-tree-TeXample. See the TeX.sx-dicussion here. However, the text in my nodes is a lot longer than the short names in the example. Therefore, starting the edges from the south-anchor of the criteria- nodes produces quite a bit of whitespace. As a solution to this, I'd like to start the edges at the west-anchor of the criteria-nodes. However, `edge from parent path` is set to `|-` and thus does not produce a horizontal section before going vertical. ![Current edge-alignment in the MWE](http://i.stack.imgur.com/X78BP.png) I tried the `below of=<node>`, but that didn't help either. The option I'm trying to avoid is setting a coordinate for each edge, in case I'd have to adjust something later. Spreading the tree out horizontally is unfortunately not an option either, because the attribute-count is too high. I googled a bit to find some pictures of trees that have this edge-style: ![Preferred](http://i.stack.imgur.com/EvEw8.jpg) ![Also nice](http://i.stack.imgur.com/WBK7P.jpg) ![Last resort](http://i.stack.imgur.com/lFFDF.jpg) The _first_ tree uses an edge style like `-|-`. The _second_ one is also nice, but this anchor does not exist in TikZ-nodes. The _third_ is better than my current solution, but doesn't look very clean. Here's the MWE that produces a tree as shown in the picture at the top:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{trees}     \tikzstyle{every node}=[draw=black,thick,anchor=west, minimum height=2.5em]          \begin{document}          \begin{figure}[!htb]     \resizebox{\linewidth}{!}{          \begin{tikzpicture}[     criteria/.style={text centered, text width=2cm, fill=gray!50},     attribute/.style={%         grow=down, xshift=-1cm,         text centered, text width=2cm,         edge from parent path={(\tikzparentnode.south west) |- (\tikzchildnode.west)}},     first/.style    ={level distance=8ex},     second/.style   ={level distance=16ex},     third/.style    ={level distance=24ex},     fourth/.style   ={level distance=32ex},     fifth/.style    ={level distance=40ex},     level 1/.style={sibling distance=10em}]         % Main Goal         \node[anchor=south]{SuperLongTitleWithNoMeaning}         [edge from parent fork down]              % Criteria and Attributes         child{node (crit1) [criteria] {Criteria1}             child[attribute,first]  {node {Attribute\\Number1}}             child[attribute,second] {node {Attribute2}}             child[attribute,third]  {node {Attribute3}}             child[attribute,fourth] {node {Attribute4}}             child[attribute,fifth]  {node {Another\\Attribute}}}         %         child{node [criteria] {Criteria2}             child[attribute,first]  {node {Attribute1}}             child[attribute,second] {node {Attribute2}}             child[attribute,third]  {node {Third\\Criteria}}             child[attribute,fourth] {node {Longtext-\\criteria}}}         %         child{node [criteria] {Criteria3}             child[attribute,first]  {node {Attribute\\two lines}}             child[attribute,second] {node {Attribute2}}                  child[attribute,third]  {node {Attribute3}}}         %         child{node [criteria] {Criteria4}             child[attribute,first]  {node {Attribute1}}             child[attribute,second] {node {Attribute2}}}         %         child{node [criteria] {Criteria5}             child[attribute,first]  {node {First\\Attribute}}             child[attribute,second] {node {Attribute2}}             child[attribute,third]  {node {Third\\Criteria}}             child[attribute,fourth] {node {Longtext-\\criteria}}};     \end{tikzpicture}}     \caption{This is a nice tree.}     \end{figure}          \end{document}      Bonus question: The top-node centers itself according to the total number of nodes in all levels. Therefore, it's a bit shifted toward the left. Can I tell TikZ to ignore the attribute-level for the centering? It would look nicer, if the heading would be right above the middle criteria.


title: rightmark without numbering?

text: I'd like to include the section name in the header WITHOUT the section number. The only instructions I could find on how to do this said to add this:               \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{#1}{}}      ...but when I added that, the section name never changed at all -- the header just displayed "Contents" for the whole document. Thoughts? I'm using Emacs org-mode to generate LaTeX. Here's what the template looks like.               \documentclass[12pt]{article}     \usepackage[hyperref,x11names]{xcolor}     \usepackage{float}     \usepackage[breaklinks=true,linktocpage,pdftitle={\@title},pdfauthor={\@author},xetex]{hyperref}     \usepackage{algorithm}     \usepackage{amsmath}     \usepackage{ifxetex}     \ifxetex       \usepackage{fontspec,xltxtra,xunicode}       \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}       \setromanfont{Adobe Garamond Pro}       \setsansfont{Arial}       \setmonofont{Courier}     \else       \usepackage[mathletters]{ucs}       \usepackage[utf8x]{inputenc}     \fi     \usepackage{microtype}     \usepackage{url}     \usepackage{graphicx}     \hypersetup{ colorlinks, citecolor=SteelBlue4,filecolor=SteelBlue4,linkcolor=SteelBlue4,urlcolor=SteelBlue4}     \makeatletter     \def\maketitle{         {\fontsize{50}{60}\selectfont \textbf{\@title}\par}         {\Huge {\textit{\@author}\par}}         {\Large \@date\par}        \end{raggedright}       \null       \cleardoublepage     }          \usepackage{paralist}     \let\itemize\compactitem         \let\description\compactdesc         \let\enumerate\compactenum           \let\description\compactdesc         \usepackage{fancyhdr}         \pagestyle{fancy}         \pagenumbering{arabic}         \renewcommand{\sectionmark}[1]{\markright{#1}}         \lhead{\href{mailto:cycleofsong@gmail.com}{Peter Salazar}}         \chead{}         \rhead{{\@title}: {\nouppercase{\leftmark}}}         \lfoot{}         \cfoot{\thepage}         \rfoot{}         \usepackage{listings}         \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}         \setlength{\parindent}{0pt}         \setlength{\parskip}{12pt plus 2pt minus 1pt}         \usepackage{fancyvrb}         \usepackage{enumerate}         \usepackage{ctable}         \setlength{\paperwidth}{8.5in}         \setlength{\paperheight}{11in}          \usepackage[margin=1.5in,hmargin=1.5in,vmargin=1.5in]{geometry}           \tolerance=1000         \usepackage{tocloft}         \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}         \usepackage[normalem]{ulem}         \newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}                    [NO-DEFAULT-PACKAGES]               [NO-PACKAGES]"              ("\\section{%s}" . "\\section*{%s}")              ("\\subsection{%s}" . "\\subsection*{%s}")              ("\\subsubsection{%s}" . "\\subsubsection*{%s}")              ("\\paragraph{%s}" . "\\paragraph*{%s}")              ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))


title: Can we define maximum width for a node?

text: My question is almost opposite to: this question. I have defined a block:               \begin{tikzpicture}[node distance = 2cm, auto,->=stealth,point/.style=                         {circle,fill=red,minimum size=0pt,inner sep=0pt}]     \tikzstyle{block} = [rectangle, draw,thick,fill=blue!0,         text centered, rounded corners, minimum height=1em]     \node [block] (start) {Start};     \node [block,below of=start] (start) {Start and blah blah blah blah blah blah                            blah blah blah blah blah blah blah blah blah                            blah blah blah blah blah blah blah blah blah                            blah blah blah blah blah blah blah blah blah};     \end{tikzpicture}      The block adjusts itself to accommodate text. ![enter image description here](http://i.stack.imgur.com/L5neb.png) But I would like to control the width of the block by using `text width=15em`:               \tikzstyle{block} = [rectangle, draw,thick,fill=blue!0,text width=20em,<---------=                   text centered, rounded corners, minimum height=1em]      I get this: ![enter image description here](http://i.stack.imgur.com/3nBpY.jpg) Though the second block looks good, the first block (`start`) has lot of empty space in it. My question is > How to adjust the width of the block according to the text and at the same > time limiting the maximum width of the block to (say) 15em? In other words, How to make the first block to fit with `start`? Or generally speaking, > How to adjust the block size automatically to fit the text with maximum > width of block as 15em? Pl. note: I am aware that I can define `block2` with a suitable width and put `start` in it. But my constraint is to use the single tikzstyle.


title: Executing Tex Live by SSH command

text: I installed Tex Live by apt-get on Ubuntu, and I could access to latex commands both in Terminal and in web scripts; e.g. in PHP by `shell_exec('pdflatex -version');` On a similar machine, I installed from source. I put PATH both in my user and /etc/profile. I could access to latex with all users (including my web user) in Terminal; but in web scripts I get error `pdflatex: not found`. How apt-get make latex commands globally available on the machine, and what should I do so with installation from source?


title: Plotting Multiple Time Series plots in LaTeX using PGFplots and txt files - Relativity Issues

text: I have a problem with plotting multiple time series plots in a single graph in Latex. Background: I have three products - Potatoes, Apples, and Oranges. Each products' historical price and projected price is plotted using data from a separate *.txt (tab delineated) file. The data is as follows Actuals:               Date       ptts appls   orngs     2013-06-30  10  20  30     2013-07-30  11  21  31     2013-08-30  12  22  32     2013-09-30  13  23  33     2013-10-30  14  24  34     2013-11-30  15  25  35     2013-12-30  16  26  36     2014-01-30  17  27  37          Forecast     2014-02-28  18  28  38     2014-03-28  19  29  39     2014-04-28  20  30  40     2014-05-28  21  31  41     2014-06-28  22  32  42     2014-07-28  23  33  43      In order to achieve continuity between the forecast and the historical data, the last historical data is included as the first forecast point in the txt file (not shown above). The code that I use to graph this is:               \begin{center}     \begin{tikzpicture}[line join=round]     \begin{axis}[width=18cm, height=300pt,xticklabel=\month.\year,date coordinates in=x,     xticklabel style= {rotate=45,anchor=north east},     stack plots=y,title=Product Price Forecast,]     \addplot table {appl-A.txt};     \addplot table{ptts-A.txt};     \addplot table {orngs-A.txt};      \addplot table {appl-F.txt};      \addplot table{ptts-F.txt};     \addplot table {orngs-F.txt};      \end{axis}      \end{tikzpicture}      \end{center}      The plot that I get is completely wrong. It looks like one of the products sets a relative basis at which all the plots are plotted. Is there some kind of an Absolute vs Relative toggle in the PFGplots package that anybody is aware of? Please see plot below. ![plot](http://i.imgur.com/aHRl88U.png?1)


title: Colorbox with complex content in Beamer

text: Here is my problem. I try to create a macro that displays a colored background for "any" kind of elements in a beamer presentation. Here is what I did :               \documentclass{beamer}     \usepackage{xcolor}     \usepackage{philex}     \usetheme{Berkeley}               \definecolor{boxalertcolor}{RGB}{165,165,221}     \def \boxalert#1#2{\alt<#1>{\colorbox{boxalertcolor}{\begin{minipage}{.97\textwidth}#2\end{minipage}}}{\hbox{\begin{minipage}{.97\textwidth}#2\end{minipage}}}}          \begin{document}          \begin{frame}{Test}         \begin{exampleblock}{What is the rule behind these sentences ?}              \boxalert{2,4}{              \lb{chien}{             \lba{chienJuste}{The dog runs.}             \lbz{chienFaux}{* The run dog.}}}            \boxalert{3-4}{\lb{oiseau}{             \lba{oiseauJuste}{I saw a bird.}             \lbz{oiseauFaux}{* I a saw bird.}}}                                                   \end{exampleblock}          \pause      \begin{block}{Possible rules}         \boxalert{2}{         \begin{description}[$R_1$]                    \item[$R_1$]The word \textit{the} must appear just before \textit{dog} to constitute a nominal phrase.         \end{description}}         \pause         \boxalert{3}{         \begin{description}[$R_1$]              \item[$R_2$]The word \textit{a} must appear just before \textit{bird} to constitute a nominal phrase.         \end{description}}         \pause         \boxalert{4}{         \begin{description}[$R_1$]              \item[$R_i$]The deteminant must appear just before the name to constitute a nominal phrase.          \end{description}}      \end{block}     \end{frame}     \end{document}      Now my problem is that spaces are not the same between colored and not colored versions of the content. I know that it is due to the `\fboxsep` that goes with the `\colorbox`. And I don't want to remove it for the colored version. So the question is: **how can I properly add the missing spaces in the _non- colored_ version, in a way that the text of both versions perfectly overlap?** So I'm asking for an improvement of the macro I have. But if someone knows a better/easyer/nicer way to do the same with a totally different code, I would be perfectly happy to replace my macro. Thanks a lot! BH EDIT : If I replace my macro `\boxalert`by the following code, I'm almost done :               \def \boxalert#1#2{\alt<#1>{\colorbox{boxalertcolor}{\begin{minipage}{.97\textwidth}#2\end{minipage}}}{\vspace{\fboxsep}\hspace{\fboxsep}\begin{minipage}{.97\textwidth}#2\end{minipage}}}      But during the transition between slides 2 and 3, there's a space that moves the boxes, and I have no idea where it comes from...


title: A better notation to denote arcs for an American high school textbook

text: For years, I've been using a hobbled together command to get the arc notation as used in the textbooks adopted by high schools in my area. I'm not really all that pleased with the result: it's just barely tolerable. I figured someone in the community here might have a better solution to what I've been getting by with for several years.               \documentclass{article}     \usepackage{amsmath,amssymb}     %% my poor man's solution to arc notation     \newcommand{\tarc}{\mbox{\large$\frown$}}     \newcommand{\arc}[1]{\stackrel{\tarc}{#1}}     %%     \pagestyle{empty}     \begin{document}          \begin{align*}         \arc{AC} \\         \arc{BAD}\\         \arc{ICK}     \end{align*}               \end{document}      ![enter image description here](http://i.stack.imgur.com/q583A.png)


title: knitr: Several figures with subcaptions, alignment issues

text: Here is a minimal working example:               \documentclass{article}     \usepackage{subfig}     \begin{document}     <<echo=FALSE,out.width="0.49\\linewidth",fig.show="hold",fig.align="center",fig.cap="Some figures",fig.subcap=c("first","second","third","fourth")>>=     plot(1:10)     plot(2:12)     plot(3:13)     plot(4:14)     @     \end{document}      The figures go off the page to the right, but if I remove the fig.subcap option they are nicely aligned. Is there a way to add subcaptions to 3 or more plots without ruining the alignment?


title: Coloured boxes inside latex

text: I want to make coloured boxes with different colours and i cannot understand the function of the mybox{} order. I attach an example that![enter image description here](http://i.stack.imgur.com/Jya4D.jpg) may helps you. I write the code               \documentclass[a4paper]{report}          \usepackage[greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{xcolor}     \usepackage{blindtext}     \usepackage{tikz,tkz-tab,amsmath}          \begin{document}          \newcommand{\mybox}[1]{%              \begin{center}%                 \begin{tikzpicture}%                     \node[rectangle, draw=green, top color=green!10, bottom color=green!90, rounded corners=5pt, inner xsep=5pt, inner ysep=6pt, outer ysep=10pt]{                     \begin{minipage}{1.05\linewidth}#1\end{minipage}};%                 \end{tikzpicture}%              \end{center}%     }               \mybox{\textlatin{\blindtext}}               \end{document}      and the result is this: ![enter image description here](http://i.stack.imgur.com/ezz1S.jpg)


title: Plot symbols from R as latex symbols

text: In a LaTeX document, I am including an image showing a plot generated by R, for example the result of a `plot(x=1:5,y=1:5,pch=13)`. Is there a way to use this nice little symbol as a LaTaX character to use it in the regular text? It's #13 from this list. To clarify, I am not looking for `\otimes`, which is a nice workaround. I am rather wondering if there is some package which has all the standard R symbols, including, say #14.


title: Vertical rule at the left of a listing

text: I would like to draw vertical rules _at a specific location_ in the left margin of a listing in a `listings` environment. Is it possible ?               ======= PSEUDO EXAMPLE =======          for i in range(5):     # One comment         if i == 2:     # One comment             print(i)          print("Finished....")          ======= OUTPUT WISHED (this is ASCII art ! ) =======             for i in range(5):         # One comment     |      if i == 2:     |   # One comment     |          print(i)              print("Finished....")


title: Lyx cross-referencing between branches

text: I'm writing a paper in LyX, of which there are two versions -- a short and a long version. I've created two branches in the (single) LyX file, and will switch them on and off appropriately. I'd like to make statements in the short version of the form, "For details, please look at theorem [ref] in the full paper." The problem is that some theorems may be missing from the short version, and so the numbering may be off. What is the recommended practice (in LyX) of solving this problem, i.e. making cross-references to external documents / different branches of the same document? There is a previous question on this for LaTeX (Cross-referencing between different files ), but I don't see an immediate way to porting this solution to LyX. That is, use package `xr`, and have a short version branch inset containing `\externaldocument{longversion}` in ERT. But now, actually doing the compile will involve first exporting the long version to LaTeX, and then building the short version (and remember that LyX does the build in a temporary folder somewhere else). Or export both versions to LaTeX, and then manually invoke `pdflatex`. That leaves a bunch of temporary files in my pristine work folder, and kind of defeats all I like about LyX.


title: Two Pspictures beside each other

text: I'm trying to put two pspictures beside each other. I also checked the same question and tried the answer about defining two columns, but it didn't work and LaTeX considered those as undefined environments. I suppose that was because the answer which suggested columns was provided for the beamer class. What should I do to have these two beside each other ?               \documentclass{book}     \usepackage{caption}     \usepackage{pstricks,pst-plot}     \usepackage{pst-bezier}     \usepackage{pst-math}          \begin{document}          \begin{columns}     \begin{column}{0.45\textwidth}     \psset{xunit=0.5cm,yunit=0.5cm}     \centering%     \begin{pspicture}(4,4)     \psaxes[labels=none]{->}(0,0)(4,4)[$x$,0][$y$,90]     \end{pspicture}     \captionof{figure}{simple}     \end{column}     \begin{column}{0.45\textwidth}     \begin{pspicture}(4,4)     \psaxes[labels=none]{->}(0,0)(4,4)[$x$,0][$y$,90]     \end{pspicture}     \captionof{figure}{compund}     \end{column}     \end{columns}          \end{document}


title: Breaking a marginpar over a pagebreak

text: Is there a way to do this in LaTeX 3? I looked at marginpar and orphans, and I am not sure that it addresses my question, but I belive it states that this is not possible in LaTeX 2e. This is most common for me when I have a marginpar that is tied to text that happens to fall out near the bottom of a page. This also happens if I use marginnote instead. If someone has ideas for how to post a MWE, let me know and I'll post one.


title: how can I make inverted letter

text: Please, is it possible to do this in Latex? Thank you.![enter image description here](http://i.stack.imgur.com/8yffB.jpg)


title: pst-3dplot and drawing cylinders

text: I am drawing a cylinder with `\psCylinder` from `pst-3dplot`, as shown here in a MWE from the manual:               \documentclass{article}     \usepackage{pst-3dplot}          \begin{document}          \begin{pspicture}(-3,-2)(3,7)     \psset{Beta=10}     \pstThreeDCoor[zMax=7]     \psCylinder[increment=5]{2}{5}     \end{pspicture}               \end{document}      The `z`-axis points vertically - how can I make it horizontal?


title: Show Chapter and Page Number in List Of Figures

text: I am creating a document framework for my mini-dissertation. The document will consist of multiple chapters. In each chapter the page numbering will start at 1. This is achieved by using `setcounter{page}{1}` after every new `\chapter{}`. In the footer I display the current chapter and page by using `\fancyfoot[RO,RE]{\thechapter.\thepage}`. Displaying 1.2 for chapter 1, page 2 for example. How can I achieve the same numbering format in my table of content, list of figures and list of tables?


title: xtable for multiple lm regression in R?

text: I'd use xtable for an object from a multiple lm regression but always failed. Here is an example:               df<-data.frame(y1=rnorm(100,2,3),     y2=rnorm(100,3,2),     x1=rbinom(100,1,0.5),     x2=rnorm(100,100,10))          fit<-lm(cbind(y1,y2)~x1+x2,data=df)      I would use xtable() for each of the coefficients form in fit:               > coefficients(summary(fit)[1])     Response y1 :                    Estimate Std. Error    t value  Pr(>|t|)     (Intercept)  3.91501372 2.85369578  1.3719100 0.1732561     x1           0.10619049 0.55613147  0.1909449 0.8489678     x2          -0.02413352 0.02803021 -0.8609824 0.3913710          > coefficients(summary(fit)[2])     Response y2 :                    Estimate Std. Error    t value  Pr(>|t|)     (Intercept)  1.67476724 1.97430246  0.8482830 0.3983688     x1          -0.29875810 0.38475430 -0.7764906 0.4393487     x2           0.01592865 0.01939244  0.8213845 0.4134415      But there's always error by trying `xtable(summary(fit)[[1]])` or `xtable(coefficients(s(fit)[1]))`. Does anybody know how to do that?


title: Problem sizing the image with \includegraphics

text: This question is very similar to Image from \includegraphics showing in wrong image size, but not quite the same. The size of the image that appears in my manuscript depends entirely on the dpi setting I give it in IrfanView. It doesn't matter which `width` or `scale` settings I use - these settings only determine the horizontal and vertical offset of my image. Now I have tried including the same image in both .png and .pdf format, always the same result. However, I have used .eps figures a lot, and there it very easy to change the size with a simple `width`. Is it somehow possible to do the same with figures that are not .eps? I will be dealing with a lot of figures in the next few months and would prefer controlling the image size directly from within LaTeX, instead of having to go through another program. I am using pdflatex with the `graphicx` package and define my figure as such:               \begin{figure}[ht]       \centering       \includegraphics[width=0.8\textwidth]{MyFigure.png}       \caption{My Caption}       \label{fig::myFig}     \end{figure}


title: Jabref won't save files as .BST and LyX doesn't recognize .BIB

text: I'm having trouble with pushing a saved bibliography from Jabref to LyX, because Jabref doesn't have an option to save as a `.bst` file , and LyX doesn't want to recognize any other format than `.bst` (he does not recognize `.bib` files). What should I do?


title: Global emphsize the theorem name

text: I would like to global define the `theorem` environment such that the name of the thereom (like `ABC` in the following example) is emphasized (either `\textit` or `\textbf`), how can I do that? I know I can do it one by one, but it would be more convienent to define it globally.               \begin{theorem}[ABC]     \end{theorem}


title: \rowcolor not shading properly

text: I am using this template for making tables. I tried to add `\rowcolor[gray]{.8}` between `\toprule`s and `\midrule`s but the the effect is bad in the sense that it highlight on 3/4 of the row leaving the edges white. Any solution?               \documentclass{article}     \usepackage{colortbl, xcolor}     \usepackage{booktabs,caption,fixltx2e}     \usepackage[flushleft]{threeparttable}     \begin{document}     \definecolor{lightgray}{rgb}{.9,.9,.9}     \begin{table}       \begin{threeparttable}         \caption{Sample ANOVA table}          \begin{tabular}{lllll}             \toprule             Stubhead & \( df \) & \( f \) & \( \eta \) & \( p \) \\             \midrule             Row 1    & 1        & 0.67    & 0.55       & 0.41    \\             Row 2    & 2        & 0.02    & 0.01       & 0.39    \\             Row 3    & 3        & 0.15    & 0.33       & 0.34    \\             Row 4    & 4        & 1.00    & 0.76       & 0.54    \\             \bottomrule          \end{tabular}         \begin{tablenotes}           \small           \item This is where authors provide additional information about           the data, including whatever notes are needed.         \end{tablenotes}       \end{threeparttable}     \end{table}          \end{document}


title: Unwanted empty page in the middle of a chapter

text: I am having an empty page in the middle of a chapter of my document. The only information that appears is the page number. The pages before and after are filled with text and figures. I have checked all float placement specifiers and still cannot find the reason for this behaviour. Any suggestion where to seek for a solution will be appreciated. Edit: I managed to find out what causes this problem. I am using tikz and pstricks at the same time. If the commands `\usepackage{tikz}`, `\maketitle`, and `\tableofcontents` are enabled at the beginning of the document, the pspicture is not displayed in the document and an empty page appears instead. I compile using `pdflatex --shell-escape filename.tex` Here is the version information:               pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)     kpathsea version 6.2.0     Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     There is NO warranty.  Redistribution of this software is     covered by the terms of both the pdfTeX copyright and     the Lesser GNU General Public License.     For more information about these matters, see the file     named COPYING and the pdfTeX source.     Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).     Compiled with libpng 1.6.10; using libpng 1.6.10     Compiled with zlib 1.2.8; using zlib 1.2.8     Compiled with xpdf version 3.03      On another machine with another latex version, this is compiling without any issues. Here is a short example of the code I would like compile:               \documentclass[twoside]{report}               \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{bbold}     \usepackage{bm}     \usepackage{caption}     \usepackage{colortbl}     \usepackage{dcolumn}     \usepackage{etex}     \usepackage[normalem]{ulem}     \usepackage{float}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{hyperref}     \usepackage{import}     \usepackage[utf8]{inputenc}     \usepackage{mathtools}     \usepackage{mhchem}     \usepackage{multicol}     \usepackage{multirow}     \usepackage[]{pstricks}     \usepackage{pst-plot}     \usepackage{auto-pst-pdf}     \usepackage{fp}     \usepackage{pst-eucl}     \usepackage{pst-all}   %%% needed to display labels on axes correctly     \usepackage{subcaption}                    %%% to disable the ps-grid:     %\let\psgrid\relax    %%% not workin well     \makeatletter       %%% better use these three lines to make grid disappear     \def\psgrid@iv(#1)(#2)(#3){}     \makeatother                         \begin{document}     \title{No title}     \author{The Author}          %\maketitle  %%% causes error          %\tableofcontents  %%% causes error          \chapter{chapter one}          \begin{figure}         \begin{pspicture}(-5,-2)(6, 6)             \psgrid             \FPset\anglealpha{70}             \FPeval\anglealphaplus{anglealpha + 90.}             \FPeval\anglealphahalf{anglealpha * 0.5}             \FPeval\anglealphahalfplus{anglealphahalf + 90.}             \FPset\unitvec{2}             \FPeval\pbegin{1.5 * unitvec}             \FPeval\pend{pbegin + unitvec}             \def\pointdummy{none}             \def\namedummy{none}%{default}                       \pstGeonode[PosAngle=135, PointSymbol = \pointdummy, PointName = \namedummy](0, 0){O}             \pstGeonode[PosAngle=45, PointSymbol = \pointdummy, PointName = \namedummy](1; \anglealpha){I}             \pstGeonode[PosAngle=180, PointSymbol = \pointdummy, PointName = \namedummy](1; \anglealphaplus){J}             \pstOIJGeonode[PointSymbol = \pointdummy, PointName = \namedummy](\unitvec,0){I'}{O}{I}{J}(0,\unitvec){J'}(-2, 0){I''}(5, 0){I'''}(\pbegin, 0){I4'}(\pend, 0){I5'}(-1.5, -0.5){I6'}(-1.5, 0.5){I7'}(3.5, 0.5){I8'}(4.5, 0.5){I9'}(4, 0.5){I10'}(6.5, 0){I11'}             \psline[linewidth = 1pt, linecolor=cyan]{->}(O)(I')             \psline[linewidth = 1pt, linecolor=cyan]{->}(O)(J')                       \pstGeonode[PointSymbol = \pointdummy, PointName = \namedummy](1; 0){X}             \pstGeonode[PointSymbol = \pointdummy, PointName = \namedummy](1; 90){Y}             \pstOIJGeonode[PointSymbol = \pointdummy, PointName = \namedummy](\unitvec, 0){XX}{O}{X}{Y}(0, \unitvec){YY}(-5, 0){XXX}(6, 0){XXXX}(\pbegin, 0){X5X}(\pend, 0){X6X}(-3, 0.5){X7X}(-3, -0.5){X8X}(3.5, -0.5){X9X}(4.5, -0.5){X10X}(4, -.5){X11X}             \psline[linewidth = 1pt]{->}(O)(XX)             \psline[linewidth = 1pt]{->}(O)(YY)                  \pstGeonode[PointSymbol = \pointdummy, PointName = \namedummy](1; \anglealphahalf){X''}             \pstGeonode[PointSymbol = \pointdummy, PointName = \namedummy](1; \anglealphahalfplus){Y''}             \pstOIJGeonode[PointSymbol = \pointdummy, PointName = \namedummy](\unitvec, 0){XX''}{O}{X''}{Y''}(0, \unitvec){YY''}             \psline[linecolor = orange]{->}(O)(XX'')             \psline[linecolor = orange]{->}(O)(YY'')                  \psline[linestyle=dashed, linewidth = 0.3pt](XXX)(XXXX)             \psline[linestyle=dashed, linewidth = 0.3pt](I'')(I11')                  \psline[linewidth = 1pt]{->}(I4')(I5')             \psline[linewidth = 1pt]{->}(X5X)(X6X)                  \psline{|-|}(I6')(I7')             \psline{|-|}(X8X)(X7X)             \psline{|-|}(X9X)(X10X)             \psline{|-|}(I8')(I9')                  \pstMarkAngle[MarkAngleRadius = 3.7, LabelSep = 4.0]{XXXX}{O}{I5'}{$\alpha$}             \pstMarkAngle[MarkAngleRadius = 1.8, LabelSep = 2.1]{XXXX}{O}{XX''}{$\frac{\alpha}{2}$}                  \uput[20](I'){$\hatvec{e}_{1'}$}             \uput[\anglealphaplus](J'){$\hatvec{e}_{2'}$}             \uput[-90](XX){$\hatvec{e}_1$}             \uput[90](YY){$\hatvec{e}_2$}             \uput[\anglealphahalf](XX''){$\hatvec{e}_{1''}$}             \uput[\anglealphahalfplus](YY''){$\hatvec{e}_{2''}$}             \uput[90](X6X){$\hatvec{p}_1$}             \uput[0](I5'){$\hatvec{p}_2$}             \uput[45](X8X){$\sigma_1$}             \uput[115](I6'){$\sigma_2$}             \uput[\anglealphaplus](I10'){$\sigma(\kappa_2)$}             \uput[-90](X11X){$\sigma(\kappa_1)$}         \end{pspicture}     \caption{Caption 1.}     \end{figure}               \chapter{chapter two}               % Define block styles     \tikzstyle{decision} = [diamond, draw, fill=blue!20,          text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]     \tikzstyle{block} = [rectangle, draw, fill=blue!20,          text width=4.cm, text centered, rounded corners, minimum height=.5cm, minimum width = 3cm]     \tikzstyle{redblock} = [rectangle, draw, fill=blue!20,          text width=2.cm, text centered, rounded corners, minimum height=.5cm, minimum width = 2cm]     \tikzstyle{line} = [draw, -latex']     \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,         minimum height=2em]     \tikzstyle{python} = [rectangle, draw, fill = green!20, text width=1.8cm, text badly centered, node distance=3cm, inner sep=2pt]     \tikzstyle{interaction} = [trapezium, trapezium left angle=70, trapezium right angle=-70, text width = 4.cm, text badly centered, draw, fill = pink!20]          \begin{figure}         \centering             \begin{tikzpicture}[node distance = 2cm, auto]                 \node [redblock, fill=red!20] (start) {start};                 \node [interaction, right of = start, node distance = 3.8cm] (files) {A};                 \node [python, right of = files, node distance = 5.5cm] (analyse) {B};                 \node [interaction, below of = files, node distance = 1.5cm] (images) {C};                 \node [python, right of = images, node distance = 3.9cm] (reconstruct) {D};                 \node [block, below of = images, node distance = 1.5cm] (display) {E};                 \node [python, below of = reconstruct, node distance = 2.7cm] (rec_marker) {F};                 \node [python, below of = rec_marker, node distance = 2cm] (calc_gonio) {G};                 \node [decision, below of = display, node distance = 3.2cm] (ports_ok) {H};                 \node [block, below of = ports_ok, node distance = 2.4cm] (port_n) {I};                 \node [decision, below of = port_n, node distance = 2cm] (overlay_ok) {J};                 \node [python, right of = overlay_ok, node distance = 4.1cm] (overlay) {K};                 \node [redblock, fill=red!20, left of = overlay_ok, node distance = 3.8cm] (cancel) {L};                 \node [block, below of = overlay_ok, node distance = 1.8cm] (irrad) {M};                 \node [decision, below of = irrad, node distance = 1.7cm] (last_port) {N};                 \node [redblock,fill=red!20, left of = last_port, node distance = 3.8cm] (end) {end};                      \node [block, fill=blue!8, draw opacity = 0.6, text opacity = 0.6, below of = last_port, node distance = 1.8cm] (GUI) {O};                 \node [python, fill=green!8, draw opacity = 0.6, text opacity = 0.6, minimum width = 3.5cm, right of = GUI, node distance = 4.7cm] (asdf) {P};                           \path [line] (start) -- (files);                 \path [line, style = dashed] (files) -- (analyse);                 \path [line] (files) -- (images);                 \path [line] (images) -- (reconstruct);                 \path [line] (reconstruct) |- (display);                 \path [line] (display) |- (rec_marker);                 \path [line] (rec_marker) -- (calc_gonio);                 \path [line, style = dashed] ([xshift = -.3cm] analyse.south) |- (calc_gonio);                 \path [line] (calc_gonio) -- (ports_ok);                 \path [line] (ports_ok) -- node [near start] {yes} (port_n);                 \path [line] (ports_ok) -| node [near start] {no} ([xshift = -1cm] display.west)                 |- (display);                 \path [line] ([xshift = -1cm] display.west) |- node [near start] {or} (images);                 \path [line] ([yshift = - 0.3cm] port_n.east) -| (overlay);                 \path [line] (overlay) -- (overlay_ok);                 \path [line] (overlay_ok) -- node [near start] {yes} (irrad);                 \path [line] (overlay_ok) -- node [near start] {no} (cancel);                 \path [line] (irrad) -- (last_port);                 \path [line] (last_port) -- node [near start] {yes} (end);                 \path [line] (last_port) -| node [near start] {no} node [near end] {} ([xshift = 3.3cm, yshift = 0.3cm] port_n.east) -- ([yshift = 0.3cm] port_n.east);                 \path [line, style = dashed] ([xshift = .3cm] analyse.south) |- (overlay);                  \end{tikzpicture}         \caption{caption 2.}     \end{figure}                    \end{document}


title: TikZ draw-Putting old calendar style date in left margin

text: I'm working on the formatting of a text book. The following picture shows the first thing I would like to do. There are two things to achieve :   1. I would like to "draw" the date using `TikZ` so as to have later the possibility to make more evoluated formatting.    2. Then the "draw" must be put in the left margin. ![enter image description here](http://i.stack.imgur.com/dH8bG.png) The LaTeX code would be similar to the following one :               \section{Name of the class}          \subsection{Chapter A : Numeric activities}          \day{Mon.}{28}{Nov.}{2011}     \subsubsection{Lesson}     ...          \subsubsection{For Tuesday Nov. 29}     ...


title: Tracing group-level and position in LuaTeX

text: I am absolutely new to LuaTeX and I have few questions about it. First of all I learned that in LuaTeX it is possible to trace all TeX tokens with `token filter' callback. Is it possible to get some additional information in callback functions like current positions in input file and current group- level. What I am achieving to do is to write callback function which looks like:               \directlua{       function foo ()         t = token.get_next()         if someTestFunction(t) then            poz = currentPositionTexEyesAreLookingAtSourceFile()            level = currentGroupLevel()            mode = isMathMode()            table.insert(someTable, {poz, level, mode})         end       end       callback.register('token_filter',foo)     }


title: biblatex: extract authors seperately

text: Given and BibTeX entry               @articel{paper,       author={Jane Doe and John Hansen and Tom Nielsen},       year={2012},       title={Paper title}     }      How do I make commands (using `biblatex`) that   1. insert "Jane Doe, John Hansen and Tom Nielsen" in the text (`\citeauthor` only use the last names)   2. insert "Jane Doe" into the text (i.e. only the first author) Thanks


title: Beginner in TikZ: Replicating an easy graph nicely

text: It's my first plot and I tried to google for half an hour but couldn't figure out how to fix my attempt to replicate this graph. Could someone help me? ![enter image description here](http://i.stack.imgur.com/3Uhv5.png) This is, what I have got: Errors so far:   1. parabola (2,2)node[pos=0.8, right=10pt] {erfahren}; positioning doesn't work, anyways the parables are wrong   2. I couldn't find how to draw these parables, something like -((x-2)^2)+2 Thank you in advance !               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}               \draw (0,0) -- (5,0) node[pos=0.5,below=14pt] {Zeit$\rightarrow$};          \draw (0,0) -- (0,3) node[pos=0.5, left=10pt][text width=2cm]{$\uparrow$\\Emotionale\\Insensität};               \draw (0,0) parabola (2,2)node[pos=0.8, right=10pt] {erfahren};          \draw[dashed] (0,0) parabola (3,2)node[pos=0.5, right=10pt] {vorhergesagt};          \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/NHcGq.png)


title: Own headings for an article

text: I've got a litte problem in making my own headings, my goal is something like this: ![Number, Heading, Text](http://i.stack.imgur.com/YQs2e.png) my current code looks like this               %-- Preamble ------------------------------------     \documentclass[10pt,a4paper,twoside]{article}          %-- Nur für Debugging     %    \usepackage{showframe}     \usepackage{blindtext}          %-- Import packages -----------------------------     % Anpassung an deutsche Sprache     % Umlaute ----------------------------------------------------------------------     %   Umlaute/Sonderzeichen wie äüöß direkt im Quelltext verwenden (CodePage).     %   Erlaubt automatische Trennung von Worten mit Umlauten.     % ------------------------------------------------------------------------------     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}               % Seitenränder und Zeilenabstände     \usepackage{geometry}     \usepackage{setspace}          % Schriften und Farben     \usepackage{color}     \usepackage{colortbl} % Für farbige Tabellen     \usepackage[default,osfigures,scale=1]{opensans}          % Textumgebungen     \usepackage{multicol} % Text in mehreren Kolumnen darstellen          % Hyperrefs und PDF Information     \usepackage{hyperref}          % Tabellen     \usepackage{booktabs}          % Inhaltsverzeichnis umbenennen     \usepackage{tocbibind}          % Listen     \usepackage[ampersand]{easylist} % Einfache Liste Umgebung     % http://en.wikibooks.org/wiki/LaTeX/List_Structures          % Kopf und Fusszeilen     \usepackage{fancyhdr}          % Grafiken und Textbausteine     \usepackage[absolute]{textpos} % Absolue Positionierung     %    \usepackage[dvips,final]{graphicx} % Einbinden von JPG-Grafiken ermöglichen für     %dvi format     \usepackage[pdftex]{graphicx}     \usepackage{graphics} % keepaspectratio     \usepackage{floatflt} % zum Umfließen von Bildern     \graphicspath{{pictures/}} % hier liegen die Bilder des Dokuments          % Mathe     \usepackage{amsmath}     \usepackage{amssymb}          % Acronym Support     \usepackage[printonlyused]{acronym}          %-- Seitenstil ---------------------------     % Setzen der Seitenränder     \geometry{top=25mm,left=30mm,right=30mm,bottom=30mm,a4paper}     \setlength{    \marginparwidth}{20mm}          % Kein Einzug     \setlength{    \parindent}{0cm}           % Konfiguration für das textpos     \setlength{    \TPHorizModule}{1mm}     \setlength{    \TPVertModule}{    \TPHorizModule}     \textblockorigin{0mm}{0mm}          % Kopf und Fusszeilen     \setlength{    \headheight}{15.2pt}     \pagestyle{fancy}          %-- Aufgabe mit Trennlinie --------------------------------     \newcounter{cntaufgabe}     \newcounter{cntfrage}     \setcounter{cntfrage}{1}     \newcommand{    \resetaufgabe}{%     \par     \vspace{10mm}     \leftskip=0cm     \setcounter{cntfrage}{1}     }     \newcommand{    \aufgabe}[1]{%     \stepcounter{cntaufgabe}     \resetaufgabe     \vspace{2ex}     \begin{flushright}     \leftskip=-2cm     \textbf{    \thecntaufgabe}     \end{flushright}     \hspace{5mm}     \textbf{#1}     \vspace{1mm}     \hrule     \vspace{2ex}%     }     %-- Frage mit Trennlinie --------------------------------     \newcommand{    \frage}[1]{%     \par     \vspace{5mm}     \leftskip=1.4cm     \alph{cntfrage})     \hspace{1mm}     \textit{#1}     \vspace{5mm}     \par     \leftskip=2cm     \stepcounter{cntfrage}     }               \begin{document}     %-- Deckblatt -----------------------------------     %    \input{allgemein/deckblatt.tex}     %-- Inhaltsverzeichnis --------------------------     \tableofcontents     \newpage           \section{Title}          \subsection{Subtitle}          \aufgabe{Dies ist eine Aufgabe}     \blindtext     \setcounter{cntaufgabe}{16}     \setcounter{cntfrage}{16}     \aufgabe{Dies ist noch eine Aufgabe}     \frage{Was bedeutet ICMP?}     Internet Control Messages Protocol     \setcounter{cntfrage}{16}     \frage{Was bedeutet CSMA/CD?}     \blindtext     \aufgabe{Dies ist noch eine Aufgabe 23}     \setcounter{cntaufgabe}{111121545}     \aufgabe{Dies ist noch eine Aufgabe 34}     \begin{align}     e=mc^2     \end{align}     \resetaufgabe % muss mach aufgaben aufgerufen werden     \blindtext     \par     \blindtext     \begin{description}       \item[First]    \hfill     \    \The first item        \item[Second]    \hfill     \    \ The second item       \item[Third]    \hfill     \    \ The third etc     \ldots     \end{description}          Plain text.      \underline{    \hfill     \    \}          \subsection{Another subtitle}          More plain text.     \blinddocument          %-- Appendix --------------------------     \appendix          \listoffigures     \listoftables          \end{document}      but unfortunately it looks so ![enter image description here](http://i.stack.imgur.com/AZdC0.png) can anyone please advise me how i can achieve it? Thx in advance Liz **Solved** The solution that Thruston mentioned in the comments worked for me!


title: Name of a certain math font

text: I want to reproduce the "x" as in the picture below ![font to reproduce](http://i.stack.imgur.com/Pt9if.png) The closest I can get is `\bm{\mathsf{x}}`, but it's not the same. EDIT: one more example: ![font to reproduce](http://i.stack.imgur.com/xjx4t.png) "x" and "t" are the only characters I have for this font.


title: Directory in the search path of LaTeX System

text: From the Acrotex installation manual: "Placement. The ZIP ﬁle installs in a folder called acrotex, so place the ZIP ﬁle in a directory in the search path of your LATEX system where you want the acrotex folder to reside." How can I know what this directory should be? I'm on Ubuntu.


title: Can anyone provide me with a simple example?

text: I want to write in urdu with nastaleeq font. I have done quite a few things but i dont know how to write it. Plus i dont know how to use xetex. So can anyone give me a simple example writing urdu in the desired font and how to run it on texmaker.


title: Spacing after itemize (without parskip package)

text: This piece of code seemed to be working fine for a long time, until I try to _remove_ the `parskip` package. Without this package, it seems that I need to include two hacks:   1. Add a `\vspace{-\baselineskip}` _before_ and _after_ the `itemize` environment.   2. Need a `\strut` to be added. So without `parskip`, and _with_ these two hacks I obtain the desired results: ![enter image description here](http://i.stack.imgur.com/7HKWb.png) But without the hacks, which is obtained by ensuring the following are un- commented:               \renewcommand{\HackVSpace}{}%     \renewcommand{\HackStrut}{}%      this yields: ![enter image description here](http://i.stack.imgur.com/TEezG.png) Surely there is a less hackish solution to this. And, what is special about `parskip` that I was getting the desired behavior. ## Notes:   * In actual usage I am only really using this for a _single_ item and `itemize` provides the desired formatting, so I could do without `itemize`. But am still interested to know how to control `itemize`. ## Code:               %\def\UseParskipPackage{}% Need to work with this commented.          \documentclass{article}     \usepackage{xcolor}     \usepackage{enumitem}     \usepackage{showframe}          \ifdefined\UseParskipPackage         \usepackage{parskip}         \newcommand{\HackVSpace}{}%         \newcommand{\HackStrut}{}%     \else         \newcommand{\HackVSpace}{\vspace{-\baselineskip}}%         \newcommand{\HackStrut}{\strut}%     \fi               %% Remove the hack - comment these out and things work fine     %% with or without the parskip package         \renewcommand{\HackVSpace}{}%         \renewcommand{\HackStrut}{}%               \begin{document}          \noindent     \colorbox{blue!20}{%         \parbox[t]{\dimexpr\linewidth-2\fboxsep\relax}{%                 \HackVSpace%                 \begin{itemize}[label={\small \texttt{X:}}]%                     \item \HackStrut\texttt{some text fff yyy}%                 \end{itemize}%                 \HackVSpace%                 }}%     %     \newline     \colorbox{blue!20}{%         \parbox[t]{\dimexpr\linewidth-2\fboxsep\relax}{%                 \HackVSpace%                 \begin{itemize}[label={\small \texttt{Y:}}]%                     \item \HackStrut\texttt{some more text fff yyy}%                 \end{itemize}%                 \HackVSpace%                 }%     }%     \end{document}


title: Help on TikZ diagram

text: I'm very sorry about dull question, but I am totally confused by TikZ. Would anyone help me to draw following diagram, please? ![enter image description here](http://i.stack.imgur.com/IaH4l.png) What I've done so far is as follows.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,positioning}     \begin{document}     \begin{tikzpicture}[%         every node/.style={{font=\tt},>=stealth'},%         list/.style={rectangle split, rectangle split parts=3,%         draw,>=stealth', rectangle split horizontal}%         ]     \node at (-1,1) (upperLeftHidden) {};     \node[list] (center) [below right=of upperLeftHidden] {x} %at (0,0)         edge[<-,bend right=20,shorten <=5pt,>=stealth']             (upperLeftHidden);     \node [below left=of center] {t}         edge[<-,bend left=20,shorten <=3pt,>=stealth'] (center);     \node[list] (bot) [below right=of center] {\nodepart{second} f} %at (0,0)         edge[<-,bend right=20,shorten <=5pt,>=stealth']             (center)         edge[->,bend right=20,shorten <=5pt,>=stealth']             (center.north);     %\node [below left=of bot] {e} % doesn't work for some reason         %edge[<-,bend left=20,shorten <=3pt,>=stealth'] (bot)     \end{tikzpicture}     \end{document}      Which results in: ![enter image description here](http://i.stack.imgur.com/ArMTP.png)


title: Knitr and numbers

text: I return to a question, which is few months old and then maybe not yet the best practice around. I use the `siunitx` package in my documents along with `knitr` to compile my R chunks. As far as I understand its behaviour, `knitr` will output integers treating them as normal characters while double into the `\ensuremath{}`environment. Then               \documentclass{article}          \begin{document}          Integer:     \Sexpr{14}          Double:     \Sexpr{-1.2324234}               \end{document}      will be knitted as               \documentclass{article}          \begin{document}          Integer:     14          Double:     \ensuremath{-1.2324}               \end{document}      According to the answer I got to my previous question (which is working) if I want to treat my numbers with `siunitx` and the `\num` environment I need to compile my doubles in my R chunks as characters, then `\Sexpr{as.character(-1.2324234)}` (or alternatively `\num{\Sexpr{as.character(-1.2324234)}}` if I want to leverage on `siunitx`) which will be knitted as `-1.2324234`. All good. Yet I wonder if there's any better way to manage my output. First, sometime I am not sure whether my output will be an integer or a double; especially when my data change I might generate error throughout my code just because 1 turned 1.1. Second, the solution of wrapping everything around `as.character()` makes my code much heavier to read especially when I also wrap everything into `num{}`. I then tried to `\renewcommand{\ensuremath}{\num}`, which was not the good idea I thought it was:               ! Undefined control sequence.     \ensuremath ->\num           l.61 \ensuremath                     {-1.2324}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      Is there any chance to gently ask `knitr` to output all numeric (integer and double) wrapped into `\num{}`?


title: Conditional using non-integer numbers

text: I am trying to generate fractals using affine transformations. I need to generate a random number in the interval (0,1), and depending on the value of this random number choose a function to calculate the coordinates of the point that I'll plot. But the compiler is reporting an error I cannot figure out how to solve. Here's a code that describes the situation.               \documentclass{article}          \usepackage{color}     \usepackage{tikz}     \usepackage{ifthen}          \begin{document}     %     \begin{center}     \begin{tikzpicture}         \draw[help lines] (0,0) grid (5,5);     % Here I generate a random number         \pgfmathparse{rnd}     % I store the random number generated in memory          \pgfmathsetmacro{\aleatorio}{\pgfmathresult}              \ifthenelse{\aleatorio<0.5}{             \node[red] at (5*rnd,5*rnd){\footnotesize\aleatorio};         }{             \node[blue] at (5*rnd,5*rnd){\footnotesize\aleatorio};         }     \end{tikzpicture}     \end{center}     %     \end{document}      When it comes to the line of the command `\ifthenelse` to make the decision, it gives me an error message. I think it is because `\ifnum` can compare only integer numbers. To be honest, I am not sure. In any case, I need help to compare nonintegers (with decimal part) numbers and then continue... I appreciate your help.


title: Why is tikz so much slower when plotting a huge amount of data than WYSIWYG plotting tools?

text: I was wondering why a `tikz/pgf` plot of a data file containing several thousand data points needs a couple of minutes to compile while creating the same plot with a WYSIWYG plotting tool (like Grace) or spreadsheet application (like MS Excel or Origin) needs only seconds. What are the WYSIWYG applications doing differently from `tikz` to be so much faster?


title: Fill a region between two sinusoids

text: I would like to fill with shade color the region between two sinusoids. Here's my code:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[scale=1.3, every node/.style={font=\scriptsize}]     % Draw axes     \draw[<->,thick] (0,2.5) node[above] (y) {$\rho$} |- (3.5,0) node[right] (x) {$\theta$};     \coordinate (c) at (1.5, 1);     \draw [fill=blue] (0,1) sin (0,1.5) cos (c);      \draw [fill=blue] (0.3,0) cos(c);     \draw [fill=blue] (c) sin (2.5, 1.5);     \draw [fill=blue] (c) sin (2.5, 0.5);     \end{tikzpicture}     \end{document}


title: Minimal LaTeX installation

text: I've been given permission to install LaTeX in a laboratory in my University. Given the simplicity of working with MikTeX Package Manager and that I will only be installing in the Windows partition, I've decided to install MikTeX. However, I've been asked that the installation takes as less space as needed. I'm not comfortable with the packages that come with the Basic Installer, feeling that they are lacking many significant ones. So, I'd like to know your opinion on what packages/classes may prove useful in order to write documentation for assignments as well as a degree thesis. Bear in mind that it will be used for assignments in Elec. Engineering. Some packages I've already considered are:   * AMS bundle   * pgf/tikz   * beamer   * graphicx   * array/tabulary   * mathtools   * babel (documents will be in Spanish)   * hyperref   * placeins   * todonotes   * listings


title: Change font size of math sans serif font only?

text: I'm using the Arev font for math sans serif. However, the font produces slightly larger letters compared to my roman math font:               \documentclass[a4paper, 10pt]{scrartcl}          \usepackage[T1]{fontenc}          \DeclareMathAlphabet{\mathsf}{OML}{zavm}{m}{n}          \begin{document}          Font sizes of different math alphabets  $\mathrm{x} \mathsf{x} \quad     \mathrm{y} \mathsf{y} \quad \mathrm{z} \mathsf{z}$          \end{document}      ![enter image description here](http://i.stack.imgur.com/HUKAe.png) How can I change the font size of the sans serif font by a factor to match the roman font?


title: Error with cleveref + enumerate + tikz-qtree

text: I get an error in my document in the following circumstance:   1. Using the `cleveref` package   2. And the `tikz-qtree` package (for drawing syntax trees)   3. Inside an `enumerate` environment Here's a MWE:               \documentclass{article}          %\usepackage{cleveref} %Uncomment for crash          \usepackage{tikz}     \usepackage{tikz-qtree}          \begin{document}          \begin{enumerate}       \item foo         \begin{tikzpicture}             \Tree [.Foo Bar ]         \end{tikzpicture}     \end{enumerate}               \end{document}      Here's a link to the log that running that file (with `cleveref` uncommented) generates: log file. The first error is:               ! Package tikz Error: A node must have a (possibly empty) label text.      I've verified the following things:   * It is not a catcode problem, i.e. the catcode of `.` and `[` is 12 both with and without loading `cleveref`   * The problem goes away if the tree is not embedded in an enumerate, i.e. delete the entire document body and replace it with only the `\begin{tikzpicture}...\end{tikzpicture}`   * The problem goes away if you change the `enumerate` to `itemize` I tried running the example with `\traceon` from the `trace` package, but got mired in the half-million(!) lines of output. Based on the esoteric combination of packages, I'm not sure a ready answer exists, but hopefully there is a TeX guru out there familiar with the guts of these packages who sees something I cannot.


title: Slanted curly brace to upshape, and \dagger, and so on

text: Imported from http://www.tug.dk/FontCatalogue/anttor/               \documentclass{article}          \usepackage[T1]{fontenc}          \usepackage[math]{anttor}          \begin{document}          $\{\sin x\mid 0<x<\pi\}$, $A\dagger B=C$.          \end{document}      ![some description](http://i.stack.imgur.com/Sj3fq.png)


title: How to get a properly centred horizontal rule?

text: I'm trying to produce a horizontal rule 2/3 the `textwidth` and centred. It's much harder than expected, as it pulls to the left. I've tried putting `noindent` but that makes it worse, as this MNWE shows:               \documentclass[12pt]{article}     \begin{document}     This line is 2/3 textwidth with hspace\{stretch\} either side and no indent:          \noindent\hspace{\stretch{1}}\rule{0.67\textwidth}{0.1pt}\hspace{\stretch{1}}          This line is 2/3 textwidth with hspace\{stretch\} either side:          \hspace{\stretch{1}}\rule{0.67\textwidth}{0.1pt}\hspace{\stretch{1}}          This line is 4/5 textwidth with hspace\{stretch\} either side:          \hspace{\stretch{1}}\rule{0.8\textwidth}{0.1pt}\hspace{\stretch{1}}          This line is 9/10 textwidth with hspace\{stretch\} either side:          \hspace{\stretch{1}}\rule{0.9\textwidth}{0.1pt}\hspace{\stretch{1}}          This line is full textwidth:          \hspace{\stretch{1}}\rule{\textwidth}{0.1pt}\hspace{\stretch{1}}          This line is full linewidth:          \hspace{\stretch{1}}\rule{\linewidth}{0.1pt}\hspace{\stretch{1}}          \end{document}      I've also tried just using `\hfill`s instead of the `\hspace{\stretch{1}}`s, but that produces the same effect. What am I missing?


title: Specifying bullet type when using itemize

text: Is there a way to get a specific type of bullet instead of the filled bullets when you first activate the itemize command in LaTeX? I am trying to get hollow bullets from the start instead of using nested commands to attempt to create them somehow. Thank you.


title: latex and cross references

text: I have defined my own enumerable environment in the layout and cls files and I have set a marker behind the automatic enumerations in the lyx file which reads A1, the name of the marker is A:1 When I try to reference the marker with a text reference I get the Name of the Chapter. When I try to use a standard reference I get only '1'. How can I get 'A1' as a reference instead? Is there some modification I have to do in the layout file? I'm using lyx 2.0.4 under win7. I hope I managed to describe the problem, Thank you very much


title: Scalebox - knowing how much it scales

text: I am relatively new to LaTeX and I was playing around with figures and came across the scalebox command. This apparently lets you scale a graph that you create or import into your LaTeX document by a certain amount. How do you know how much scalebox will scale your figure by? I read somewhere that typing `\scalebox{0.5}` scales a graph to 0.8 times the original size. Is there any way to figure out what fraction of the original size your graph will become?


title: How to plot a bar graph of decaying values?

text: How would I draw a picture like this in tex? I'm not sure of the scaling ratio. I believe it can be arbitrary. i.e. As long as the length of `$\ell_j$` is less than `$\ell_i$`, `$\forall \, j>i$` ![enter image description here](http://i.stack.imgur.com/fnj7t.png) Any help would be appreciated.


title: Equation signs disappeared

text: I really hope someone can help me, because I'm soon submitting my master thesis and suddenly this happend: All minus/plus/equal-signs have disappeared from my equations! They have been there all the time, but suddenly they are gone, and I have no idea how I made it happen. I'm using the following math packages:               \usepackage{amsmath,amsfonts,amsthm}      One of my equations looks like this:               \begin{equation}     CO + 2H_{\textrm{2}} \leftrightarrow CH_{\textrm{3}}OH      \end{equation}      I'll be forever thankful for any help!


title: Mirror image of the neg symbol?

text: Is there a mirror symbol for the `$\neg$` symbol, or a symbol like `$\vdash$` without the bottom part of the vertical line? I couldn't find it. Thanks.


title: Labeling columns of figures in a subfig environment

text: I have the following problem: Using the `subfig` package I display 4 images in a 2x2 layout.               \documentclass{article}          \usepackage{subfig,caption}     \usepackage{graphicx}          \begin{document}          \begin{figure}       \centering       \subfloat{\includegraphics[width=0.31\textwidth]{img.png}}       \hspace{1em}       \subfloat{\includegraphics[width=0.31\textwidth]{img.png}}\\       \subfloat[Column 1]{\includegraphics[width=0.31\textwidth]{img.png}}       \hspace{1em}       \subfloat[Column 2]{\includegraphics[width=0.31\textwidth]{img.png}}     \end{figure}          \end{document}      The result is that the labels start with (c) and (d), positioned under the 3rd and 4rd image. I want the labeling to be (a) and (b). Somehow I need the counter for the caption of subfloat to be reset.


title: Get MiKTeX dvips to embed fonts found in EPS file

text: I have some EPS figures embedded in a LaTeX document. When I run dvips on the .dvi file I get complaints like this:               dvips.exe: Font TimesTen-Roman used in file ./fig01-01.eps is not in the mapping file.      Note that I _do_ have the Adobe Type 1 font for TimesTen-Roman, but I do not know how to get dvips to associate the font it finds in the EPS file with that file and to put it into the generated Postscript. I am using MiKTeX 2.9.


title: \listoffigures problem

text: As a part of my thesis, I am using `\listoffigures` to display the list of figures. Now, some of the figures have `\footnote` in their captions. To display the `\footnote`s properly, I have used the suggestions of: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ftncapt   Now when I go to the `\listoffigures` I see, for this figure: `[Caption for LOF] ....... 39`. What I should see is: **map and encap scheme** , Which is the actual caption for the figure. How can I fix this? The 2nd problem is regarding CLICKABLE link in `\listoffigures`. For example, for the entry,               2.3 Traffic Engineering Scenario ............ 24      The whole caption is CLICKABLE. But for another entry with `\cite` in it:               2.4 Compact Routing Example [24] ................ 29      Only the citation number [24] is CLICKABLE. I can't click **Compact Routing Example**. Why is this happening? How do I fix this?


title: Error with \fbox in beamer?

text: I'm using `\fbox` in a `beamer` document to draw a box around the content, but I don't get the required output. The `\fbox` content is               \fbox{Risk is defined as the potential future harm that may arise due to some present actions}      Also, `\emph{\texbf{sample text}}` makes the text only bold not in italic font in `beamer`. ![enter image description here](http://i.stack.imgur.com/pLLVy.png)                        \documentclass{beamer}              \usetheme{CambridgeUS}              \setbeamercolor{title}{bg=red!65!black,fg=white}              \begin{document}              \title{Risk Management in Software Engineering}              \author{S.Subham Soni}              \institute[P.E.C]{Department of Computer Science and Engineering\\      Pondicherry Engineering College}               \date{January 6, 2014}                    \begin{frame}               \maketitle               \end{frame}               \begin{frame}               \frametitle{Table Of Contents}               \tableofcontents               \end{frame}               \begin{frame}               \frametitle{Introduction to Risk Management}               \section{Introduction to Risk Management}               \begin{itemize}               \item Risk Management involves \textsl{\textbf{anticipating risks}} that might affect the project schedule or the quality of the software being developed and taking action to avoid these risks.               \item The results of the risk analysis should be documented in the project plan along with an analysis of the consequences of a risk occurring.               \item Effective risk management makes it easier to cope with problems and to ensure that these do not lead to \underline{unacceptable budget} or \underline{schedule slippage}.               \end{itemize}               \end{frame}               \begin{frame}               \frametitle{Types of Risks}               \section{Types of Risks}               \textbf{What is Risk?} \par               \fbox{\parbox{\linewidth}{%               Risk is defined as the potential future harm that may                arise due to some present actions}}               \end{frame}               \end{document}


title: Using footnotesize in ctable package

text: I have a long table requiring the use of a `\footnotesize`. The table is made using a `\ctable` package as follows.               \documentclass{article}     \usepackage{ctable}     \usepackage{booktabs}               \begin{document}          \ctable[         caption = {cap1},         label   = {tab:tabu},             pos = ht,     ]{lcc}{       \tnote[$\ast$]{footnote is here}     }{                             \FL     Variable & Estimate & p-value \ML     var1  &   4.4   &   0.02 \\     var2 \tmark[a]  &   2.4   &   0.01  \\     var3  &   -6.2  &   0.08 \LL     }          \end{document}      I want to know how to use `\footnotesize` to help fit the contents my table in a page.


title: Extending amsmath book structure with Volume (tomo)

text: I've tried to define a new Document section, called _tomo_ ("volume" in English) at the upper level of the `amsmath` **part** document section like this:               \documentclass[12pt,italian]{amsbook}          \newcounter{tomo}     \renewcommand\thetomo          {\roman{tomo}}     \let\tomorunhead\tomorunhead     \def\tomoname{tomo}     \def\tomo{\cleardoublepage \thispagestyle{empty}%       \null\vfil  \markboth{}{}\secdef\@tomo\@tomo}     \def\@tomo[#1]#2{%       \ifnum \c@secnumdepth >-2\relax \refstepcounter{tomo}%         \addcontentsline{toc}{tomo}{\tomoname\ \thetomo.         \protect\enspace\protect\noindent#1}%       \else         \addcontentsline{toc}{tomo}{#1}\fi       \begingroup\centering       \ifnum \c@secnumdepth >-2\relax            {\fontsize{\@xviipt}{22}\bfseries          \tomoname\ \thetomo} \vskip 20\p@ \fi       \fontsize{\@xxpt}{25}\bfseries           #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}}          \def\@stomo#1{\addcontentsline{toc}{tomo}{\protect\noindent#1}%       \begingroup\centering       \fontsize{\@xxpt}{25}\bfseries          #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}}     \def\tomorunhead#1#2#3{%       \@ifnotempty{#2}{\uppercase{#1 #2}\@ifnotempty{#3}{. }}%       \def\@tempa{#3}%       \ifx\@empty\@tempa\else\uppercasenonmath\@tempa\@tempa\fi}     \def\l@tomo{\@tocline{-1}{12pt plus2pt}{0pt}{}{\bfseries}}     \let\toctomo\tocsection          \begin{document}          \tomo{example}     \part{ciao}     \chapter{test}          \end{document}      But at compile time, it returned me the following error:               ! Use of \@ doesn't match its definition.     \@xdblarg #1#2->#1[                    {#2}]{#2}     l.36     \tomo               {example}      I've been using the amsbook class to define the following extension. Where am I wrong? By the way, I didn't use the `volumes` package, as it won't add the _tomo_ in my table of contents.


title: Page layout: problems setting margins and placing footer

text: I am having trouble setting the correct margins for my page, especially the bottom margin in combination with a footer which includes only my page number. I feel like I'm close to making it work but I seem to need help for the last bits of code. I read posts about similar problems but I just couldn't find a solution. I don't think it's a printer issue as the document written with LibreOffice turns out fine. **How it should be** :   1. top, right, left margin = 25mm   2. bottom margin (from the bottom up to the page number) = 20mm   3. space between footer (i.e. page number) and last line of text = 10mm   4. text fills up the document until the page is full => starts on a new page **What works** :   1. Setting the left and right margins to 25mm using the package geometry   5. Using titlesec to delete the extra space above the chapter head using -\topskip  Here is what I tried so far:               \documentclass[12pt, a4paper, oneside]{report}     \usepackage[a4paper, showframe, tmargin=25mm, lmargin=25mm, rmargin=25mm, bmargin=20mm]{geometry}     \usepackage{titlesec}          \titleformat{\chapter}[hang]{}{\thechapter.\ }{0pt}{}     \titlespacing*{\chapter}{0cm}{-\topskip}{0pt}[0pt]               \setlength{\parindent}{0mm}               \begin{document}     Top margin doesn't work even though this is normal text :(          \chapter{Hello World}     Does this work? I don't know, man...          \end{document}         **What doesn't work** :   1. using the code above, the 25mm top margin starts from the top of the page but goes all the way down to the baseline of the text! So that with a 12pt font I only get about 20mm of white space from the top.   2. using bmargin or bottom=20mm seems to work but when I use a footer it doesn't. The page number is located in the bottom margin of 20mm where it shouldn't be   3. I couldn't figure this out yet   4. When there is a section or a subsection anywhere near the end of the page which would cause the section or subsection head to be the last line of the page it takes away the section head and puts it on the next page, which results in one or two blank lines on the previous page. The section head needs to be the last line of the page even if the first line of text belonging to this section is on the next page! (we have to do this even though it may look ugly) I hope someone can help me. This is my first post here. I used the search function to find similar problems but couldn't find anything. Edit: I forgot to mention that the top margin is 1-2mm bigger when the first line is a chapter head. So maybe -\topskip doesn't do the trick?


title: Footnotes without markers only in the text, and with markers before the note words

text: Now what is needed is to add a footnote that is not attached to any place in the document, yet it is counted in the counter and appears. What's more, I want the footnote's number to appear before the words of the note. (So it's like a 'ghost' footnote that refers to nowhere.)


title: Possessive cite in biblatex-chicago (authordate)

text: For my master's thesis I changed my citation package from `harvard` with `bibtex` to `biblatex-chicago` with `authordate` and `bibtex8`, primarily because I need babel to translate my bibliography to Norwegian. But I miss the `\possessivecite` command from the `harvard` package, and I haven't found anything like it in the `biblatex-chicago` documentation. Making a command like               \newcommand{\posscite}[1]{\citeauthor{#1}'s \autocite*{#1}}       would solve it, but then I won't be able to cite a certain page with               \posscite[135]{key})      and I would really like to. As I'm writing in Norwegian, I also need the possessive to be `'` when the author's name ends with s/sh/sj/rs/z (much like in English)and just `s` (no apostrophe) in any other case. How do I do that?


title: Vertical space between 2 subsequent headers (of chapters, sections, etc)

text: I'm writing a LaTeX class for my bachelor's thesis. My university's standard says that there should be a space after headers:   * 2cm if there's text after the header   * 1.3cm if there's another header after it (for example, subsequent section and subsection headers). For now I've set 2cm space after all headers (in the class file) and adding `\vspace{-7mm}` between subsequent headers (manually, in the document). Is there a way to make it automatically, i.e. some kind of "conditional spacing" if the last command was a header?


title: XeLaTeX with fontspec not recognizing ANY fonts on a windows platform (with miktex)

text: Getting the message: font-not-found see fontspec documentation. I'm using cls file abbreviated at the bottom of this page whose origin is latextemplates.com/template/friggeri-resume-cv. I've tried all sorts of fonts from system fonts and tex fonts. Nothing seems to work! I would like to get fonts like in http://www.tug.dk/FontCatalogue/ to work, but I would be happy if I can just get one font to work!               \ProvidesClass{friggeri-cv}[2012/04/30 CV class]     \NeedsTeXFormat{LaTeX2e}          \DeclareOption{print}{\def\@cv@print{}}     \DeclareOption*{%     \PassOptionsToClass{\CurrentOption}{article}%     }     \ProcessOptions\relax     \LoadClass{article}               %%%%%%%%%%     % Colors %     %%%%%%%%%%          \RequirePackage{xcolor}          \definecolor{white}{RGB}{255,255,255}     ...          %%%%%%%%%     % Fonts %     %%%%%%%%%     \RequirePackage{fontspec}     \RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}     \RequirePackage[T1]{fontenc}          \RequirePackage{libertine}          \newfontfamily\bodyfont[]{\rm}     \newfontfamily\thinfont[]{\biolinum}     \newfontfamily\headingfont[]{\sc}          \defaultfontfeatures{Mapping=tex-text}     \setmainfont[Mapping=tex-text, Color=textcolor]{Tex Gyre Heros}          %\setmathfont{XITS Math}          %%%%%%%%%%     % Header %     %%%%%%%%%%          \RequirePackage{tikz}          \newcommand{\rolefont}{%       \fontsize{14pt}{24pt}\selectfont%       \thinfont%       \color{white}%     }          \newcommand{\header}[3]{%       \begin{tikzpicture}[remember picture,overlay]         \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum    height=4cm] (box) at (current page.north){};         \node [anchor=center] (name) at (box) {%           \fontsize{40pt}{72pt}\color{header}%           {\thinfont #1}{\bodyfont  #2}         };     \node [anchor=north] at (name.south) {%       \fontsize{14pt}{24pt}\color{header}%       \thinfont #3%         };       \end{tikzpicture}       \vspace{2.5cm}       \vspace{-2\parskip}     }          ...      %%%%%%%%%%%%%%%%      % Other tweaks %      %%%%%%%%%%%%%%%%          \RequirePackage[left=6.1cm,top=2cm,right=1.5cm,bottom=2.5cm,nohead,nofoot]{geometry}     \RequirePackage{hyperref}


title: How to fit the width of a tcolorbox to a long title (single line)?

text: Using "clip title=false" enables a tcolorbox long title to sit on a single line. However, the width of the tcolorbox itself remains fitted to the content. How can the tcolorbox width be fitted to the natural width of a long title that sits on a single line (not wrapped) ?               \documentclass[]{article}     \usepackage[skins,listings,breakable,listingsutf8,theorems,hooks,fitting]{tcolorbox}     \usepackage{calc}          \newtcbox{\LongTitleBox}[1][]{enhanced,title=\mbox{Title Larger than the Box Content},clip title=false,colbacktitle=white,coltitle=black,#1}%           \newtcbox{\LongTitleBoxResult}[1][]{enhanced,title=\mbox{Final Result},clip title=false,colbacktitle=white,coltitle=black,#1}%           \begin{document}     \LongTitleBox{Box Content}       \LongTitleBoxResult{1}     \LongTitleBoxResult{123 456 789}     \end{document}      ![enter image description here](http://i.stack.imgur.com/5h8p7.png)


title: Two plural forms for acronyms

text: Is it possible to have more than one plural form for acronyms? I want to use the following german term for revision/version control system: VVS for **Versionsverwaltungssystem** the normal plural would be **Versionsverwaltungssysteme** But I would also use it like this: ...mit verteilten **Versionsverwaltungssystemen** (n at the end) How may I do that right with latex? :)


title: Search and replace in a verbatim token list

text: I maintain a package for the R programming language that contains a vignette which gets processed using the Sweave literate programming system. Now, one of the irks about Sweave is that it always produces output wrapped in two layers of environments like the following:               \begin{Schunk}     \begin{Sinput}     > Some R command     \end{Sinput}     \begin{Soutput}     The result     \end{Soutput}     \end{Schunk}      Now, I would like to collapse this into something that only uses a single environment by tossing out the `\begin`, `\end` commands. Or, optionally replacing them with delimiters that the `listings` package can hook into with a `moredelim` definition:               \begin{Schunk}     > Some R command     swe@veSt@rtOutput     The result     swe@veEndOutput     \end{Schunk}      I am currently achieving this effect through a hack that re-writes the R output driver when Sweave loads the `.Rnw` file. However, this is proving to be a maintenance burden as the structure of the driver changes with every R release and I have to update the hack. So, I am looking for a way to attack this from the TeX end. Here is a minimal example of some Sweave output along with my current method of wrapping it into a listing:               \documentclass{minimal}     \usepackage{verbatim}     \usepackage{listings}          \newwrite\listinginput          \makeatletter     \def\startcapture{%       \begingroup       \@bsphack         \immediate\openout\listinginput=\jobname.lst%         \let\do\@makeother\dospecials\catcode`\^^M\active         \def\verbatim@processline{%             % The macro now pipes it's input to our temp file.             \immediate\write\listinginput{\the\verbatim@line}         }%         \verbatim@start     }     \def\stopcapture{%         \immediate\closeout\listinginput         \@esphack       \endgroup     }     \makeatother          \newenvironment{Schunk}{\startcapture}%       {\stopcapture\lstinputlisting{\jobname.lst}}          \begin{document}          \begin{Schunk}     \begin{Sinput}     > getLatexStrWidth("The symbol: alpha")     \end{Sinput}     \begin{Soutput}     [1] 82.5354     \end{Soutput}     \end{Schunk}          \end{document}      In my full version the `Schunk` environment is also wrapping the whole show into a TikZ node, which is why I am using verbatim to write things to a temp file and then read them back in using `lstinputlisting` (listing doesn't take kindly to being embedded in another environment). Now, in `verbatim@processline`, I have an opportunity to examine things line by line and so I am wondering if there is a way to perform the equivalent of:               s/\\begin{Sinput}/customDelimiter/      On the contents of the token list stored in `verbatim@line`. The closest I have gotten is by using the ted package:               \def\verbatim@processline{%       \Substitute*{\the\verbatim@line}{Sinput}{swe@veSt@rtOutput}       % The macro now pipes it's input to our temp file.       \immediate\write\listinginput{\the\ted@toks}     }%      This gives me the following output:               \begin{swe@veSt@rtOutput}     > getLatexStrWidth("The symbol: alpha")     \end{swe@veSt@rtOutput}     \begin{Soutput}     [1] 82.5354     \end{Soutput}      However, I am unable to get the following to work:               \Substitute*{\the\verbatim@line}{\begin{Sinput}}{swe@veSt@rtOutput}      Any pointers on how to achieve this act of sourcery would be greatly appreciated! * * * ### Update Aaron's comment led me to discover how to properly escape things like `\begin{Sinput}` so that `listings` will treat them as delimiters:               \lstdefinestyle{sweave}{       moredelim=[is][]         {\\begin\{Sinput\}}         {\\end\{Sinput\}},       moredelim=[is][]         {\\begin\{Soutput\}}         {\\end\{Soutput\}}     }      When used with `\lstinputlisting[style=sweave]`, this gives the following output               .      > getLatexStrWidth("The symbol: alpha")     .     .     [1] 82.5354     .      The `.` characters aren't actually in the output, they are just there to show that empty lines get left behind. I think I can work with this result, but I am leaving the question open in case anyone has an answer to the general question of "How do I `s/\\\begin{this}/that/` in a token list??". * * * ### Update 2 I have been experiencing difficulty with using pattern matching macros inside `\verbatim@processline`. I suspect this is because that macro is executed when the verbatim environment is active and catcodes are all shifted. So any pattern specified when `\verbatim@processline` is defined won't have the proper catcodes to generate a match. I've stared at the verbatim documentation long enough to get a headache, and I still can't figure out how to set things up correctly. The workaround I have come up with is to expand my original example to a three-step process by writing the content captured by verbatim to a temporary file. This output is then re-read line-by-line outside of the verbatim environment where catcodes are in their normal state and pattern matching works. The result of this processing step is then written to a final file that `lstinputlisting` reads in and processes. The code now looks like this:               \documentclass{minimal}     \usepackage{verbatim}     \usepackage{listings}     \usepackage{xcolor}     \usepackage{xstring}          \newwrite\listinginput     \newread\tempin          \newif\ifskipline     \newif\ifhaveoutput     \newtoks\linebuffer     \def\addtobuffer#1{%       \toks0={#1}%       \edef\act{\noexpand\linebuffer={\the\linebuffer \the\toks0}}%       \act}     \def\addoutput#1{%       \expandafter\addtobuffer\expandafter{#1}%       \haveoutputtrue}     \newtoks\parpattern\parpattern={\par}          \makeatletter     \def\startcapture{%       \begingroup       \@bsphack         \immediate\openout\listinginput=\jobname.tmp%         \let\do\@makeother\dospecials\catcode`\^^M\active         \def\verbatim@processline{%             % The macro now pipes it's input to our temp file.             \immediate\write\listinginput{\the\verbatim@line}         }%         \verbatim@start     }     \def\stopcapture{%         \immediate\closeout\listinginput         \@esphack       \endgroup     }     \makeatother          \def\replaceenvs#1{%       \immediate\openin\tempin=\jobname.tmp       \immediate\openout\listinginput=\jobname.lst       \def\prependcode{}       \begingroup         % Xstring doesn't like parameter and comment characters         \catcode`\#=11         \catcode`\%=11         \loop           \ifeof\tempin             \immediate\write\listinginput{\the\linebuffer}           \else             \immediate\read\tempin to \codeline             \IfBeginWith{\expandafter\string\codeline}{\string\begin{Sinput}}{\addtobuffer{Swe@veBeginInput}\skiplinetrue}{}             \IfBeginWith{\expandafter\string\codeline}{\string\end{Sinput}}{\addtobuffer{Swe@veEndInput}\skiplinetrue}{}             \IfBeginWith{\expandafter\string\codeline}{\string\begin{Soutput}}{\addtobuffer{Swe@veBeginOutput}\skiplinetrue}{}             \IfBeginWith{\expandafter\string\codeline}{\string\end{Soutput}}{\addtobuffer{Swe@veEndOutput}\skiplinetrue}{}             \IfBeginWith{\expandafter\string\codeline}{\expandafter\string\the\parpattern}{\skiplinetrue}{}             \ifskipline               \skiplinefalse             \else               \ifhaveoutput                 \immediate\write\listinginput{\the\linebuffer}                 \linebuffer={}\haveoutputfalse               \fi               \addoutput{\codeline}             \fi         \repeat          \endgroup            \immediate\closein\tempin       \immediate\closeout\listinginput     }          \lstdefinestyle{sweave}{       moredelim=[is][\color{red}]         {Swe@veBeginOutput}         {Swe@veEndOutput},       moredelim=[is][\color{blue}]         {Swe@veBeginInput}         {Swe@veEndInput}     }          \newenvironment{Schunk}{%       \startcapture%     }{%       \stopcapture%       \replaceenvs{\jobname.tmp}%       \lstinputlisting[style=sweave]{\jobname.lst}%     }          \begin{document}          \begin{Schunk}     \begin{Sinput}     # This is a comment     > getLatexStrWidth("The symbol: alpha")     \end{Sinput}     \begin{Soutput}     [1] 82.5354%     \end{Soutput}     \end{Schunk}          \end{document}      `verbatim` works it's magic as before between the `\startcapture` and `\endcapture` macros to produce a `\jobname.tmp` file with the following contents:               \begin{Sinput}     # This is a comment     > getLatexStrWidth("The symbol: alpha")     \end{Sinput}     \begin{Soutput}     [1] 82.5354%     \end{Soutput}      This is reprocessed by the new code in `\replaceenvs` using the `xstring` package to create `\jobname.lst`:               Swe@veBeginInput# This is a comment      > getLatexStrWidth("The symbol: alpha") Swe@veEndInputSwe@veBeginOutput     [1] 82.5354% Swe@veEndOutput      Listings then processes `\jobname.lst` to produce:               # This is a comment      > getLatexStrWidth("The symbol: alpha")     [1] 82.5354%      Where the first two lines are highlighted in red and the last line is in blue. This successfully removes the `Sinput` and `Soutput` environments, replaces them with delimiters that `listings` can use to style the code, and leaves no blank lines behind. However, I really feel like I took the long way around with reading and writing two files. So, I'm leaving this question open and offering a bounty to anyone that can come up with a solution that uses fewer passes. * * * ### Final Thoughts In the end, the problems I had with pattern matching inside `\verbatim@processline` were due to the fact that I had to supply a pattern that would match both the characters _and the catcodes_ of the strings I was looking for. For those people like me who are somewhere in the transition zone between TeX users and TeX programmers, here are the details: Inside a verbatim environment, the catcodes of many characters are reassigned to 12. This is done by the combination of `\let\do\@makeother` and `\dospecials`. Staring at the sections of package manuals that documents TeX code gives me a headache, so I finally started using TeX compiler in interactive mode (something I have always ignored until now) along with `\show` to unravel macro definitions:               grendel:~ sharpie$ pdflatex     This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)     **\documentclass{minimal}     *\usepackage{verbatim}     *\makeatletter          *\show\@makeother     > \@makeother=macro:     #1->\catcode `#112\relax .          *\show\dospecials     > \dospecials=macro:     ->\do \ \do \\\do \{\do \}\do \$\do \&\do \#\do \^\do \_\do \%\do \~.      `\let\do\@makeother` defines `\do` to be a macro that changes the catcode of its argument to 12. `\dospecials` applies `\do` to a list of special characters: ``,`\`,`{`,`}`, etc. So, if you want to match against a string that contains one of those characters inside a verbatim environment, you have to define the your match pattern in an environment where those characters have a catcode of 12. Leo Liu and unbonpetit win the prize for pointing out how to do this. It was a tough decision to decide who gets the bounty---I wish I could split it in half. In the end, I'm giving it to ubonpetit because they went the extra mile in their example. However, Leo Liu did answer first with information that led me to a better implementation so I am going to go through his answer list and vote up some of his excellent contributions. The final version that I ended up with is available as a package on GitHub: > http://github.com/Sharpie/SweaveToLst Thanks to everyone who answered!


title: Bug in TikZ? Line width on layers

text: I found a curios behavior in TikZ. If I set the line width globaly or for the current scope it wont affect the line with inside a `{pgfonlayer}` but the arrow tips are changed: ![line width](http://i.stack.imgur.com/CWxJa.png) Did I found a bug and does anyone know a solution or at least a workaround? **Code**               \documentclass{minimal}          \usepackage{tikz}     \pgfdeclarelayer{background}     \pgfsetlayers{background,main}          \begin{document}     \begin{tikzpicture}[line width=5pt]         \draw (0,0) -- (5,0);         \draw [<->] (0,1) -- (5,1);         \begin{pgfonlayer}{background}             \draw (0,2) -- (5,2) node [right] {on BG};             \draw [<->] (0,3) -- (5,3) node [right] {on BG};         \end{pgfonlayer}     \end{tikzpicture}     \end{document}      * * * ## Update As Christian Feuersäger said, it could be a feature that a new layer sets a fully new picture with the default settings. But in this case all settings should be reset. And in my opinion the `every picture` style should be evaluated anyway. Here’s an extended example showing the inconsequent behavior with `every picture` (color is taken only for nodes of background layer, line width is completely ignored and arrow tips are changed even according to the `line width` setting).   It shows also my workaround, since I’m using a shortcut for the `{pgfonlayer}` environment it was easy to add a scope which uses `every picture`. Unfortunately this `{scope}`doesn’t respect settings given directly to the `{tikzpicture}`. And it seems to be incompatible with Caramdir’s `\makeatletter\tikz@options\makeatother` workaround …               \documentclass{minimal}          \usepackage{tikz}     \pgfdeclarelayer{background}     \pgfsetlayers{background,main}     \tikzset{every picture/.style={line width=5pt,blue,>=stealth}}          \newcommand{\bglayer}[1]{%         \begin{pgfonlayer}{background}             \begin{scope}[every picture]             #1             \end{scope}         \end{pgfonlayer}     }          \begin{document}     \begin{tikzpicture}[green]         \draw (0,0) -- (5,0);         \draw [<->] (0,1) -- (5,1);         \bglayer{%             \draw (0,2) -- (5,2) node [right] {on BG};             \draw [<->] (0,3) -- (5,3) node [right] {on BG};         }     \end{tikzpicture}     \end{document}      ![example 2](http://i.stack.imgur.com/F0NLz.png)