title: Draw randomized tree in TikZ

text: I am trying to draw a randomized tree using TikZ, that is, I'm looking for a macro `\randtree{NN}{x}` that attaches a randomized tree of maximum depth x to a node named `NN`. The nodes need not be visible or marked, I just want the lines. I did a bit of research on randomized TikZ pictures, but since I never really used randomization with TikZ before, most of the examples were so complicated that I didn't understand what was going on (e.g. referring to tikz picture again in the same latex document) plus, most randomization examples (at least the ones I found) just randomize the shape of individual lines, wheras I want entire node structures to be randomized. Here is a (non-random, non-automatic) example of what I'm hoping for:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{positioning}          \newcommand\mytree[1]{     \coordinate[above right=1cm and 1.0cm of #1] (r);     \coordinate[above right=2cm and 2.0cm of r] (rr);     \coordinate[above left =1cm and 0.5cm of r] (rl);     \coordinate[above right=1cm and 1.0cm of rl] (rlr);     \coordinate[above left =1cm and 0.5cm of rl] (rll);     \coordinate[above left =1cm and 1.0cm of #1] (l);     \coordinate[above left =1cm and 1.0cm of l] (ll);     \coordinate[above right=2cm and 0.5cm of l] (lr);     \coordinate[above left =1cm and 1.0cm of lr] (lrl);     \coordinate[above right=1cm and 0.2cm of lr] (lrr);     \coordinate[above left =1cm and 1.0cm of ll] (lll);     \coordinate[above right=1cm and 0.5cm of ll] (llr);     \coordinate[above left =1cm and 1.0cm of rlr] (rlrl);     \draw[black] (lll) -- (ll);     \draw[black] (ll) -- (l);     \draw[black] (l) -- (sv);     \draw[black] (sv) -- (r);     \draw[black] (r) -- (rr);     \draw[black] (r) -- (rl);     \draw[black] (l) -- (lr);     \draw[black] (rl) -- (rll);     \draw[black] (rl) -- (rlr);     \draw[black] (ll) -- (llr);     }          \begin{document}          \begin{tikzpicture}[node distance=1cm and 0.4cm]     \coordinate (sv);     \mytree{sv};     \end{tikzpicture}          \end{document}      It's not required that all branches have the same total height at the end, nor is the absolute number of nodes of any interest. I just want to specify the maximum number of nodes from trunk to leaf, and the total scale of the tree (approximate height and width, both values are allowed to float up or down). The tree should alway grow from bottom to top, but if that's also customizable, even the better. A ready-made solution would be too much to ask, so I'll be happy with a simple example or pointers to the appropriate sections of the TikZ manual. ## Edit Following a request from one of the comments, I try to be more clear about what I'm trying to achieve. I'm trying to reproduce the following graphic: ![Illustration of event structure simulated by a showering and hadronization generator.](http://i.stack.imgur.com/Sf5Iq.jpg) I managed to make most of it on my own, the only thing still missing is the (more-or-less) random decay diagrams on top of the pink blobs (circled in red). Since the precise structure of these things is not of particular importance, nor is the fact that they have arrow tips at their end, I thought that the easiest way to generate them was to create a randomized tree of given size and attach it to the TikZ nodes at the pink blobs. In the meantime, I opened another question on the same subject, trying to build these decay-chain-structures manually (Drawing recursive randomized structures with TikZ). If you have a solution on how to do this using a tree construct (`forest`, `tikz-qtree`, ...), please answer to this question - if you know a way how to manually create these structures, please anwer the one linked above. ## Edit 2 Since I got a nice answer and was able to plug everything together, I figured I might as well make the source code of my picture available to everyone. Enjoy! ### Preparation               \usetikzlibrary{positioning,arrows,patterns}     \usetikzlibrary{decorations.pathmorphing}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{decorations.shapes}          \def\pgfdecoratedcontourdistance{0pt}          \pgfkeys{/pgf/decoration/contour distance/.code={%         \pgfmathparse{#1}%         \let\pgfdecoratedcontourdistance=\pgfmathresult}%     }          \pgfdeclaredecoration{contour lineto}{start}     {         \state{start}[next state=draw, width=0pt]{             \pgfpathmoveto{\pgfpoint{0pt}{\pgfdecoratedcontourdistance}}%         }         \state{draw}[next state=draw, width=\pgfdecoratedinputsegmentlength]{                    \pgfmathparse{-\pgfdecoratedcontourdistance*cot(-\pgfdecoratedangletonextinputsegment/2+90)}%             \let\shorten=\pgfmathresult%             \pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentlength+\shorten}{\pgfdecoratedcontourdistance}}%           }         \state{final}{             \pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentlength}{\pgfdecoratedcontourdistance}}%         }        }          \tikzset{       photon/.style={decorate, decoration={snake}, draw=black},       crossed/.style={draw=black, postaction={decorate},decoration={markings,mark=at position .5 with {\draw (-2pt,-2pt) -- (2pt,2pt);\draw (2pt,-2pt) -- (-2pt,2pt);}}},       fermion/.style={draw=black, postaction={decorate},decoration={markings,mark=at position .55 with {\arrow{>}}}},       weak/.style={dashed, draw=black},       special/.style={decorate,decoration={shape backgrounds,shape=circle,shape size=0.5pt,shape sep=2pt}},       gluon/.style={decorate, draw=black,decoration={coil,amplitude=4pt, segment length=5pt}} ,       hadron/.style={         draw=black,         postaction={             decoration={contour lineto, contour distance=-2pt},             draw=black, decorate},         postaction={             decoration={contour lineto, contour distance=2pt},              draw=black, decorate}       },       meson/.style={         draw=none,         postaction={             decoration={contour lineto, contour distance=-1pt},             draw=black,decorate},         postaction={             decoration={contour lineto, contour distance=1pt},              draw=black, decorate},       },       vertex/.style={draw,shape=circle,fill=black,minimum size=3pt,inner sep=0pt},       bbvertex/.style={draw,shape=circle,pattern=north east lines,very thin,minimum size=12pt,inner sep=0pt}     }          \newcommand{\generateShower}[1]{       \scalebox{.3}{         \pgfmathsetseed{#1}         \begin{forest}           random tree/.style n args={2}{% #1=max levels, #2=max children             if={##1>0}{repeat={random(0,##2)}{append={[,random tree={##1-1}{##2}]}}}{},             parent anchor=center, child anchor=center, grow=north},           [,random tree={3}{3}]         \end{forest}       }     }      ### Actual picture               \begin{tikzpicture}[node distance=1cm and 0.4cm]     %% the bottom part     \coordinate[vertex] (sv);     \coordinate[vertex,   below      =1cm and 0.4cm of sv] (pv);     \coordinate[bbvertex, below left =1cm and 0.4cm of pv] (vl);     \coordinate[bbvertex, below right=1cm and 0.4cm of pv] (vr);     \coordinate[          below left =1cm and 0.4cm of vl] (il);     \coordinate[          below right=1cm and 0.4cm of vr] (ir);     \coordinate[          above left =1cm and 0.4cm of vl] (fl);     \coordinate[          above right=1cm and 0.4cm of vr] (fr);     \draw[hadron] (il) -- (vl);     \draw[meson]  (vl) -- (fl);     \draw[fermion](vl) -- (pv);     \draw[hadron] (ir) -- (vr);     \draw[meson]  (vr) -- (fr);     \draw[fermion](pv) -- (vr);     %% the connecting line     \draw[photon] (pv) -- (sv);     %% the top part     \coordinate[  vertex,above right=2cm and 2.0cm of sv] (r);     \coordinate[  vertex,above left =0.5cm and 0.7cm of r] (rl);     \coordinate[  vertex,above right=0.5cm and 1.0cm of rl] (rlr);     \coordinate[  vertex,above left =0.5cm and 1.0cm of rl] (rll);     \coordinate[  vertex,above left =1cm and 1.0cm of sv] (l);     \coordinate[  vertex,above left =1cm and 1.0cm of l] (ll);     \coordinate[  vertex,above right=2cm and 0.5cm of l] (lr);     \coordinate[bbvertex,above left =1cm and 1.0cm of lr] (lrl);     \coordinate[bbvertex,above right=1cm and 0.2cm of lr] (lrr);     \coordinate[bbvertex,above left =2cm and 2.0cm of ll] (lll);     \coordinate[  vertex,above right=1cm and 0.5cm of ll] (llr);     \coordinate[bbvertex,right=1cm of lrr] (rlrl);     \coordinate[bbvertex,right=2.5cm of rlrl] (rr);     %% tree-level fermion lines     \draw[fermion] (lll) -- (ll);     \draw[fermion] (ll) -- (l);     \draw[fermion] (l) -- (sv);     \draw[fermion] (sv) -- (r);     \draw[fermion] (r) -- (rr);     %% connection gluons     \draw[gluon] (r) -- (rl);     \draw[gluon] (l) -- (lr);     \draw[gluon] (rl) -- (rll);     \draw[gluon] (rl) -- (rlr);     \draw[gluon] (ll) -- (llr);     %% branch-level fermion lines     \draw[fermion] (rr) -- (rlr);     \draw[fermion] (rlr) -- (rlrl);     \draw[fermion] (rlrl) -- (rll);     \draw[fermion] (rll) -- (lrr);     \draw[fermion] (lrr) -- (lr);     \draw[fermion] (lr) -- (lrl);     \draw[fermion] (lr) -- (lrl);     \draw[fermion] (lrl) -- (llr);     \draw[fermion] (llr) -- (lll);     %% decay chains for bb vertices: rr, lrl, lrr, lll, rlrl     \node[yshift=-5.5pt,xshift=-1.5pt,anchor=south] at (lll.north) {\generateShower{33333}};     \node[yshift=-5.5pt,xshift=-3pt,anchor=south]   at (lrl.north) {\generateShower{25763}};     \node[yshift=-5.5pt,xshift=2pt,anchor=south]    at (lrr.north) {\generateShower{76924}};     \node[yshift=-5.5pt,xshift=-4pt,anchor=south]   at (rlrl.north){\generateShower{45678}};     \node[yshift=-5.5pt,xshift=-1.5pt,anchor=south] at (rr.north)  {\generateShower{14285}};     %% lhs braces     \draw [decorate,decoration={brace,amplitude=5pt}] (-5,-3.5) -- (-5,-1.5)         node [black,midway,xshift=-0.8cm,left,text width=3cm,align=right] {parton\\distributions};     \draw [decorate,decoration={brace,amplitude=5pt}] (-5.5,-1.5) -- (-5.5,0.5)      node [black,midway,xshift=-0.3cm,left,text width=3cm,align=right] {hard\\scattering};     \draw [decorate,decoration={brace,amplitude=5pt}] (-5,0.4) -- (-5,3.8)           node [black,midway,xshift=-0.8cm,left,text width=3cm,align=right] {parton\\shower};     \draw [decorate,decoration={brace,amplitude=5pt}] (-5.5,3.7) -- (-5.5,4.7)       node [black,midway,xshift=-0.3cm,left,text width=3cm,align=right] {hadronization};     \draw [decorate,decoration={brace,amplitude=5pt}] (-5,4.6) -- (-5,5.7)           node [black,midway,xshift=-0.8cm,left,text width=3cm,align=right] {decay};     \end{tikzpicture}      ### Result ![Schematic illustration of the basic structure of a events simulated with a showering and hadronisation generator. The time evolution of the event goes from bottom to top.](http://i.stack.imgur.com/5OG0G.png)


title: Customizing references style

