title: author's index with imakeidx in LaTeX

text: I am not an expert at all with LaTeX; I used it for the very first time some month ago to compose a conference proceedings volume modifying an already available script. I am trying to refine the final aspect of the this year edition of the proceedings using personalized authors and affiliations indexes. I make use of the `imakeidx` package with LaTeX and I would like to know if it is possible to: 1) substitute the default comma separating the index entry from the first page number in the index with a colon; as an example I would like to have > Einstein Albert: 1, 2, 3 instead of the predefined > Einstein Albert, 1, 2, 3 2) control the indentation of lines following the first in the index; with predefined settings I obtain something like               Einstein Albert, 1, 2, 3, 4, 5,            6, 7, 8      Any hint?


title: Creating variable pagebreaks

text: Is it possible to procedurally generate page breaks by measuring text/page space? I am having a problem which you can see here: ![enter image description here](http://i.stack.imgur.com/O7RNK.png) There are two problems in this picture. First, the heading should overflow to the next page because it doesn't fit...but more importantly, and more annoyingly, the heading should be forced to the next page because its content does not fit on the same page. I am procedurally generating my latex from javascript, so it is sort of hard to post code snippets, but I can show you the function/environment I am using...it is the second code block in the accepted answer here Any ideas or tips for measuring the text? **edit** Here is the code to generate my custom lists, from the link above:               \documentclass{article}     \usepackage{fancyhdr}      \usepackage[head=41.68335pt]{geometry}      \usepackage{enumitem}      \usepackage{indentfirst}      \pagestyle{empty}     %% I use a box for your "title" and save its width in "\mytitlewidth"     \newlength{\mytitlewidth}     \newlength{\mytopsep}     \newsavebox{\mytitlebox}     %% and environment to handle your list     \newenvironment{enumwithinenum}[1]       {\setlength{\mytitlewidth}{\dimexpr0.30\textwidth\relax}%%'           \setlength{\mytopsep}{2ex}%%'        %% save the title in a box so we can access its height later to        %% use to adjust where the next enumerate begins.        \begin{lrbox}{\mytitlebox}%%'          \begin{minipage}[t]{\dimexpr\mytitlewidth\relax}             \raggedright\strut            \textbf{#1}            \par\xdef\tpd{\the\prevdepth}%%'          \end{minipage}%%'        \end{lrbox}%%"        \usebox{\mytitlebox}%%'        \vspace{-\dimexpr\dp\mytitlebox+\parskip+0.7\baselineskip+\mytopsep\relax}%%'        \begin{enumerate}[align=left,                          label={.\arabic*},                          leftmargin=\dimexpr\mytitlewidth+2em\relax,                          topsep=\mytopsep,                         ]       }       {\end{enumerate}}     %-@-(1)---------------------------------------------------------------------     \begin{document}          \noindent     \textbf{Part One - General}               zzz          \vspace{12.85cm}          \begin{enumerate}[leftmargin=*,topsep=1ex,itemsep=4ex,label={1.\arabic*}]       \item  \begin{enumwithinenum}{SECTION INCLUDES}                \item \strut Work covered by Contract documents                \item Contract Method                \item Contract Method                \item Contract Method                \item Contract Method                \item Contract Method                \item Contract Method                \item Contract Method                \item Contract Meth              \end{enumwithinenum}       \item  \begin{enumwithinenum}{THIS IS A LONGER TITLE}                \item \strut Work covered by Contract documents                 \item Contract Method               \end{enumwithinenum}     \end{enumerate}          \end{document}


title: ! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab le: Metric (TFM) file not found

text: I have this sample code that I was trying to run but it kept on producing an error that says:               ! Font \zf@basefont=Flama-Light at 10.0pt not loadable: Metric (TFM) file not found.     ! Font \@tempfonta=Flama-Light at 10.0pt not loadable: Metric (TFM) file not found.     ! Font \@tempfontb=Flama-Light at 10.0pt not loadable: Metric (TFM) file not found.     ! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadable: Metric (TFM) file not found.      Here is the code:               \documentclass[12pt,a4paper]{beamer}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amsfonts}     \usepackage{url}          \usetheme{hsrm}     \usecolortheme[named=BurntOrange]     \useinnertheme{rounded}     \usefonttheme{serif}     \setbeamertemplate{navigation symbols}{} %remove navigation symbols     \beamerdefaultoverlayspecification{<+->}          \title{A Discussion of rational and Psychological Decision-Making Theories and Models:}     \subtitle{The Search for a Cultural-Ethical Decision-Making Model}     \author[Arnaldo Oliveira]     \date{September 4, 2013}          \begin{document}     \begin{frame}[plain]         \maketitle     \end{frame}          \begin{frame}     \frametitle{Table of Contents}         \tableofcontents     \end{frame}          \section{Introduction}     \begin{frame}        \begin{block}{Example}           This is my first Beamer example.        \end{block}     \end{frame}          \section{Rational Decision-Making Models}     \begin{frame}        \begin{block}{Example}           This is my first Beamer example.        \end{block}     \end{frame}          \section{Psychological Decision-Making Models}     \begin{frame}        \begin{block}{Example}           This is my first Beamer example.        \end{block}     \end{frame}          \end{document}      I've searched for answers in this website and found some similar problems and followed their answers but I still end up with the same errors. The code produced a PDF file but nothing is written on the slides.


title: Converting tex to HTML

text: I am in need of an easy way of converting .tex to .html for ultimately converting it to word in windows. I have looked into a few different ways, but the ones I have encountered are not free and/or are very complicated to figure out. Any help at all would be much appreciated.


title: Conditional content in moderncv

text: I am using the package moderncv. I implemented already a conditional statement in the preamble:               \usepackage{ifthen}     \newif\ifresume     \resumetrue %true for RESUME, false for CV      This allows me to set up different designs for either generation of a resume or a cv based on the same data. What I would like to do now, is to also to implement this condition in the               \cventry{year--year}{Degree}{Institution}{City}{Grade}{Description}      data fields in the following sense:               \cventry{year--year}{Degree}{Institution}{City}{Grade}{(short) Description for resume}{(long) Description for CV}      I already tried various ideas to implement this, but none succeeded. The obvious solution would be               \cventry{year--year}{Degree}{Institution}{City}{Grade}{\ifresume     %Text for RESUME     \else     %Text for CV     \fi}      but that does not appear very pracicable.# Any ideas how to solve this smoothly? Cheers, Mil


title: Stop table going off page (vertically)

