title: Calculate label angle from a value list

text: As a beginner of tex and tikz i stuck on array handling together with foreach. I would like to draw two circle with text along its circumference.               \documentclass[tikz]{standalone}     \usepackage[utf8]{inputenx}     \usetikzlibrary{decorations.text}     \begin{document}     \sffamily     \begin{tikzpicture}[         black,         ultra thick,         planet/.style = {draw,fill,circle,inner sep=#1},         circle label/.style = {         postaction={             decoration={             text along path,             text = {#1},             text align=center,             text color=black,             reverse path,             },         decorate,         }         }     ]     \filldraw[white] (-8,-8) rectangle (9,10);         \path[circle label={|\large|Circle one}] (0,-8-.2) arc (-90:360-90:8+.2);         \draw[color=black,fill=gray!15] (0,0) circle (8);         \path[circle label={|\large|Inner Circle}] (0,-4-.2) arc (-90:360-90:4+.2);         \draw[color=black,fill=black!20] (0,0) circle (4);          % Values     \pgfkeys{/90/.code=Point A,         /0/.code=Point B,         /180/.code=Point C,         /270/.code=Point D}          \foreach \angle in {0,90,180,270}     \draw (\angle:2.75) -- (\angle:2.75cm) node {\pgfkeys{\angle}};          \end{tikzpicture}     \end{document}      ![Output of sample above](http://i.stack.imgur.com/1LE7C.png) I figured out how to draw the labels in the right angles. But i would like to create a list with its Point's and proceed the rest automatically. **As an example:** I add an additional point to the pgfkeys (without angle) and 360 is divided by the count of items. For every loop the next item is removed from list and placed along the path.


title: Book Cover with pstricks - turns colored image to Black and White image

text: I'm trying to make Book back cover with `pstricks`. I have one issue with it, it turns my colored image to Black and White image. Any help to overcome this problem is highly appreciated. Thanks **Output** ![enter image description here](http://i.stack.imgur.com/Y7tP5.png) **MWE**               \documentclass[a4paper, 12pt]{article}     % load the necessary packages      \usepackage[margin=0in]{geometry}          \usepackage[dvipsnames,prologue,table]{pstricks}     \usepackage{pst-all}     \usepackage{graphicx}     \usepackage{lipsum}     \usepackage{rotating}     \usepackage{color}     \usepackage[ISBN=978-80-85955-35-4]{ean13isbn}          %\EANisbn[SC4]     % begin the document and suppress page numbers     \begin{document}     \pagecolor{Maroon}     \pagestyle{empty}          % set up the picture environment     \psset{unit=1in}     \begin{pspicture}(13.24in,9in)     % set up the fonts we use     \DeclareFixedFont{\PT}{T1}{ppl}{b}{it}{0.65in}     \DeclareFixedFont{\PTsmall}{T1}{ppl}{b}{it}{0.5in}     \DeclareFixedFont{\PTsmallest}{T1}{ppl}{b}{it}{0.4in}     \DeclareFixedFont{\PTtext}{T1}{ppl}{b}{it}{12pt}     \DeclareFixedFont{\Logo}{T1}{pbk}{m}{n}{0.2in}                    % put the publisherӳ logo on the spine     \rput[b](6.65,-1.00){\color{white}{\fbox{\Logo ASD}}}     % Create a Box containing the text for the back cover     \newsavebox\Blurbbox     \sbox\Blurbbox{\begin{minipage}{4.5in}     \textcolor{white}{%       \large{%       This booklet contains       }     }          \end{minipage}}     % And position the box     \rput[tl](1,8){\usebox\Blurbbox}     % Then we close all open environments          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5          \newsavebox\Authorbox     \sbox\Authorbox{\includegraphics[width=0.5in, height=0.5in]{Agri1.jpg}}     % now place the picture     \rput[lb](0.5,2.1){\usebox\Authorbox}          % create a savebx for the biography. The width has been adjusted so     % that the right margin matches with that of the book blurb     \newsavebox\Biobox     \sbox\Biobox{\begin{minipage}{3.6in}     \textcolor{white}{%         \large{%     AB  \LaTeX{}. Contact him     by at bla@bla.com       }      }          \end{minipage}}     % and put it where it belongs     \rput[tl](1.9,2.9){\usebox\Biobox}          \rput(5.0,-1.2){     \colorbox{white}{\EANisbn[SC1]}}          \end{pspicture}          \end{document}


title: Multiline equations with one identifier

text: I have a two line equation, but the following code puts two numbers (e.g. (1) and (2))               \begin{alignat}{2}        &E_{peer} = E_{miss} \\                         &+ h_{3} \times (E_{dir}+E_{r}+E_{L2}(access)+h_{4} \times E_{wire})      \end{alignat}      The output is ![enter image description here](http://i.stack.imgur.com/s0ggG.jpg) However there should be only one number.


title: Special formatting for section numbers

text: In these Mathematical Writing notes prepared by Knuth et al. (worth checking out the first few pages if you write technical articles), they use a certain typography for Section numbers. Aside from the `\S` symbol, a special formatting is applied to the number itself, such that it appears more "squat" than usual. ![enter image description here](http://i.stack.imgur.com/t29ch.jpg) I quite like this style (it is somehow elegant and familiar) but I don't know how to recreate it in TeX. Any ideas on how this special formatting of the number was done?


title: Centering text in a table cell

text: I know the question has been asked before, but the answers don't seem to apply. I have a table defined below:               \begin{table}[!ht]     \begin{center}     \caption[Micromagnetic simulators]{Micromagnetic simulators. \citesource{Kim2010}.\label{tab:sims}}     \begin{tabular}{|c|c|c|c|}     \hline \textbf{Name} & \textbf{Developers} & \textbf{Open Source} & \textbf{Method} \\     \hline LLG Simulator & M. R. Scheinfein & Paid & FDM \\     \hline MAGPAR & W. Scholtz & Free & FEM \\      \hline {\centering MicroMagus} & D. V. Berkov & Paid & FDM \\ & and N. L. Gorn & & \\      \hline Nmag & H. Fangohr & Free & FEM \\ & and T. Fischbacher & & \\      \hline OOMMF & M. Donahue & Free & FDM \\ & and D. Porter & & \\      \hline      \end{tabular}     \end{center}     \end{table}      This gives a table as below: ![enter image description here](http://i.stack.imgur.com/qGPn9.png) As you may notice `{\centering MicroMagus}` did not succeed in centring the entry. Also, how would you rate my table in terms of good practices etc?


title: How to show additional contact information in t-letter head

text: I am working on a letter using the `t-letter` module and have found that only my name and address show in the head layer. Any ideas as to how I can show additional contact information as well? Here is the content:               \usemodule[letter][style=fullblock]          \setupletter       [fromname={Name},        fromaddress={Address},        fromphone={Phone},        fromfax={Fax}        fromurl={URL}]          \setupletter       [toname={Mike Wilson},        toaddress={Linden street 12\\78569 TeX City}]          \setupletter       [opening={Dear Reader,},        closing={Greetings from the Author},        subject={Step by step guide to write a letter},        signature={Arthur Thor}]          \startletter     \input knuth\par     \stopletter      I've looked through the `t-letter` module source and it looks like it has the ability to display that information, but I'm not sure how to get it to. Thanks in advance. **Edit:** After fiddling with the workings of the `t-letter` module source I figured out that the following will produce the desired output, but the formatting is lost (the head is displaced in a single line with no spaces between the fields):               \setupletterlayer[head][alternative=left,fromrule=no]      Google searches commenced and I found that it should be `\setupletterstyle`, but when I use that the old head returns. Any thoughts?


title: Programming Conway's Game of Life in LaTeX

text: My aim is to program Conway's Game of Life in LaTeX, and make the output into an animated PDF. I intend to use PGF/TikZ for this, especially `pgfmath`, but I'm stuck at the moment because I need to assign values to array elements, and I don't know how to do that, if it is even possible. Here is my first approach, which outputs a single generation:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc,positioning}          \begin{document}     \pagestyle{empty}          \begin{tikzpicture}         \def\grid{{{0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,1,0,0,0,0},%             {0,0,0,0,0,1,0,0,0},%             {0,0,0,1,1,1,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0}}}              \def\temp{{{0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0},%             {0,0,0,0,0,0,0,0,0}}}              \foreach \z in \grid {             \foreach[count=\xi] \x in \z {                 \foreach[count=\yi] \y in \x {                     \pgfmathtruncatemacro{\i}{\xi - 1}                     \pgfmathtruncatemacro{\iminus}{mod(mod(\xi - 2, 9) + 9, 9)}                     \pgfmathtruncatemacro{\iplus}{mod(\xi, 9)}                     \pgfmathtruncatemacro{\j}{\yi - 1}                     \pgfmathtruncatemacro{\jminus}{mod(mod(\yi - 2, 9) + 9, 9)}                     \pgfmathtruncatemacro{\jplus}{mod(\yi, 9)}                     \pgfmathtruncatemacro{\value}{\grid[\i][\j]}                          \pgfmathtruncatemacro{\topleft}{\grid[\iminus][\jminus]}                     \pgfmathtruncatemacro{\top}{\grid[\iminus][\j]}                     \pgfmathtruncatemacro{\topright}{\grid[\iminus][\jplus]}                     \pgfmathtruncatemacro{\left}{\grid[\i][\jminus]}                     \pgfmathtruncatemacro{\right}{\grid[\i][\jplus]}                     \pgfmathtruncatemacro{\bottomleft}{\grid[\iplus][\jminus]}                     \pgfmathtruncatemacro{\bottom}{\grid[\iplus][\j]}                     \pgfmathtruncatemacro{\bottomright}{\grid[\iplus][\jplus]}                          \pgfmathtruncatemacro{\neighbourcount}{\topleft + \top + \topright + \left + \right + \bottomleft + \bottom + \bottomright}                          \pgfmathtruncatemacro{\nextvalue}{(\value == 1 && (\neighbourcount == 2 || \neighbourcount == 3)) || (\value == 0 && \neighbourcount == 3) ? 1 : 0}                          \node at (\yi, -\xi) {\value};                     %\node at (\yi, -\xi) {\value, \neighbourcount};                          \node at ($ (0, -10) + (\yi, -\xi) $) {\nextvalue};                 }             }         }     \end{tikzpicture}          \end{document}      ![glider](http://i.stack.imgur.com/jyxR5.png) I only need help for how to assign values to array elements, because I want to solve other things myself. * * * **Edit #1** Question's original title was _Assign value to array element (PGF/TikZ)_ , but I think that this title does not suite the question anymore given the answers below.


title: \cite spills over into the margin

text: As you can see at the picture, a citation spills over into the margin of my paper. How can I resolve the issue? ![enter image description here](http://i.stack.imgur.com/BMpX5.jpg)


title: Why do paramaters of \renewcommand need to double up the # within a \foreach

text: ## Introduction: When you use `\renewcommand` within another macro or environment, one needs to double up the `##` to access the parameters of the inner macro. This serves as a way to distinguish the inner macros `##1` with the outer macros `#1` (even if the outer macro does not have any parameters, it provides for error checking). For example:               \newcommand*{\OuterCommand}{%         \renewcommand*{\SomeCommand}[1]{\color{red}##1}%         ....     }%        The references below provide more details on this. ## Issue: It appears that the same doubling up of the `#` is needed within a `\foreach` loop as illustrated in the MWE below. This took me quite some time to figure this out as the error message that the MWE below gives is: > Illegal parameter number in definition of \pgffor@body This was within a very deeply nesting of `\foreach` loops, so I was sure the problem was that I was nesting the `\foreach` too deeply. Surprisingly, if you skip past the error, the output is still correct, so this made it even harder to locate the problem. ## Questions:   * Since the `\foreach` does not have parameters like `#1` (as `\newcommand` does), why is it necessary to double up the `#` within a definition within a `\foreach`?   * How is that the output is still correct, if you simply ignore the error and hit return to continue processing?  ## References:   * renewcommand in a newcommand.   * Defining LaTeX commands within other commands.   * Nesting command definitions more than two levels. ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{pgffor}          \newcommand*{\MyList}{A,B,C}%     \newcommand{\SomeCommand}[1]{#1}%          \begin{document}     \foreach \x in \MyList {%         \renewcommand*{\SomeCommand}[1]{\color{red}#1}%  Using ## here eliminates the error.         \par\SomeCommand{\x}%     }%     \end{document}


title: how to add new page (page break) to article

text: This is my code, I am learning how to use the TikZ package and am trying to put different examples on different pages. I would like to have a page break between lines 22 & 24 if at all possible. Thanks.               \documentclass[11pt]{article}            \usepackage{tikz}            %optional libraries       \usetikzlibrary{decorations,arrows}            \begin{document}       \begin{tikzpicture}            \draw(1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;            \draw[step=0.25cm, color=gray]     (-1,-1) grid (1,1);       \draw[fill,color=blue!30,draw=red, line width=2pt, opacity=0.5]        (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;            \draw (0,0) grid (10,10);       \draw (5,5) circle (5);       \draw (0,10) rectangle (-2,8);       \draw (5,5) circle (3 and 5);       \draw (10,0) arc (-90:90:5);           %Define the desired points      \coordinate (origin) at (0,0);      \coordinate (A) at (360.0/7.0 *0 : 1);      \coordinate (B) at (360.0/7.0 *1 : 1);      \coordinate (C) at (360.0/7.0 *2 : 1);      \coordinate (D) at (360.0/7.0 *3 : 1);      \coordinate (E) at (360.0/7.0 *4 : 1);      \coordinate (F) at (360.0/7.0 *5 : 1);      \coordinate (G) at (360.0/7.0 *6 : 1);          %Draw the edges     \draw(A) -- (B) -- (C) -- (D) -- (E) -- (F) -- (G) -- cycle;          %Add spokes     \draw (origin) -- (A) (origin) -- (B) (origin) -- (C) (origin) -- (D)       (origin) -- (E)    (origin) -- (F) (origin) -- (G);          \end{tikzpicture}     \end{document}


title: How can I adjust the fine positioning of stackrel?

text: I use stackrel to define a custom stacked relation symbol:               \def\qMapsfrom{\stackrel{?}{\Mapsfrom}}      However, the question mark is not centered properly and has too much distance from the `\Mapsfrom`. Is there a way to fine-adjust the vertical and horizontal spacing of `\stackrel`?


title: How to make a block transparent for a background image

text: I use the code                 \usebackgroundtemplate{         \centering             \includegraphics[width=0.5\paperwidth,height=0.5\paperheight]{image.png}     }      to get a background image in a Beamer/Latex presentation. However, blocks, for example, are not transparent (they have white background so that the image can't bee seen). The same is true for the title on the titlepage. How can I set the blocks/titles such that they are transparent?


title: Reproducing the standard layout of the "book" class with "titletoc"

text: Is there a reference that shows how to use `titletoc` commands (`\titlecontents`, etc.) to approximate the layout of the table of contents in the standard `book` class? In particular, I would like to see how to do this for the full range of sectioning commands, including `\part` and `\chapter`.


title: References are printed with spaces between them?

text: Is it possible to better format this so that I can remove the huge spaces between words? Code used:               \bibliographystyle{abbrv}       \bibliography{library}      Code in `.bib` library:               @misc{marsrover,     author = {Greicius, Tony},     booktitle = {NASA},     file = {:Users/user/Library/Application Support/Zotero/Profiles/zotero/storage/index.html:html},     howpublished = {http://www.nasa.gov/mission\_pages/msl/index.html},     title = {{\{NASA\} - Mars Science Laboratory}},     url = {http://www.nasa.gov/mission\_pages/msl/index.html}     }      ![enter image description here](http://i.stack.imgur.com/8oVVc.png) * * * Is this due to 'justify' style of the document ? Maybe I can prevent justifying the bibliography ? My document starts like this :               \documentclass[12pt,a4paper]{report}     \usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}     \linespread{1.5}      _EDIT_ I can confirm that it's due to 'justify' .. I added `\raggedright` just before the bibliography and the text flushes to the left now. However I would like to keep it justified but without the spacing ... Editing the margins is not efficient, anyone got an idea how to achieve this ?


title: show urls only for webpages using bibtex and urlbst

text: I used `urlbst` package to modify a `.bst` file for URL inclusion. All worked good, but if I want the url only for the webpages, how should i modify the `.bst`? From what I read the response should be in this function:               FUNCTION {output.url}     { url empty$     'skip$      { new.block        format.url output       format.lastchecked output     }       if$     }      But i didn't managed to modify it. Can some one point me to the right modification?


title: How to create footnote for algorithmicx's comment

text: The number is displayed, but the footnote text is missing. How to fix that?               \documentclass{article}          \usepackage{algorithm}     % Need it for floating environment     \usepackage[noend]{algpseudocode}      % Hide endif .etc     \usepackage{caption}     % Need it for \caption*     \usepackage{xspace}     % Fix macro spacing bug          \algrenewcommand{\algorithmicrequire}{\textbf{Input:}}     \algrenewcommand{\algorithmicensure}{\textbf{Output:}}     \algrenewcommand{\algorithmicforall}{\textbf{for each}}     % \algrenewcommand instead of \renewcommand according to manual     \newcommand{\To}{\textbf{to}\xspace}     % Not stated in manual, \Return and \algorithmicreturn are defined, but no \algorithmicstate, why?     \newcommand{\Dosth}{\State \textbf{Do Something}\xspace}     % Note no space before \xspace     \newcommand{\Please}[1]{\State \textbf{#1}}     \newcommand{\ForEach}{\ForAll}     % Fail to use \algorithmicforall, why?     \begin{document}          \begin{algorithm}         \caption*{\textbf{Algorithm:} \textsc{Depth First Search}} \label{alg:dfs1}              \begin{algorithmic}[1]                  \Function{DFS}{$v$}                 \State $count \gets count + 1$                 \Please{mark} $v$ with $count$                 \Dosth with $v$                 \ForEach{vertex $w \in \mathcal{V}$ adjacent to $v$}                     \If{$w$ is marked with $0$} \Comment Only needed to exclude its parent.\footnote{No sibling is visited before the loop. Each sibling will be visited exactly once due to the nature of the loop.}                         \State \Call{DFS}{$w$}                     \EndIf                 \EndFor                 \State \Return             \EndFunction              \end{algorithmic}     \end{algorithm}          \end{document}


title: LaTeX - Reference Help

text: I have some problems, when I try to use the command `\ref{}`. When I compile my LaTeX code, It will not show me any number at all in the final pdf-document eventhough that I am using the correct command `\ref{fig:statestik}`. I have my picture:               \begin{figure}[H]     \centering     \includegraphics[scale=0.6]{../../../Billeder/Horeskader/statestik.jpg}     \caption{This is my caption.}     \label{fig:statestik}     \end{figure}      I should just say, that i'm writing in subiles, and load it all in a main file.


title: Hobby path realization in convex hull approach

text: ### Motivation In the answer Highlight a group of nodes in a tikz tree, Jake suggested combining the convex hull approach from padded boundary of convex hull with the _hobby path_ and I was really intrigued by the possibility. ### Preliminary work At first I tried to modify at least as possible the `\convexpath`:               \documentclass[a4paper,11pt]{article}     \usepackage{tikz}     \usetikzlibrary{hobby,backgrounds,calc,trees}          \newcommand{\myconvexpath}[2]{     [            create hobbyhullnodes/.code={             \global\edef\namelist{#1}             \foreach [count=\counter] \nodename in \namelist {                 \global\edef\numberofnodes{\counter}                 \node at (\nodename) [draw=none,name=hobbyhullnode\counter] {};             }             \node at (hobbyhullnode\numberofnodes) [name=hobbyhullnode0,draw=none] {};             \pgfmathtruncatemacro\lastnumber{\numberofnodes+1}             \node at (hobbyhullnode1) [name=hobbyhullnode\lastnumber,draw=none] {};         },         create hobbyhullnodes     ]     ($(hobbyhullnode1)!#2!-90:(hobbyhullnode0)$)     \foreach [         evaluate=\currentnode as \previousnode using \currentnode-1,         evaluate=\currentnode as \nextnode using \currentnode+1         ] \currentnode in {1,...,\numberofnodes} {        let \p1 = ($(hobbyhullnode\currentnode)!#2!-90:(hobbyhullnode\previousnode) - (hobbyhullnode\currentnode)$),         \n1 = {atan2(\x1,\y1)},         \p2 = ($(hobbyhullnode\currentnode)!#2!90:(hobbyhullnode\nextnode) - (hobbyhullnode\currentnode)$),         \n2 = {atan2(\x2,\y2)},         \n{delta} = {-Mod(\n1-\n2,360)}       in          {arc [start angle=\n1, delta angle=\n{delta}, radius=#2]}          ..($(hobbyhullnode\nextnode)!0.5!(hobbyhullnode\currentnode)$)          ..($(hobbyhullnode\nextnode)!#2!-90:(hobbyhullnode\currentnode)$)     }     --cycle     }          \begin{document}     \begin{tikzpicture}[use Hobby shortcut]     \node (f) {f}         child { node (g) {g}           child { node (a) {a}         }           child { node (b) {b}         }       }         child { node (h) {h}           child { node (c) {c}         }       };       \begin{pgfonlayer}{background}       \fill[draw,blue, opacity=0.3] \myconvexpath{f,h,c,g}{12pt};       \fill[draw,red, opacity=0.3] \myconvexpath{g,b,a}{12pt};       \end{pgfonlayer}       \end{tikzpicture}          \end{document}      which leads to: ![enter image description here](http://i.stack.imgur.com/dIaaX.png) I suspected the combination of `arcs` with the _hobby_ path was the cause of cusps, so in another example I tried with:               \documentclass[a4paper,11pt]{article}     \usepackage{tikz}     \usetikzlibrary{hobby,backgrounds,calc,trees}          \newcommand{\myconvexpath}[2]{     [            create hobbyhullnodes/.code={             \global\edef\namelist{#1}             \foreach [count=\counter] \nodename in \namelist {                 \global\edef\numberofnodes{\counter}                 \node at (\nodename) [draw=none,name=hobbyhullnode\counter] {};             }             \node at (hobbyhullnode\numberofnodes) [name=hobbyhullnode0,draw=none] {};             \pgfmathtruncatemacro\lastnumber{\numberofnodes+1}             \node at (hobbyhullnode1) [name=hobbyhullnode\lastnumber,draw=none] {};         },         create hobbyhullnodes     ]     ($(hobbyhullnode1)!#2!-90:(hobbyhullnode0)$)     \foreach [         evaluate=\currentnode as \previousnode using \currentnode-1,         evaluate=\currentnode as \nextnode using \currentnode+1         ] \currentnode in {1,...,\numberofnodes} {        let \p1 = ($(hobbyhullnode\currentnode)!#2!-90:(hobbyhullnode\previousnode)$),         \n1 = {atan2(\x1,\y1)},         \p2 = ($(hobbyhullnode\currentnode)!#2!90:(hobbyhullnode\nextnode)$),         \n2 = {atan2(\x2,\y2)},         \n{delta} = {-Mod(\n1-\n2,360)},         \n{end}={add(\n1,\n{delta})}       in          {..([in angle=\n1]$(hobbyhullnode\currentnode)!#2!-90:(hobbyhullnode\previousnode)$)..([out angle=\n{end}]$(hobbyhullnode\currentnode)!#2!90:(hobbyhullnode\nextnode)$)}          ..($(hobbyhullnode\nextnode)!0.5!(hobbyhullnode\currentnode)$)          ..($(hobbyhullnode\nextnode)!#2!-90:(hobbyhullnode\currentnode)$)     }     --cycle     }          \begin{document}     \begin{tikzpicture}[use Hobby shortcut]     \node (f) {f}         child { node (g) {g}           child { node (a) {a}         }           child { node (b) {b}         }       }         child { node (h) {h}           child { node (c) {c}         }       };       \begin{pgfonlayer}{background}       \fill[draw,blue, opacity=0.3] \myconvexpath{f,h,c,g}{12pt};       \fill[draw,red, opacity=0.3] \myconvexpath{g,b,a}{12pt};       \end{pgfonlayer}       \end{tikzpicture}          \end{document}      that gives a not promising result: ![enter image description here](http://i.stack.imgur.com/OYqfx.png) ### Question Is there a way to automatically recognize the node angle a path will fall when arrives near it? Doing things by hand, one can force a path to follow the desired direction, for example, `h.north -> h.east -> h.south`, but how is it possible to do it automatically without the `arc` syntax? Notice that, for some shapes, one could proceed as follows:               \documentclass[a4paper,11pt]{article}     \usepackage{tikz}     \usetikzlibrary{hobby,backgrounds,calc,trees}          \newcommand{\hobbyconvexpath}[2]{     [            create hobbyhullnodes/.code={             \global\edef\namelist{#1}             \foreach [count=\counter] \nodename in \namelist {                 \global\edef\numberofnodes{\counter}                 \node at (\nodename) [draw=none,name=hobbyhullnode\counter] {};             }             \node at (hobbyhullnode\numberofnodes) [name=hobbyhullnode0,draw=none] {};             \pgfmathtruncatemacro\lastnumber{\numberofnodes+1}             \node at (hobbyhullnode1) [name=hobbyhullnode\lastnumber,draw=none] {};         },         create hobbyhullnodes     ]     ($(hobbyhullnode1)!#2!-40:(hobbyhullnode0)$)     \foreach [         evaluate=\currentnode as \previousnode using \currentnode-1,         evaluate=\currentnode as \nextnode using \currentnode+1         ] \currentnode in {1,...,\numberofnodes} {       let \p1 = ($(hobbyhullnode\currentnode)!#2!-90:(hobbyhullnode\previousnode) $),         \n1 = {atan2(\x1,\y1)},         \p2 = ($(hobbyhullnode\currentnode)!#2!-90:(hobbyhullnode\nextnode)$),         \n2 = {atan2(\x2,\y2)},         \n{delta} = {-Mod(\n1-\n2,360)},         \n{fin}={add(\n1,\n{delta})}       in            {..($(hobbyhullnode\currentnode)!#2!-220:(hobbyhullnode\previousnode)$)..($(hobbyhullnode\currentnode)!#2!40:(hobbyhullnode\nextnode)$)}        %{arc [start angle=\n1, end angle=\n{fin}, radius=#2]}          ..($(hobbyhullnode\nextnode)!0.5!(hobbyhullnode\currentnode)$)          ..($(hobbyhullnode\nextnode)!#2!-40:(hobbyhullnode\currentnode)$)     }     --cycle     }          \begin{document}          \begin{tikzpicture}[use Hobby shortcut]       \foreach \place/\text in {{(1,0)/a},{(0,-1)/b},{(-1,0)/c},{(0,1)/d}}       \node[name=\text] at \place {\text};       \begin{pgfonlayer}{background}       \fill[draw,green, opacity=0.3] \hobbyconvexpath{a,b,c,d}{10pt};       \end{pgfonlayer}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/whPTR.png) but in general is not a valid approach and it is still to improve, to get at least the same result of Highlight a group of nodes in a tikz tree.


title: Setting margins with LyX

text: I've looked around and can't seem to get my problem right. I'm trying to set the margins of my thesis and it looks right on screen (PDF) but when i print it it's totally different. I'm using a class file and layout (with LyX) from ucb and am trying to modify the margins to fit my schools requirements. 1.6" left, 1" elsewhere with page # top right. For example, my left margin with the settings below measures to just under 1.5" but my understanding is the margin is set to 1.6". The distance from top of page to top of page # is measuring at 1.4" instead of 0.75" Please let me know if I am misunderstanding things. Thanks in advance Here is the code from the .cls               %%%%% SET THE OVERALL DOCUMENT PROPERTIES, such as page numbering,     % margins... Initialize several global document properties, but do so     % *before* the beginning of the document to forces these changes.     \AtBeginDocument{         \setlength{\topmargin}{-.25in}         \setlength{\headheight}{0.1in}         \setlength{\headsep}{0.4in}         \setlength{\topskip}{0in}   % first line, down from page number         \setlength{\textheight}{8.75in} % 9"-(topmargin+headsep+headheight)         \setlength{\footskip}{0pt}         \setlength{\oddsidemargin}{.6in}         \setlength{\evensidemargin}{.6in}         \setlength{\parindent}{0.5in}   % somewhere between 0.3" and 0.5"         \setlength{\textwidth}{5.9in}         \setlength{\leftmargini}{3.5em}         \setlength{\leftmarginii}{2.2em}         \setlength{\leftmarginiii}{2.2em}         \setlength{\leftmarginiv}{2.2em}         \setlength{\leftmarginv}{2.2em}         \setlength{\leftmarginvi}{2.2em}         \setlength{\leftmargin}{\leftmargini}         \setlength{\labelsep}{.5em}         \setlength{\labelwidth}{ 1.5em}         \pagenumbering{arabic}         \pagestyle{myheadings}         \markright{}         \onecolumn         \raggedbottom         \normalsize         \normalfont         \EmphReset  % bold or underlined?         \doublespacing  % footnotes and floats still singlespaced         \setcounter{tocdepth}{2}         \setcounter{secnumdepth}{\value{th@SecNum}}


title: Import \vec from fouriernc?

text: I am wondering how to import the `\vec` font from `fouriernc` (which is much better designed than that in other fonts families, but I don't like other designs in `fouriernc`) without affecting the font family (I am using `mathpple`). I guess something like Import a symbol from the Fourier font family might work, but I have not idea how to find the index of the symbol (130 in that case of `\partialup`).


title: Inserting a multi-paged PDF document in a LyX document.

text: I can successfully insert a PDF document in a LyX document using _Insert -> File -> External Material_ (choosing _PDFPages_ in the template dropdown). The PDF document shows up in the LyX document, however, when I click export the LyX document to a PDF document, the inserted file doesn't appear. Where can the problem be?


title: Revtex 4.1 bibliography style in other classes

text: I'd like to know if someone ported the bibliography styles used in revtex 4.1 (like apsrev4-1.bst) so they can be used in other classes, like book. Thanks in advance!


title: Suppress month in biblatex-apa

text: Please consider the following MWE               \RequirePackage{filecontents}          \begin{filecontents*}{mybib.bib}     @article{test1,         title = {Structural holes and good ideas},         volume = {110},         issn = {0002-9602, 1537-5390},         doi = {10.1086/421787},         number = {2},         urldate = {2012-10-04},         journal = {American {Journal} of {Sociology}},         author = {Burt, Ronald S.},         month = sep,         year = {2004},         pages = {349--399},     }     @book{test2,         address = {New {York}, {NY}},         edition = {1st ed.},         title = {Understanding media: {The} extensions of man},         lccn = {P90 .M26},         publisher = {McGraw-{Hill}},         author = {{McLuhan}, Marshall},         year = {1964}     }     \end{filecontents*}          \documentclass[a4paper]{article}               % Set the values for the bibliography     \usepackage[         style=apa,         backend=biber,         isbn=false,         url=false,         doi=false,         eprint=false,         hyperref=true,         backref=false,         firstinits=false     ]{biblatex}          % Recommended by biblatex     \usepackage[utf8]{inputenc}     \usepackage{csquotes}     \usepackage{xpatch}          % Remove series & month     \AtEveryBibitem{       \clearfield{month}       \clearfield{edition}     }          % Set language     \usepackage[british]{babel}     \DeclareLanguageMapping{british}{british-apa}          \addbibresource{mybib.bib}          \begin{document}          \cite{test1} \cite{test2}          \printbibliography     \end{document}      I don't get why the option `\clearfield{edition}`successfully suppress the edition from the second reference, while the option `\clearfield{month}`doesn't succeed in getting rid of the month: > Burt, R. S. (2004, September) instead of what I would like to see: > Burt, R. S. (2004)


title: why are only part indents nicely but the rest don't

text: First, I know that the \\ command is bad. My question is why does number 43 indent nicely, but the following 44 - 46 do not.                 \documentclass[10pt,a4paper]{article}       \usepackage[latin1]{inputenc}       \usepackage{amsmath}       \usepackage{amsfonts}       \usepackage{amssymb}       \usepackage{makeidx}                           \usepackage{paralist}       \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}           \begin{document}                  43. Let $f\left(x\right) = \sqrt{x}, \; x = 100,\; \mathrm{d}x = -0.6.$       \\            $ \begin{array}{ccl}       f\left(x + \Delta x\right) & \approx & f\left(x\right) + f^{\prime}\left(x\right)\, \mathrm{d}x \\        & = & \sqrt{x} + \frac{1}{2\sqrt{x}}\,\mathrm{d}x \\        f\left(x+\Delta x\right) & = & \sqrt{99.4} \\        & \approx & \sqrt{100} + \frac{-0.6}{2\sqrt{100}} = 9.97       \end{array}  $         \\            Using a calculator: $\sqrt{99.4} \approx 9.96995$        \vfill            44. Let $f(x)=\sqrt[3]{x},\; x = 27, \; \mathrm{d}x = -1$       \\       $f(x+ \Delta x) \approx f(x) + f^{\prime}(x)\,\mathrm{d}x = \sqrt[3]{x} +    \frac{1}{3\sqrt[3]{x^2}}\,\mathrm{d}x$        $\sqrt[3]{26} \approx \sqrt[3]{27}+\frac{1}{3\sqrt[3]{27^2}}(-1) =    3-\frac{1}{27} \approx 2.9630$        \\      Using a calculator, $\sqrt[3]{26} \approx 2.9625$      \vfill           45. Let $f(x) = \sqrt[4]{x},\; x = 625,\; \mathrm{d}x =-1$       \\            $\begin{array}{ccl}        f(x +\Delta x) & \approx & f(x)+f^{\prime}(x)\,\mathrm{d}x = \sqrt[4]{x} + \frac{1}{4\sqrt[4]{x^3}} \\         f(x + \Delta x) & = & \sqrt[4]{624} \approx \sqrt[4]{625} + \frac{1(-1)}       {4\left(\sqrt[4]{625}\right)^3} \\        & = & 5-\frac{1}{500} = 4.998       \end{array} $      \\     Using a calculator, $\sqrt[4]{624} \approx 4.9980$\\          \vfill           46. Let $f(x) = x^3,\; x = 3, \; \mathrm{d}x = -0.01$       \\       $\begin{array}{ccl}       f(x + \Delta x) & \approx & f(x) + f^{\prime}(x)\, \mathrm{d}x =x^3 + 3x^2\,\mathrm{d}x \\       f(x + \Delta x) & = & \left(2.99\right)^3 \approx 3^3 + 3\left(3\right)^2\left(-0.01\right) \\       & = & 27 - 0.27 = 26.73        \end{array}$        \\      Using a calculator: $\left(2.99\right)^3 \approx 26.7309$       \vfill      \end{document}      * * * ![enter image description here](http://i.stack.imgur.com/PCWLh.png) * * *


title: font selection for entire doc

text: Hello there:) Could someone show me how to select fonts (serif: regular/bold/italic/bolditalic/smallcaps, sans: regular/bold/italic) for entire document using `fontspec` and font's filenames. And at least one decorative font for special occasions (not for entire doc) and one for equations. Should I set font families or not and what's the difference? I'm fighting with `fontspec` manual and I see several options and I'm totally lost. I found this:               \fontspec     [ BoldFont = texgyrepagella-bold.otf ,     ItalicFont = texgyrepagella-italic.otf ,     BoldItalicFont = texgyrepagella-bolditalic.otf ]     {texgyrepagella-regular.otf}      But how to set other fonts? Where can I obtain examples?


title: referencing sections in other chapters

text: Is there a norm for citing sections in other chapters? That is, when I am in Chapter 3 and refer to section 2 in chapter 2. Do I write "Section 2.2" or "Chapter 2.2" or Section 2 of Chapter 2. Logically Section 2.2 seems to be the correct way, since 2.2 is not a chapter but part of a chapter ... I actually saw all three variants and would like to have this decided once and for all.


title: TikZ crop image

text: Is there a way to crop everything outside the bounding box? I made some periodic pattern in TikZ but I wanna crop it outside some box. Just making a bounding box helps for the alignment but the pattern still repeats outside the box.


title: ragged2e breaks soul package \textbf{} spacing

text: If you compile the XeLaTeX below you will see the output is not-as-expected for the bold part of the text i.e. it is: `underline underline boldboldbold` In other words the spacing of the bold elements inside _soul_ 's `\ul` is seemingly non-existent. One would expect: `underline underline bold bold bold` I have narrowed down the issue to the `ragged2d` package when using the Minion Pro font (although it is reproducible with other fonts). The problem also occurs with macros such as `\textit`. The following demonstrates the issue.               \documentclass{article}         \usepackage{soul}     \usepackage{ragged2e}          \begin{document}     \ul{underline underline \textbf{bold bold bold}}     \end{document}      Having identified the problem, I noted one workaround is using `{\bfseries{}bold bold bold}` but that sometimes leads to "Reconstruction failed" error, and in any case I am curious as to what is going on here. * * * Another workaround, seemingly more robust than `bfseries`, is to end then re- start the underlining so that the `textbf` encapsulates the `ul` i.e. `\ul{underline underline }\textbf{\ul{bold bold bold}}`. Whenever the font changes, then, we may end then re-start the underlining.


title: How to place a node in the middle of an arc?

text: I think it is a simple question, but I didn't find the answer yet. The code I'm using is the following:               \draw[->](1,0) arc(0:-30:1) node[midway]{$30$};      But in this way the node is placed at the origin intead of at the middle of the arc. Note: it must be done with `arc`.


title: Nodes to angles and arcs

text: > **Possible Duplicate:**   >  How to place a node in the middle of an arc? A very common problem I come across drawing technical pictures is drawing zillions of angles. In general, there is no nice way to put a node to an arc, so I usually have to do this               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}     \draw (0,0) -- (0:2cm);      %rays     \draw (0,0) -- (60:2cm);          \draw (1cm,0) arc (0:60:1cm); % angle     \draw (30:1cm+20pt) node {$\alpha$};     \end{tikzpicture}     \end{document}      I wonder if there is a way to simplify last two commands. Of course I could define a \newcommand{\angle}[4] which looks very awkward. I would rather use something like that               \draw (1cm,0) arc (0:60:1cm) node[outarc=20pt] {$\alpha$};      Is it possible to define "outarc" position of the node? ![enter image description here](http://i.stack.imgur.com/UZwBP.gif)


title: How to place tabs

text: I want to generate these lines:               GREATER(x,y)=true                 =false      If i itemize it i get :               GREATER(x,y)=true     =false


title: Monus operator macro

text: I'm doing some CS theory papers and need to use a monus operator. Picture below: ![enter image description here](http://i.stack.imgur.com/6IsbD.jpg) What package should I use to be able to use it? I've Google'd, but nothing came up. Thanks for the help.


title: rnode: strange behavior of relative point translation

text: I recently discovered a strange behavior of a relative point translation of coordinates given by a node created by `\rnode`. The docs tell that the coordinate form `([parameter]node)` determines a coordinate relative to the geometrical center of the given node. I wrote a picture, which output is not consistent with that. At least at first sight :) Here's the code:               \begin{pspicture}(1,1)              \rput(0.5,0.5){           \rnode[t]{n-t}{%             \rnode[b]{n-b}{%              \rnode{n-c}{\Huge{X}}%           }%          }%       }%            \psdot[dotsize=4pt, linecolor=red](n-t)       \psdot[dotsize=3pt, linecolor=red](n-c)       \psdot[dotsize=2pt, linecolor=red](n-b)            \psdot[dotsize=4pt, linecolor=blue]([offset=0,nodesep=0]n-t)       \psdot[dotsize=3pt, linecolor=blue]([offset=0,nodesep=0]n-c)       \psdot[dotsize=2pt, linecolor=blue]([offset=0,nodesep=0]n-b)     \end{pspicture}      that yields this ![enter image description here](http://i.stack.imgur.com/pD814.png) If I had only read the code it would be clear for me that the blue dots cover the red dots. But not so in the compiled picture. Is there an error in my reasoning?


title: Free cell alignment in a table

text: I want to use the package `tabu` which I've heard is the latest and greatest package for creating tables to generate a table that looks like this:               -------------------------------------     |A          |     B     |          C|      |           |           |           |      |           |           |           |      -------------------------------------     |           |           |           |      |A          |     B     |          C|      |           |           |           |      -------------------------------------     |           |           |           |      |           |           |           |      |A          |     B     |          C|      -------------------------------------      It is a simple table but the text in each cell is aligned differently. The package documentation says that `X` columns can be aligned both vertically (using `p`, `m`, `b`) and horizontally (using `l`, `c`, `r`, `j`) at the same time but I cannot find a way to use this feature to create this table. I know that it is always possible to use some low-level commands such as `\parbox` for this purpose but I'm very interested to know if there is a better way to do it. If there is any other package that can create such a table or help with alignment please discuss it here.


title: Alignment of the titles in a ToC and \Roman{section}

text: There is a problem with the alignment of the numbering of the ToC: When we use               \renewcommand{\thesection}{\Roman{section}}      the numbers encroach on the titles. When the command is commented out, the numbers are all aligned [from the first number on the left] but the titles do not begin at the same position. What I want is to use `\Roman{section}` but with the numbers being displaced after V (or 9 in arabic) so that the first letters of the titles are all aligned ! An illustration:               %\RequirePackage{fix-cm}     \documentclass[a4paper, 11pt, twoside]{article}          \renewcommand{\thesection}{\Roman{section}}          \begin{document}               \tableofcontents     \normalfont     %\cleardoublepage          \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}     \section{QWERTY}          \end{document}


title: How to configure/redefine the quotation environment to cite?

text: I want to redefine the `quotation` or `quote` environment so that I have a different presentation style, such as big quotes or all italics, right aligned, etc. I also want to cite the source (a real cite, or authorcite ...). This is what I have:               \renewenvironment{quote} %[1]     {       {\rightmargin\leftmargin}       \relax       {\Large\textbf{``}}     }     {       {\Large\textbf{''}}       %\hfill\citeauthor{#1} \cite{#1}     }      My problems:   * `{\rightmargin\leftmargin}` to center in less than full width is not working, I copied this from the original `quote` environment. The `quotation` env. used the `list` environment to do this, but that alters the paragraph spacing too, and I do not want that. What is the right way to define the width I want and where I want to center?   * The commented out parts for the citation itself are not working, I wanted to use this as `\begin{quote}{someBibRef}Some bla bla bla.\end{quote}`   The argument is being passed correctly and I can print it, but I can not use it with cite commands. The output looks like `##1 [##1]` and the error log says `Illegal parameter number in definition of \endquote }`   * How can I make `\citeauthor` display the author's full name, not just the last?   * I wanted this last part to appear in a newline, at right, I haven't found a way to do this simultaneously. I am using `biblatex` with biber as backend.


title: Biblatex style for 'author, year, publisher'

text: For a beamer presentaion, I need to use footnote cite, and the citation entry should be in 'author, year, publisher' format; But I cannot find any exisiting style in _biblatex_ ; can anyone suggest a method to do that? Thanks in advance.


title: Undefined \printindex

text: tex/.../supp-pdf.tex     tex/.../supp-mis.tex     loading : Context Support Macros / Miscellaneous (2004.10.26)     )     loading : Context Support Macros / PDF (2004.03.26)     )     tex/latex/hyperref/nameref.sty)     ! Undefined control sequence.     l.19 \printindex      ?       I am getting this error right now. I googled and found in the same forum about this and it asked for `hyperref` package download. As I am in HUB , I cannot access `hyperref` folder and but I can see hyper ref folder is already existing. I am using tetex(3.0) I can see that while converting from latex to pdf , It is giving the compilation errors. Is there other ways to solve this. Or What are the other packages I need to to be installed .?


title: Chapter-dependent even header does not flush left

text: [EDIT: Editing this post to comply with observations in comments] I am editing a conference proceedings and can't get the author names in the left (even) header to flush left (close to the page numbers). The author names appear but in the centre of the even headers. The paper titles do appear flush right in the odd headers, as desired. The source file structure is composed of a \main that uses \input{filename} for each paper. At the beginning of each paper I use               \title{}     \author{}     \titlerunning{}     \toctitle{}     \institute     \maketitle      Interestingly, I copied the document structure and commands from another book for which I have the complete source and where this works perfectly well. The file that works does not use \authorrunning so I don't either. I tried it just in case (with \hfill on the right of the author names) and it didn't make any difference. The definitions that both examples use are:               \documentclass[runningheads,11pt,a4paper]{misc/llncs}      ...     \begin{document}     \pagestyle{headings}      In the file that works the \pagestyle command is placed after \begin{document}, so I did the same. I can't see any other packages or commands that would relate to the headers. For instance the file that works does not use the fancyhdr package. I originally used a 'home-made' variant of the llncs.cls, which treated the leaders in the ToC slightly differently. I then tried this version of the standard class file, which I downloaded from the Springer site:               % LLNCS DOCUMENT CLASS -- version 2.17 (12-Jul-2010)     % Springer Verlag LaTeX2e support for Lecture Notes in Computer Science      and saw that the same exact problem shows up. I am guessing there may be some other package that I am using that is interfering. If you think there is a simple solution please let me know, otherwise let me know what else I should add... * * * One of my colleagues found the solution. Apparently the babel package adapts a document to the appropriate formatting of currencies, dates, times, etc. It also changes format of the document to common formats of the language chosen. In this case babel changes indentation including the header. It is unclear why this happens as I chose English as the language, which should not induce any changes in indentation. In any case the solution is to comment out babel and to specify English in the \documentclass:               \documentclass[runningheads,11pt,a4paper,english]{misc/llncs}     ...     %\usepackage[english]{babel}      The even headers now look the way they are supposed to.


title: tikz: how to define a flowchart (hexagon) loop shape that keep its width fixed but adapts its height to the text inside it?

text: I am using following (hexagon) loop definition I found in Stackexchange in my flowchart. When the number of text lines in it increases, the width of the whole shape also increases. I want the width of the shape itself to be fixed. Can you help in defining such a hexagon? It does not have to follow the starting definition I give in the MWE.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric, arrows, calc, shapes.misc, matrix, shapes, arrows, calc, positioning, shapes.geometric, shapes.symbols, shapes.misc, intersections, chains, scopes}               \tikzset{         loop/.style={ % requires library shapes.misc             draw,             chamfered rectangle,             chamfered rectangle xsep=2cm,             text width=10em,         },     }               \begin{document}               \begin{tikzpicture}[node distance=1.6cm]          \node (l1)[loop]{aa};     % node below is wider then the one above. I want the width of the one below to be same as the one above.     \node (l2)[loop,below of=l1]{aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa };          \end{tikzpicture}          \end{document}      ![Result picture](http://i.stack.imgur.com/OEFpI.png)


title: What is the font family name for Cabin?

text: I need to set cabin font locally in my document. what is font family for cabin font?               {        \fontfamily{x}\selectfont         Some text in anttlc...     }      x = ? Regards


title: APA citation problem

text: my code is:               \documentclass[12pt,letterpaper]{report}     \usepackage{blindtext}     \usepackage[utf8]{inputenc}     \usepackage[margin=1in]{geometry}     \usepackage{titlesec}          \usepackage[autostyle]{csquotes}          \setcounter{secnumdepth}{4}          \titleformat{\chapter}[display]     {\filcenter\normalfont\bfseries}     {\MakeUppercase{\chaptertitlename}\ \thechapter}     {0pt}     {}     \titlespacing{\chapter}{0pt}{-24pt}{20pt}          \titleformat{\section}     {\normalfont\normalsize\bfseries}{\thesection}{12pt}{}     \titlespacing{\section}{0pt}{0pt}{0pt}          \titleformat{\subsection}     {\normalfont\normalsize\bfseries}{\thesubsection}{12pt}{}     \titlespacing{\subsection}{0pt}{0pt}{0pt}          \titleformat{\subsubsection}     {\normalfont\normalsize\bfseries}{\thesubsubsection}{12pt}{}     \titlespacing{\subsubsection}{0pt}{0pt}{0pt}          \titleformat{\paragraph}     {\normalfont\normalsize\bfseries}{\theparagraph}{12pt}{}     \titlespacing{\paragraph}{0pt}{0pt}{0pt}          \usepackage{indentfirst}     \usepackage{parskip}     \setlength{\parindent}{.5in}          \usepackage{setspace}     \renewcommand{\baselinestretch}{1.75}           \usepackage{apacite}     \usepackage{chemfig}     \usepackage{chemmacros}          \usepackage{color}     \usepackage{gensymb}     \usepackage{amsmath}     \usepackage{siunitx}               \begin{document}          It is particularly notable for its flexibility, its     superb hyphenation, and its ability to choose aesthetically satisfyingline\citep{Wel03}          \bibliographystyle{apalike}     \bibliography{Bibliography}          \end{document}      my bib file is:               @book{Wel03,     author = "Stefan Wellek", year = 2003,     title = "Testing Statistical Hypotheses of Equivalence",     publisher = "{Chapman \& Hall/CRC Press}",     address = "New York"     }      it compiles to: ![enter image description here](http://i.stack.imgur.com/fnLiS.jpg) I wanted to show the author and year. What is wrong with my code? I tried to read and search for answers but the information is just too overwhelming and sources differ from one another.


title: References problem

text: I am writing my references using jabref and i created a new database called "ref.bib" but it doesn't work and give errors, any help please? Here is my database code:               % This file was created with JabRef 2.8.1.     % Encoding: MacRoman          @ARTICLE{Yang2011,       author = {Yang, Chenhui and Olson, Byron and Si, Jennie},       title = {A multiscale correlation of wavelet coefficients approach to spike         detection},       journal = {Neural Comput.},       year = {2011},       volume = {23},       pages = {215--250},       number = {1},       month = jan,       acmid = {1943013},       address = {Cambridge, MA, USA},       doi = {10.1162/NECO_a_00063},       issn = {0899-7667},       issue_date = {January 2011},       numpages = {36},       publisher = {MIT Press},       url = {http://dx.doi.org/10.1162/NECO_a_00063}     }          @comment{jabref-meta: selector_review:}          @comment{jabref-meta: selector_publisher:}          @comment{jabref-meta: selector_author:}          @comment{jabref-meta: selector_journal:}          @comment{jabref-meta: selector_keywords:}      Here is a sample of my paper code:               \begin{document}         \IEEEpeerreviewmaketitle     \bibliographystyle{IEEEtran}          \section{Introduction}     my introduction \cite{Yang2011}          \bibliography{ref}          Thanks A lot,     \end{document}


title: Regular expressions in listings

text: I'm looking for a possibility to use regular expression in listings. I'd like to highlight each N thats followed by 4 decimal numbers for example N1234. How can I achieve that? Here is an example:               \documentclass{report}     \usepackage{listings,xcolor}          \lstdefinelanguage{NCSyntax}     {morekeywords={N\d\d\d\d},  % <-- regular expression ???     sensitive=false,     morecomment=[l]{;},     morestring=[b]",     }          \lstnewenvironment{mylang}{\lstset{language=NCSyntax, keywordstyle=\color{red}\bfseries\underbar }}{}          \begin{document}     \begin{mylang}     N1234   ; colored as keyword     A1234   ; text     N12     ; text     N12345  ; text     N4242   ; colored as keyword                     \end{mylang}     \end{document}


title: Generate list of all cited pages, grouped by bibitem

text: Is there any package (perhabs a tool would be more appropiate) to generate a list of all citations for a given document? The aim would be to have a list of all sources (and the page numbers used) of a given document. So lets say a given LaTeX document has paragraphs with bibtex citations like > Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy > eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam > voluptua. At vero eos et accusam et justo duo dolores et ea rebum **(Smith > 2012, p.12)**. Stet clita kasd gubergren, no sea takimata sanctus est Lorem > ipsum dolor sit amet **(Smith 2012, p.18)**. Lorem ipsum dolor sit amet, > consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut agna > aliquyam erat, sed diam voluptua **(Miller 1999, p.12-14)**. At vero eos et > accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea > takimata sanctus est Lorem ipsum dolor sit amet. And I'd like to generate a list (not inside the document itself, just as a separate output) from the available sources like: >   * Miller 1999; used pages: 12-14 >   * Smith 2012; used pages: 12,18 > A plaintext analysis of the sources (grep or similar) won't work as there are a bunch of wrapped commands to cite with page (thanks to natbib), so I think it needs to b something which is able to intrepret the LaTeX code. Any clues? Detailed purpose: For our academic documents there should be a list of source material, so that every cited page can be made available in context of the document. As we are restricted due to copyright, we want to minimize the copy as much as possible. To know what to copy we need the relevant pages nevertheless.


title: Brace and text in side margin

text: Within a text, I would like to emphasize one or two paragraphs by placing a curly brace in the left side margin, and next to it some short text vertically centred around the brace's centre. The question Adding a large brace next to a body of text shows how to add braces in the main text, maybe that can help as a starting point? A slight modification of the accepted answer there is               \documentclass{report}      \usepackage{lipsum}          \begin{document}     \lipsum[1]     \noindent$\left\{     \begin{minipage}{\textwidth}     \lipsum[2]     \end{minipage}     \right.$     \lipsum[3]     \end{document}      But this has the drawbacks that   1. it spills into the right, not the left margin;   2. I cannot add text to the brace; and that   3. the line spacing before the braced paragraph is incorrect. Maybe this can be modified, or a completely different approach should be used? But I wouldn't know which one.


title: Typesetting chord progressions

text: For this to work, you need to install the New Real Book fonts and the experimental `realbookchords` package by cgnieder, then compile with XeLaTeX or LuaLaTeX. I'm working on a simple set of macros to typeset chord progressions. Here's an MWE:               \documentclass{article}     \usepackage{array, collcell, realbookchords}     \setlength{\unitlength}{12pt}     \renewcommand{\|}{\rule[-.2\unitlength]{.7pt}{1.4\unitlength}} % measure bar     \newcommand{\zif}[1]{\multicolumn{4}{l}{\fbox{\sffamily #1}}\\} % ziffer     \newcommand{\hd}{\Large\textsf{\o}} % half diminished     \newenvironment{chordprog}[1]                    {\bigskip\bigskip                     \SongTitle{#1}                     \par\medskip\noindent                     \begin{tabular}{l !{\|} l !{\|} l !{\|} l}}                    {\end{tabular}}     \newcolumntype{Z}{>{\collectcell\rbc}l<{\endcollectcell}}     \newenvironment{chordprog*}[1]                    {\bigskip\bigskip                     \SongTitle{#1}                     \par\medskip\noindent                     \begin{tabular}{ZZZZ !{\|} ZZZZ !{\|} ZZZZ !{\|} ZZZZ}}                    {\end{tabular}}     \setmainfont{Century Gothic}     \RBCsetup{songtitle-format-center={\rmfamily\LARGE\bfseries}}          \begin{document}     \begin{chordprog}{After You've Gone}     \zif A     \rbc{Abmaj} & \rbc{Abmi6} \rbc{Db9} & \rbc{Ebmaj} & \rbc{Gmi7} \rbc{C9} \\     \rbc{F9}   & \rbc{Bb9} & \rbc{Eb6} & \rbc{Bbmi7} \rbc{Eb7} \\     \zif B     \rbc{Abmaj} & \rbc{Abmi6} \rbc{Db9} & \rbc{Ebmaj} & \rbc{Gmi7} \rbc{C9} \\     \rbc{Fmi} \rbc{C7alt} & \rbc{Fmi7} \rbc{Db9} & \rbc{Ebmaj} \rbc{D\hd} \rbc{G7} & \rbc{Cmi7} \rbc{A0} \\     \rbc{Eb6} \rbc{C7} & \rbc{Fmi7} \rbc{Bb7} & \rbc{Eb6} & \rbc{Bbmi7} \rbc{Eb7}     \end{chordprog}          \begin{chordprog*}{At Last}     \zif{Intro}     F && F7 && Bb && B0 && F & F7/{Eb} & D7\b9 && Db7 && C7\\     \zif{Verse 1.}     F && Dmi7 && Gmi7 && C7 && F && Dmi7 && Gmi7 && Cmi7  & C7 \\     F && Dmi7 && Gmi7 && C7 && F & F7/{Eb} & D7\b9 && Db7 && Gmi7 & C9 \\     \end{chordprog*}     \end{document}      ![output](http://i.stack.imgur.com/xdj56.png) **Comments:** In the unstarred environment, one tabular cell corresponds to one measure; in the starred version, one cell is one quarter note. The latter is needed when I want to align the beats, and not only the measures. It also allows me to wrap the table cell in the `\rbc` (realbookchord) macro, but creates more space even when there are one or two chords in a measure. I'm asking for   1. How to simplify / beautify this code? (The vertical bar seems hackish.)   2. How to make the starred environment as narrowly spaced as the unstarred one? May not be as beautiful, but I want to print it out on small paper and stick it onto a synth with no music stand :)


title: First paragraph indentation with ragged2e and \RaggedRightParindent set

text: I am using the `ragged2e` package for my `raggedright` text and have set `\RaggedRightParindent` to 2em, as I want my paragraphs indented. But now, the _very_ first paragraph in the document (following `\maketitle` is also indented. My original question was why the first graf in a new section is indented, though, as the first commenter pointed out and as the MWE shows, the first graf in a new section is _not_ indented. So my question is now why the very first paragraph is not indented. Is there anyway to have `ragged2e` set `\RaggedRightParindent` for the very first paragraph of a document to return to flush left? Here is my MWE:               \documentclass[letterpaper,article,oneside]{memoir}          %% packages     \usepackage{graphicx,url}     \usepackage{rotating}      \usepackage{datetime}      \usepackage{ragged2e}     \usepackage[footnotesep=1.75\baselineskip]{geometry}          %% Paragraph settings     \expandafter\def\expandafter\quote\expandafter{\quote\vspace{-3\parskip}\SingleSpacing}     \DoubleSpacing     \setlength{\RaggedRightParindent}{2em}     \RaggedRight                    \title{Dummy title}     \author{Dummy author}          \begin{document}     \maketitle          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam imperdiet venenatis mi ut vehicula. Sed semper pharetra fringilla. Pellentesque scelerisque sagittis sem, ut vestibulum lectus suscipit iaculis. Proin sit amet ligula scelerisque, convallis ante et, mattis mauris.           Praesent in viverra nulla. In eleifend posuere enim, non pharetra magna accumsan nec. Donec ullamcorper et justo imperdiet vehicula. Sed malesuada erat auctor, commodo enim vehicula, iaculis orci.           \section     Praesent in viverra nulla. In eleifend posuere enim, non pharetra magna accumsan nec. Donec ullamcorper et justo imperdiet vehicula. Sed malesuada erat auctor, commodo enim vehicula, iaculis orci.           \end{document}


title: Suppress line numbering for empty lines in listings package

text: The `listings` package quite nicely formats my pseudo code listings. Is there a way that one can specify that line numbering should be suppressed for empty lines?


title: Adding vertical space at the start of a page

text: I'd like to, first thing before writing anything on a page, add some vertical space. Minimal (non)working example:               \documentclass{article}     \begin{document}          \vspace{250px}     I want to be further down on the page :(          \vspace{250px}     Haha! Sucker :D     \end{document}      ![Whhhhhhy????](http://i.stack.imgur.com/FBOmq.jpg) How can I get the first `\vspace` to work, just like the second one?


title: Annoying behaviour of \vspace

text: > **Possible Duplicate:**   >  Adding vertical space at the start of a page Basically I am making a title page and I want the title to be in the center of the text               \documentclass[15pts]{article}     \usepackage{amsmath}     \usepackage{parskip}     \textwidth = 500pt     \textheight = 700pt     \voffset = -90pt     \oddsidemargin = -10pt          \begin{document}     \vspace{9000pt}          \begin{center}      \big {Title Page}      \end{center}     \end{document}      And no matter how much I change (...pt), it stays the same. Note that I do not want to change the formatting of my document because I got other pages to deal with too.


title: Begin document with blank lines

text: > **Possible Duplicate:**   >  Start off a page by adding vertical space I'm entirely new to LaTex, but I've been googling for a while and haven't found out how to do the following: How can I start a document with several blank lines before my first line with text? As one in MS Word would just hit enter X times at the beginning of a document.


title: document style for paper editing

text: Many of the LaTeX styles (e.g., article, memoir, and koma-script) seem designed to produce beautiful documents that are easy to read. Is there a document class (or options) or typographical rules that creates hard copy documents are are easy to edit (yes, I still like to edit hard copies)? In someways, I think that easy to read hinders editing where I am trying to force myself to read word-by-word. Wide spaces between lines might be ugly, but it makes it easier to insert comments.


title: "Dynamic Endnotes" (footnotes on side): what to do with footnotes at the end of the page?

text: I want to use what Bringhurst calls "dynamic endnotes", i.e. footnotes in the marginpar. This can be easily achieved with the `footmisc` package. However, I need some support and guidance how to handle footnotes that are near the bottom of the page and hence extend below the bottom margin of the page. The MWE below illustrates the problem. I am open to suggestion what to do with this. I think the following would be best:   * If there is enough space, push the footnote upwards so that the last line of the footnote is aligned with the last line of the text   * If there is not enough space (because there is a footnote above), let the footnote flow to the bottom of the page as done here. Is this typographically acceptable? If yes, how could this be implemented?               \documentclass[12pt]{scrartcl}          \usepackage{lipsum,geometry}          \geometry{left=2cm,textwidth=130mm}     \setlength{\marginparwidth}{4cm}          \usepackage[side,flushmargin]{footmisc}               \begin{document}          \lipsum[1]          \lipsum[1]          Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum     gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulpu-     tate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi     tristique senectus et netus et malesuada fames ac turpis egestas. Mauris     ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibu- lum urna     fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat.     Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent     eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla,     malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auc- tor semper     nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan     eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim     rutrum\footnote{This footnote now extends below the bottom margin which     does not look nice. Lorem ipsum dolor sit amet, consectetuer adipiscing     elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.     Curabitur dictum gravida mauris}          \lipsum[3]          \end{document}      ![Dynamic Endnote problem](http://i.stack.imgur.com/Bh1ba.png)


title: Questions regarding conversion from acronym package to glossaries

text: In my thesis I use the `acronym` package. I have only one problem with the package, which is the lack of capability to capitalize first letter, a functionality which I read is provided by `\makefirstuc` in `glossaries`. I have reservations though since I have already written most of the Thesis and I am wondering if it is too much trouble converting it, or should I seek ways to go around the limitation while sticking to `acronym`. My questions are:   1. I make my own custom table for acronyms, because I want to conserve my own table style rather than rely on built-in ones from `acronym` or `glossaries`. As such, I need to be able to access the page reference labels that gives the page number the acronym was fist used. With `acronym` it is simply `\pageref{acro:label}`. Is there an analogue with `glossaries`?   2. To be able to build a custom table of abbreviations, I used the starred commands from `acronym` package, which does not mark the acronyms in the table as "used". This is important because otherwise all page references for the first use will point to the table itself. Does this problem exist with `glossaries` and if so is it solvable?   3. What are the direct equivalent in `glossaries` for the `acronym` commands of:              \acs  %short form     \acl  %long form      \acf  %long form (short form)     \acfi  %emphasized long form (short form)      and their starred versions if any?


title: New line in pgfplots/tikz not displaying in TeX

text: I have a multiple-line legend entry to preserve the width of my figure. I can use `\newline` in Matlab and the legend entry is split between two lines. When I produce a `.tikz` of the figure however, I can't figure out how to get a new line... It appears there was a similar issue or the same issue github of matlab2tikz but when I use this syntax the same issue arises where Matlab shows the multi-line legend entry but LaTeX doesn't. Am I missing a package or writing the syntax wrong ? LaTeX code generated by `matlab2tikz` to display the multiline legend (`\newline` works in matlab, tried `"\n"` and tried removing all of the `\text{}`'s which didn't help - the `\newline` command is just ignored by LaTeX): `\addlegendentry{$\text{R}_{\text{Darcy,pwr}}\text{ = [1.26x10}^{\text{10}}\text{, 3.76x10}^{\text{9}}\text{] (1/m)**\newline** MAE=1.14x10}^{\text{-2}}\text{(g/min)}$};` Unfortunately I can't post images because I don't have 10 repuation... sorry about the links: **Matlab output:** ![enter image description here](http://i.stack.imgur.com/AihBF.png) **LaTeX output:** ![enter image description here](http://i.stack.imgur.com/ZfeCP.png)


title: tikz callout shape not working with alltt environment

text: I want to use the `callout` shape from `tikz` in order to explain some elements of a program listed in an `alltt` environment. But the `callout` shape is not pointing correctly to the desired element in the listing.               \documentclass{article}          \usepackage[papersize={7cm,2cm}]{geometry}     \usepackage{alltt}     \usepackage{tikz}     \usepgflibrary{shapes.callouts}     \usetikzlibrary{decorations.text}%workaround for undefined \pgf@test          \newcommand{\refnode}[2]{\tikz[remember picture,baseline=-.5ex]{\node[draw](#1){#2};}}          \begin{document}          \begin{alltt}     let \refnode{r}{greatest} a b =       if a > b then a else b     \end{alltt}          \tikz[remember picture,overlay]{%       \node[rectangle callout,fill=green!30,callout absolute pointer={(r)}]          at (4,0) {function name};}          \end{document}      ![output](http://i.stack.imgur.com/K68yv.png) Any clues on how to fix this?


title: Use \LetLtxMacro with a \Macro* (starred variant)

text: If I use:               \LetLtxMacro{\MacroToUse}{\FormatText}      then using `\MacroToUse` invokes `\FormatText` exactly as desired. But, how do use this construct to invoke `\FormatText*`? The MWE below yields: ![enter image description here](http://i.stack.imgur.com/uQ2uG.png) but the desired output is the two lines being identical. ## References:   * When to use \LetLtxMacro? ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{xparse}          \usepackage{letltxmacro}               \newcommand*{\FormatColor}{}%     \NewDocumentCommand{\FormatText}{s m}{%         \IfBooleanTF{#1}{%             \def\FormatColor{red}%         }{%             \def\FormatColor{blue}%         }%         \textcolor{\FormatColor}{#2}%     }%          \begin{document}     \FormatText{one}     \FormatText*{two}          \newcommand{\MacroToUse}{}%          \LetLtxMacro{\MacroToUse}{\FormatText}%     \MacroToUse{one}     \LetLtxMacro{\MacroToUse}{\FormatText*}%     \MacroToUse{two}     \end{document}


title: Introducing courtesy folding marks in moderncv

text: I have a new idea but it seems I don't know how to realise... as always! I am doing some experiments with `moderncv`, and I would like to introduce folding marks like in `scrlttr2` (KOMA 2 Letter format) - possibly on the cover letter only, not in the CV pages. I did the following: I created a copy of `moderncv` in my local package repository (on Mac with MacTex: `~/Library/textmf/tex/latex`) and registered it (with `sudo texhash`). Since I am not familiar with the (sometimes) convoluted LaTeX commands that go beyond the normal usage, I diligently copied all the commands from `scrlttr2.cls` featuring the word "fold" to the beginning of my copy of `moderncv.cls`, just after the `\ProvidesClass{moderncv}` expression (line 13). Then I tried to compile my copy of the `moderncv` template, getting a few errors due to some missing expression that was required by the code I pasted. I identified those expressions in `scrlttr2.cls` and copied them in my copy of `moderncv.cls` as well. I reiterated this process a few times, until I got stuck. The code I added is the following:               \RequirePackage{keyval}     \newcommand*{\KOMA@key}{\define@key{KOMA}}     \newif\if@fold\@foldtrue     \KOMA@key{foldmarks}[true]{\@setif[@fold]{foldmarks}{#1}}     \newcommand*{\foldmarkson}{%       \@ObsoleteCommand{\foldmarkson}{foldmarks=on}}     \newcommand*{\foldmarksoff}{%       \@ObsoleteCommand{\foldmarksoff}{foldmarks=off}}     \newcommand*{\@newplength}[1]{%       \@ifundefined{ltr@len@#1}{%         \expandafter\let\csname ltr@len@#1\endcsname=\z@%         }{%         \ClassError{scrlttr2}{%           pseudo-length \expandafter\string\csname ltr@len@#1\endcsname           already defined%           }{%           You tried to define a new pseudo-length using           \string\@newplength\MessageBreak           which is already defined. Try another name or           better\MessageBreak           Don't use this KOMA-Script internal macro}         }       }     \@newplength{foldmarkhpos}     \@newplength{tfoldmarkvpos}     \@newplength{bfoldmarkvpos}     \newcommand*{\@foldmark}[2]{%       \vskip #1%       \vb@t@z{\rlap{\move@topl\hskip\useplength{foldmarkhpos}%         \rule{#2}{.2pt}}}%       \vskip -#1\ignorespaces%     }     \newcommand*{\@foldmarks}{%       \if@fold%         \typeout{Foldmarks: yes}%         \move@topt         \@foldmark{\useplength{tfoldmarkvpos}}{2mm}         \@foldmark{.5\paperheight}{4mm}         \@foldmark{\useplength{bfoldmarkvpos}}{2mm}         \move@frompt       \else         \typeout{Foldmarks: no}%       \fi%     }      I also changed `\newcommand*{\opening}[1]{\def\@opening{#1}}` into `\newcommand*{\opening}[1]{\def\@foldmarks\@opening{#1}}` since something similar was also happening in `scrlttr2.cls`. Now, apart from a few instructions still referring to `scrlttr2` (like `\ClassError{scrlttr2}{%` for instance), I get the following error when I compile:               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013     Processing: ./template.tex     Document Class: moderncv 2013/04/29 v1.5.1 modern curriculum vitae and letter document class     LaTeX Font Warning: Font shape `OMS/qpl/m/n' undefined     Latex Error: ./template.tex:68 Undefined control sequence.     LaTeX Font Warning: Font shape `T1/lmss/sb/n' undefined     LaTeX Warning: Citation `book1' on page 3 undefined on input line 145.     LaTeX Font Warning: Some font shapes were not available, defaults substituted.     LaTeX Warning: There were undefined references.     Output written on template.pdf (3 pages, 216601 bytes).     Complete transcript is in template.log     Found 1 errors, and 5 warnings in 1 runs     /Users/stefano/Library/Application\ Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/bin/latexmk.pl -pdf -f -r /tmp/latexmkrc "template.tex" exited with status 12      The complaining command is `\makelettertitle`, the command that takes care of the rendering of the letter opening. I tried to figure out what else to change, but it is beyond my understanding. Can someone please explain me what I am missing and how to proceed? Thanks.


title: Using ConTeXts cow font with pdfTeX

text: So I have really become intrigued with the Cow font of context, however I really wish I would be able to use this with latex. I found a place, where it listed the steps on what to do, but it was rather vague on how one would actually do these steps. The steps where: > it "just" requires that you grab the stuff in cont-tmf.zip and put it in a > texmf-local sort of tree, texhash, and then updmap-sys --Enable Map > koeieletters.map (link) Can anybody explain to me what I actually need to do to get this installed, such that I can use it with latex? I have located the con-tmf.zip file on my computer.


title: Ground symbol issue in Circuitikz

text: I'm using TexLive2013 and the Circuitikz package. I'm trying to draw the `ground` symbol but it appears as just a line and not the proper symbol. The code I'm using is:               \documentclass{article}     \usepackage{circuitikz}     \begin{document}     \begin{center}       \begin{circuitikz}          \draw (0,0) to [ground] (0,-1);        \end{circuitikz}      \end{center}     \end{document}      But what I get is this: ![enter image description here](http://i.stack.imgur.com/5ZQFY.png) Anyone know why?


title: How do you write the "estimate" equal sign?

text: I'm looking for a code, which can depict the estimate equal sign as in http://en.wikipedia.org/wiki/Equals_sign#Other_related_symbols (6th sign: ESTIMATES).


title: How can i auto resize the column according to content

text: I use this code:               \begin{table}[H]     \caption{Offsets 2}     \centering     \begin{tabular}{*{6}{|c}}     \hline\hline     \rowcolor{orange}     student status  &  location type  & outside region & approved outside area (ha) & delivery agent\\ \hline \hline     Current         &  Restoration    & Northwest john Province & 476.0 &      If the position ... \\ \hline     \end{tabular}     \label{table:nonlin}     \end{table}      But the table is going outside the page. Is there any way that page don't go outside the page and shrink accoring to content and fit on page.


title: Figure on the left and some complex comments on the right

text: As the title described, I would like to put a figure on the left and make some complex comments parallelly on the right. I write some code, but I feel the code is not "clean" . Sometimes works but sometimes with an error notice. I appreciate someone could help me to give out a clean and nice code, then I can use it for many other similar jobs. One practical example is as following (I would like to have something shown by the picture) ![enter image description here](http://i.stack.imgur.com/wv6tN.jpg) And the current bad written Latex code with error message as follow:               \begin{SCfigure}[\sidecaptionrelwidth][h]     \centering     \includegraphics[scale=0.6]{E:/.../Sample.jpg}     \caption{$\boxed{     \varphi(y)=\frac{1}{\sqrt{2\pi}}\cdot exp (-\frac{y^2}{2})     }$     \\      Density of $N(0,1)$ with $y=\frac{x-\mu}{\sigma}$}     \end{SCfigure}      The Error Message: ![enter image description here](http://i.stack.imgur.com/nY21X.jpg)


title: btex \begin{align} ...\end{align} etex METAPOST issue

text: I seem to be having trouble getting my code to carry out any amsmath command with the btex--etex environment in a metapost file. The appropriate packages are defined withint my tex file, so I really have no idea what the problem is! I will appreciate any help! This is my mp code:               outputtemplate:="%j%c.mps";     beginfig(1)     defaultscale := 10pt/fontsize(defaultfont);     u:=1.1cm;     path p; p:=(0.1cm,u)--(0.1cm,u+0.5cm);     pair A;     A:=(0.8cm,0);     drawarrow p;     draw unitsquare scaled 1cm withpen pencircle scaled 0.5;     draw (-0.01cm,0)..(-0.01cm,2cm) dashed evenly scaled 0.8 withpen pencircle scaled 0.8 withcolor red;     draw (0,-0.01cm)..(2cm,-0.01cm) dashed evenly scaled 0.8 withpen pencircle scaled 0.8 withcolor red;     %drawarrow p;     for i=0 upto 2:     drawarrow p shifted (i*A/2);     endfor;     label.ulft(btex \begin{align}\sqrt{3} \\ u_{r}=0\end{align} etex, origin );          endfig;     bye      Thank you!


title: How display the href link in the footnote?

text: My document has several `\href` that I would like to be shown on the footnote. How can I do it?


title: Need to make a box over my title

text: how to make a box over my title? Just a box (like that one on the picture) on my titlepage? kind regards![enter image description here](http://i.stack.imgur.com/dw0JK.png)


title: Alternatives to asterisk and star for superscripts

text: While writing a paper, I find myself exhausted with superscript symbols to denote similar types of variables. I have used `x`, `x^\ast` (i.e. x*), `x^\star` and `x'`. I can't use symbols which sit right on top of 'x' such as `\hat` or `\tilde` or `\bar` etc. Neither can I use a new variable (like y or z) for a new quantity related to x. I must also not use a number or an alphabet for the superscript. I saw some people using alternatives such as big asterisk/star, a club or diamond in the superscript. But these symbols stand out in the text to the extent that they give the text a garish look. Although I did notice a number of other star/asterisk-related symbols in the comprehensive latex symbol guide, I was not sure which of them is a conventional math superscript. Any suggestions about using a few more (= 2 or 3) decent superscript symbols? Are there any other commonly used math symbols to solve this problem? Any help will be greatly appreciated. Thanks. Correction: I am using matrix pseudoinverse in the paper. So, `\dagger` symbol has also been used.


title: LaTeX error ! Too many }'s. \color@endbox ->\color@endgroup \egroup

text: I am getting an endgroup error. i.e. too many } causing an early closing of the document with the below code. I use sideways tables and floats later on in the document, not sure if this is causing the error. This is all the preamble info               \NeedsTeXFormat{LaTeX2e}     \documentclass[11pt]{article}               \usepackage{setspace}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{epsfig}     \usepackage{eso-pic}     \usepackage{fancybox}     \usepackage{listings}     \usepackage{algo}     \usepackage{url}     \usepackage{pgfgantt}     \usepackage{natbib}      \usepackage{sistyle}     \usepackage{epstopdf}     \usepackage{hyperref}     \usepackage{sistyle}     \usepackage{appendix}     \usepackage{pdflscape}     \usepackage{float}     \usepackage{rotating}     \usepackage{graphicx}     \usepackage{rotfloat}     \usepackage{dpfloat}     \usepackage{tcolorbox}     \usepackage{xcolor}               \setlength{\textheight}{9.4in}     \setlength{\textwidth}{7in}     \setlength{\oddsidemargin}{-.25in}     \setlength{\topmargin}{-0.75in}      \hyphenation{itself}        Beginning of document and other text then the table that is causing the above error message ! Too many }'s. \color@endbox ->\color@endgroup \egroup               \begin{table}[htbp]     \renewcommand{\arraystretch}{1.25}     \centering     \begin{tabular}{c c c}         \hline         \bf{SPI Value} & \bf{Category} & \bf{Pobability \%} \\         \hline               2.00 or more & Extremely Wet & 2.3 \\               1.50 to 1.99 & Severely Wet & 4.4 \\               1.00 to 1.49 & Moderately Wet & 9.2 \\               0 to 0.99 & Mildly Wet & 34.1 \\               0 to -0.99  & Mild Drought & 34.1 \\               -1.00 to -1.49 & Moderate Drought & 9.2 \\               -1.50 to -1.99 & Severe Drought & 4.4 \\               -2 or less & Extreme Drought & 2.3 \\         \hline             \end{tabular}%                \caption[Precipitation anomaly (SPI) classification]{Precipitation anomaly           classification based on SPI values and corresponding event probabilities}           \label{tab:SPI}%     \end{table}


title: Changing background color of external pdf files using pdfpages

text: The following TeX code is intended to change the background color of an external pdf file by using the `pdfpages` package, but it does not work for me. Does it work at all?               \documentclass{minimal}     \usepackage{xcolor}     \pagecolor[HTML]{B0A030}     \usepackage{pdfpages}     \begin{document}     \includepdf[fitpaper,pages=-]{external/notes.pdf}     \end{document}


title: Piecewise highlighting in beamer presentation

text: I would like to do the following with `beamer`: All items of an `itemize` environment should be displayed in gray. The current item should be highlighted in black while all others remain grayed out, but visible (So for the example I would like to get three slides in the end: "Hallo" in black on slide 1, the rest in gray; "Welt" in black on the 2nd slide, all other items in gray, etc.). I just went through the manual, could not find any specific code to do so.               \documentclass{beamer}     \begin{document}     \frame{       \begin{itemize}         \item Hallo         \item Welt         \item Foobar       \end{itemize}     }     \end{document}


title: Problem with MikTex and Hebrew when using 12pt font

text: I'm using MikTex 2.9 (on Windows 7), together with the culmus-latex pack (I used the instructions I found here: http://www.ma.huji.ac.il/~sameti/tex/culmusmiktex.html). When working with the default (10pt I believe) font, or simply not specifying the font, everything works alright. But when choosing 12pt (with `\documentclass[hebrew,12pt]{article}`) the fonts **(only the Hebrew ones)** get all weird and their spacing goes wrong. Here's an example of what happens: ![bad spacing \(12pt\)](http://i.stack.imgur.com/aHbam.jpg) as opposed to the normal result I get when I use 10pt: ![good spacing \(10pt\)](http://i.stack.imgur.com/xad96.jpg) I really need the 12pt font. Does anyone know how to solve this issue? Many thanks! **Also** I'd like to point out that this only happens when exporting to PDF, if I just use LaTeX the DVI looks fine. But I usually need the PDF files. **Edit:** Here is an example code:               \documentclass[a4paper,12pt]{article}     \usepackage{a4wide}     \usepackage[english,hebrew]{babel}     \usepackage{amsmath}     \usepackage{amssymb}     \linespread{1.3}     \begin{document}     \section{קיום הפוטנציאל המרוכב}     ראשית, נתאר מערכת דו-ממדית באמצעות משתנים מרוכבים:      עבור שדה וקטורים שטוח )דו-ממדי(, נתאר כל אחת מהנקודות כנקודה במישור המרוכב,      וכל פונקציה וקטורית תתואר כפונקציה מרוכבת.      כמקובל, הרכיב האופקי יהווה את החלק הממשי והרכיב האנכי יהווה את החלק המדומה.      נציג את שדה המהירות של נוזל זורם באמצעות פונקציה      $f(z)$,      באופן הבא:     \[ f(z) = u(x,y) + iv(x,y) \]     בשלב זה נציג הנחות על שדה הווקטורים.      ההנחות שננסח אינן תקפות תמיד במציאות, אולם הן מהוות קירוב טוב לתנאים מציאותיים,      וכן הן מאפשרות כוח חישובי שלא היה מתאפשר בלעדיהן.     \end{document}      And I put the .tex, .pdf and .log files here: http://www.sendspace.com/file/imx3qr


title: How to make \ref references include the word 'Figure'?

text: > **Possible Duplicate:**   >  Table, Figure, and Listing prefixes   >  Automatically inserting "Section, Subsection, etc" I'm using the package `hyperref`. When referencing my figure, I currently use code like               Figure \ref{fig:chorus-overview} gives an overview of the basic concept.      because `\ref` will just yield a single integer `1`, as opposed to `Figure 1`. However, the word `Figure` is auto-generated for the figure environment caption, so when using a package such as `[ngerman]{babel}`, it's `Abbildung` instead, and I need to fix the text before my reference. Is there any way to directly get the `Figure 1` text via `\ref` or a similar command? **EDIT** Additionally to the steps described in Sveinung's answer (using \autoref from hyperref or \cref from cleveref), I needed to make sure to place the label _before_ the caption in the figure environment, as pointed out by Werner, and to include babel _before_ hyperref/cleveref. `\nameref` does not do what I need, since it copies the text of the caption instead.


title: Cross-Referencing: equations, figures, and chapters, sections, etc

text: When we reference equations, we can use `\eqref`, and when we reference figures, we can use `\fref`. Then the reference for equation has `( )` and the word `figure` is inserted into the document locations. Is there a reference for chapters, sections, subsections, subsubsections, etc? This way when I reference the section, I can just do `\somethingref` instead `section~\ref`?


title: Figure references with the word Figure and not just a number

text: I reference figures this way: `\label{fig:hello}` and then just `\ref{fig:hello}` but the latter returns only the number without the word `"Figure"`. How can I get the word Figure such as `"Figure 1"`?


title: Table, Figure, and Listing prefixes

text: ## Background Using LyX and KOMA Script to author a technical manual. ## Problem The documents are strewn with the following references:               \ref{fig:Example-Database-Type}      When converted to PDF, this results in "1.1" for the figure number, whereas I would prefer it to read "Figure 1.1". Similarly, for Tables and Listings, they should read "Table 1.1" and "Listing 1.1", respectively. ## Code The caption code is:               \caption{\label{fig:Example-Query-Statement}Example Query Statement}      The reference code is:               \ref{fig:Example-Query-Statement}      The document preamble includes:               \usepackage{hyperref}      The result is: "The screen shot in 1.1 shows ..." The desired result is: "The screen shot in Figure 1.1 shows ..." ## Ideas Tried:               \let\oldref=\ref     \renewcommand{\ref}[1]{Figure {\oldref{#1}}}      Tried:               \usepackage{fancyref}     \renewcommand{\ref}[1]{\fref{#1}}      Tried:               \usepackage{hyperref}      ## Question How do you change the `\ref` command to include a `\figurename` prefix without having to edit (and thus duplicate) the code for every figure (that already has the `\ref`)? Thank you!


title: Create linewidth spaced three columned table with column alignment

text: I'm writing a two columned article:               \documentclass[10pt, aps, prb, twocolumn]{revtex4-1}      I would like to include a table which is as long as `1.\linewidth`. The table should consist of three columns, the first two are aligned to the left and the last column should be aligned to the right. The last column should also be at the end of `1.\linewidth`. I have the following code but it is very unsatisfying. This is because I have to manually tune the size of the first two columns in order to have the final column aligned to the end of `1.\linewidth`.               \noindent     \begin{tabularx}{1.\linewidth}{p{.3\linewidth} p{.3\linewidth} r}       \hline       Animal    & Description & Price (\$) \\       \hline       Gnat      & per gram    & 13.65      \\                 & each        & 0.01       \\       Gnu       & stuffed     & 92.50      \\       Emu       & stuffed     & 33.33      \\       Armadillo & frozen      & 8.99       \\       \hline     \end{tabularx}      What would be the correct approach to this problem? Am I correct in using `tabularx` or would you advise something else?


title: Is there a way to configure pdflatex to make all but the .tex and .pdf files hidden files?

text: I have asked a previous question about how to manage all the files generated when my LaTeX files are compiled but the approach in the answer I accepted is still unsatisfactory for the many small documents I generate. I realize the LaTeX needs all the files it generates so I can't prevent their creation. However **is there a way to configure`pdflatex` to make all but the `.tex` and `.pdf` files hidden files (i.e., preceded by `.`)?** (Edit: The two main systems that I use are tex live on Ubuntu Linux and BasicTeX on OS X)


title: Skipping ticks in pgfplots plot

text: I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if I have values 2^3,..,2^32 in my x axis, I would like to display only 2^3, 2^5, 2^7 and so on (show one, skip one) An example output is here: ![enter image description here](http://i.stack.imgur.com/nSldX.png)


title: justify text and preserve paragraph indentation

text: I want to justify my text to left without losing the paragraph indentation. I tried ragged and flushleft, although both justify the text and the next paragraph. So I am losing intendation. I do not want to do individual paragraphs because my document is pretty long.


title: lstlisting produces empty row when used inside a tabular

text: Is there any way I can get rid of the empty new row produced by `lstlisting` inside a `tabular`? ![enter image description here](http://i.stack.imgur.com/zQEnX.png) Here's a minimum working example:               \documentclass[11pt]{article}          \usepackage{listings}     \lstset{     language=python,     showspaces=false,     showtabs=false,     tabsize=4,      frame=trbl,     frameround=tttt,     basicstyle=\ttfamily,     showstringspaces=false,     numbers=left,     breaklines=true,     }          \begin{document}          \begin{tabular}{l | p{0.8\textwidth}}     test &     \begin{lstlisting}     somecode     \end{lstlisting}     \end{tabular}          rest of text               \end{document}      I'm using TexShop with xelatex. Follow-up question: It also seems to break when I'm using `longtable`: The tables don't continue into other pages, instead it creates huge gaps and I'm suspecting it has to do with `lstlisting`.


title: Getting the (variable) number of columns per row with pgfplotstable?

text: I've already seen PGFplots and table with different number of elements in columns; but this is a slightly different question... Consider the following MWE:               \documentclass{article}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{adjustbox}          \pgfplotstableread[       col sep=comma,       header=false,     % columns/0/.style={string type}, % nowork here; on typeset     ]{     c002,128,64,0.000119,-1,-1,0.000162,-1,-1,0.000494,-1,-1,0.001540,1,65,0.001906,0,1,0.002997,1,1,0.003341,0,65,0.004432,1,65,0.004797,0,1,0.005889,1,1,0.006253,0,65,     c003,128,64,0.000166,-1,-1,0.000463,-1,-1,0.001546,1,65,0.001936,0,1,0.002981,1,1,0.003362,0,65,0.004437,1,65,0.004939,0,1,0.005918,1,1,0.006269,0,65,     c004,128,64,0.000118,-1,-1,0.000161,-1,-1,0.000456,-1,-1,0.001518,1,65,0.001903,0,1,0.002973,1,1,0.003339,0,65,0.004410,1,65,0.004795,0,1,0.005866,1,1,0.006252,0,65,     }\mytable          \pgfplotsset{%       compat=1.5.1,     }          \pgfplotstablegetrowsof{\mytable} %Determine no. of rows     \pgfmathtruncatemacro{\rows}{\pgfplotsretval} % pgfmathsetmacro float, this int     \pgfmathtruncatemacro{\lastrow}{\rows-1}               \begin{document}     \typeout{Rows: \rows} % 3.0          Test 1: \\ \newline               \foreach \r in {0,1,...,\lastrow}{       \pgfplotstablegetelem{\r}{[index]0}\of\mytable%       \edef\colzerotag{\pgfplotsretval}%       \pgfplotstablegetcolsof{\mytable} % how to get cols for this row???       \edef\numcolsstr{\pgfplotsretval}%       \noindent \r: \colzerotag\ - \numcolsstr \\     }               % just testing wide printout     \begin{adjustbox}{width=\textwidth}     \noindent\pgfplotstabletypeset[       columns/0/.style={string type},       font=\tiny,     ]{\mytable}     \end{adjustbox}          \end{document}      The data has variable number of columns; I would like to avoid re-parsing the data and padding with null columns. Using the data verbatim as is, `pdflatex` fails with: > % ! Package pgfplots Error: input table '' has an unbalanced number of > columns in row '2' (expected '37' cols; got '34'). Maybe the input table is > corrupted? If you need unbalanced data, consider using 'nan' in empty cells > (perhaps combined with 'unbounded coords=jump'). If you keep on pressing "Enter", the document will eventually compile, and this is the output (click for full size): ![test.png](http://i.stack.imgur.com/BC01Mm.png) (The full table is rendered, just to confirm whether `pgfplotstable` interprets the data per row as I do - that is, "start from beginning, and keep going for as many data columns are available"; and it seems that is the case. There is an empty column appended, apparently because of existence of trailing comma `,` in the data) So, basically, what I'd like to do is loop through each row, print the first column label as identifier, then print the number of columns in that row; the expected output would be:               0: c002 - 37     1: c003 - 37     2: c004 - 34      Here just as a demo I use `\pgfplotstablegetcolsof{\mytable}` which will always use the first deduced number of columns for the table (so it always prints 37 regardless). Is there a way I could achieve this only with `pgfplotstable` (possibly with an extra Latex package), without having to reparse the data?


title: Align sequence with curly bracket and half row shift

text: Can anybody tell me how to rewrite these equations: ![enter image description here](http://i.stack.imgur.com/Do8G0.png) There are curly brackets and half row shift and I don't know how to write it in align (`eqnarray`) environment.


title: Pdfbookmark with number

text: I'm importing some pdf files, to my document.               \pdfbookmark{First}{r01}          \includepdf[pages=-,pagecommand={}]{inc/r01.pdf}          \pdfbookmark{Second}{r02}     \includepdf[pages=-,pagecommand={}]{inc/r02.pdf}      These are book chapters, with their own formatting - it's a reason, why I can't use `\section` there. I don't want to have any table of contents in my document, just the chapters names in the bookmarks area together with the numbering. How to do this?