text: I plan to submit a paper to ICVL. Their reference of itspaper template has the following sample. Is it possible to render this structure in LaTeX?               4   References     4.1 Books:     Bergman, B. and Klefsjö, B. (1995): Quality: from Customer Needs to Customer Satisfaction. Taylor & Francis, London.     4.2 Book Chapters:     Jenkins, D. (1983): Quality of working life: Trends and directions. In H. Kolosny and H. van Beinum (Eds): The Quality of Working Life and the 1980s. Praegner, New York.     4.3 Journal Articles:     Anderson, R. E. (1992) Social impacts of computing: Codes of professional ethics. Social Science Computing Review 10, 2, 453-469.     4.4 Conference Proceedings:     Axelsson J. R. C. (1997a): Creating commitment for continuous improvements by focusing on working conditions and participation. In Proceedings of The 14th International Conference on Production Research, Osaka Institute of Technology and Setsuan University, Osaka, 650-653.     4.5 Technical Reports:     Axelsson, J .R. C. (1997): Ergonomics in Design. Technical report: Linköping Institute of Technology, LiTH-IKP-R-871.     4.6 Theses:     Caldenfors, D. (1998): Top-down Reasoning in Design Synthesis and Evaluation. Licentiate of engineering thesis: Linköping Institute of Technology, Division of Industrial Ergonomics, Linköping.      4.7 Manuscripts And Working Papers (Unpublished Material):     Pries-Heje, J. (1994): Multimedia Requirements Engineering Method. Working Paper no. 94-5, The School of Management, Binghamton University, New York.     4.8 Newspapers Or Magazines:     Richardson, P.W. (1996): RSI and the future of publishing? The Times Higher Education Supplement, 1 November, 16.     4.9 Internet Sources:     Give the universal resource locator in full, e.g.      http://www.liu.se/cmto/english/projects/index.html     4.10    Personal Communication:     Kondo, Y. (1998): Personal communication.     4.11    Computer Programs:     Niles Software Inc, California, USA (1998): EndNote [Macintosh, version 3.0].


title: Easy absolute positioning in beamer

text: For my presentaton slides I'd like to have list uncovered and highlighted by time and each item supported by appropriate image/graph/table. Thinking about it in wider application, I'd like to find/create command:               \abspos{<anchor-spec>}{<coords>}{<content>}      where:   * `<anchor-spec>` specifies anchor point of positioned object. IE. NE for NorthEast corner point, etc.,   * `<coorrds>` specifies x-y-z coordinates on frame using standard LaTeX dimensions,   * `<content>` contain positioned graphics, table or text. Idea of code for my purpose:               \begin{minipage}{.5\textwidth}     \begin{itemize}      \item<1-> Foo      \item<2-> Bar     \end{itemize}     \end{minipage}     \begin{minipage}{.5\textwidth}     \uncover<1>\abspos{C}{.5\textwidth,.5\textheight,1}{\includegraphics{foo}}     \uncover<2>\abspos{C}{.5\textwidth,.5\textheight,1}{\includegraphics{bar}}     \end{minipage}


title: How to include wrapfigure inside '\begin{enumerate} \end{enumerate}'?

text: \documentclass{article}     usepackage{xypic,wrapfig,enumitem}          \begin{document}          \begin{enumerate}     \item Let $X$ be an annulus surrounded by two concentric circles $C_1$ and $C_2$ and $C$ be any concentric circle lying completely in $X$. Show that the circle     $C$ is a strong deformation retract of $X$. Calculate $\pi_1(X)\cong \mb Z$     \begin{wrapfigure}{r}{0.2\textwidth}     \includegraphics[width=0.2\textwidth]{fig2.png}     \vspace{-.5cm}     \end{wrapfigure}     $[From the centre $O$ draw a half line in each direction. Each such line meets the circle $C$ in a unique point, $r(x)$(say). Let $r : X \rightarrow C$     be the mapping which maps all points of the half line to the corresponding point $r(x)$. Define $H : X \times I \rightarrow X$ by $H(x,t)=(1-t)x+tr(x)$.      Then $H$ is a strong deformation retraction.     $]$     \end{enumerate}          \end{document}


title: Is it possible to use commands defined in DTLforeach as conditions in a tikz environment?

text: I have been tearing out my hair with this one all afternoon and was hoping someone could help me. Essentially the problem I have is that I'm using a DTLforeach loop to iterate over values in a .csv file and put them into a table. One of the things I want to see in this table is a series of shapes that change colour based on the text that occurs in the .csv file. However so far every time I've tried to do this it only seems to run the colour test once and so all of the shapes end up being the same colour rather than different colours dependant on the text. So my question comes down to is what I'm trying to do possible and if so how would you go about doing it? Hope this is all relevant and sorry if this is a duplicate but I searched and couldn't find a question similar to mine. Also sorry if this code is awful, I'm fairly inexperienced with LaTeX so if there's a really easy way to do this I'm open to suggestions. The data looks like this as a .csv file and is provided by a command added at compile time so that the .csv file can be dynamically generated from a database:               {"jobRefId","CISKeywords","problemLocation","jobProgress"      "2","Broken, Other","Gate Green  NA Ticket Office","Issue Reported"      "4","Blocked, Broken, Flooded","Village Purple Purple 4 Toilet (Disabled)","Issue Reported"      "6","Shower, Blocked, Too Hot","Venue Children/Youth Stepping Stones Shower","Issue Reported"}      Code:               \documentclass{beamer}          \usepackage{tikz}     \usepackage{xifthen}     \usepackage{longtable}     \usetikzlibrary{shapes}     \usepackage{xcolor}     \usepackage{tabu}          \definecolor{mellowyellow}{RGB}{255,255,199}     \definecolor{darkred}{RGB}{150,0,0}     \definecolor{darkyellow}{RGB}{255,178,0}     \definecolor{darkgreen}{RGB}{0,65,0}     \setbeamercolor{background canvas}{bg=mellowyellow}          \tikzset{          image/.cd,     1/.style = {ellipse, align=center, minimum height = 1.3cm, minimum width = 2.1cm, darkred, fill = darkred},     2/.style = {ellipse, align=center, minimum height = 1.3cm, minimum width = 2.1cm, darkyellow, fill = darkyellow},     3/.style = {ellipse, align=center, minimum height = 1.3cm, minimum width = 2.1cm, darkgreen, fill = darkgreen},     test/.code={         \ifthenelse{\isin{#1}{Issue Reported}}{\tikzset{image/1}}{         \ifthenelse{\isin{#1}{Ticket Printed Job In Progress Job Escalated}}{\tikzset{image/2}}{         \ifthenelse{\isin{#1}{Job Complete}}{\tikzset{image/3}}{         }}}     },     }          \newcommand{\jobindicator}[5]{     \node (#1) [xshift=#2cm,yshift=#3cm]  [image/test=#4] {\color{mellowyellow}{#5}};     }          \begin{frame}[allowframebreaks, noframenumbering]     \transduration{5}           \frametitle{\huge{\\[-8pt] Ongoing Jobs Around Site}}     {\tabulinesep=1mm\begin{longtabu}to\linewidth{|X[c,m]|X[c,m]|X[c,m]|}      \firsthline      \bfseries{Where?} & \bfseries{What?} & \bfseries{\vspace{4mm} Job Ref \& Status} %            \DTLforeach{CIS}{%      \ciskeywords=CISKeywords, \problemlocation=problemLocation, \jobrefid=jobRefId, \jobprogress=jobProgress}        {%       \\ \hline       \problemlocation & \ciskeywords &  \expandafter{\begin{tikzpicture}\jobindicator{ell1}{0}{0}{\expandafter{\jobprogress}}{\jobrefid} \end{tikzpicture}}       }      \\ \lasthline       \end{longtabu}}           \end{frame}      \end{document}


title: Subequations inside align result in too wide equation

text: I want to create subequations and allign them such that nice 'inquality constraints' arise. My current code:               \begin{subequations}     \begin{align}     a & \le b & \le c \label{eq:constr1}\\     d & \le effff & \le f \label{eq:constr1}\\     \end{align}     \label{eq:constr}%     \end{subequations}      The result in PDF is a much too large distance between "`b` and `c`" and "`efffff` and `f`". I would like to have `\le` exactly below eachother. Have `b` and `effff` centered between those. Finally `a` and `d` should be right aligned to the `\le` and `c` and `f` should be left aligned to the `\le`.


title: Add -shell-escape option to the LaTeX invocation of preview-latex in AUCTeX

text: I need `preview-latex` to use the `-shell-escape` option when it invokes PDFLaTeX, which is required by the `minted` package for syntax highlighting, as it invokes python. How can I do that?


title: Package listings doesn't work

text: I'm trying to understand how to use `listings`. In the preamble I have:               \usepackage {listings}      Inside my document I wrote:               \begin{lstlisting}     for i:=maxint to 0 do     begin     { nothing !}     end;     write(’Welcome !’);     \end{lstlisting}      It all doesn't work. I'm wondering why. MWE :               \documentclass[a4paper,singleside,11pt]{report}      \usepackage{ia_urb_thesis}      \usepackage[italian]{babel}      \usepackage[latin1]{inputenc}      \usepackage[T1]{fontenc}      \usepackage{graphicx}      \titolo{xxxxxx... \[5mm] }      \candidato{io}      \relatore{Chiar.mo Prof.~A}      \annoaccademico{2011-2012}      \copertinatesi \dedica{Ai miei genitori}      \indice \indicefigure \indicetabelle \iniziatesto      \include{cap_1}      \include{cap_2}      \appendix      \include{app_a}      \include{biblio}      \ringraziamenti Vorrei ringraziare ...      \end{document}


title: How to make LaTeX code from the pdf file?