text: Much like this question, I want to force a table to fit within the vertical page margins. Any ideas? Edit: Margin size: `\usepackage[left=3cm,right=3cm,textheight=23.5cm]{geometry}` Present situation: ![Output and LyX text.](http://i.stack.imgur.com/nXP2d.png)


title: Undefined Citations Error

text: I'm using zotero which generates a bib file in a the folder below.               \bibliography{zotero}     \documentclass{emulateapj}     \begin{document}          \title{The Outer Profiles of S0 Galaxies in Dense Environments}     \citep{faber_galaxy_2007}          \bibliographystyle{apj}     \bibliography{C:/Users/User/texlibrary/bibtex/bib/zotero.bib}{}     \end{document}      This does not work and just gives:               Texification succeeded: no errors!          However, there were warnings in your LaTeX source     C:\Program Files\MiKTeX 2.9\tex\latex\revtex\revtex4-1.cls: Class revtex4-1 Warning: No Society specified, using default society aps.     C:\Program Files\MiKTeX 2.9\tex\latex\revtex\revtex4-1.cls: Class revtex4-1 Warning: No journal specified, using default pra.     C:\Program Files\MiKTeX 2.9\tex\latex\revtex\revtex4-1.cls: Class revtex4-1 Warning: No type size specified, using default 10.     C:/Users/User/Documents/Project work/Latex Report/Master/Master.tex:5: Package natbib Warning: Citation `faber_galaxy_2007' on page 1 undefined on input line 5.     C:/Users/User/Documents/Project work/Latex Report/Master/Master.tex: Package natbib Warning: There were undefined citations.      Ive tried the steps listed here but they don't work!


I just want to use Alegreya font with pdflatex. i had a question about an error before and got an answer. But it gives another error now. what should i do. error message: > miktex-makepk: PK font Alegreya-Regular-lf-t1--base could not be created. in log file: > !pdfTeX error: pdflatex.exe (file Alegreya-Regular-lf-t1--base): Font > Alegreya- Regular-lf-t1--base at 657 not found ==> Fatal error occurred, no > output PDF file produced!               \documentclass[11pt,a4paper]{article}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}     \usepackage[T1]{fontenc}     \usepackage{Alegreya} %% Option 'black' gives heavier bold face      \renewcommand*\oldstylenums[1]{{\AlegreyaOsF #1}}          \begin{document}     This is giving an error.     \end{document}


title: installation of TeX Live and Mathtype

text: I am documenting a project using TeX Live.There are few mathematical expressions to be included. I am using Mathtype for writing expressions. Can anyone tell me how to link both Mathtype and TeX Live?


title: Is there a way to draw TikZ lines on the "inside" or "outside" of a path?

text: In this answer, Jake points out > The `miter` option is more "correct" in that it doesn't add new corners to a > shape or introduce rounding. In some cases with very sharp angles, the > results might be undesirable though, as in the question you linked to... in reference to this question. It's certainly true that for very acute angles, a mitered joint will extend far beyond the coordinate where the two lines intersect. In some sense, this is because TikZ draws lines centered on the specified coordinates, which is almost always the desired result. But in this circumstance, it might be better to specify the outermost point of the miter as the "endpoint" of the lines, and have the strokes be entirely _uncentered_ and to one side of the coordinates or the other. Illustrator (for example, because I have it handy) supports this, but only for closed paths, where there is a well-defined "inside" and "outside" to the path. For an acute angle, you could reuse "inside" or "outside" in a semi-sensical way, but that terminology may not generalize to single lines... For lack of better terminology then, I'll reuse "above" or "below" or "left" or "right", as are used to describe label positioning. Is there a convenient way in TikZ to specify lines as being drawn "above" or "below" their coordinates---effectively being offset by exactly half the line- thickness in the direction perpendicular to the line? And is there a similar solution for drawing curves "above" or "below" their coordinates (not as easy to say "perpendicular to the line", though still mathematically possible)? If there isn't a good solution for arbitrary open paths, is there a good one for closed paths, as in Illustrator? **EDIT** : To answer Andrew's question, Illustrator draws the following path by default, "inside" and "outside": ![Illustrator's path-stroke options](http://i.stack.imgur.com/Qub15.png) The top path is selected, which is drawn in blue highlighting. That stroke is "default", or centered. The middle is "inside", and draws the two subregions separately. The bottom is "outside". Here's a twistier, more self-intersecting example, that shows Illustrator has a miter limit, as well as an algorithm that seems to be parity-based: ![twisty paths](http://i.stack.imgur.com/b9OaV.png) Note that Illustrator limits "inside" and "outside" to solid strokes on closed paths only: if you attempt a dashed stroke, or have a non-closed path, or try tiger-striping like in Andrew's example, it disables the inside and outside options, which makes me wonder whether there happens to be a convenient PDF or PS command for offsetting simple strokes on simple paths, rather than a more robust solution... I completely agree that the choice of side is not local, but on the other hand if you pick a single option for the first segment of the path (e.g., "to the right side, when headed from the first point on the path to the second"), it will stay consistent for the rest of the path. The original question that prompted mine was the attempt to draw a cube in 3d with thickened edges. I was curious whether you could draw said cube by saying, "Draw the front face, stroked inside. Draw the (foreshortened) top face, stroked inside. Draw the (foreshortened) side face, stroked inside." In that scenario, Andrew's twisty paths don't come up and there still is a well- defined inside and outside, and the goal would be to have pointy corners as befits a cube, so the mitering would need to be specified by the outermost points... **EDIT** : To follow-up on my commented question to Andrew's answer, here's what TikZ makes of his solution as applied to the figure-eight example he gave. The paths here are drawn in a figure-eight, starting in the direction of the arrow. They use the `reverseclip` style from this answer, and the exact path used is drawn in color over the clipped versions: ![Tikz clipping of figure-eight paths](http://i.stack.imgur.com/Cokxj.png) The red example uses clipping, and gets the "inside" to match Illustrator's behavior...but the blue example uses reverse clipping, and gets confused in the right half of the image. If I draw the figure-eights in the other orientation, then the red example stays the same, but the blue example gets confused on the left half of the image. And finally, the exact same styles, but using the "twisty" path I had above: ![Tikz clipping of twisty paths](http://i.stack.imgur.com/jXVJS.png) Both the red and blue paths are slightly confused, and while they don't follow Illustrator's even-odd algorithm, I have no idea what algorithm the _are_ following... (And finally, the TikZ code for the twisty paths I used, for anyone who wants to reproduce the behavior I'm seeing:               \documentclass{article}     %\url{http://tex.stackexchange.com/q/29991/86}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[remember picture,overlay,scale=2,line width=2mm]     \tikzstyle{reverseclip}=[insert path={(current page.north east) --       (current page.south east) --       (current page.south west) --       (current page.north west) --       (current page.north east)}     ]     \draw (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \draw[green,line width=1pt] (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \begin{scope}[yshift=-2.5cm,line width=4mm]     \begin{scope}     \clip (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \draw (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \end{scope}     \draw[red,line width=1pt] (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \end{scope}     \begin{scope}[yshift=-5cm,line width=4mm]     \begin{pgfinterruptboundingbox}     \path[clip] (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle [reverseclip];     \draw (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \end{pgfinterruptboundingbox}     \draw[blue,line width=1pt] (0,1) -- (1,0) -- (4,2) -- (1,1) -- (4,1) -- (3,0) -- (1,2) -- (2.5,0) -- cycle;     \end{scope}     \end{tikzpicture}     \end{document}


title: Positioning TikZ pictures in beamer slide

text: I am trying to position a TikZ picture on a `beamer` slide but some nodes (well, not all?) get pushed to the right. I have tried to add `%` wherever it seemed fitting as mentioned in Tikz figure in Beamer shifting way to the right of the frame, but that doesn't help. I have tried the `adjustbox` which only resize the nodes but doesn't move them to the right. My head hurts so maybe you could help since I probably have missed something. I can make things more or less work with the `textblock` environment but I think it's Here is my MnotWE:               \documentclass{beamer}     \usepackage{tikz}     \usetikzlibrary{positioning}          \tikzstyle{block1} =[draw=black, fill=blue!40, rectangle, minimum height=0.25cm, minimum width=0.25cm, inner xsep=0.25cm, font=\bf\normalsize]     \tikzstyle{link} =[draw=blue, ultra thick]     \tikzstyle{box1} =[draw=blue, fill=white, ultra thick, rectangle, inner ysep=0.25cm, inner xsep=0.25cm, minimum height=0.25cm]     \tikzstyle{fancytitle1} =[fill=black, rounded corners, text=white]          \begin{document}          \begin{frame}     \begin{tikzpicture}%     \node (preop) [block1] {blabla};     \node (op) [block1, right=.25cm of preop] {blabla};     \node (postop) [block1, right=.25cm of op] {blabla};     \node (posthp) [block1, right=.25cm of postop] {blabla};          \draw (preop) -- (op);     \draw (op) -- (postop);     \draw (postop) -- (posthp);          \node[box1, above= 2cm of preop] (box1) {%        \begin{minipage}{1\textwidth}%        \vspace{.5cm}%          \begin{itemize}%          \item tutu          \item tete           \end{itemize}%        \end{minipage}};          \node[fancytitle1, right=10pt] at (box1.north west) {Operation};     \draw[link] (op.north) -- (op|-box1.south);          \end{tikzpicture}%     \end{frame}          \end{document}      Additionally:   1. I would like to have the `minipage` flush with the most left blabla node `(preop)`; and both somewhere close to the left hand side of my slide.   2. Can we position a node relatively by giving separate measures for vertical and horizontal distance? I know there is such a thing as `above left= 2 cm of XXX` but what if I want 1cm above and 2cm left?


title: Get {standalone} to ignore blocks of text from \input files (e.g., \begin{spacing} and \maketitle)

text: I've got a number of separate `.tex` files that are all `\documentclass{article}`. I'm inputting these into a `\documentclass{book}` file as chapters. In the `book.tex` file, then, I've got inputs like this:               \chapter{Chapter One!}     \input{article}      But I want to be able to compile `article.tex` separately when I need to. So in `article.tex`, I've kept the `\begin{spacing}{1.5}`, `\end{spacing}`, and `\maketitle` commands. Is there any way to have these commands ignored when I compile `book.tex`? The `\standaloneignore` command seems to work only for ignoring things above the `\documentclass` declaration.


title: Export Mathematica 8 plot to TikZ

text: Is it possible to generate a plot in Mathematica 8 and then somehow export the data so that I can plot it using TikZ? I do not like how Mathematica's plots are rendered and would like to use proper LaTeX fonts. This is not a simple case of just plotting a simple function, i.e. I might as well just type the plot commands in TikZ; The generated expressions I want to plot are fairly horrible and long. EDIT: Currently in Mathematica I do something like:               Plot[          RecurrenceTable[      ...     ]      {w, 0, 10}     ]      Where I am calculating the recurrence table of a coupled set of non-linear recurrence relations up to some `n`. Each term is a function of `w`. I hope this is helpful. I doubt that I want to do the calculation using TeX.


title: Remember position of equal sign from one align environment to the next

text: As you know, the align-environment puts all positions marked with & (normally the equals sign) exactly beneath each other. I now want to save the position LaTeX calculates for & and use it again later. In more detail, I have something like that:               \begin{xyz}       \begin{align}         x &= a \\           &= b   %store the position of & in \positionequal       \end{align}     \end{xyz}     \begin{xyz}        \begin{align} %read \positionequal and use it to put & at the right position           &= c        \end{align}     \end{xyz}      The things marked with % are unclear to me: How to I find out this position, save it (so that it does not get lost from one xyz-environment to the next) and the use it again?


title: New format for bibliography item

text: This is what I want : a new bibliography item format. I was looking for a matching style, but I found none, so I have to modify the default. I don't know which package to use for this. ![enter image description here](http://i.stack.imgur.com/mPLnG.jpg) I really don't undestand how to modify this!? my bibliography : the name of authors must be bold (bfserief) the title of references must be italic except the first line of each the reference, the indent is about 2 cm sort by the author A,B,C-Z the format is Authors.year.title.place/penerbitan I use book and report class both in lyx and texmaker I use klunum style but I get this one : ![enter image description here](http://i.stack.imgur.com/YiSR5.jpg)


title: Lyx Single Column

text: In Lyx, one has the option of making 'Two-column' document by selecting the corresponding option in the 'Text Layout' section of the document settings. Is there any way of disabling this for a few pages? So if I have a document that's two column, is there a way to make the third page and only the third page single column only?


title: How to draw a irregular circle(shape)?

text: I want to draw some irregular circle(shape) in my wireless scenario. with a basestation in the center. around is some irregular circle(shape). I find something(could be used) in this web(but I feel it's size is too large) * * * Now my teacher want me use this circle as small as possible, but I find when I turn the radius smaller, the irregularcicle's round isn't clear so much. Is there any idea to solve this problem?


title: latex equation not displaying correct format

text: my equation not displaying in expected format. can any one help me to correct this equation to display exactly the same as source.. i used this code               \alpha=a_{1}+\frac{1}{a_{2}+\cdots+\frac{1}{a_{n}+\frac{1}{\alpha_{n+1}}}}.       ![enter image description here](http://i.stack.imgur.com/8RiMV.png)


title: Tabular: Using tabular to separate figures in a minipage

text: \documentclass[demo]{article}     \usepackage{tabu}     \usepackage{tikz}     \usepackage{capt-of}     \usepackage{subfig}     \captionsetup[subfigure]{labelformat = parens}     %\usepackage[demo]{graphicx}                                                             \begin{document}     \begin{minipage}{\linewidth}       \centering       \begin{tabular}{c@{\hspace{.5em}}c}         \includegraphics[width = 2.5in]{something}         \captionof{figure}[short]{figure 1}         \label{one} &         \begin{tikzpicture}           \draw (0,0) -- (2,0);         \end{tikzpicture}         \captionof{figure}[short]{figure 2}         \label{two}       \end{tabular}       \caption[short]{figures}       \label{three}     \end{minipage}     \end{document}      I want to put a `eps` file and a `TikZ` picture side by side as `subfigures` in a a `minipage`, but no matter what I try this doesn't work. I also tried including the `TikZ` picture with `\includestandalone` but that failed as well. How can I do this? * * * Gonzalo Medina One question, how can I avoid the captions running to close and looking sloppy? ![enter image description here](http://i.stack.imgur.com/62LdX.png)


title: Make an C programming language array in LaTeX

text: Im wondering if I can do some kind of table in LaTeX in order to show my C array nicely in text? I did something like this in KolourPaint: ![enter image description here](http://i.stack.imgur.com/pfRxP.jpg) Tried to do the same with LaTeX tables, but with no success ... Is it even possible? I have only something like this so far (not very impressive, I know):               \documentclass[11pt]{article}     \begin{document}          \begin{table}[ht]     \begin{center}     \begin{tabular}{|c|c|}         \multicolumn{2}{c}{tab[0]  tab[1]}\\ \hline         123 & 23 \\ \hline     \end{tabular}     \end{center}     \label{tab:multicol}     \end{table}          \end{document}


title: Contour plots with PSTricks

text: I'd like to use the PSTricks functionality to get the contour plots of 3D surfaces (more precisely, corresponding to functions z = f(x,y) from R^2 to R). Since, to the best of my knowledge, there is no package including this functionality, I've resorted to using the `pst-solides3d` package in order to plot the surface with an appropriate range of colors encoding the z value and choosing the viewpoint with an azimuthal angle set to 90 (sexagesimal degrees). In some cases this works (I've obtained good results with some trigonometric functions). In others, the result is simply wrong: I've tried with a parabolloid z = x^2 + y^2 having the plot restricted to the first octant and (x,y) \leq (1,1), but the view I've obtained with the azimuthal angle set to 90 degrees is flawed. What follows is an MWE for the parabolloid:               \documentclass{memoir}          \usepackage[pdfcrop={--hires}]{auto-pst-pdf}     \usepackage{xcolor,pstricks,pst-solides3d}          \begin{document}     \pagestyle{empty}     \psset{unit=3cm}     \begin{pspicture}(-2,-2)(2,2)         \psset{lightsrc=viewpoint,       viewpoint=60 0 90 rtp2xyz,     Decran=60}     \psSurface[linewidth=0.01pt,     ngrid=0.01 0.01,      tablez=0 0.01 2 {} for,     zcolor=0.5 0,     grid](0,0)(1,1){x x mul y y mul add}     \end{pspicture}     \end{document}      Please observe how the boundary of the plot is not actually a square -- as it should from the viewpoint I've chosen -- because it curves near the corner corresponding to the point (1,1,0). This is wy I say that the plot is ``flawed''. I know there are two Perl scripts available from http://tug.org/PSTricks/main.cgi?file=pst-plot/3D/contour that have been devised with the aim to providing the functionality I'm looking for, but both links to the scripts lead actually to the same script, namely, to `MakeData.pl`. Besides, there are no indications as to what to do with them. I'm using the MikTeX 2.9 distribution; are the scripts to be saved in the `miktex/bin` folder, where other scripts are saved? Could anyone possibly provide any further hints as to how to use these scripts? On the other hand, anyone knows of a different approach to obtain contour plots with PSTricks-based techniques?


title: TOC formatting edited chapters indentation issue

text: I am using a style file for an edited book that I didn't create and can't figure out a TOC command. Here's the problem: The list of authors in the TOC spans two lines, but the second line is not indented like the first line. Here's how the `\chapter` command is used:               \chapter{Title}     \chapterauthors{AuthorX,\affilmark{1} AuthorY,\affilmark{2} Authorz,\affilmark{3}     \chapteraffil{     \affilmark{1}AffiliationX\\     \affilmark{2}AffiliationY\\     \affilmark{3}AffiliationZ}     }      Here's how I think the line for chapter authors is formatted in the TOC:               {\let\chapteraffil\eatone\let\affilmark\eatone     \addtocontents{toc}{\string\nobreak     \vskip\authorskip     \string\noindent\vrule height 9pt width0pt\hskip\chapskip#1\hfill\vskip\chapheight} \ \vskip3pt}}      And just before that we get some definitions:               \newdimen\chapskip     \chapskip=26pt     \newdimen\chapheight     \newdimen\authorskip      And elsewhere, `\authorskip` is defined as:               \authorskip=-6pt     \chapheight3pt      I can't make heads or tails of all the commands in `\addtocontents`. Can anyone else see why the second line wouldn't be indented like the first? Have I provided enough info or even the right info? Ideally my edit will be to the style file and not with an additional package, but I'm also desperate.


title: Space added after \right

text: I have a problem regarding the space added by `\right.`. I have read this answer regarding the topic, where @egreg proposes a macro that deletes this space. However, when using this in my own documents the space is still added. I have written a MWE where I set the value of `\nulldelimiterspace` to `10pt` for clarity. The MWE is:               \documentclass{minimal}          \usepackage{amsmath}     \newcommand{\zerodel}{.\kern-\nulldelimiterspace}          \begin{document}          \setlength{\nulldelimiterspace}{10pt}          I$\left(\delta t;\delta t;\right.\delta t;\delta t$I          I$\left(\delta t;\delta t;\right\zerodel\delta t;\delta t$I          I$\left(\delta t;\delta t;\delta t;\delta t\right.$I          I$(\delta t;\delta t;\delta t;\delta t$I          \end{document}      Which results in: ![Result](http://i.stack.imgur.com/JXURX.png) You can clearly see the large 10pt space after the second semicolon (line 1), a smaller space (line 2) where the `\zerodel` was used, a space _after_ the math (line 3) where `\right.` was moved after the math block and no space added at all where neither `\left` nor `\right` where used (line 4). The look of line 4 is what I want, but I want to have the `\left`/`\right` autospacing. Why is `\zerodel` not working and how can I fix this? Thanks!


title: glossaries: fail to expand in tabularx

text: When I use an acronym (glossaries or acronym package) for the first time in tabularx, then it fails to expand, and even breaks down the table structure. The problem is already mentioned here, but there is no straightforward solution provided. The problem does not appear with `\acf`, `\acs` or other commands that do not check for the first time usage of the entry. However, it is not a solution, as the whole idea of this package is automatic checking. I am looking for a simple solution with not too much processing overhead, as I have thousands of `\ac` commands in my text. Sample code:               \documentclass{article}     \usepackage[acronym,shortcuts]{glossaries}      \usepackage{tabularx}     \newacronym{BI}{BI}{Beacon Interval}          \begin{document}          \begin{tabularx}{\textwidth}{|l|X|}     Parameter & Value \\ \hline     \ac{BI}  & Typical: 0.1 seconds. I heard somebody say, that the sentence ended here, But everyone knows it's goin' still. \\     \end{tabularx}          \bigskip          \begin{tabularx}{\textwidth}{|l|X|}     Parameter & Value \\ \hline     \ac{BI}  & Typical: 0.1 seconds. I heard somebody say, that the sentence ended here, But everyone knows it's goin' still. \\     \end{tabularx}          \end{document}


title: ticks disappearing for diverging (out of range) plots

text: my xticks disappear for some plots even though I explicitly ask for them. Here is my MWE. The function goes to -infinity at the right border of the interval.               \documentclass{article}          \usepackage{pgfplots}          \begin{document}         \begin{tikzpicture}[domain=0:1]             \begin{semilogyaxis}[xtick={0,0.5,1}]                 \addplot[mark=none,samples=300] {x - 1/(4 - 4*x) + 5/4};             \end{semilogyaxis}           \end{tikzpicture}     \end{document}      How do I get them back? A general idea how to deal with the plotting of divergent functions would be great.


title: biblatex : avoid redundant information

text: I'm exploring the great possibilities of biblatex ... and there are a few questions I can't resolve. I'll start :) with one (edit !) of them : I'm using "crossref" to cite several chapters in a book. Currently, when a second chapter in the same book is cited, all information about the publisher etc is reprinted. I'd like only the first reference to the book to have the full information, the following chapter could just have "author, chapter, in : bookname, **op. cit.** " Something tells me this should be possible ... would you know how to achieve this ? Thanks in advance, Jos Here's a small code :               \documentclass[ngerman,french]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}          \makeatletter     \usepackage{lmodern}     \usepackage{perpage}     \MakePerPage{footnote}     %% Biblatex %%     \usepackage[language=french,%     autopunct=true,%       citestyle=verbose-trad2,%        strict,%         citepages=suppress,%         idemtracker=true,%         loccittracker=true,%        opcittracker=true,%       related=false,           bibstyle=reading,entryhead=false,entrykey=false,annotation=false,abstract=false,library=false,file=false,%     backend=biber]%     {biblatex}%          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @Book{MH_Holzwege,       keywords =     {MH,D},       author =   {Martin Heidegger},       title =    {Holzwege},       publisher =    {Vittorio Klostermann},       address =      {Frankfurt a. M.},       year =     2003,       series =   {Einzelausgabe des Bd. 5 der Gesamtausgabe},       edition =      {8., unver\"{a}nderte Auflage},       addendum =     {1. Publikation: 1950}}          @InBook{MH_Kunstwerk,       keywords =     {MH,D},       author =   {Martin Heidegger},       title =    {Der Ursprung des Kunstwerkes},       pages =    {1--74},       crossref = {MH_Holzwege}     }          @InBook{MH_NietzscheGott,       keywords =     {MH,D},       author =   {Martin Heidegger},       title =    {Nietzsches Wort `{Gott} ist tot'\,},       pages =    {193--247},       crossref = {MH_Holzwege}     }          @InBook{MH_Weltbild,       keywords =     {MH,D},       author =   {Martin Heidegger},       title =    {Die Zeit des Weltbildes},       pages =    {69--104},       crossref = {MH_Holzwege}          @Book{MH_SZ,       keywords =     {MH,D},       author =   {Martin Heidegger},       title =    {{Sein und Zeit}},       address =      {T\"{u}bingen},       publisher =    {Max Niemeyer},       year =     2001,       edition =      {18. Auflage},       addendum =     {1. Publikation: 1927}}         }          \end{filecontents}     \addbibresource{\jobname.bib}          \makeatother          \usepackage{babel}     \addto\extrasfrench{\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}}          \begin{document}          \title{Titre}               \author{A. Teur}          \maketitle          Texte\footcite[20]{MH_Kunstwerk}.          Plus de texte \footcite{MH_Weltbild}.          Et hop \footcite{MH_SZ}          Une derni\`ere\footcite{MH_NietzscheGott}          \printbibliography[title={Oeuvres de Martin Heidegger},keyword=MH,keyword=D]           \end{document}


title: How can I explain the meaning of LaTeX to my grandma?

text: I wrote a book about LaTeX, and my proud grandma wanted to have a copy. So she got it, said "What a beautiful picture on the cover!" and - "What is this, LaTeX?". She doesn't know Word, never used a computer. But she reads books. How can I explain what makes TeX and LaTeX special to a non-technical person? I don't mean introducing in using, and the existing question "What are TeX and LaTeX?" with its answers is still much too technical. Such challenges are not rare. I need to explain to my boss why I request some days off to go to a TeX conference, and soon my daughter will want to know what daddy does on the computer. My girlfriend needs to understand why I spend so much time at TeX.SE. Does anyone know eye-opening words? Perhaps an analogy or a metaphor would help? So grandma, girlfriend, daughter, boss - all may roughly understand and say "Ah, such a thing? Useful indeed!"


title: Number equations like subsections

text: I would like for equations to share the same counter as subsections. For example if my document is:               \documentclass{article}     \begin{document}     \section{A}     \begin{equation} 1+1=2 \end{equation}     \subsection{X}     \begin{equation} 1+1=2 \end{equation}     \begin{equation} 1+1=2 \end{equation}     \subsection{Y}     \begin{equation} 1+1=2 \end{equation}     \end{document}      I would like this output (produced here through a sneaky use of `\tag`): ![enter image description here](http://i.stack.imgur.com/8i3Zx.png) Something similar to how theorems of `amsthm` can be "siblings" with another counter. I am aware of the `\numberwithin` command of amsmath, but this is not what I want. I am also aware of the `aliascnt` package, but since "equation" is an existing counter, it doesn't work.


title: Beamer section page and show notes for every page

text: I want to have a notepage for every single page, even if it will be empty. This I accomplished with the help of this answer http://tex.stackexchange.com/a/11724/36296 But now, I have the problem, that I also want to have a special page at the beginning of a new section. But when I try to add a `\note{...}` after a new section started, there is an additional empty notepage. **Edit:** The goal I am trying to achieve is that after the section page the note page with "notes to section page" follows immediately without an empty notepage first.               \documentclass{beamer}          \setbeameroption{show notes}          % notepage for every slide, even if empty     \makeatletter      \def\beamer@framenotesbegin{%            \gdef\beamer@noteitems{}%            \gdef\beamer@notes{{}}%       }     \makeatother          % section page     \AtBeginSection{%         \begin{frame}             \insertsection         \end{frame}     }          \begin{document}              \begin{frame}             slide with note             \note{testnote}         \end{frame}              \begin{frame}             test with empty note         \end{frame}              \section{Section with note}         \note{notes to section page}          \end{document}      ![enter image description here](http://i.stack.imgur.com/2vwTp.png)


title: Table of Contents incorrect page numbering

text: I am using the following code.               \newpage     \section*{Abstract}     \addcontentsline{toc}{section}{Abstract}          \newpage     \tableofcontents     \addcontentsline{toc}{section}{Table of Contents}          \newpage     \listoftables     \addcontentsline{toc}{section}{List of Tables}          \newpage     \listoffigures     \addcontentsline{toc}{section}{List of Figures}       In my actual document, I have many sections, so the table of contents is actually two pages long. Unfortunately, when I run my LaTeX file, the 'Table of Contents' section in the Table of Contents has the incorrect page number (while everything else seems to be in order). It looks like the Table of Contents is using the page number of the second page, instead of the first page. e.g. In the Table of Contents, 'Table of Contents' is listed as being under page iii, when actually it starts on page ii. Page iii is actually the second page of my Table of Contents. Anybody know a quick fix for this?


title: Biblatex-nature \textcite with superscript reference number

text: My question is related to this question (shameless copy pasta of MWE). I would like to obtain the same citation style, so a `\textcite` that results in the author followed by a superscript reference. The standard for `biblatex- nature` however is a "full sized" reference               \documentclass{report}          \usepackage[style=nature]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{ABib.bib}     @article {article1,      AUTHOR = {Author, A. N.},      TITLE = {A sample paper},      JOURNAL = {Sample journal},      VOLUME = {1},      YEAR = {2013},      NUMBER = {1},      PAGES = {1--2}}     \end{filecontents}          \addbibresource{ABib.bib}          \begin{document}     Someone saw something \autocite{article1}.          \textcite{article1} saw something.     \end{document}      However, the answer given on the previous linked question gives the following error when used in combination with the `style=nature` command;               ! Package biblatex Error: Bibliography macro 'cite' undefined.


title: Blank page with page number after list of figures

text: I am getting a blank page after list of figures after compiling my TeX code. When I use `\clearpage` command, the page is removed but it reduces the total number of pages in my entire document. I am writing a report using report class and my references are limited to only one page if I use the `\clearpage` command otherwise the entire document is generated but with a blank page after list of figures. Can someone help me solve this issue? This is the main TeX code that I am compiling.               \documentclass[12pt]{report}     \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage{geometry}     \geometry{verbose,a4paper,tmargin=15mm,bmargin=30mm,lmargin=30mm,rmargin=20mm}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{float}     \usepackage{epstopdf}     \usepackage{setspace}     \usepackage{amsmath}     \usepackage{cite}     \usepackage{xcolor}     \usepackage{hyperref}     \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=blue,citecolor=red}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}     \onehalfspacing     \makeatletter     \makeatother     \renewcommand\bibname{Bibliography}     \begin{document}     \begin{titlepage}     \thispagestyle{empty}       <title page contents>     \end{titlepage}     \pagenumbering{roman}     \input{Certificate.tex}     \thispagestyle{empty}     \input{Declaration.tex}     \thispagestyle{empty}     \input{Acknowledgement.tex}     \thispagestyle{empty}     \input{Abstract.tex}      \tableofcontents     \listoffigures     \let\clearpage\relax     \input{Nomenclature.tex}     \newenvironment{mydef}[1]{\begin{definition} #1 \mbox{\\}     \rm}{\end{definition}}     \pagenumbering{arabic}     \input{Introduction.tex}     \input{Chapter1.tex}     \input{Chapter2.tex}     \input{Chapter3.tex}     \input{Conclusion.tex}     \input{Reference.tex}     \end{document}


title: Subcaption cannot be found by MiKTeX package manager?

text: Even though I cannot find it with the pacakage manager, a file with `\usepackage{subcaption}` in preambles can be complied successfully. Besides, the command `\begin{subfigure}...\end{subfigure}` cannot be recognized by TeXstudio, after I have manually added `subcaption.cwl` into the completion files.


title: Helix on a cylinder

text: I want to plot geodesics on a cylinder. These are straight lines, circles or helices. I can plot the first two, but I don't know how to draw the helices. To be precise, I would like to know how to draw an helix on this cylinder (passing thru two points A and B, but the location of the points is not relevant), using `TikZ` exclusively (maybe with `pgfplots`, but without using `pstricks`): ![enter image description here](http://i.stack.imgur.com/vsIFL.png)               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric}     \begin{document}     \begin{tikzpicture}     \node [cylinder,rotate=90,draw,aspect=2,minimum width=2cm,minimum height=3.5cm](C){};     \draw[fill] (-0.5,-0.5) circle [radius=0.045]node[below]{$A$};     \draw[fill] (0.5,0.75) circle [radius=0.045]node[below]{$B$};     \end{tikzpicture}     \end{document}


title: Different editor for collection and maintitle

text: BibLaTeX/biber seems to be unable to handle the following case: A `@Collection` is part of another series-like collection (`series` has already been used), for which I use `maintitle` (`series` has already been used). But: The `@Collection`'s `editor` is not the `maintitle`'s editor ... To give an example _how it should look like_               @BookInBook{Erler:PlatonHaBu,       title =    {Platon},       year =     2007,       author =   {Michael Erler},       gender =   {sm},       booktitle ={Die Philosophie der Antike},       editor =   {Hellmut Flashar},       maintitle ={Grundriss der Geschichte der Philosophie},       language = {german},       volume =   2,       part =     2,       publisher = {Schwabe},       location = {Basel}     }      becomes (using BibLaTeX/biber with `style=philosophy-modern`, which shouldn't make any difference) > Erler, Michael > > 2007 _Platon_ , in _Grundriss der Geschichte der Philosophie_ , Bd. 2.2: > _Die Philosophie der Antike_ , hrsg. von Hellmut Flashar, Basel: Schwabe. > > Excellent: 20 volumes _Outlines of the History of Philosophy_ (`maintitle`) > --> part of it: _Ancient Philosophy_ (`booktitle`, `editor` is Flashar) --> > single volume: _Plato_ (`title`, `author` ist Erler) **BUT** :               @Collection{JongNuenlist:Time,       editor =   {Irene J. F. de Jong AND Ren{\'e} N{\"u}nlist},       sortname = {Jong, Irene J. F. de AND Rene{\'e} N{\"u}nlist},       gender =   {pp},       title =    {Time in Ancient Greek Literature},       booktitle = {Time in Ancient Greek Literature},       shorttitle = {Time},       maintitle = {Studies in Ancient Greek Narrative},       volume =   2,       language = {english},       year =     2007,       series =   {Mnemosyne. Supplementum},       number =   291,       publisher = {Brill},       location = {Leiden AND Boston}     }      becomes > De Jong, Irene J. F. und René Nünlist > > 2007a Hrsg., _Studies in Ancient Greek Narrative_ , Bd. 2: _Time in Ancient > Greek Literature_ , Mnemosyne. Supplementum 291, Leiden und Boston: Brill. I need it as `@Collection`, because I cite several `@InCollection`s. Neither are de Jong and Nünlist the editors of the `maintitle`, whereof there is no `editor` at all, but of this `@Collection`, nor do I want to print the `maintitle` before the `title` of the `@Collection`. It should look like > De Jong, Irene J. F. und René Nünlist > > 2007a Hrsg., _Time in Ancient Greek Literature_ , in _Studies in Ancient > Greek Narrative_ , Bd. 2, Mnemosyne. Supplementum 291, Leiden und Boston: > Brill. The latter I get with `booktitleaddon`, which is un-TeXy, messy and unordered.


title: \cref inside a heading breaks PDF bookmark

text: In the following MWE, the bookmark produced by hyperref is incorrect:               \documentclass{article}      \usepackage{hyperref}     \usepackage[capitalize,nameinlink,noabbrev]{cleveref}          \hypersetup{%         bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%     }             \begin{document}      \section{\label{sec:foo}foo}     \section{Code for \cref{sec:foo}}     \end{document}      The heading of section 2 in the PDF is correct (`Code for Section 1`), but the bookmarks as shown in Acrobat read:               1 foo     2 Code for sec:foo      **Edit:** as Micha pointed out, the code also produces a warning:               Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):     (hyperref) removing `\@ifnextchar' on input line 11.      Using the allmighty `\protect` before the `\cref` unfortunately did not change anything ;).


title: footnotes indentation issue

text: I have checked the whole forum for finding solution to this problem. Problem: I have added some footnotes to my LaTeX template. All footnotes work fine except this one. This is how it appears ![enter image description here](http://i.stack.imgur.com/ZpPbv.png) Here is the minimal working example.               \documentclass{fcs}     \usepackage{bm}          \volumn{ }     \doi{ }     \articletype{REVIEW~ARTICLE}     \copynote{{\copyright} Higher Education Press and Springer-Verlag Berlin Heidelberg 2012}     \ratime{Received month dd, yyyy; accepted month dd, yyyy}     \email{$\times\times\times\times@\times\times\times.\times\times\times$}     %% Title     \title{$\bm{Frontiers~ of~ Computer~ Science}$\\[2mm] Instruction for authors}     %% Authors     \author{Firstname LASTNAME \xff $^{1,2}$}     %% Addresses of authors     \address{{1\quad Higher Education Press, Beijing 100029, China}\\     {2\quad Acadcmic Journal Division, Beijing 100029, China}}          %% Running head     \markboth{Front. Comput. Sci.}{Firstname LASTNAME: please insert running head here}          \begin{document}     \maketitle     \setcounter{page}{1}     \setlength{\baselineskip}{14pt}          \begin{abstract}      A short abstract of up to 300 words written in one paragraph     \end{abstract}          \Keywords{Up to 8 words separated by commas.}          \section{Introduction}          \noindent Frontiers of Computer Science is an international     peer-reviewed academic journal sponsored by the Ministry of     Education of China. The journal is jointly published by Higher     Education Press of China and Springer on a bimonthly basis in     English. Online versions are available through both     http://www.springerlink.com/content/11704 and     http://journal.hep.com.cn/fcs.     % here is my line     For instance, \textit{@ActionID}\footnote{http://bits.netbeans.org/dev/javadoc/org-   openide-awt/org/openide/awt/ActionID.html, verified 24-07-14} taken from the NetBeans  FAQ\footnote{http://wiki.netbeans.org/DevFaqActionAddJavaPackage,verified 24-07-14} deals with the retention (how long annotations are to be retained in a system) and target of a code.          \end{document}      It is clearly seen that the first footnote doesn't appear properly while the second one appears almost perfect.


title: pmatrix and superscript

text: I would like to place a superscript to a pmatrix, but the superscript is not correctly positioned.               \begin{pmatrix}      1 & 2 & 3 \\     4 & 5 & 6 \\     7 & 8 & 9     \end{pmatrix}^{T}      Any suggestions?


title: Error: "per-mode" is undefined

text: The simple expression:               $v_f = \SI[per-mode=fraction]{32}{\meter\per\second}$      when parsed, yields the following error:               ! Package xkeyval Error: `per-mode' undefined in families `key'.      However, removing `[per-mode=fraction]` causes it to work fine. How can I print this as a fractional unit?


title: What command to use for reversed $\vDash$?

text: I want to use a symbol similar to               $\vDash$       but reversed (like if it's mirrored against an imaginary vertical line). I cannot find such a symbol anywhere. I have used detexify too but no luck there either. Do you know what command and package I should use?


title: Referencing a figure throwing up '??', not '1'

text: I've only very recently started with LaTeX and can't seem to get this to work!               \documentclass{article}     \begin{document}     \begin{figure} [h!]     \centering     %\includegraphics[width=40mm]{UNSWlogo.jpg}     \caption{UNSW Emblem}\label{fig:logo}     \end{figure}     Please see Figure \ref{fig:logo} blah blah blah     \end{document}      Its giving me > Figure ?? instead of > Figure 1 as expected or an actual number.


title: parsing bbl file to an xml file from within pdflatex while typesetting

text: As editor of a journal I need to translate the bibliography, in a bbl file, into part of an xml file (for potential submission to cross-ref). It seems best done on the fly by pdfLaTeX so I can also record in the xml the main metadata (authors, title, pages, volume, etc). Currently I use a scheme for bbl files where the `\bibitem` does not involve brackets, e.g. `\bibitem{Smith99} ...` The problem is that as soon as the bbl file uses brackets (as in `natbib`) then my scheme fails catastrophically on `\bibitem[blah]{Smith99} ...` Question: how can I get pdfLaTeX to parse a bbl file, with such `\bibitem[]{}`, into an xml file while pdflatex is typesetting to pdf? Currently I do the following (hacked from somewhere in latex and executed \AtBeginDocument):               \renewcommand{\bibitem}[1]{</unstructured_citation></citation>         ^^J<citation key="#1"><unstructured_citation>}     ...       \def\j@@Input{%       \let\jrnltempb\jrnltempa       \immediate\read\jrnlin to\jrnltempa       \ifeof\jrnlin         \immediate\closein\jrnlin       \else         \immediate\write\jrnlout{\jrnltempb}         \expandafter\j@@Input       \fi}     \typeout{**** Starting to write the bibliography to the xml.}     \newread\jrnlin     \immediate\openin\jrnlin\jobname.bbl\relax     \immediate\write\jrnlout{<citation_list>         ^^J<citation key="nil"><unstructured_citation>}     \immediate\read\jrnlin to\jrnltempa       \immediate\read\jrnlin to\jrnltempa     \j@@Input     \immediate\write\jrnlout{</unstructured_citation></citation>         ^^J</citation_list>}       \immediate\closein\jrnlin


title: How do I change the label separator for marginfigure in Tufte Book/Handout?

text: I'm trying to use the caption package to do this and I've used the following code, but it's still not giving me a period as a label separator. How can I go about fixing this? Here's what I have:                   \documentclass[english,dotinlabels,nohyper,notoc]{tufte-handout}         \usepackage{babel}         \usepackage{hyperref}         \usepackage{caption}         \captionsetup[figure]{labelformat=simple, labelsep = period}         \captionsetup[marginfigure]{labelformat=simple, labelsep = period}              \begin{document}              \section{test}              \begin{figure}         \caption{erere}         \end{figure}              \vspace{20pt}              this is a test              \begin{marginfigure}         \caption{rerweaere}         \end{marginfigure}              \end{document}      As indicated below, it works for figure, but not margin figure: ![enter image description here](http://i.stack.imgur.com/GQSHQ.png)


title: Bessel function with pgfplots

text: I want to plot a vibrating membrane and therefor I need the bessel functions. As I'm using pgfplots, I wondered if there is anything pgf-related that can be used to create a corresponding output. I'm providing a MWE for playing around with the package.               \documentclass{article}     \usepackage{pgfplots}     \begin{document}       \begin{tikzpicture}         \begin{axis}           \addplot3[surf, z buffer=sort, domain=0:1, y domain=0:2*pi]             ({x * cos(deg(y))}, {x * sin(deg(y))}, {cos(pi*x)});         \end{axis}       \end{tikzpicture}     \end{document}      Has anybody a workaround or a way of using the functions?


title: Error with line-breaking in cvlistdoubleitem in moderncv

text: I'm experiencing a strange asymmetry in how `moderncv`'s `\cvlistdoubleitem` command handles line-breaking. This code compiles perfectly.               \documentclass{moderncv}     \moderncvstyle{classic}     \moderncvcolor{blue}     \name{John}{Doe}          \begin{document}          \section{References}     \cvlistdoubleitem{Prof. Charles Xavier\\Trinity College, Cambridge}{Prof. John Frink}          \end{document}      However, when I switch the line-breaking to the second part of the `\cvlistdoubleitem`, it doesn't compile.               \documentclass{moderncv}     \moderncvstyle{classic}     \moderncvcolor{blue}     \name{John}{Doe}          \begin{document}          \section{References}     \cvlistdoubleitem{Prof. Charles Xavier}{Prof. John Frink\\Trinity College, Cambridge}          \end{document}      In the latter case, I get the following error message. > ! TeX capacity exceeded, sorry [parameter stack size=10000]. \csuse #1-> > \ifcsname #1\endcsname \csname #1\expandafter \endcsname \fi l.9 ...of. John > Frink\Trinity College, Cambridge} Why does the problem occur in one case but not the other?


title: Koma script: Restore default chapter style

text: I want to have for just one chapter a special chapter heading format. So I use the command               \setkomafont{chapter}{\centering\large\rmfamily}      and then I want to revert back to the default chapter style that `scrbook` uses. The problem is that I don't know this default style (e.g. someone may change the preamble and have `\Huge` size instead of `\LARGE` that I have now). Can I somehow save the current chapter style and restore it later?


title: Chapter name overrunning page

text: I am editing a collection of documents, a few of which the author has given such long titles that, when they are formatted as chapters, the heading overruns the page. The following code should suffice to reproduce this situation:               \documentclass[12pt,letterpaper]{book} % 12pt is a manuscript requirement.     % I am using the following three packages with pdflatex.     \usepackage[utf8x]{inputenx}     \usepackage[T1]{fontenc}     \usepackage[german]{babel}     \usepackage[top=3.0in,head=2.0in,inner=2.0in,outer=1.0in,bottom=1.0in,nofoot]{geometry} % Manuscript requirement.     \usepackage[none]{hyphenat} % Manuscript requirement.     \usepackage{microtype} % Provides ligature disabling in pdflatex (manuscript requirement) among other things.     \usepackage[document]{ragged2e} % Manuscript requirement.     \usepackage[doublespacing]{setspace} % Manuscript requirement.     \usepackage{textcomp}     \usepackage{tgheros} % The font that I intend to use.     \sloppy % Helps package hyphenat.     \renewcommand*{\familydefault}{\sfdefault}     \DisableLigatures[f]{encoding=T1} % Manuscript requirement.     \begin{document}     \selectlanguage{german}     \renewcommand*{\chaptername}{\textnumero{}}     \renewcommand*{\thechapter}{592}     \chapter{>>Kleiner Ärger -- vom Mantel der Zufriedenheit überdeckt<< (Beweise für die Unmenschlichkeit und Verlogenheit der >>Arbeiter<<-Annonce in >>Welt<< und >>Spiegel<<) (von~Schnitzler, 2.~August~1971)}     \textlangle{}Text\textrangle{}     \end{document}      Obnoxious in more ways than one, no? In this situation I would prefer to break the heading to the next page at the bottom margin. Does anyone have ideas on how to do this?


title: The number line drawn by tikz tex doesn't shift as I had expected

text: I was trying to draw a number line such as:               |---+----+-----+----- ....    |      0  0.1  0.2    0.3       0.9  1      However, the dot number line doesn't shift as I had expected, any help is appreciated. ![enter image description here](http://i.stack.imgur.com/KPSOW.png) The source are:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows}     \begin{document}     \begin{tikzpicture}          % draw arrow line     \draw[latex-latex] (-0.5,0) -- (10.5, 0);     % draw vertical bar     \foreach \x in {0, 1, ..., 10}         \draw[shift={(\x,0)}, color=black] (0pt, 3pt) -- (0pt, -3pt);          \draw[color=black] (0pt, 0pt) -- (0pt, -3pt)              node[below] {\Large $0$};          \draw[shift={(10,0)}, color=black] (0pt, 0pt) -- (0pt, -3pt)             node[below] {\Large $1$};          \foreach \x in {1,2, ..., 9}         draw[shift={(\x,0)}, color=black] (0pt, 0pt) -- (0pt, -3pt)             node[below] {$0.\x$};          \end{tikzpicture}     \end{document}


title: Image behind and beyond crop marks?

text: This is what I'm trying to do... Please note that the images that will be used in the final version are of slightly uneven size, so that should ideally be taken into account. I've been through the usual suspects and hope someone can help! Normal pages should look like this: ![enter image description here](http://i.stack.imgur.com/y8zLB.jpg) Pages with a background image (and no text whatsoever) like this: ![enter image description here](http://i.stack.imgur.com/VE5Bu.jpg) Close up, notice the crop marks: ![enter image description here](http://i.stack.imgur.com/iNjv1.jpg) I'm using `memoir` with `showtrims` (custom page size), here's an MWE in just in case...               \documentclass[book,openany,showtrims]{memoir}     %  Crop settings via  http://latex-my.blogspot.dk/2009/10/setting-page-size -and-margins.html          %% The stock paper size     \setstocksize{236mm}{161mm}          %% The 'real' page size     \settrimmedsize{230mm}{155mm}{*}          %% The stock paper will be trimmed 3mm from the     %% top edge and 3mm from the left edge     \settrims{3mm}{3mm}          %% Spine and trim page margins from main typeblock     \setlrmarginsandblock{20mm}{15mm}{*}          %% Top and bottom page margins from main typeblock     \setulmarginsandblock{20mm}{20mm}{*}          %% Header occupies height of a single line;     %% Bottom edge of footer is 7mm from bottom edge     %% of typeblock     \setheadfoot{\baselineskip}{7mm}          %% Bottom edge of header is 7mm from top edge of     %% typeblock     \setlength\headsep{7mm}          \checkandfixthelayout          \usepackage[utf8]{inputenc}     \usepackage[danish]{babel}     \begin{document}      Bla     \end{document}


title: Proper alignment of three boxes

text: I want two text boxes to appear next to a photo which is 5cm wide. The combined height of the boxes may be greater than or less than the height of the photo. If the combined height is less than the photo, I want the text boxes aligned vertically with the top and the bottom of the photo thus:               +---------------------------------------+  +------------+     | Text1 text1 text1 text1 text1 text1   |  |            |     | text1 text1 text1 text1 text1.        |  |            |     +---------------------------------------+  |            |                                                |   Photo    |                                                |            |     +---------------------------------------+  |            |     | Text2 text2 text2 text2 text2 text2   |  |            |     | text2 text2 text2 text2 text2.        |  |            |     +---------------------------------------+  +------------+      If the combined height is greater than the photo, I want the two boxes below each other thus:               +---------------------------------------+  +------------+     | Text1 text1 text1 text1 text1 text1   |  |            |     | text1 text1 text1 text1 text1 text1   |  |            |     | text1 text1 text1 text1 text1 text1   |  |            |     | text1 text1 text1 text1 text1 text1   |  |   Photo    |     +---------------------------------------+  |            |     +---------------------------------------+  |            |     | Text2 text2 text2 text2 text2 text2   |  |            |     | text2 text2 text2 text2 text2 text2   |  |            |     | text2 text2 text2 text2 text2 text2   |  +------------+     | text2 text2 text2 text2 text2.        |     +---------------------------------------+      Is there any way to achieve this automatically? And if not, how can I best achieve what is shown in the first illustration? (I've experimented with both tabular/multirow setups and with floats, but I just can't get it right.) Edit: This is one of the things I've tried to no avail (replace 1988.jpg with an appropriate filename):               \documentclass{report}     \usepackage{graphicx}     \usepackage{multirow}          \begin{document}          \begin{tabular}{l r}     \fbox{\parbox[t]{8cm}{Text1 text1 text1 text1 text1 text1 text1 text1 text1 text1     text1 text1 text1 text1 text1.}}      & \multirow{3}{*}{\parbox[t]{5cm}{\includegraphics[width=5cm,height=10cm]{1988.jpg}     }} \\     \parbox{8cm}{\vfill} & \\     \fbox{\parbox[b]{8cm}{Text2 text2 text2 text2 text2 text2 text2 text2 text2 text2     text2 text2 text2 text2 text2.}} & \\     \end{tabular}          \end{document}


title: Selfhosted collaborative webbased LaTeX editor

text: I'm searching for a LaTeX editor that I can run on my GNU/Linux server and allows realtime collaboration as well as online compiling and previewing. What I've tried so far:   * FlyLaTeX: Editing works fine, but PDF-Preview doesn't work (Bug report)   * Cloud9 IDE: Works fine, but I can't get the LaTeX-Plugin to work (Bug report) So my question: Can anyone suggest such an editor that is actually working or does anyone know how to solve the issues I encountered with FlyLaTeX and Cloud9 IDE. **Edit:** I wrote an email to the developer of FlyLaTeX and he explained that FlyLaTeX currently doesn't support additional LaTeX packages. So FlyLaTeX is not an option right now. I stumbled across etherTeX, based on etherpad lite. I'll try this one out.


title: Appendices of each chapter in latex

text: ![enter image description here](http://i.stack.imgur.com/4gNIr.png)I have two chapters and I have two appendix (A and B) for each chapter. How can I create it in latex at the end of my thesis?


title: How to scale or resize equation with \eqno in LaTeX

text: I want to scale or resize an equation because it goes over the margin. Take this example:               $$0<a_{1}\leq a(X,t)\leq     a_{2}<+\infty, ~~~\forall X \in \Omega;~~~ \eqno(3) $$      In normal equation command I can resize it like this:               \begin{equation}     \resizebox{0.9\hsize}{!}{$     0<a_{1}\leq a(X,t)\leq     a_{2}<+\infty, ~~~\forall X \in \Omega;~~~ \eqno(3)      $}     \end{equation}      But when I try to do the same approach for the equation with `\eqno` it doesn't work, it says you cannot use `\eqno` in math mode, even if I put the `\eqno` outside the resizebox it says you can't use `\eqno` in horizontal mode. Note that I have hundreds of equation already written in `\eqno` format not `\begin{equation}` so it will be hard for me to convert them. Also, I want to use `\eqno` to customize the equation numbers. Is there any solution for this?


title: natbib: modifying citation style for particular source type, while others remain default

text: I'm using `natbib` and would like to modify the punctuation style for one particular type of source (classical texts), while punctuation for remaining sources should remain at their default settings. In particular, I would like to cite ancient texts without author names and without commas: e.g. Aristotle's Politics, section 123, would be referred to in-text like this: > blablabla (Politics 123) whereas other sources should be referred to in-text in the default manner, i.e. as author-year, with a comma between year and page: > yadayayaya (Smith 1992, 33). So far I'm using `\defcitealias` and `\citepalias`, which works fine except for the punctuation:               \defcitealias{Aristotle1992}{\textit{Politics}}       \citepalias[123]{Aristotle1992}      results in > (Politics, 123) => I would like to get rid of the comma here, while still keeping the comma for the other references. Is there any way of achieving this from within the `natbib` package (if at all possible, I'd rather not switch to e.g. `biblatex`)...? I'd be immensely grateful for any help. * * * Here's some example code (hope this classifies as a workable example):               \documentclass{article}     \begin{filecontents}{\jobname.bib}     @BOOK{Aristotle1992,       title = {The Politics},       publisher = {London: Penguin},       year = {1992},       author = {Aristotle}         }          @BOOK{Smith2003,       title = {Blalala},       publisher = {London: Penguin},       year = {2003},       author = {Smith, John}         }     \end{filecontents}       \usepackage{natbib}       \begin{document}            \defcitealias{Aristotle1992}{\textit{Politics}}              This is as close as I get to what I want, but I would like to get rid of the comma:            \citepalias[123a]{Aristotle1992}            Other sources should be referred to in the usual way though (author date, page):            \citep[p.~222]{Smith2003}            \bibliographystyle{chicago}         \bibliography{\jobname}       \end{document}


title: How to embed 3 videos horizontally using media9?

text: I am using `media9` package. I want to insert 3 videos horizontally & then in the next row again 2 videos.               \includemedia[       activate=pageopen,       width=50pt,height=50pt,       addresource=camera1-.mp4,       flashvars={%          source=camera1-.mp4% same path as in addresource!        &autoPlay=true%    % optional configuration        &loop=true%        % variables       }       ]{}{VPlayer.swf}          \includemedia[       activate=pageopen,       width=50pt,height=50pt,       addresource=camera2-.mp4,       flashvars={%          source=camera2-.mp4% same path as in addresource!        &autoPlay=true%    % optional configuration        &loop=true%        % variables       }       ]{}{VPlayer.swf}          \includemedia[       activate=pageopen,       width=50pt,height=50pt,       addresource=camera6-.mp4,       flashvars={%          source=camera6-.mp4% same path as in addresource!        &autoPlay=true%    % optional configuration        &loop=true%        % variables       }       ]{}{VPlayer.swf}          \includemedia[       activate=pageopen,       width=50pt,height=50pt,       addresource=camera4-.mp4,       flashvars={%          source=camera4-.mp4% same path as in addresource!        &autoPlay=true%    % optional configuration        &loop=true%        % variables       }       ]{}{VPlayer.swf}          \includemedia[       activate=pageopen,       width=50pt,height=50pt,       addresource=camera7-.mp4,       flashvars={%          source=camera7-.mp4% same path as in addresource!        &autoPlay=true%    % optional configuration        &loop=true%        % variables       }       ]{}{VPlayer.swf}      Please help!


title: Make all elements in pause cleared (Beamer)

text: I have more than two elements in one frame that I would like to have in `\pause`. But the `\pause` make me appear only the next element cleared. I want that all elements in the same frame in pause appear cleared and then go colored one by one. How can I do?                \documentclass{beamer}      \begin{document}      \begin{frame}\frametitle{Title}      \begin{block}{}           \end{block}       \pause      \begin{block}{}           \end{block}       \pause      \begin{block}{}           \end{block}     \end{document}


title: how to store page numbers in array and retrive them later?

text: I am working on one application where i need to store page numbers in an array and retrive them later to print index. I don't want to use the existing index function as i need to have control on it. How can i implement it?


title: Set a tikz node's contents from a style

text: In tikz, how can I set a node's contents from a style ? For example, instead of writing this:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix}     \begin{document}     \begin{tikzpicture}       \matrix[matrix of nodes] {         |[name=A-Foo]|A.Foo & |[name=B-Foo]|B.Foo & \dots \\       };     \end{tikzpicture}     \end{document}      I would like to write this, but the option `contents` doesn't exist:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix}     \begin{document}     \begin{tikzpicture}[       nc/.style 2 args={name={#1-#2}, content={#1.#2}}       ]       \matrix[matrix of nodes] {         |[nc={A}{Foo}]| & |[nc={B}{Foo}]| & \dots \\       };     \end{tikzpicture}     \end{document}


title: How to change the color of itemized text using `\color<>[]{}` in Beamer?

text: I want to change the item text color in Beamer. I checked the Beamer User Guide and found the `\color<>[]{}` command in page 80. > \color<2-3>[rgb]{1,0,0} This text is red on slides 2 and 3, otherwise black. Then I found an example which uses this command in the `enumerate` environment in the tutorial (page 15).               \begin{enumerate}[A]            \item<2-5> James Madison             \item<3-5> Harry Truman             \item<4-> \color<6>[rgb]{0,0.6,0}Abraham Lincoln             \item<5-5> Calvin Coolidge         \end{enumerate}         I then try a minimal example as follows (the example is also publicly available at ShareLatex. It is read-write allowed. So you are free to modify it.):               \documentclass[a4paper]{beamer}        \begin{document}             \begin{frame}                 \begin{itemize}                     \item \color<2>[rgb]{1,0,1}{text1}                     \begin{itemize}                         \item text11                     \end{itemize}                     \item text2                     \begin{itemize}                         \item text21                     \end{itemize}                     \item text3                \end{itemize}           \end{frame}       \end{document}      On the first slide, it is OK: ![item text color 1](http://i.stack.imgur.com/VoDx5.jpg) On the second slide (`\color<2>[rgb]{1,0,1}{text1}`), all the three outer itemized texts (i.e., text1, text2, and text3) become red as shown in the following image. However, I only want to change the color of the first itemized text (i.e., text1 here). ![item text color 2](http://i.stack.imgur.com/JTxxB.jpg) Therefore, my question is: >   1. How to change the color of a single itemized text (i.e., text1 here) > using the command `\color<>[]{}`? >   2. If the command is not feasible (why?), then what are the alternative > approaches? >


title: Scaling of Schwabacher font

text: I want to use the Schwabacher font from the yfonts package but unfortunately I am unable to scale it. So this works:               \documentclass{article}     \usepackage{yfonts}     \usepackage[T1]{fontenc}     \begin{document}     \swabfamily     Text     \end{document}      But when I try to change the font size using               \documentclass[12pt]{article}      or               \Large      or               \fontsize{12}{18}      I get an output which isn't typeset in Schwabacher anymore but falls back to the standard font. Any help would be much appreciated!


title: Strange line appearing in tikz plots

text: I am generating plots using matlab2tikz and then including all of these .tikz files into my dissertation. I have declared the following in the the .tex file               \usepgfplotslibrary{external}      \tikzexternalize      because many of the plots contain lots of data points and its gets difficult to compile it all at together. The problem is that many of the plots contain this strange vertical line through them as shown and I have no idea where this is coming from. It occurs in many of the plots and I don't know how to remove it. If anybody has any ideas I would be very grateful. I cant post a screenshot of what it is because but its just a slightly gray line that runs down the right hand side of the plot on each figure ![With the line](http://i.stack.imgur.com/wc2vd.jpg) ![Without the line](http://i.stack.imgur.com/PkxGY.jpg)


title: Can I automatically adjust the vertical alignment of square brackets in text?

text: Many roman and sans serif fonts, and the default LaTeX fonts in particular, seem to have a thing with square brackets: they descend a long distance below the baseline, probably in order to "catch" descenders. However, in a lot of cases this looks really odd (at least to me), especially when typesetting things like X[10]: ![Weird brackets](http://i.stack.imgur.com/3zTwM.png) For that use case it looks a lot better to me (personally) when the square bracket is centered vertically around the midpoint of the capital letter. Except in the `tt` font where it already looked fine before and which got broken by the change. I can live with the fact that the `g` now looks slightly out of place, which was also the case before in the `tt` version. ![Nice brackets](http://i.stack.imgur.com/8lAW2.png) Now I ask more out of curiosity than out of need: Is there a document-based way (i.e. other than adjusting the font files) to shift all square brackets in the current scope (or in the whole document) up bit a certain amount (ideally depending on the current font family and size)? In my limited understanding such a thing would probably require a lot of black magic TeX hackery, breaking many things in the process... or maybe it would not. Maybe one of the wise TeX wizards around here knows the answer. * * *               \documentclass{article}     \newcommand{\R}[1]{\raisebox{0.075em}{#1}}     \begin{document}     \noindent     rm: \textrm{X[10g]}\\     sf: \textsf{X[10g]}\\     tt: \texttt{X[10g]}\\     math: $X[10g]$\\          \noindent     rm: \textrm{X\R[10g\R]}\\     sf: \textsf{X\R[10g\R]}\\     tt: \texttt{X\R[10g\R]}\\     math: $X\R[10g\R]$\\     \end{document}


title: Header on even or odd pages

text: Hi everyone I have been trying to create a different header for even or odd pages where I want to see the name of the section and the name of subsections. This is what I have done but it is not working.               \usepackage{fancyhdr}         \makeatother          \usepackage{babel}     \begin{document}     \pagenumbering{Roman}          \renewcommand{\thesection}{\Roman{section}}              \section{Introduction}         \newpage          \renewcommand{\thesection}{\arabic{section}}         \setcounter{section}{0}          \pagenumbering{arabic}         \pagestyle{fancy}          \fancyhf{}         \fancyfoot{}         \fancyhead[RO,LE]{\thepage}         \fancyhead[LO]{\small\nouppercase\leftmark}         \fancyhead[RE]{\small\rightmark}              \section{First Section}         \newpage          \subsection{First subsection}         \newpage             \subsection{Second subsection}         \newpage            \section{Second Section}     \newpage          \subsection{First subsection}         \newpage         \subsection{Second subsection}          \end{document}      This is pretty much my example, I would like to see something like this: On even pages the name of the section, and on odd pages the name of the subsection, but I am having the same result always. Only the name of the section appears, and the numeration is not located according with the kind of page (even or odd). What else do I need to add or erase?.


title: How would I typeset a two-column layout, where the headings are on the left side and the contents are on the right?

text: I'm trying to typeset my resume using TeX. I'll start off by showing an approximation of what I want to do with this picture: ![image](http://i.stack.imgur.com/2aXp2.png) Note the red lines in the picture are only for illustrative purposes. Here are the details. I would like to have a two-column format. My resume would have some headings, like EDUCATION, and EXPERIENCE, these headings should all be on the left side of the thick line. (Refer to the picture.) All the contents that belong to the headings are on the right side. Also, I would like the first line of contents to align with its corresponding heading, as shown by the thinner lines. Here's my attempt at solving this problem. The following code gave rise to the above picture. It's hacky, and I really don't like it:               \long\def\section#1#2{{\leftskip=1.5in \noindent\llap{\hbox to 1.5in{#1\hss}}#2\par}\medskip}     ...     \section         {EXPERIENCE}         {These are my experiences\par\indent Experience 1\par\indent Experience 2}      There are many problems with this. First, because I can have multiple paragraphs in the contents, I had to use `\long\def` for the definition. The macro also awkwardly uses `\llap` to force the headings on the left side. The `\noindent` in the macro forces the start of a paragraph. It does not do the line-breaking properly for the heading (as you can see from the summary of qualifications). If I typed a lot of contents, it probably won't do the correct line breaking for that, either. I thought that there's got to be a better way to do this. At this point, I'm still torn about the choice between between LaTeX and ConTeXt. The choice would be a different discussion, but I can accept answers in either flavour.


title: Absolute positioning in beamer when using `show notes on second screen`: text on wrong page

text: If you compile the example below, you have a very comfortable way to put sources on the slides for for LaTeX `beamer`. However, if you uncomment the line with the option `show notes on second screen`, then the text is set on the wrong page, namely the previous page. Here is a(n) (almost) minimal working example:               \documentclass{beamer}          \usepackage{pgfpages}     % the following line, if not commented, moves the ``source'' to the previous page     %\setbeameroption{show notes on second screen}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % ----------     % from http://tex.stackexchange.com/a/48485/17127     \usepackage[absolute, overlay]{textpos}          \setbeamercolor{framesource}{fg=gray}     \setbeamerfont{framesource}{size=\tiny}          \newcommand{\source}[1]{\begin{textblock*}{8cm}(4.7cm,8.6cm)         \begin{beamercolorbox}[ht=0.5cm,right]{framesource}           \usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}         \end{beamercolorbox}        \end{textblock*}     }     % ----------          \title{MWE}          \begin{document}          \begin{frame}       \titlepage       \note{my note}     \end{frame}          \begin{frame}{title}       a diagram       \source{some article or url}     \end{frame}          \end{document}      The answers to this question did not really help me. Update: This answer to another question might contain the answer. Is this correct? Are there a better solutions to the problem? Or are there alternatives for the `\source`-command? Can the above `\source`-command be extended to support multiple sources? Footnotes are an easy substitute, but they are more obtrusive than the above `\source`-command. Could this easily be changed and how? **Solution:** The accepted answer provides the desired `\source`-command. It is convenient to use, provides a correct and unobtrusive placement, and works with `show notes on second screen`. It even supports multiple sources.


title: Line breaks in bibliography with biblatex/biber

text: I'm having trouble getting `biblatex` to break lines in a sensible way in the bibliography. Specifically, it seems that the line cannot be broken within the specification of chapter and/or page numbers. Mostly, the breaks are fine just because there is no need to break at this point. So the example below is fairly specific and altering it slightly eradicates the problem. In my real bibliography, of course, I can't just change the book title or chapter number to make the lines easier for TeX to break! MWE:               \documentclass[11pt,a4paper]{article}     \usepackage{geometry}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @inbook{den-art-coll,         crossref            =   {den-coll},         title               =   {Personal Chips and Getting Oneself Good},         pages               =   {345--564},         chapter             =   89}     @suppbook{den-coll-intro,         crossref            =   {den-coll},         title               =   {Introduction},         pages               =   {1--9}}     @book{den-coll,       author                =   {Till, Jr., Dennis E.},         booktitle           =   {Penguin Land and Further North: Human Influence},         title               =   {Penguin Land and Further North: Human Influence},         publisher           =   {Oxford University Press},         year                =   2008,         address             =   {Oxford and New York}}     \end{filecontents}     \usepackage[citestyle=authoryear-comp,bibstyle=authoryear,mergedate=basic,isbn=false,url=false,eprint=false,dashed=true,doi=false,sortcites=true,backend=biber,mincrossrefs=6]{biblatex}     \DefineBibliographyStrings{english}{%       page                  =       {{}{}},       pages                 =       {{}{}},       }     \bibliography{\jobname}     \begin{document}            \autocite{den-art-coll, den-coll-intro}            \printbibliography          \end{document}      ![Poor line breaks in bibliography](http://i.stack.imgur.com/SDocC.png) What should I be doing differently to avoid this problem? Specifically, how do I persuade TeX to break the line following the chapter and before the page numbers when this is appropriate? That is, I take it that the best break probably follows 'Chap. 89,' just before the first page in the page range. But TeX seems unwilling to break the line at this point. If I add a single letter to the book title, TeX breaks the line before 'Chap.' which suggests that it is treating 'Chap. 89, 345--' as a single unit which seems clearly undesirable.


title: Align numbers with each other

text: In using the `align*` environment, how can I get specific numbers to align with each other? In the following example, I want each term of the top sum and the bottom sum to be aligned with each other:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}     2S &= 1 &+ 2 &+ 3 &+ \ldots &+ (N-2) &+ (N-1) &+ N \\     &= N &+ (N-1) &+ (N-2) &+ \ldots &+ 3 &+ 2 &+ 1     \end{align*}     \end{document}      Currently, this looks ugly: ![alignpic](http://i.stack.imgur.com/kRlqi.png)


title: including algorithms in latex

text: I am using the               \usepackage{algpseudocode}     \usepackage{algorithm}      packages and creating a sample algorithm using the `\COMMENT`, `\IF`, `\ENDIF` and `\FOR` constructs. When I compile this and view the PDF file, I don't see any of the key words, the indenting is not correct and I have to explicitly mention the key words. Is there anything that I am missing here? I am using TeXShop on OS X. EDIT : This is what I am using                      \begin{algorithm}            \caption{Algorithm for finding server indices using OFG}                  \begin{algorithmic}             \newline             \COMMENT { \%comment: servers[] contains the index of servers whose         data rate are sorted in descending order\%}\newline             \STATE servers[]= index(of all servers) \newline             \STATE serverIndex[]=servers[0..K]\newline             \STATE linearlyIndependentServerIndex[]=0\newline             \STATE $[Z] \leftarrow 0$\newline             \FOR  {$i=0$ to $serverIndex.length$} \newline             \COMMENT{ \%comment: find the equation corresponding the serverIndex        from the mapping at the File Server\%} \newline             \STATE        $eqn= equation(serverIndex[i])$ \newline             \COMMENT{ \%comment: try insert equation into Z using OFG\%} \newline                   \ENDFOR end for\newline \newline              \WHILE{ ( linearlyIndependentServerIndex.length!=K ) } \newline               \COMMENT{\%comment: remove all the server index which were not inserted in Z\%} \newline               \STATE temp[]=serverIndex[]-linearlyIndependentServerIndex \newline                \IF{  (linearlyIndependentServerIndex.length=K) }\newline                \STATE break\newline                \ENDIF  \newline              \ENDWHILE  \newline             \end{algorithmic}             \end{algorithm}      I had to include newline so that the code is readable. The resulting output after compiling: ![](http://i.stack.imgur.com/iAlR6.png)


title: pgfplots: Reduce number of ticks

text: I'm doing a histogram with a large number of bins:               \pgfplotstableset{col sep=semicolon}     \begin{tikzpicture}       \begin{axis}[         ybar interval,       ]         \addplot+[hist={bins=200}] table[y index=0] {FILENAME};       \end{axis}     \end{tikzpicture}      Unfortunately, pgfplots produces a terribly ugly x-axis where the xticks are printed too close together so that they are overlapping and you can't read a thing. How can I reduce the number of ticks? For example show only every nth tick.


title: How to specify custom behavior on line breaking

text: Is it possible to detect when LaTeX breaks a long line of text and add some custom behavior to it? Specifically, If a long sentence breaks, I want to prepend some code to all but the first line, similar to what the `listings` package provides with `postbreak`. I tried hinting where LaTeX should break using `discretionary` and it works in some cases, but not when I try to prepend the lines with horizontal whitespace. What are the alternatives?


title: Changing the colon to a comma after the vol.(num.) in bst file

text: I need to change the format in the `.bst` file that I am using. The format currently as: > Beth, T. and Gollmann, D. (1989). Algorithm Engineering for Public Key > Algorithm. IEEE Journal on selected areas in communications 7 (4): 458–465. I want them to be as: > Beth, T. and Gollmann, D. (1989). Algorithm Engineering for Public Key > Algorithm. IEEE Journal on selected areas in communications, 7 (4), 458–465. I need to add comma after the Journal's name and also changing the colon after the series number into comma. What commands should I add and on which function should I make changes? Is the following function the right one to add changes on?               FUNCTION {format.bvolume}     { volume empty$         { "" }         { series empty$            { "" }            { series emphasize }          if$          swap$ bbl.volume volume tie.or.space.connect output         }       if$     }      I have also other functions in bst file where I think they might be related, such as:               FUNCTION {format.number.series}     FUNCTION {format.vol.num.pages}      I appreciate the help in advance.


title: A list of newcommand objects

text: I often have a whole bunch of definitions such as               \newcommand{\R}{\ensuremath{\mathbb{R}}}      with `R` replaced by `R,Z,C`, etc. I might also have a bunch of math operators or category definitions, e.g.               \newcommand{\cC}{\ensuremath{\mathscr{C}}}      What I would love is a way I could define this all at once. For example I could have some function `\bb` that I could just write               \bb{Z,R,C,...}          \operators{Hom,Tor,Ext,....}          \category{C,S,H,...}      and this would then allow me to just use `\Z` for `\mathbb{Z}` in the document. Is such a thing possible?


title: Modifying mini-toc content

text: I have adapted the pretty table of contents solution written by Gonzalo Medina with the modification to the "blue box style" that Stephan Lehmke helped me with to design a somewhat consistent look-and-feel for chapter heads and table of contents, as illustrated below. However, I am facing one last problem that has me stomped. For the MWE example below, the table of contents looks like the following, where I have changed some of the colors for the chapter names. ![Table of contents](http://i.stack.imgur.com/sItul.png) A "typical" chapter head, that includes a mini table of contents looks as follows: ![Correct chapter head](http://i.stack.imgur.com/pdxAo.png) However, a "typical" Appendix head has the Appendix title repeated in the mini table of contents: ![Incorrect Appendix head](http://i.stack.imgur.com/vF0fp.png) Note that I can achieve (!) the same look for a chapter if I include the package `titletoc` at the beginning of the preamble rather than at the end, as illustrated below.   ![Incorrect chapter head](http://i.stack.imgur.com/ast6M.png) In other words, in order to include the proper amount of material in the mini table of contents at the beginning of a chapter, I need to include `titletoc` after I include the code to create the "pretty table of contents"; somehow, `titletoc` must redefine some macros which, perhaps (?) are rewritten when `\appendix` is interpreted - or perhaps are not defined in `titletoc` in the first place. So, how do I get rid of the extra "Appendix title" in the mini table of contents?               \documentclass[openany]{memoir}          \usepackage{lipsum}   % for testing purpose only     \usepackage{mdframed}        \usepackage{mathtools}     \usepackage{hyphenat}       % I use it to prevent hyphenation of table of contents items     \usepackage{xcolor}          %%% Do not include titletoc here - do it at the end      %\usepackage{titletoc}                       %%% colors definitions     \definecolor{MainRed}{rgb}{.6, .1, .1}     \definecolor{GoldDecoration}{RGB}{170, 120, 70}          % Colored section, subsections, as well as     % chapter and section name in the head - included for completeness     \setsecheadstyle{\color{MainRed}\large\bfseries}     \setsubsecheadstyle{\color{MainRed}\bfseries}     \copypagestyle{myheadings}{headings}     \makeevenhead{myheadings}{\thepage}{}{\color{MainRed}\leftmark}     \makeoddhead{myheadings}{\color{MainRed}\rightmark}{}{\thepage}          %% RedBox style -- adapted from BlueBox style, pp:43-44     % http://mirror.csclub.uwaterloo.ca/CTAN/info/latex-samples/MemoirChapStyles/MemoirChapStyles.pdf     % with modifications from      % http://tex.stackexchange.com/questions/49864/automatically-adjusting-size-of-a-box-based-on-other-content     % and others modifications of my own     \newcommand{\RedBarLength}{3em}          \newsavebox{\ChpNumBox}     \newsavebox{\ChpContBox}     \makeatletter     \newcommand*{\thickhrulefill}{%       \leavevmode\leaders\hrule height 3\p@ \hfill \kern \z@}     \newcommand*\BuildChpNum[3]{%       \begin{tabular}[t]{@{}c@{}}         \makebox[0pt][c]{#1\strut} \\[.5ex]         \colorbox{MainRed}{%           \rule[-\RedBarLength-(#3)]{0pt}{0pt}%           \rule{1ex}{0pt}\color{white}#2\strut           \rule{1ex}{0pt}}%       \end{tabular}}     \makechapterstyle{BoxedChapNum}{%       \renewcommand{\chapnamefont}{\large\scshape}       \setlength{\beforechapskip}{-30pt}       \setlength{\midchapskip}{10pt}       \setlength{\afterchapskip}{30pt}       \renewcommand{\printchaptername}{}       \renewcommand{\chapternamenum}{}       \renewcommand{\printchapternum}{%         \startcontents[chapters]         \sbox{\ChpContBox}{%           \parbox{\linewidth}{%             \printcontents[chapters]{}{1}{\color{blue}}%           }}%         \sbox{\ChpNumBox}{%           \BuildChpNum{\color{GoldDecoration}\bfseries\chapnamefont\@chapapp}%           {\chapnumfont\thechapter}%           {\ht\ChpContBox+\dp\ChpContBox}%         }}       \renewcommand{\printchapternonum}{%         \startcontents[chapters]         \sbox{\ChpContBox}{%           \parbox{\linewidth}{%             %\printcontents[chapters]{}{1}{}%  Useless?           }}%         \sbox{\ChpNumBox}{%           \BuildChpNum{\chapnamefont\vphantom{\@chapapp}}%           {\chapnumfont\hphantom{\thechapter}}%           {\ht\ChpContBox+\dp\ChpContBox}%         }}       \renewcommand{\afterchapternum}{}       \renewcommand{\printchaptertitle}[1]{%         \usebox{\ChpNumBox}\hfill         \parbox[t]{\hsize-\wd\ChpNumBox-1em}{%           \raggedright\vspace{\midchapskip}%             {\color{GoldDecoration}\thickhrulefill}\\[10pt]           {\chaptitlefont\LARGE\textcolor{MainRed}{\nohyphens{##1}}}\par\vspace*{10pt}           \renewcommand\cftsectionpagefont{\sffamily\itshape\color{black}}           \renewcommand\cftsubsectionpagefont{\sffamily\itshape\color{black}}           \renewcommand\cftsectionfont{\sffamily\color{MainRed}}           \renewcommand\cftsubsectionfont{\sffamily\color{MainRed}}           \printcontents[chapters]{}{1}{}%         }}%     }      \makeatother           %%%%%% use the newly defined style     \chapterstyle{BoxedChapNum}          %%% Pretty ToC     %%%%% adapted from http://tex.stackexchange.com/questions/35825/pretty-table-of-contents/35835     % a modification of the leftbar environment defined by the framed package     % will be used to place a vertical colored bar separating the page number and the     % title in chapter entries     \renewenvironment{leftbar}{%       \def\FrameCommand{\textcolor{GoldDecoration}{\vrule width 2pt depth 6pt}\hspace*{15pt}}%       \MakeFramed{\advance\hsize-\width\FrameRestore}}%      {\endMakeFramed}          \makeatletter          % redefinitions for chapter entries     \renewcommand\chapternumberline[1]{\mbox{\small\@chapapp~#1}\par\noindent\Large}     \renewcommand\cftchapterfont{\sffamily}     \cftsetindents{chapter}{0pt}{0em}     \renewcommand\cftchapterpagefont{\Huge\sffamily\bfseries\color{MainRed}}          \newcommand*{\l@mychap}[3]{%       \def\@chapapp{\color{MainRed}#3}       \vskip1ex%       \par\noindent\begin{minipage}{\textwidth}%       \parbox{4.5em}{%         \hfill{\cftchapterpagefont#2}%       }\hspace*{1.5em}%       \parbox{\dimexpr\textwidth-4.5em-15pt\relax}{%         \leftbar\cftchapterfont{\color{MainRed}#1}\hspace{1sp}\endleftbar%       }%       \end{minipage}\par%     }     \renewcommand*{\l@chapter}[2]{%       \l@mychap{#1}{#2}{\chaptername}%     }     \renewcommand*{\l@appendix}[2]{%       \l@mychap{#1}{#2}{\appendixname}%     }          % redefinitions for section entries     \renewcommand\cftsectionfont{\sffamily\color{black}}     \renewcommand\cftsectionpagefont{\sffamily\itshape\color{MainRed}}     \renewcommand\cftsectionleader{\nobreak}     \renewcommand\cftsectiondotsep{\cftnodots}     \renewcommand\cftsectionafterpnum{\hspace*{\fill}}     \setlength\cftsectionnumwidth{12em}     \cftsetindents{section}{6em}{3em}     \renewcommand\cftsectionformatpnum[1]{%       \hskip1em\hbox to \@pnumwidth{{\cftsectionpagefont #1\hfill}}}          % redefinitions for subsection entries     \renewcommand\cftsubsectionfont{\sffamily\color{black}}     \renewcommand\cftsubsectionpagefont{\sffamily\itshape\color{MainRed}}     \renewcommand\cftsubsectionleader{\nobreak}     \renewcommand\cftsubsectiondotsep{\cftnodots}     \renewcommand\cftsubsectionafterpnum{\hspace*{\fill}}     \setlength\cftsubsectionnumwidth{12em}     \cftsetindents{subsection}{9em}{3em}     \renewcommand\cftsubsectionformatpnum[1]{%       \hskip1em\hbox to \@pnumwidth{{\cftsubsectionpagefont #1\hfill}}}     \makeatother          %%%% End of Pretty ToC          \settocdepth{subsection}     \setsecnumdepth{subsection}          % include after the change above     \usepackage{titletoc}             \begin{document}     \nouppercaseheads     \pagestyle{myheadings}     \frontmatter         \tableofcontents*         \chapter{Foreword}         \lipsum[9]          \mainmatter         \chapter{First Chapter}             \lipsum[1]             \section{First section}             \lipsum[2]             \subsection{First subsection}             \lipsum[3]             \section{Second section}             \lipsum         \chapter{Second Chapter}             \section{First section}              \appendix         \chapter{First Appendix}             \lipsum[7]             \section{First section}             \lipsum[8]             \section{Second section}     \end{document}      Note that I have included a few extra lines (such as the color selection for section heads) as various attempts I have made have resulted in changing other elements; those included are the ones needed for the "complete look and feel".