text: I am now on a project on translation a book from English to my native language. I always tried to do it as nearest to the orginal book as possible, and I used LaTeX for that. But my attempt failed, since I do not know much LaTeX to produce the same file. I will upload here my source LaTeX code, some original pages and hope you can help me to find the right LaTeX code that produce the same result: Here is the picture of some special original page: ![Picture for part 1](http://i.stack.imgur.com/NWOU5.png) ![Section in part](http://i.stack.imgur.com/K7g74.png) ![Header](http://i.stack.imgur.com/0E8Hj.png) ![Header](http://i.stack.imgur.com/is6qk.png) Here is my LaTeX code:               \documentclass{article}      \usepackage[utf8]{vietnam}     \usepackage{natbib}     \usepackage{graphicx}     \begin{titlepage}          \vspace*{3.5cm}     \centerline{\Huge\bf Vòng quay của thời gian}     \vspace*{1cm}     \centerline{\Huge \bf \it Một cái nhìn đặc biệt mới về vũ trụ}     \vspace*{5cm}     \centerline{\bf Tác giả: Roger Penrose}     \vspace*{0.5cm}      \centerline{\bf Dịch bởi : Nguyễn Duy Khánh}     \vspace*{0.5cm}     \centerline{\bf Hà Nội, 12-03-2013}     \vspace*{3cm}     \centerline{\bf VIỆN HÀN LÂM OLIMPIA BẤT TỬ}     \end{titlepage}     \newpage     \usepackage[top=3cm, bottom=3cm, left=2cm, right=2cm] {geometry}     \begin{document}          \newpage     \vspace*{6.5cm}     \centerline{\it \Large Trang này cố ý bị bỏ trống}     \pagebreak          \centerline{\Large \textbf{Phần 1}}     \vspace*{1cm}     \centerline{\Large \textbf{Định luật hai của nhiệt động học và bí ẩn đằng sau nó}}     \vspace*{3cm}     \centerline{\textbf{1.1 Sự phát triển không ngừng của ngẫu nhiên}}     \vspace*{0.7cm}     \centerline{\textbf{1.2 Entropy, việc đếm trạng thái}}     \vspace*{0.7cm}     \centerline{\textbf{1.3 Không gian pha, và định nghĩa entropy của Boltzmann}}     \vspace*{0.7cm}     \centerline{\textbf{1.4 Sức mạnh bền vững của khái niệm entropy}}     \vspace*{0.7cm}     \centerline{\textbf{1.5 Sự phát triển không thể lay chuyển của entropy trong tương lai}}     \vspace*{0.7cm}     \centerline{\textbf{1.6 Tại sao quá khứ lại khác biệt}}          \pagebreak     \centerline{\textbf{1.1 Sự phát triển không ngừng của ngẫu nhiên}}     \vspace*{3cm}          \noindent Định luật thứ 2 của nhiệt động lực học là gì ? Vai trò trung tâm của nó trong hành xử vật lý thế nào ?       Here are some corresponding picture: ![enter image description here](http://i.stack.imgur.com/3B68k.png) ![enter image description here](http://i.stack.imgur.com/KRzKL.png) My question is: How can I change my LaTeX code to get the header and the title page like the original one? I know that if I keep using my code, then LaTeX will not auto name the header if I use fancy package. Please help me. If mod feel something not appropriate here, please help me to edit. **Update** : Besides the purpose of approximation the original book, which is in fact : Cycle of Time : An Extraordinary New View of the Universe by Sir Roger Penrose, since I really like this type of page layout and decoration, I really want to know what LaTex code can give me this results. I got only the answer of David Carlisle, thank David for that, but it is only some suggestion. I hope you can help me or just ignore if my question bothers you :|


title: Call the current section name from within a subsection

text: I'm within a beamer presentation (again) and trying to get a frame title to automatically print the title of the section from within a subsection. The code (with example of what I'd like to do) looks like this:               \documentclass{beamer}     \mode<presentation>     \title[Title]{Title}     \author{My Name}     \institute{Where I am}     \date{September 2013}     \begin{document}     \begin{frame}     \section{SECTION NAME}     \subsection{Subsection Name}     \begin{frame}{"SECTION NAME": Title of Frame}     Content     \end{frame}      To be clear, I'd like the "SECTION NAME" in quote marks to automatically pull the text of `\section{SECTION NAME}` Thanks! **UPDATE:** Thanks to moewe, the solution was found. It comes from this article. The updated code looks like this:               \documentclass{beamer}     \usepackage{nameref}     \mode<presentation>     \title[Title]{Title}     \author{My Name}     \institute{Where I am}     \date{September 2013}     \begin{document}     \begin{frame}     \section{SECTION NAME}\label{itsname}     \subsection{Subsection Name}     \begin{frame}{\label{itsname}: Title of Frame}     Content     \end{frame}


title: Why do I get an unnecessary blank page between abstract and acknowledgement?

text: There is an unnecessary blank page between abstract and acknowledgement. The content of `abstract.tex` is between `\begin{abstract}` and `\end{abstract}`. The content of `ack.tex` starts with `\chapter*{Acknowledgement}`. Can you tell me how I can remove this blank page? More importantly why am I getting this blank page? Acknowledgement is starting at 8th page in the generated pdf while abstract finishes at 6th page. The same problem (blank page) occurs between the last chapter and author's publications. The content of `pub.tex` starts with `\chapter*{Author's Publications}`. Another problem is that despite doing an `openright` except the first chapter all my chapters are beginning on an even numbered page. I thought these two might be related. UPDATE: A compilable file               \documentclass[12pt, a4paper, twoside, openright]{memoir}          % \includeonly{./chapters/conclusion/conclusion}          \usepackage{graphicx} % For inserting graphics in the page     \usepackage{epstopdf} % For automatically converting eps images to pdf while using pdflatex     \usepackage{dblfloatfix} % For using a "b" as placement specifier for a page wide image     \usepackage{fixltx2e} % For ensuring correct image numbering when we use \figure*     \usepackage{mathtools} % For using mathematics environments     \usepackage{amsfonts} % For using text formatting in equations eg \mathbf     \usepackage{algorithm} % For wrapping algorithmic environment to produce a floating environment.     \usepackage{algorithmic} % For using algorithmic environment     \usepackage{threeparttable} % For adding footnotes to the table     \usepackage{subcaption} % For putting multiple figures within a single figure environment     \usepackage{tikz} % For drawing          \setsecnumdepth{subsubsection}          \begin{document}     \null\thispagestyle{empty}\newpage          % title page     \begin{titlingpage}         ASD     \end{titlingpage}          % page numbering with roman     \pagenumbering{roman}     % Increase line spacing     \DoubleSpacing          % abstract     \begin{abstract}         Asd     \end{abstract}          % Acknowledgement     \chapter*{Acknowledgement}         Asd          % Table of contents     \newpage     \tableofcontents          % List of figures     \newpage     \listoffigures          % List of tables     \newpage     \listoftables          \mainmatter          % Reset page numbering with arabic     \pagenumbering {arabic}          \chapter{Intro}         Asd     \chapter{Literature}         Asd     \chapter{GSNN}         Asd     \chapter{SASNN}         Asd     \chapter{Conclusions}         Asd          \backmatter     \chapter*{Author's Publications}         Asd          \end{document}      UPDATE: The blank page between abstract is coming because going by the numbering in the document abstract ends at iii and since I use `\chapter*` achnowledgement begins on page iv. I tried cutting down the abstract to finish it on page ii then there is no blank page. Can someone tell me how I can suppress this blank page or is there a better alternative? UPDATE: The even numbered pages was because I was using `\include` which uses `\clearpage`. After I use `\input` all chapters are now beginning on odd numbered pages.


title: How to make a box around an equation in align-environment

text: I would like to draw a frame around one equation to point it out. I used               \fbox{...}       but it didn't work out. Here is a minimal example where I tried it. Any package suggestions?               \documentclass[         german,         paper=a4,         ]{scrbook}              %KOMA-     \usepackage[latin1]{inputenc}     \usepackage[ngerman]{babel}           \usepackage[babel,german=guillemets]{csquotes}     \usepackage[T1]{fontenc}         \usepackage{amsmath}          \begin{document}          \begin{align}     Nu_\text{m}        &= \frac{\alpha_m \, L}{\lambda}    \text{ \quad .} \\      Nu_\text{m}        &= \frac{\alpha_m \, L}{\lambda}    \text{ \quad .}     \end{align}          \end{document}


title: Thermistor in Tikz circuit library

text: Is there a symbol like a thermistor in the Tikz circuit library? I read the documentation and couldn't find anything like it. There is a symbol for a varistor but what I'm looking for would be something like this: ![thermistor](http://i.stack.imgur.com/E5M6e.png) rather than this: ![enter image description here](http://i.stack.imgur.com/pomnI.png)


title: Change height of a math command

text: I want to change the effective height of the `\ket{...}` command (from the `braket` package). I _don't_ want to change the visual appearance of the ket, I just want change its _effective_ height. Ideally this change would be in both directions, i.e. it would be slightly bigger both above and below. _Is this possible?_ ## The current behavior: If I do `\left( \ket{x} \right)`, then the parentheses are the exact same height as the ket, which is not visually pleasing and can be very confusing when using `\rangle` instead of parentheses. ## The desired outcome: If I do `\left( \ket{x} \right)`, then the resulting parentheses should be slightly bigger then the ket (as if the ket were slightly bigger then it looks). The output should be roughly the same as `\big( \ket{x} \big)` (perhaps a little bigger).   The reason I can't just use `\big` instead of `\left\right` is that the parenthesis might contain other stuff (for which `left\right` is more appropriate) and I don't want to have to edit this in a case-by-case basis. I feel like it must be possible to make latex think that command is a little taller than it actually is, so that the parentheses will look right automatically.


title: Order Bibliography alphabetically (author and titles)

text: I'm writing a paper using `jurabib`. The problem I have is that in the bibliography the entries are well sorted by author, but where an author has more than one entry these are not in alphabetical order. I guess that they are sorted by the type of entry (book, article, phdthesis). How can I get the entries sorted by author AND title in alphabetical order?               \documentclass[fontsize=10pt, fleqn, pdftex, version=last, x11names,pointlessnmbers]{scrartcl}     \usepackage[howcited=normal, authorformat=smallcaps]{jurabib}      These would be the `.bib` file entries:               @article{PBadh,     Author = {Peter B{\"o}ckli},     Date-Added = {2013-09-23 16:44:10 +0200},     Date-Modified = {2013-09-23 16:46:41 +0200},     Howcited = {\textsc{B{\"o}ckli}, Ad hoc Publizit{\"a}t},     Journal = {\textsc{B{\"u}hler} (Hrsg.), Informationspflichten des Unternehmens im Gesellschafts- und B{\"o}rsenrecht,},     Keywords = {GC 89029},     Pages = {87-XX},     Shorttitle = {Ad hoc Publizit{\"a}t},     Title = {Ad hoc Publizit{\"a}t und Insiderstrafnorm: Nach und Feinschliff f{\"u}r das Informationsrecht des kapitalmarktes},     Year = {Bern/Stuttgart/Wien 2003}}          @article{PBInsich,     Author = {Peter B{\"o}ckli},     Date-Added = {2013-08-26 10:44:52 +0200},     Date-Modified = {2013-09-20 10:12:18 +0200},     Howcited = {\textsc{B{\"o}ckli}, Insichgesch{\"a}fte},     Journal = {Gesellschafts- und Kapitalmarktrecht},     Pages = {354-371},     Shorttitle = {Insichgesch{\"a}fte},     Title = {Insichgesch{\"a}fte und Interessenkonflikte im Verwaltungsrat: Heutige Rechtslage und Blick auf den kommenden Art. 717a E-OR},     Volume = {(3)},     Year = {2012}}          @book{PBIns,     Author = {Peter B{\"o}ckli},     Date-Added = {2013-08-20 09:30:03 +0200},     Date-Modified = {2013-09-20 10:12:03 +0200},     Howcited = {\textsc{B{\"o}ckli}, Insiderstrafrecht},     Publisher = {Z{\"u}rich},     Shorttitle = {Insiderstrafrecht},     Title = {Insiderstrafrecht und Verantwortung des Verwaltungsrates},     Year = {1989}}           @article{PBBP,     Author = {Peter B{\"o}ckli},     Date-Added = {2013-08-26 11:27:44 +0200},     Date-Modified = {2013-09-20 10:11:50 +0200},     Howcited = {\textsc{B{\"o}ckli}, R{\"u}ckkauf nichtkotierter eigener Aktien},     Journal = {Der Schweizer Treuh{\"a}nder},     Pages = {575-586},     Shorttitle = {R{\"u}ckkauf nichtkotierter eigener Aktien},     Title = {Neun Regeln der ''Best Practice'' f{\"u}r den R{\"u}ckkauf nichtkotierter eigener Aktien},     Volume = {(6-7)},     Year = {2001}}           @book{PB,     Author = {Peter B{\"o}ckli},     Date-Added = {2013-07-10 11:04:12 +0200},     Date-Modified = {2013-09-20 10:11:12 +0200},     Edition = {4},     Howcited = {\textsc{B{\"o}ckli}, Schweizer Aktienrecht},     Publisher = {Z{\"u}rich},     Shorttitle = {Schweizer Aktienreecht},     Title = {Schweizer Aktienrecht},     Year = {2009}}      As I would expect I should have the following order: >   1. PBadh >   2. PBInsich >   3. PBIns >   4. PBBP >   5. PB > As it turns out, that's exactly the order I have in the bib-file. However in the bibliography I get the following order: >   1. PBIns >   2. PBBP >   3. PB >   4. PBInsich >   5. PBadh >


title: Combining TikZ foreach and let operation

text: I'm not having any luck using the TikZ `let` operation inside a `foreach` loop. Is there anything I'm missing? Sample code (that doesn't work):               \begin{tikzpicture}       \foreach \y in {1,2,3}          {\draw (0,0) -- (3,\y);           \draw let              \p1 = (3,\y),             \n1 = {atan2(\x1,\y1)} in           (\y,0) arc [start angle = 0, end angle = \n1, radius=\y];           }     \end{tikzpicture}


title: Tikz \draw not working with several tikzpictures on the same page

text: I need to output a bunch of number lines from a program, to latex, and I'm using tikz. On these number lines, some areas need to be highlighted, like in the first line of the picture. However, if a have two of these lines on the same page, the highlights do not show up in the second picture.                   \documentclass[a4paper,10pt]{article}         \usepackage[utf8]{inputenc}         \usepackage{tikz}              \begin{document}              \begin{tikzpicture}[scale=1.5]          \draw[latex-latex] (-4.5,0) -- (4.5,0) ;         \foreach \x in  {-3,-2,-1,0,1,2,3}         \draw[shift={(\x,0)},color=black] (0pt,3pt) -- (0pt,-3pt);         \foreach \x in {-4,-3,-2,-1,0,1,2,3,4}         \draw[shift={(\x,0)},color=black] (0pt,0pt) -- (0pt,-3pt) node[below] {$\x$};          \draw[very thick] (0.00,0) -- (1.00,0);          \draw[very thick] (2.00,0) -- (2.50,0);          \end{tikzpicture}              \begin{tikzpicture}[scale=1.5]          \draw[latex-latex] (-4.5,0) -- (4.5,0) ;         \foreach \x in  {-3,-2,-1,0,1,2,3}         \draw[shift={(\x,0)},color=black] (0pt,3pt) -- (0pt,-3pt);         \foreach \x in {-4,-3,-2,-1,0,1,2,3,4}         \draw[shift={(\x,0)},color=black] (0pt,0pt) -- (0pt,-3pt) node[below] {$\x$};          \draw[very thick] (0.00,0) -- (1.00,0);          \draw[very thick] (2.00,0) -- (2.50,0);          \end{tikzpicture}              \end{document}      With this it draws the second line just like the first, but without the highlights. If I insert a \newpage between them it works fine. Any ideas how to correct this, and get it to draw it properly?


title: Create short bibliography with bibtexkeys from aux files (biblatex)?

text: I have a draft version of a large latex document with a long bibliography (>30 pages long). It has been created with `biblatex` and has about 330 entries. I'm editing a printout of the draft version and I'd like to create a short version of the bibliography to have a more compact copy which contains   * the bibtexkey for each entry   * the number (like [3])   * and the most important data of the entry (title, year, authors, where published, pages) - no URLs Is there an easy way to do that in a separate document?


title: How to denote a logical matrix (mask) as used in image processing?

text: **Updated Below** In my thesis, I am discussing an image processing mask, which is a matrix of the same size as some image but with ones where that image meets some criteria and zeroes elsewhere. I am wondering what is a good way to describe such a matrix mathematically? As an example, suppose I have two grayscale images Z1 and Z2, and a matrix M_BothSat that has ones wherever both images are above some saturation threshold t_OS. How would I describe M_BothSat so that   1. It's clear what M_BothSat is.   2. The notation is rigorous enough mathematically for an engineering master's thesis.   3. I can define more masks in the future without introducing ambiguity or conflicting definitions with earlier masks.  I realize this is more a math question than Latex, but I'm betting this is the best place to get an answer to it. I have included an example of what I'm trying to do below, and several different options I've looked at that all say the same thing in different ways. The red text is my thoughts on each, the black is what I'm proposing using in my thesis. Can anyone either tell me which of these approaches is the best, or suggest another better form of notation, that would be great. My set notation's a little rusty. Thanks.               \documentclass[12pt, oneside]{report}      \usepackage[english]{babel}         \usepackage{blindtext}     \usepackage{color}     \usepackage{amsmath}     \newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}           \begin{document}          \textcolor{red}{     \textbf{Option 0}     This option uses a combination of plain english and math equation. It works nicely for here, but I'm going to define a series of logical masks $\mat{M}$, and seems it will be confusing to redefine $m_{i,j}$ repeatedly.      }          The areas \textit{saturated in both} images are given by the set $\mat{M}_{BothSat}$ of logical values $m_{i,j}$ such that           \begin{equation}             m_{i,j} = \begin{cases} 1 & \text{if} \quad  z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\                                                                                0 & \text{if} \quad  \text{else}                                          \end{cases},     \end{equation}                        \textcolor{red}{     \textbf{Option 1}     This expresses what I'm trying to say: $\mat{M}_{BothSat}$ is a matrix the same size as $\mat{Z}$, with ones where $\mat{Z_1}$ and $\mat{Z_2}$ are both less than some threshold $t_{OS}$. However, to my eye this looks horrible. with the two opening squiggly braces. If the one beginning the cases could be made thinner, so that the one closing the overall set is less ambiguous, that might work. }          \begin{equation}             \mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{cases} 1 & \text{if} \quad  z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\                                                                                0 & \text{if} \quad  \text{else}                                                                                \end{cases}                                                                                \right\},     \end{equation}          \textcolor{red}{     \textbf{Option 2}     This tries to say the same thing, but breaking it apart into two equations. Will this option be confusing if I define a series of different masks $\mat{M}$ with equations like this where each one contains a line defining $m_{i,j}$? }          \begin{gather}             \mat{M}_{BothSat} = \left\{ m_{i,j} \right\} \nonumber             \\m_{i,j} = \begin{cases} 1 & \text{if} \quad  z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\                                                                                0 & \text{if} \quad  \text{else}                                          \end{cases},     \end{gather}          \end{document}      **Update** I found another post on here about modifying the cases environment, and I used that approach to add a closing brace to the cases environment so it can be placed inside a set notation, thereby making the set's closing brace slightly less visually confusing. Any feedback? Here's an example:               \documentclass{article}     \usepackage[english]{babel}     \usepackage{amsmath}     \DeclareMathOperator{\rank}{rank}          \makeatletter             \newenvironment{closedcases}{%                 \matrix@check\closedcases\env@closedcases             }{%                 \endarray\right\}% \right\lrack             }             \def\env@closedcases{%                 \let\@ifnextchar\new@ifnextchar                 \left\{                 \def\arraystretch{1.2}%                 \array{@{}l@{\quad}l@{}}%                        }     \makeatother          \newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}           \begin{document}          \begin{equation}             \mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{closedcases} 1 & \text{if} \quad  z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\                                                                                0 & \text{else}                                                                                \end{closedcases}                                                                                \right\},     \end{equation}          \end{document}      ![Cases within set notation](http://i.stack.imgur.com/85qdJ.jpg)


title: hypertarget works for files but not URLs

text: I want to link directly to a `\hypertarget` inside a document. If works file to file, but not to URL. The linking MWE:               \documentclass{article}     \usepackage{hyperref}          \hypersetup{pdftoolbar=true,pdfpagemode=UseNone,pdfstartview={FitH top},colorlinks=true,extension=pdf}          \hyperbaseurl{http://www.elfsoft2000.com/temp/}          \begin{document}     \href{hypertarget.pdf#target}{click here}     \end{document}      The target MWE:               \documentclass{article}     \usepackage{hyperref}          \hypersetup{pdftoolbar=true,pdfpagemode=UseNone,pdfstartview=FitH,         colorlinks=true,extension=}          \begin{document}     Nope, not right     \newpage     \hypertarget{target}{This is the target.}     \end{document}      I preloaded a copy onto my web site. You can switch from file-to-file to URL mode using the extension=.


title: \animategraphics cuts image

text: My image works perfectly with `\includegraphics`:               \includegraphics[height=1.0\textheight]{../../../movie/frinj_cII/movie20100}       but when I include it with `\animategrahics` ...               \animategraphics[height=1.0\textheight,loop]{10}{../../../movie/frinj_cII/movie2}{0100}{0100}      ... approximately the lower half of the image is cut off. Whats wrong ?


title: Dec sep align & \multicolumn incompatibility?

text: _As I did not get any answer, I decided to split the two question so that they appear less daunting. The initial question I am referring to isthis one_ Here is a table with _regular_ alignment mixed with `dec sep align`:               \documentclass{article}     \usepackage{pgfplotstable}     \usepackage{booktabs}     \begin{document}            \pgfplotstabletypeset[%       col sep=&, header=false,       every head row/.style={before row={\toprule%     \multicolumn{1}{l}{a}  & \multicolumn{1}{l}{b} & \multicolumn{1}{l}{c} &  \multicolumn{2}{l}{ddd ddd ddd}\\     % \multicolumn{2}{l}{Glonk}\\                                         }, after row={\midrule}                              },       every last row/.style={after row=\bottomrule},       display columns/0/.style={column name={Grandeur}, string type, column type={l}},       display columns/1/.style={column name={Unite}, string type, column type={l}},       display columns/2/.style={column name={Reference}, dec sep align={l}},       display columns/3/.style={column name={Reference}, dec sep align={l}},       display columns/4/.style={column name={Reference}, dec sep align={l}},                            ]       {%     glonk  &     z           &  323.1 & 323.1  & 323.1     plokt  &     y           &  33.12 & 33.12  & 33.12     jlorp  &     x           &  3.123 & 3.123  & 3.123       }          \end{document}      And here is what it produces: ![buggy-table 2](http://i.stack.imgur.com/H5Yx9.png) Somehow the width of the columns are incorrectly accounted for when using `dec sep align`. How could I correct this strange behaviour.


title: Command to set cycle list position?

text: Is there a command to (re)set the starting point of a cycle list? What I am using now is the `cycle list shift` command but I end up doing some time consuming calculations and my code is oftenless robust as it use the number of elements of the cycle list which I might want to change afterwards. Is there something like `set cyle list at` _n_? * * * _Edit: to clarify the point raised by Jake, here is an example of the two possible mode as I undestand them._ Mode 1:                \addplot    <- uses style 0      \addplot    <- uses style 1      \addplot    <- uses style 2          \pgfplotsset{cycle list set=5}      \addplot    <- uses style 5      \addplot    <- uses style 6      \addplot    <- uses style 7     …      Mode 2:                \addplot    <- uses style 0      \addplot    <- uses style 1      \addplot    <- uses style 2          \pgfplotsset{cycle list set just once=5}      \addplot    <- uses style 5      \addplot    <- uses style 4      \addplot    <- uses style 5     …      What I had in mind when asking the question was `mode 1`. Mode 2 could be interesting too, but maybe as a style:                \addplot[set cycle list=5]    <- uses style 5      There could be also `Mode 3`:                \addplot    <- uses style 0      \addplot    <- uses style 1      \addplot    <- uses style 2          \pgfplotsset{cycle list set=5}      \addplot    <- uses style 5      \addplot    <- uses style 5      \addplot    <- uses style 6      but this is more or les equivalent to `mode 2` (a shift of only one step is easily handled with `cycle list shift`).


title: Writing a macro in LaTeX for getting a vector i,j,k representation by passing parameters

text: I want to create a newcommand `\vecty` to create a vector which will take 3 parameters like `\vecty{1}{2}{3}` and this should display as `$\hat{i}+2\hat{j}+3\hat{k}$` and if I give `\vecty{0}{3}{-3}` then it should show `$3\hat{j}-3\hat{k}`. I am using LaTeX. I would appreciate any guidance that comes how to get through it. I did try `\ifthenelse` code but it turned to be quite hefty. You can have a look at the code. But I know that the code is too bad. Hence wanted to understand if there are other ways to implement it. Kindly help I m a newbie.


title: Small Caps Computer Modern Unicode problem

text: I want to use CMU with xelatex for my docs. Everything is working fine except small caps for greek letters. My input (code)               \documentclass{article}     \usepackage{xunicode,fontspec,xltxtra}     \usepackage{xgreek}     \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}     \setmainfont{CMU Serif}     \setromanfont{CMU Serif}     \setsansfont{CMU Sans Serif}     \setmonofont{CMU Typewriter Text}     \begin{document}     \noindent This is a greek text Ακολουθεί ελληνικό κείμενο\\     \textit{This is a greek text Ακολουθεί ελληνικό κείμενο}\\     \textsc{This is a greek text Ακολουθεί ελληνικό κείμενο}     \end{document}      The CMU news mention that **_Added Greek small capitals to CMUSerif-Roman, CMUSerif-Bold, CMUSansSerif, CMUSansSerif-Bold, CMUTypewriter-Regular_** I cannot figure what i am doing wrong.


title: \renewcommand{\bibheadtitle} not working with hyperref package

text: I had a document that properly divided my biblography into three sections with the help of **multibib** package, and forcing the Biliography Section Titles by means of a **\renewcommand{\bibheadtitle}** , but when I add the **hyperref** package I loose the titles of my Bibliographies and they go back to the standard "References" name. How can I preserve the names of my biblographies while using **hyperref**?               \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{mathptmx}     \usepackage[T1]{fontenc}     \usepackage{color}     \usepackage[latin1]{inputenc}     \usepackage{comment}     \usepackage{upgreek}     \renewcommand{\contentsname}{Índice}     \usepackage{authordate1-4}     \theoremstyle{definition} \newtheorem{defi}{Definición}[subsection]     \theoremstyle{plain} \newtheorem{teorema}[defi]{Teorema}     \theoremstyle{plain} \newtheorem{coro}[defi]{Corolario}             \usepackage{multibib}     \newcites{pri,sec}{Primari Sources,Secondary Sources}          \expandafter\def\expandafter\quote\expandafter{\quote\small}     \usepackage[colorlinks=true, backref]{hyperref}          \begin{document}          \include{aaa}     \include{bbb}          \renewcommand{\bibheadtitle}{Mixed Sources}     \bibliographystyle{authordate1}     \bibliography{Bibfile}          \renewcommand{\bibheadtitle}{Primary sources}     \bibliographystylepri{authordate1}     \bibliographypri{Bibfile}          \renewcommand{\bibheadtitle}{Secondary sources}     \bibliographystylesec{authordate1}     \bibliographysec{Bibfile}          \end{document}      I enclose a Minumun Working Example:               \documentclass[spanish,1p,20pt]{article}     \usepackage{multibib}     \newcites{prix,secx}{Primary Sources,Secondary Sources}               \begin{document}           Text          \cite{RefWorks:33}          \citeprix{RefWorks:22}          \citesecx{RefWorks:23}          \bibliographystyle{alpha}     \bibliography{Borradores}          \bibliographystyleprix{alpha}     \bibliographyprix{Borradores}          \bibliographystylesecx{alpha}     \bibliographysecx{Borradores}          \end{document}      This sample works fine until I add the following _Authordate_ package, that I need to format the style I'm forced to use:               \usepackage{authordate1-4}      Whether it is before or after _\usepackage{multibib}_ makes no difference. The problem is that my section **names** carefully inserted by _multibib_ package. The sections itself are preserved so I tell myself: perhaps I can just rename the sections. And certainly I can by coding a _\renewcommand{\bibtitle}{Fuentes primarias}_ to obtain a new Minimum Working Example:               \documentclass[spanish,1p,20pt]{article}          \usepackage{authordate1-4}          \usepackage{multibib}     \newcites{prix,secx}{Primary Sources,Secondary Sources}               \begin{document}          Text          \cite{RefWorks:33}          \citeprix{RefWorks:22}          \citesecx{RefWorks:23}               \renewcommand{\bibheadtitle}{Mixed Sources}     \bibliographystyle{authordate1}     \bibliography{Borradores}          \renewcommand{\bibtitle}{Fuentes primarias}     \bibliographystyleprix{authordate1}     \bibliographyprix{Borradores}          \renewcommand{\bibtitle}{Fuentes secundarias}     \bibliographystylesecx{authordate1}     \bibliographysecx{Borradores}          \end{document}


title: Problem with fancyhdr

text: I use package `fancyhdr` for make header and footer. I want to auto quote text in the chapter for right header. I use : `\rhead{\thechapter}` when latex show for me the number of chapter not text. Can you tell me : How to show text of chapter on the right header(auto) ? Thanks for hint . Now i have a new problems , if chapter name is very long , i want to have two line in header?


title: Moving a table all the way to the left side of the Page

text: I'm having trouble with a table I have made. It is too long and goes off of the page to the right. I have already made the font smaller and made the page landscape. What I need to do is have the table start farther to the left so the entire thing can fit. Right now the table will start on the indent from the left. In other words, having the entire table centered on the page.


title: Vertically center two side by side figures, leaving captions on the same line

text: I would like to place two independent figures (no subfigures) besides each other. Each figure should have its own caption. This approach uses two `minipage`s inside a `figure` environment and is nearly what I'm looking for. But my figures don't have the same height, so I want to center them vertically, whereas the captions should stay on the same line. Here is an example:               \documentclass{article}     \usepackage[demo]{graphicx}     \usepackage{caption}          \begin{document}          \begin{figure}     \centering     \begin{minipage}{.5\textwidth}       \centering       \includegraphics[width=.4\linewidth, height=.8\linewidth]{image1}       \captionof{figure}{A figure}       \label{fig:test1}     \end{minipage}%     \begin{minipage}{.5\textwidth}       \centering       \includegraphics[width=.4\linewidth, height=.4\linewidth]{image1}       \captionof{figure}{Another figure}       \label{fig:test2}     \end{minipage}     \end{figure}          \end{document}      This shows how the output looks vs. how I would like it to look: ![how it should look](http://i.stack.imgur.com/LDCTl.gif)


title: Math in picture environment

text: Is it possible to avoid excessive use of the symbol `$` in pictures containing a lot of formulas/math symbols? I mean to use `\put(m,n}{math}` instead of `\put(m,n}{$math$}`.


title: I'm confused about how expansion is happening here

text: I was really pleased that I could come up with a means of building the contents of a `tabular` environment using `\foreach \x in {...} {...}` structure. But I was curious about what exactly it would take to break my code. Here's my preamble, which works for generally _non-complex_ content (whatever that's supposed to mean):               \documentclass{article}     \usepackage[margin=0.5in]{geometry}     \usepackage{amsmath,amssymb,array}     \usepackage{booktabs}     \usepackage{etoolbox}     \usepackage{pgfkeys,pgffor}          \pgfkeys{/ae/agenda/.cd,       items for the agenda/.initial=,       title/.initial=,     }      \def\aeset#1{\pgfkeys{/ae/agenda/.cd,#1}}     \def\aeget#1{\pgfkeysvalueof{/ae/agenda/#1}}          \makeatletter          \newcounter{agendaitemcounter}     \def\agenda@item@number{%%       \stepcounter{agendaitemcounter}%%       \arabic{agendaitemcounter}.)}          \def\full@agenda{}     \long\def\build@agenda{%%       \foreach \x in \list@of@agenda@items {         \xdef\full@agenda{%%           \expandonce\full@agenda           \expandonce\agenda@item@number           \expandonce\aeamp           \expandonce\x           \noexpand\\           \noexpand\midrule}       }}          \def\setagenda#1{%%       \bgroup       \aeset{#1}%%       \edef\list@of@agenda@items{\aeget{items for the agenda}}%%       \build@agenda       \begin{minipage}[t]{4in}\centering         {\large \aeget{title}}%%         \par\vspace{1ex}         \begin{tabular}{cp{3in}}\toprule           \full@agenda          \bottomrule         \end{tabular}%%       \end{minipage}%%       \setcounter{agendaitemcounter}{0}%%       \egroup       \def\full@agenda{}%%       }          \makeatother          \renewcommand{\arraystretch}{1.5}          \def\aeamp{&}     \def\aepar{\par}     \def\dollars#1{\$#1}%$     \def\mypoly{\[x^2+1\]}          \pagestyle{empty}      So, I started playing with things to see where the macros in the preamble would break: it wasn't too hard to find something. The example code below compiles fine as written with the above preamble (except for the one commented-out line that contains `\noexpand\par`). However, if I start removing `\noexpand` commands from these _working_ lines, errors start popping up. What I can't quite understand is why certain structures don't break (e.g. `\frac{...}{...}`, `x^2`, and `\infty`) while other---superficially similar or simpler?---structures (e.g. `\cos` or `\$`) do break my code.               \begin{document}          \setagenda{       title={To-do list},       items for the agenda={%%         {Line of random content, but nothing too fancy.},         {Not too involved math: $x\cdot y$ },         {A bit more involved, but it works! $\displaystyle{}\frac{1}{2d}$ },         { Random collection of math symbols: $\inf \infty x^2+x$ },         %% I need to use `\noexpand` to avoid getting an error.         {This line works!\noexpand\aepar Hello world }         %%{This line fails!\noexpand\par Hello world }         { what follows fails without \noexpand\texttt{noexpand}},         { Trying something which covers multiple lines            \belowdisplayskip=0pt%%           \belowdisplayshortskip=0pt%%           \noexpand\mypoly         },         {Transfer \noexpand\dollars{3000} for trip to Venice},         { $x\noexpand\cos(x)$ How many suitcases do I need?},         { What's this going to result in?            \belowdisplayskip=0pt%%           \belowdisplayshortskip=0pt%%           \noexpand\[ x^2+1\noexpand\]         }       }%%     }          \vspace{1cm}          \setagenda{       title={something else},       items for the agenda={%%         {first item},         {second item}}}          \end{document}      Why is it that some math commands work and others don't. I thought that, because I'm issuing `\expandonce` in the macro used to build the contents of the `tabular` environment, these errors shouldn't arise. To labor the point a bit more, when I try to look at this in miniature, without all the noise of the `tabular` environment, I get even more confused. The following MWE compiles fine:               \documentclass{article}     \usepackage{etoolbox}     \usepackage{pgffor}     \begin{document}     \let\mytrial\relax     \foreach \x in {$\cos$,                     $x^2+x$}       {\xdef\mytrial{\x}}     \mytrial     \end{document}      So, there's nothing inherently evil about `\cos` and `\xdef` being used together. But when I try to make this look a bit more like the code above in `\setagenda`, things go awry in ways I can't quite fathom.               \documentclass{article}     \usepackage{etoolbox}     \usepackage{pgffor}     \begin{document}     \let\mytrial\relax     \foreach \x in {$\cos$,                     $x^2+x$}       {\xdef\mytrial{\mytrial\x}}     \mytrial     \end{document}      I don't even get an error. TeX just enters an infinite loop (it's as though there's a LaTeX3'ish quark in there or something). Well, I have `\let` something to be `\relax` in there. So, I tried               \documentclass{article}     \usepackage{etoolbox}     \usepackage{pgffor}     \begin{document}     \def\mytrial{\relax}     %%\def\mytrial{}%%<--- this line works too!     \foreach \x in {$\cos$,                     $x^2+x$}       {\xdef\mytrial{\mytrial\x}}     \mytrial     \end{document}      which does work, which totally flabbergasts me! How is this last example any different from what I'm doing inside `\setagenda`? There aren't even any `\expandonce` commands in there to _save_ things for later. My understanding of `\noexpand\x` is that               \xdef\mycmd{\noexpand\somecmd}      results in               \mycmd=\somecmd      My understanding of `\expandonce\x` where `\x=\noexpand\cos` is that               \xdef\mycmd{\expandonce\x}      results in               \mycmd=\noexpand\cos      So if I've got something like               \mycmd=\noexpand\cos     \x=\noexpand\tan      and then try               \xdef\mycmd{\expandonce\mycmd \expandonce\x}      I expect the result to be               \mycmd=\noexpand\cos \noexpand\tan      What's happening? What am I not understanding here? I guess I should conclude that there's something going on inside the `tabular` environment that I haven't tapped yet with my examples. But I'm not really sure what that would be.


title: Using custom \locallabels command with custom \eqref command

text: I am trying to restrict refs' and labels' scopes to certain sections of a LaTeX document. Cf. this question. I have a custom `\locallabels{}` command, modified from here, and a custom `\eq{}` command:               \documentclass{article}          \AtBeginDocument{%       \let\origref\ref \let\origpageref\pageref \let\origlabel\label \let\origeqref\eqref \newcommand\locallabels[1]{%         \renewcommand\label[1]{\origlabel{#1##1}}% ← notice the change here:         \renewcommand\ref[1]{\origref{#1##1}}% ##1#1, not #1##1         \renewcommand\pageref[1]{\origpageref{#1##1}}%         \renewcommand\eqref[1]{\origeqref{#1##1}}%       }}          \usepackage{amsmath}          \newcommand{\eq}[1]{\eqref{eq:#1}}          \begin{document}          \section{Section 1}     \label{sec}          \begin{equation}       \label{eq:1}       \int3x+4\pi\,dx     \end{equation}           \eq{1} should give (1), but it actually gives (2).          \locallabels{:sec2}     \section{Section 2}     \label{sec2}          \begin{equation}       \label{eq:1}       \int6x+3y\,dx     \end{equation}           \eq{1} should give (2), but it gives "(??)".          \end{document}      Why do I get unresolved references, "(??)" for the second `\eq{1}`? Why do I get "(1)" for the first `\eq{1}`? UPDATE: I discovered that `hyperref` (not included in the above MWE) complicates things. See the comments below. Also, how would I define a command that would turn off `\locallabels{}`'s effect for a certain reference. E.g., this doesn't work:               \newcommand{\refnolocallabels}[2]{\locallabels{}\ref{#1}\locallabels{#2}}      thanks


title: How to embed abstract as an XMP metadata?

text: Can `hyperxmp` embed the document's abstract as an XMP metadata in LaTeX? If not, can anyone suggest a way on how I can execute this?


title: Latex posters - to scale or not to scale

text: I am designing a rather large poster (850mm x 2150mm) and trying to figure out whether to create it in actual size or whether to create a smaller version and scale it up afterwards. The two comments under an answer that recommends scaling up make good points against it: > I recommend creating the poster in its true size, since that will enable > commands like `\vspace{1cm}` to do what's expected. – Ben Jan 30 '11 at > 18:48 > > Another reason for creating your poster in its original size is that if you > use a font with optical scaling, then you will get the correct weight. > (Large fonts != small fonts scaled up). See this question for example. – > mforbes Dec 8 '11 at 5:42 "this question" is about optical font size which implies that fonts are designed for a particular size, so you should always select the correct font size rather than scale another one. Stephan Lemke, however, argues the exact opposite, also for optical font size reasons. So: To scale or not to scale? If I try to use a 32pt font, is that not a scaled up version anyway? Or is it a matter of creating the poster in real size but use all the different font sizes scaled up by the same amount (i.e. redefine `\large` as being \cmr12 at 32pt, for example)?


title: pgfplotstable: fixed precision, switch-case?

text: I tried using `pgfplotstable` to format an external txt file, but some problems arrived. My goal is to show the numbers with fixed, fixed zerofill, precision two and with the presign, which should result in numbers like -0.30 -0.10 -0.00 +0.00 ... Additionally I want that the values between -0.05 and 0 are display in red and the values between 0.00 and 0.05 are displayed in green. Problems: 1) I could not combine the `fixed,fixed zerofill,precision=2` and `pgfplotstabletypeset` 2) Does some switch-case structure exist for my 3 cases problem? My try was:               \documentclass[a4paper,6pt]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[left=0cm,right=1cm,margin=1in,bottom=1in]{geometry}          \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{booktabs}     \usepackage{array}     \usepackage{colortbl}          %\pgfkeys{/pgf/number format/showpos}          \begin{document}          \pgfplotstableset{fixed,fixed zerofill,precision=2}          \def\bordervalue{0}     \pgfplotstabletypeset [     assume math mode=false,     postproc cell content/.style={@cell content={     \pgfmathparse{int(less(abs(#1),0.05)) }         \ifnum\pgfmathresult=1       \color{red} #1        \else            \color{black} #1         \fi        }       }     ]{G.txt}          %\pgfmathparse{int(less(abs(#1),0.05)}% + 2*int(greater(#1,0)) + 1*int(less(#1,0)) }               \end{document}      The input file G.txt could be found on http://pastebin.ca/2460404.


title: Suggestions for splitting a large fractional equation?

text: I have seen a number of questions detailing specific means for how to break down a given equation, however I am more interested in the design at this point. That is, I'm not sure what part of this equation is suitable to be split. I have an equation that will not fit in a single column as is:               \documentclass{article}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath     \begin{document}     \begin{equation}       p_{ij,k} = \begin{cases}         \frac{           [\tau_{ij,1}]^{\lambda_k \alpha} \cdot [\tau_{ij,2}]^{(1-\lambda_k)\alpha} \cdot   [\eta_{ij,1}]^{\lambda_k \beta} \cdot [\eta_{ij,2}]^{(1-\lambda_k)\beta}         }         {           \sum_{h \in N_i} [\tau_{ih,1}]^{\lambda_k \alpha} \cdot [\tau_{ih,2}]^{(1-\lambda_k)\alpha} \cdot [\eta_{ih,1}]^{\lambda_k \beta} \cdot [\eta_{ih,2}]^{(1-\lambda_k)\beta}         } & \textrm{ if }j \in N_i \\         0&\textrm{ otherwise} \\       \end{cases}     \end{equation}     \end{document}      The problem is that both the numerator and the denominator would need to be split, and I'm not sure of a way to do this that would still look appropriate. Any suggestions?


title: Shaded continuous across new enumerate environment

text: I'm trying to write up solutions where I include the original problem text, in a light gray shaded box. I had been creating the shading with the 'framed' package `shaded` environment, but some of the problems have enumerated parts, with some text before the parts. I would like to have the starting text and the first part continuously shaded, but apparently the `shaded` environment can't cross a `\begin{enumerate}`. So what I have right now is               \begin{shaded}Starting text...\end{shaded}     \begin{enumerate}     \begin{shaded}\item This is the first problem.\end{shaded}     This is the first solution.     \begin{shaded}\item This is the second problem.\end{shaded}     Second solution.     \end{enumerate}      Is there a way to have the shading continuous instead of that first gap?


title: Bibtex references coming out as (<number>) instead of (Author, year)

text: I am having trouble with the following code to make my \citep{} references come out as (Author, Year) instead of ().               \documentclass[12pt]{article}     \usepackage{cite}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{refstyle}     \usepackage{pdfpages}     \usepackage{amsmath}     \usepackage{relsize}     \usepackage{booktabs}     \usepackage[round, authoryear]{natbib}     \usepackage{apalike}     %\usepackage{apacite}     \usepackage{setspace}          \citep{<somename>}          \bibliography{GDBibliography}     \bibliographystyle{apalike}          \end{document}      The error I get when I compile is: ! Package natbib Error: Bibliography not compatible with author-year citations. Anyone have any suggestions for me?


title: Wrapping and aligning pspicture in the top left corner with first line text

text: I want to align the `pspicture` into the top-left corner of the page. Currently it is slightly below the header text when I want those two to be aligned up together. The table for the Email/Website information is slightly indented so I want to remove that indentation as well. I also want the "Lorem Ipsum Dolor" section to have no indent but I know how to fix that. Right so here's what my `.tex` file looks like:               % LaTeX CV     \documentclass[final,a4paper,notitlepage,10pt]{report}          %%% Packages %%%     \usepackage[utf8]{inputenc} % inputenc for encoding to utf8     \usepackage{auto-pst-pdf}   % auto-pst-pdf converts pst to pdf     \usepackage{pst-barcode}    % pst-barcode try implement QR code     \usepackage{multicol}   % multicol used for multiple columns     \usepackage[paper=a4paper,left=0.7cm,right=0.7cm,top=0.7cm,bottom=0.7cm,noheadfoot]{geometry}   % geometry for margins     \usepackage[hidelinks,breaklinks]{hyperref} % hyperref for linking references for pdf     \usepackage{wrapfig}    % wrapfig to wrap text around figures     \usepackage{mdwlist}    % mdwlist for compact enumeration/list items     \usepackage[compact]{titlesec}  % titlesec for title section layout     \usepackage{mdwlist}    % mdwlist for compact enumeration/list items          % Rule settings     \hyphenpenalty=5000     \tolerance=1000          % for mailto command     \newcommand{\mailto}[1]{\href{mailto:#1}{#1}}          % Name and contact information     \newcommand{\name}{FirstName LastName}     \newcommand{\addr}{123 Fake Street, London, XX00 0XX, England}     \newcommand{\phone}{+44 123 456 6789}     \newcommand{\email}{\mailto{email@example.com}}     \newcommand{\website}{\href{http://google.com}{http://google.com}}          % change itemize to be compact     \makecompactlist{compactitemize}{itemize}          % tweak title spacing     \titlespacing{\section}{0pt}{*2}{*0}     \titlespacing{\subsection}{0pt}{*2}{*0}     \titlespacing{\subsubsection}{0pt}{*2}{*0}          % disables chapter, section and subsection numbering     \setcounter{secnumdepth}{-1}           % set paragraph indent to 0     \setlength\parindent{0pt}          % begin actual CV     \begin{document}     \thispagestyle{empty}   % this page does not have a header          \begin{wrapfigure}[5]{l}{1.2in}     \begin{pspicture}(1in,1in)     % The MECARD format is used to exchange contact information.     \psbarcode{MECARD:N:LastName,FirstName;EMAIL:email@example.com;URL:http://google.com;}}{}{qrcode}     \end{pspicture}     \end{wrapfigure}          \noindent \textbf{\LARGE \name }\\     \textit{     \begin{tabular}{l l}\\     Email: \email\ & Address: \addr \\     Web: \website\ & Mobile: \phone \\     \end{tabular}     }\\     Objective: Lorem ipsum dolor sit amet, consectetur adipisicing elit.\\          \section{Lorem Ipsum Dolor}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.          \end{document}      How can I align the top of the `pspicture` with the text? Should I use a `minipage` enviroment? Should I use a different tabular package for the table? The generated PDF document looks similar to: ![enter image description here](http://i.stack.imgur.com/UXnon.png)


title: \includegraphics[width=40mm], reserves correct space, but includes full size image

text: I'm using the following code to include an image. The reserved space in the resulting .pdf document is correct and changes according to the width I set. Nevertheless, the .png is always embedded in full size and doesn't change with the width parameter. I read in other posts, that maybe the .png is missing resolution information. But I changed the resolution with Photoshop and had no success either. I also added the `resolution` parameter to `\includegraphics`, with no luck.               \begin{figure}[bbp]     \centering     \includegraphics[resolution=72, width=40mm]{bilder/rmv_tag.png}     \caption[RMV-Kontaktpunkt am Bahnhof]{RMV-Kontaktpunkt am Bahnhof, Quelle:     http://goo.gl/i1k0l}     \label{pic:rmv}     \end{figure}      I'm using the graphicx-package and pdflatex on my mac. * * * Update: This is my image: ![enter image description here](http://i.stack.imgur.com/2qiom.png)


title: How to make time-dependent code?

text: I would like to create a command `\ifafter{year}{month}{day}{yes}{no}` so that if the current date is after `year`/`month`/`day`, the command would produce `yes`, and otherwise produce `no`. I came up with a solution, and I wanted to document it as well as see other solutions. Natural generalizations, e.g. a version that compares the current time with `hour` : `minute` : `second`, a version that checks whether `year`/`month`/`day` is further than `x` days in the future (or past), etc., would also be welcomed.


title: Tikz Graphics: Curved arrow drawn parallel to curved line

text: Drawing a short directional arrow, lying parallel to a straight line A-B, is pretty trivial to accomplish using Tikz;               \documentclass{article}     \usepackage{tikz} \usetikzlibrary{calc} \tikzset{>=latex}     \begin{document}              \begin{tikzpicture}             \draw (0,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$A$}}] (A) {};               \draw (1,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$B$}}] (B) {};                   \draw (A) to (B);                \draw ($(A)!0.15!(B) + (0,0.02)$) node (a) {};              \draw ($(A)!0.35!(B) + (0,0.02)$) node (b) {};                   \draw[->>] (a) to (b);         \end{tikzpicture}          \end{document}       ![\(Correct\) Straight line, with parallel straight directional arrow](http://i.stack.imgur.com/2hZXk.gif) However, drawing a short **curved** directional arrow, lying parallel to a **curved** line C-D, seems to be far more complicated, since the directional arrow's curvature and end points need to be shifted relative to the shape of the curved line;               \documentclass{article}     \usepackage{tikz} \usetikzlibrary{calc} \tikzset{>=latex}     \begin{document}              \begin{tikzpicture}             \draw (0,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$C$}}] (C) {};               \draw (1,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$D$}}] (D) {};                   \draw (C) to [bend left=45] (D);             \draw ($(C)!0.15!(D) + (0,0.02)$) node (c) {};              \draw ($(C)!0.35!(D) + (0,0.02)$) node (d) {};                           \draw[->>] (c) to [bend left=45] (d);         \end{tikzpicture}          \end{document}       ![\(Incorrect\) Curved line, with parallel curved directional arrow](http://i.stack.imgur.com/OshyX.gif) I realise that the problem lies with the fact that the short directional arrow's endpoints are defined differently to those of the curved line C-D, and thus, using the `[bend left=45]` angle option within both curved arrow/line definitions plots the incorrect `tikzpicture` above. The answered question 2 arrows at same distance successfully tackles the problem for lines/directional arrows of equal length, but I ran into difficulties when trying to modify its answer for plotting short arrows lying alongside long lines; my main problem was defining and positioning two "extra" thick white lines with which to cover/shorten the directional arrow. Has anyone managed to modify the above answer to answer my question? I also guessed that `[bend left=45]` curves were mathematically defined in Tikz using a parabola equation, which then allowed me to produce the desired curved directional arrow/curved line E-F plot below;               \documentclass{article}     \usepackage{tikz} \usetikzlibrary{calc} \tikzset{>=latex}     \begin{document}              \begin{tikzpicture}             \draw (0,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$E$}}] (E) {};               \draw (1,0) node[circle, inner sep=0.8pt, fill=black, label={below:{$F$}}] (F) {};                       \draw[domain=0:1, samples=100, black] plot ({\x},{\x*(1-\x)*tan(45)});                 \draw[domain=0.15:0.35, samples=100, black, ->>] plot ({\x},{\x*(1-\x)*tan(45) + 0.02});         \end{tikzpicture}           \end{document}       ![\(Partially Correct\) Non-"Bend Left" curved line, with parallel curved directional arrow](http://i.stack.imgur.com/NYBy6.gif) However, after further investigation, it seems the `[bend left=45]` curve shown in red below seems to suggests my guess wasn't completely correct, and `[bend left=45]` is not given by a parabola equation. Does anyone know what the underlying `bend` curve equation is? Is it possible to redefine the equation used to plot these curved lines? Or am I missing an easy way of plotting parallel curved lines? ![Parabola defined curve \(black\) vs. \[Bend left=45\] defined curve](http://i.stack.imgur.com/EkkTv.gif)


title: Clash between splitbib and hyperref

text: When I use the `splitbib` package, the anchors for the citations produced by `hyperref` seem to disappear. I have some example code to illustrate the problem:               \documentclass{article}     \usepackage{hyperref}     \usepackage{splitbib}          \begin{document}     We cite~\cite{entry1,entry3,entry4,entry5}.          \clearpage     \begin{thebibliography}{4}          \bibitem{entry1} This is the first entry.          \bibitem{entry3} This is the third entry.          \bibitem{entry4} This is the fourth one.          \bibitem{entry5} This is the last one.          \end{thebibliography}     \end{document}      If the `splitbib` package is commented out, then the hyperlinks work as expected, i.e., clicking on `[1]` will take you to the next page. If the `splitbib` package is included, the link no longer works. Also, if you change the order of the two packages, it won't even compile. My ultimate goal is to have a bibliography with a two categories ("Good Stuff" and "Everything Else") and then to have the "Good Stuff" split into several subcategories. I know many folks have suggested `biblatex`, but it's hard to figure out how to use the system. If someone can give me an `biblatex` example of what I ultimately need, that would also suffice to solve my problem.


title: Square brackets in math mode without the bracket symbols

text: Is there a way to typeset a square bracket without using the symbols [ and ]? What I am looking for is like `\vert` instead of `|`. Motivation is a need for a workaround in using LaTeX formulas inside Moodle wiki pages. The latter use square brackets to start a new page (like [page- name]), and this functionality interferes with scripts processing LaTeX formulas (which otherwise are ok in Moodle HTML/wiki).


title: how puts a long table in two columns

text: > **Possible Duplicate:**   >  Balancing long table inside multicol in LaTeX In a document without columns, how puts only a long table in a two columns to save space ? Others possible duplicate answers related use of package like supertabular, this involve re-write the table. Also this is possible in lyx ?


title: (Why) Can't we get 'fully expandable' versions of every command?

text: I'm just starting to figure out what 'expandable' means in LaTeX, and why it is useful to have commands that expand as far as possible. In particular:   * If you want to `\typeout` some string to the log file, you need to be able to expand all the way to it.   * If you want to do any kind of unit-testing (like with `qstest`), you need to be able to expand at least down to the strings you want to compare. I've been reading a lot about this topic. As I understand it, a command is not expandable if it changes the 'state' in some way, i.e., uses `\def`, `\let`, etc. In particular, I've also read the question "Why isn't everything expandable". But my question is less theoretical than that one. I'd like to know why I haven't encountered any 'solutions' yet. The thing is, 'making everything expandable' is conceptually so simple. TeX is perfectly capable of _typesetting_ the result of 'unexpandable' commands, simply by performing the state changes in the execution processor. The point being, TeX does eventually arrive at the final string. _(Edit: Please note that I'm talking about textual characters here. I understand that one cannot capture the notion of, e.g., an image, flexible whitespace or a state-manipulation in a string.)_ It seems inconceivable to me that we can't somehow intercept it and use it. I would have expected someone to have created a command like this:               \getresult { <expr> } { <result-macro> }      It's not expandable, but we can still get our hands on the fully expanded result in order to log it... compare it... what have you. Questions like this one suggest to me that this has not been accomplished. **Why?** Ok... I'm willing to cheat. What if we spawn an extra TeX process to fully evaluate the expression and (almost) typeset it. Can we get the string that way? Doesn't `\scantokens` use a similar trick to overcome another inherent TeX limitation (that catcodes are fixed once a token is read)? **Can it be done?**


title: Appendix as regular \chapter; Appendixes as \section within Chapter-Appendix but with \alph chapter number

text: I'd like to have something like this               1. Chapter 1       1.1. Section 1.1       1.2. Section 1.2     2. Chapter 2     ...     7. Appendix       A. Appendix 1       B. Appendix 1      Im trying it like this:               \chapter{Chapter 1}     \section{Section 1.1}     \section{Section 1.2}     \chapter{Chapter 2}     ...     \chapter{Appendix}     \renewcommand\thechapter{\Alph{section}}     \section{Appendix 1}     \section{Appendix 2}      But the result is               1. Chapter 1       1.1. Section 1.1       1.2. Section 1.2     2. Chapter 2     ...     7. Appendix       A.1 Appendix 1       B.2 Appendix 1      How to get rid of the 1 & 2 in A.1 and B.2?


title: TeXLive with custom location does not find "biblatex.sty"

text: I am using Ubuntu 12.04 and installed TeXLive 2012 via download. I did not use the packages provided by Ubuntu. Since I don't have enough space I installed TeXLive to another partition. However, LaTeX won't find my `biblatex.sty` now. It is there. If I run `texhash` it will update the ls-R files in the standard directories but not my custom directory. How can I tell TeXLive to look in my custom directory for files? It does find all my binaries. I hope you can help me out! **EDIT** I still does not work from Texmaker but a simple bash script with the export as described below does the trick.


title: How can you use both fontspec and xmpincl?

text: Is there a way to use both the `fontspec` and the `xmpincl` packages? Using PDFTeX returns > Fatal fontspec error: "cannot-use-pdftex" > > The fontspec package requires either XeTeX or LuaTeX to function. > > You must change your typesetting engine to, e.g., "xelatex" or "lualatex" XeLaTeX and LuaLaTeX returns > Package xmpincl Error: latex is not supported by the \includexmp package.


title: acronym \acresetall & cleveref: multiply defined labels

text: I'm using the `acronym` package to expand acronyms and I'm also using the `cleveref` package. I would like to have acronyms expanded once per chapter. For instance in the following code, both acronyms should produce the expansion:               \documentclass{report}     \usepackage{acronym}     \usepackage{cleveref}          \acrodef{ac}{Acronym}          \begin{document}     \chapter{one}          \ac{ac}           \acresetall     \chapter{two}          \ac{ac}     \end{document}      According to the `acronym` manual I found that calling `\acresetall` before each chapter produces the desired result but I get warning about duplicate labels (somehow a conflict with `cleveref`). Is there another way to get the desired result or avoid the warning?


title: L-Tromino by using Tables with zero padding

text: I want to display a L-Tromino. L-tromino is a shape consisting of three equal squares joined at the edges to form a shape resembling the capital letter L. I have tried               \begin{array}{cc} \square& \\ \square&\square\end{array}      but this contains paddings. How can I use zero padding for a 2x2 table?


title: No space after inline math

text: how do I prevent (at least nearly) any space after an inline math environment?               abc def $\Delta$ ghi      The space between the delta and _ghi_ shouldn't be larger than the space between _abc_ and _def_.


title: How do you use MacVim for LaTeX?

text: I'm a long-time Emacs+AUCTeX user (I even once wrote a short tutorial for it!), but for a couple of different reasons (problems maintaining my Emacs configuration, the beauty of Drew Neil's voice, and simply embracing the uncomfortable) I began looking at (Mac)Vim. As far as general Vim usage is concerned, I can always consult numerous online resources, but it seems that not so many people are using Vim for LaTeX. So to anyone who's using Vim for editing TeX files, here are my questions:   1. Which plugins do you recommend? I've been trying LaTeX-Box and it seems nice, but perhaps there are better solutions?   2. Is there something similar to AUCTeX's Preview-mode offered by any Vim plugin?   3. Is there a way of automatic formatting/indentation of LaTeX code similar to AUCTeX's `C-c C-q C-s`? Vim's indentation commands don't seem to work properly, or perhaps I just don't know how to use them properly.  I'm happy to hear any advice about the points above, because I'd really like to switch to Vim. I find it quicker, easier to configure (and maintain configuration) and more powerful. It's just that 10 years of AUCTeX habits are hard to get rid off. cheers; Piotr


title: Beamer: \abovedisplayskip inactive in sublist?

text: A weird mechanism is observed below:               \documentclass{beamer}     \begin{document}     \abovedisplayskip=0ex     \belowdisplayskip=0ex     \frame{\frametitle{Title}     \begin{itemize}     \item text text text text text text text     \begin{equation}     \cos \pi=-1     \end{equation}     text text text text text text text        \begin{itemize}        \item text text text text text text text        \begin{equation}        \cos \pi=-1        \end{equation}        text text text text text text text        \end{itemize}     \end{itemize}}     \end{document}      ![enter image description here](http://i.stack.imgur.com/UmUEk.png) the new `\abovedisplayskip=0pt` seems to be ignored in the second level `itemize` list. It seems to be related to the fontsize in the lists but is a bit annoying as such.


title: Automatically adjust ybar width (overlapping bar plot)

text: I am plotting a table with vertical bars and I get in trouble for large tables since the vertical bars are overlapping. Is there an option to automatically adjust the bar width? ![enter image description here](http://i.stack.imgur.com/2tNeX.png) Here is the code producing overlapping :               \documentclass{standalone}     \usepackage{filecontents,pgfplots}          \begin{filecontents}{pistonkinetics.dat}     x y     1   1     2   2     3   3     4   4     5   5     6   6     7   7     8   8     9   9     10  10     11  11     12  12     13  13     14  14     15  15     16  16     17  17     18  18     19  19     20  20     21  21     22  22     23  23     24  24     25  25     26  26     27  27     28  28     29  29     30  30     31  31     32  32     33  33     34  34     35  35     36  36     37  37     38  38     39  39     40  40     \end{filecontents}          \begin{document}     \begin{tikzpicture}{width=10cm,height=5cm}     \begin{axis}     \addplot+[ybar,mark=none] plot table{pistonkinetics.dat};     \end{axis}     \end{tikzpicture}          \end{document} black,fill=red


title: Why does the following not compile?

text: The following compiles well in TeXShop on one of my Mac computer (an old one), but produces error on another one. I must have forgot to install something on the new computer, but cannot figure out what. Any ideas?                 \begin{tikzpicture}       \draw[very thin,color=gray] (1,1) ;       \foreach \x/\xtext in {0.3/a, 1.58/c, 2*pi/b}       \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\xtext$};       \draw[->] (-0.2,0) -- (9,0) node[right] {$x$};       \draw[->] (0,-0.2) -- (0,4.5) node[above] {$y$};             \draw plot[domain=0.3:2*pi]                  (\x, 0.5+{0.5*(\x)+sin((\x) r)}) node[above right] {$f$};             \draw[-] [dotted]                (0.3,0.5+{0.5*(0.3)+sin((0.3) r)})--(2*pi, 0.5+{pi+sin(2*pi r)}) ;              \node at (pi/2, 0.5+{0.25*pi+1}){$\bullet$};             \draw[-] [draw=red]plot[domain=0.2:pi]             (\x, {0.5+{0.25*pi+1}+0.5*(\x-pi/2)}) node[above]  {$f'(c)={f(b)-f(a)\over b-a}$};        \end{tikzpicture}      Error Message:               <to be read again>                     {     l.23 ...0.3:2*pi] (\x, 0.5+{0.5*(\x)+sin((\x) r)})                                                    node[above right] {$f$};


title: Avoid vertical justify of chapter table of contents?

text: I'm creating a table of contents at the beginning of each chapter using:               \makeatletter     \xpatchcmd{\ttl@printlist}{\endgroup}{{\noindent\color{nicedarkblue}\rule{\textwidth}{1.5pt}}\vskip30pt\endgroup}{}{}     \makeatother     \newcommand\chaptertoc{     \vspace{-30pt}     \startcontents[chapters]     \printcontents[chapters]{p}{1}{\noindent{\color{nicedarkblue}\rule{\textwidth}{1.5pt}}\par\medskip}%     \vspace{20pt}     }      But the problem is that the table of contents is vertically justified (space between each element of the toc is increased) when the first page has some empty space. How to prevent that? When there is some empty space, I would like to vertically center the text on the first page between the end of the toc and the end of the page. Or to summarize visually: ![enter image description here](http://i.stack.imgur.com/4XHMd.png)


title: Limitations associated with getting length as number

text: I am representing actual object dimensions with scaled down graphics which capture the relative proportions of the objects (for instance, imagine a simple set of three or four line segments). I would like to annotate the length of a nominal segment on the graphic using that segments actual length. I store the actual lengths using the `\newlength` and `\setlength` commands. I apply a suitable scaling factor to these segments by operating on the declared actual lengths in order to compute lengths as they should appear in print. This link provides several possible solutions, e.g.               \newcommand*{\getlength}[2]{%        % Convert to `cm` and round to two fractional digits:        \pgfmathsetmacro#1{round(3.51459804*#2)/100.0}%     }      When I provide a value of 180 cm               \newlength{\lengtha}     \setlength{\lengtha}{180cm}     \getlength{\annotlengtha}{\lengtha}      I encounter some restriction, that is, I receive a Dimension too large error message. Might someone explain the limitations associated with this approach?


title: How to write readable commands

text: Consider the common LaTeX way of defining environments, for example:               \begin{summary}     In olden times when wishing still helped one, there lived a     king whose daughters were all beautiful, but the youngest was      so beautiful that the sun...     \end{summary}      Contrast this, with Knuth's way and ConTeXt which tend to omit the braces.               \summary     In olden times when wishing still helped one, there lived a     king whose daughters were all beautiful, but the youngest was      so beautiful that the sun...     \endsummary      The latter is more readable in an editor and makes the life of the author easier. Personally I prefer the latter, and although one can argue about the advantages of the LaTeX way of having arguments and commands, I suggest that these styling commands do not belong in the text but in a `setsummarystyle` and should go in the preable, i.e, try and keep the text with structural commands only (no styling). **Have you got your own strategies to keep the text as clean and readable as possible? Any suggestions to alternatives and problem areas?** MWE example if you want to experiment.               \documentclass{book}     \usepackage[paperwidth=4.75in,paperheight=7.25in,                 textwidth=4.2in,textheight=6.5in,                 headsep=0.1in, footskip=0.15in,                 marginratio=1:1]{geometry}     \usepackage{lipsum}     \long\def\summary#1\endsummary{{%      \baselineskip11pt      \leftskip3em\rightskip3em      \noindent      {\bf Summary}.\quad#1      \bigskip     \par}}%          \begin{document}     \chapter*{Introduction}          \summary      In olden times when wishing still helped one, there lived a     king whose daughters were all beautiful, but the youngest was      so beautiful that the sun itself, which has seen so much, was     astonished whenever it shone in her face. Close by the king's     castle lay a great dark forest, and under an old lime-tree in the     forest was a well, and when the day was very warm, the     king's child went out into the forest and sat down by the side     of the cool fountain, and \ldots     \endsummary          \lipsum[1]     \end{document}


title: Using amspset package

text: I use the `amspset` package. I understand there are options to use the `cm` font (Computer Modern) and also an option called "unboxed" to remove boxes from the questions. What is the correct command to activate these options? I Use BaKoMa TeX on Windows 7 Ultimate 64-bit.


title: Creating node shapes

text: I am currently learning how to use TikZ/PGF to make some figures for a project report, and so I have a question: > Is there is a practical way of making a particular object into a node? The object I have in mind is shown in the Figure below. I want the object to consist in the big circle, the two circular arcs, the label and anchors at north, south, east and west. The dotted lines are simply there to indicate that I am going to have paths going out of these points, which is why I need the anchors there. ![object](http://i.stack.imgur.com/PMQZw.png) I include the source, in the case that it is useful to anyone.               \begin{tikzpicture}     \draw[help lines, gray, dotted] (-2,-2) grid (2,2);          \begin{scope}[shift={ (0,0) } ]         \begin{scope}[rotate=90]             \draw[thick] (-1,0) arc[start angle=-90, delta angle=90, %                                   x radius=1, y radius=1] -- (0,1) %NW                          (0,-1) arc[start angle=180, delta angle=-90, %                                        x radius=1, y radius=1] -- (1,0); %SE             \draw[gray] (0,0) circle (1);         \end{scope}     % Anchor replacements         \node(N1)       at (0,1)    {};         \node(S1)       at (0,-1)   {};         \node(E1)       at (1,0)    {};         \node(W1)       at (-1,0)   {};     % Label         \node(Crossing number) at (0,0) {1};     \end{scope}          \path[thick, gray, dotted]     [ out=90,   in=270]     (N1.center) edge (0,2)     [ out=180,  in=0]       (W1.center) edge (-2,0)     [ out=270,  in=90]      (S1.center) edge (0,-2)     [ out=360,  in=180]     (E1.center) edge (2,0);     \end{tikzpicture}      PS. I have had a look at _the_ Manual, but I could not find a description of how to do this.


title: Microtype and LuaTeX: changing protrusion and hanging punctuation

text: I'm experimenting (using TeXLive 2013) with having my punctuation marks extend fully into both the left and right margins. I don't know how to include images so I'll do my best to format this here to show what I'm saying:                Text with normal space     "Quotation mark hanging"      text with normal space      If I use pdfTeX and microtype with the following code, it works:               \documentclass{article}     \usepackage{microtype}     \LoadMicrotypeFile{cmr}     \SetProtrusion      {encoding=OT1,family=cmr}     {\textquotedblleft = {1000, },\textquotedblright = { ,1000}}     \begin{document}     Text\\     text\\     "text"\\     text.     \end{document}      (You can't see the right margin but it works also). But of course I want to use LuaLaTeX so I can get all my fancy fonts, but to keep things simple:               \documentclass{article}     \usepackage{fontspec}     \usepackage{microtype}     \LoadMicrotypeFile{cmr}     \SetProtrusion      {encoding=OT1,family=cmr}     {\textquotedblleft = {1000, },\textquotedblright = { ,1000}}     \begin{document}     Text\\     text\\     "text"\\     text.     \end{document}      And compile with LuaLaTeX, I get the normal protrusion (about half a quotation mark even if I use 0 or 3000 for the modification) but it's the exact same as if I didn't include all that "\SetProtrusion" business. And since I'm using LuaLaTeX I want to be able to use my own fonts so if I do:               \documentclass{article}     \usepackage{fontspec}     \usepackage{microtype}     \setmainfont[Ligatures=TeX]{Garamond Premier Pro}     % \LoadMicrotypeFile{cmr}     \SetProtrusion      {encoding=OT1,family=Garamond Premier Pro}     {\textquotedblleft = {1000, },\textquotedblright = { ,1000}}     \begin{document}     Text\\     text\\     "text"\\     text.     \end{document}      Which produces something that looks no different than had I just used microtype without the "\SetProtrusion" business, i.e., the normal amount of protrusion. The `hanging` package exists and does a decent job but does not include any means to control the amount of protrusion plus the manual cautions about using it as it treats punctuation marks as commands and not glyphs (I do not understand the distinction) and then of course I'm not sure how it works/conflicts with `microtype` (though I guess one could turn off protrusion in `microtype` and just let `hanging` deal with that?) There's also:               \usepackage[factor=3000]{microtype}      Which gets the left-side hanging punctuation I want but really screws up the right side. There are other questions dealing with similar ideas but some of them are old and others mention something about using `Renderer=Basic` but not only does this not help but it looks like it turns off protrusion altogether or at the very least makes the quotation marks look weirdly spaced out. And then other questions do not appear to deal with system fonts. So really what it all comes down to is that I cannot figure out how to specify protrusion settings when using LuaLaTeX and `microtype` or if this is even possible.


title: Vertical space after title of unnumbered chapters (bibliography/ToC)

text: The title pretty much says it all: It is possible to add arbitrary vertical space after the title of the ToC or bibliography page within the `report` document class?


title: Class with template parameter

text: AFAIK pgf-umlcd does not support classes with template parameter (`std::vector<T>` for instance). Does anybody have a workaround allowing the drawing of such classe? Is there a simple PGF/Tikz trick to do so? I would achieve something roughly equivalent to MetaUML rendering. See MetaUML documentation page 8/9, section 2.5 "Parametrized Classes (Templates)". Thanks!