title: Last cell in complex table not behaving

text: I am having a hard time figuring out why the text in the last cell on each row of this complex table I am creating is not positioning correctly. As you can see from my code, the issue only occurs when I set the height of the row manually (using the [size] technique after `\\\` or `\tabularnewline`). Can anyone point out what I am doing wrong? Everything seems to work apart from this small, but annoying issue. I know it's a "last cell on line" thing, because if I add another column, the issue transfers to the cells in that column.               \begin{tabularx}{\linewidth}{X|m{1.4cm}|m{1.4cm}|m{1.4cm}|m{1.4cm}}     & & \centering{\textbf{\emph{C1}}} & \centering{\textbf{\emph{C2}}} &      \centering{\textbf{\emph{C3}}}         \tabularnewline     \hline          \centering{R1}     & \centering{OK}     & \centering{OK}     & \centering{OK}     & \centering{BAD}     \tabularnewline[1em]     \hline          \centering{R2}     & \centering{L1\\L2}     & \centering{OK}     & \centering{OK}     & \centering{OK}     \tabularnewline     \hline          \end{tabularx}      Here is a screenshot of the offending cell: ![image](http://i.imgur.com/1OW7HWP.png)


title: How can I force a TikZ background pattern to be underneath nodes? (using layers)

text: I am drawing Simon Dik's Functional Grammar Model Overview using TikZ, but I have run into a stumbling block. It is a design flaw on my part, and I would rather not redesign everything. The box called **Lexicon** was created using the `fit library` to make a box around a few nodes. It must be therefore drawn after those nodes are draw. Unfortunately, I need a pattern to fill the box (see original diagram). _UPDATE_ : I have solved the issue of the background covering my nodes using layers (see comments below). I am leaving this question open for anybody who could offer improvements to the code below and potentially solve my pattern issue and perhaps other alignment issues (like why the diagram is not centered when using the article class). Problems:   * I keep getting a black fill rather than a dotted background   * The layer covers contained nodes NOTE: The code I provide below does not include the pattern, because I could not get it to work. Original Diagram: ![enter image description here](http://i.stack.imgur.com/QDJd7.png) My Code (updated according using layers _see comments_ ):               \documentclass[10pt]{article}     %\documentclass[tikz,border={5pt 5pt}]{standalone}     %SET MARGINS (AND PAGE DIMENSIONS)     %\usepackage[includeheadfoot,head=30pt,foot=30pt,top=1cm,bottom=1cm,left=1cm,right=1cm]{geometry}                    \usepackage{fontspec}     \setmainfont{cmunrm.otf}     %\setmainfont{Calibri}          \usepackage{tikz}                    \usetikzlibrary{fit,calc,trees,patterns,positioning,backgrounds,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols}          \tikzset{%         join/.style={},         myarrow/.style={->, thick,shorten >=1pt},         mybox/.style={draw,rounded corners, minimum height=.7cm,align=center,node distance=1em},         leftright/.style={outer sep=0,inner sep=0,text width=2cm,draw,align=center,node distance=0em,minimum height=3em},         mainnode/.style={very thick,fill=red!10},         spannodes/.style={text depth=-5pt,draw,inner sep=0em,outer sep=0,minimum height=1.5em,align=center,node distance=0em}     }%               \begin{document}     \thispagestyle{empty}          \begin{figure}     \centering     \vspace*{-45pt}     \hspace*{-3cm}\begin{tikzpicture}[remember picture]          % THE MAIN CHAIN THAT GOES STRAIGHT DOWN     \node(placeholder){};     \node[minimum height=1cm,minimum width=5cm,below=of placeholder.south,join] (lexicon) {};     \node[mainnode,mybox,below=2cm of lexicon.south,join] (nuclearpredication) {nuclear predication};     \node[mybox,below=of nuclearpredication,join] (lev1) {π\textsubscript{1} σ\textsubscript{1}};     \node[mainnode,mybox,below=of lev1,join] (corepredication) {core predication};     \node[mybox,below=of corepredication] (lev2) {π\textsubscript{2} σ\textsubscript{2}};     \node[mybox,below=of lev2] (syntacticfunctions) {syntactic functions};     \node[mainnode,mybox,below=of syntacticfunctions] (extendedpredication) {extended predication};     \node[mybox,below=of extendedpredication] (lev3) {π\textsubscript{3} σ\textsubscript{3}};     \node[mainnode,mybox,below=of lev3] (proposition) {proposition};     \node[mybox,below=of proposition] (lev4) {π\textsubscript{4} σ\textsubscript{4}};     \node[mybox,below=of lev4] (pragmaticfunctions) {pragmatic functions};     \node[mainnode,mybox,below=of pragmaticfunctions] (clausestructure) {clause structure};     \node[mybox,below=of clausestructure] (expressionrules) {\textsc{Expression Rules}\\\\form\\order\\prosody};     \node[mainnode,fill=yellow!20,mybox,below=of expressionrules,] (linguisticexpression) {\textsc{Linguistic Expression}};               % THE SECONDARY CHAIN LEFT AND RIGHT     % LEFT OF     \node[xshift=-1.5cm,leftright,left=of lexicon.south] (basicpredicates) {basic predicates};     \node[leftright,left=of basicpredicates] (derivedpredicates) {derived predicates};     \node[xshift=-2em,leftright,left=of derivedpredicates] (predicateformation) {predicate\\formation};     \node[fit={(derivedpredicates.west) (basicpredicates.east)},spannodes,below=of basicpredicates.south] at ($(derivedpredicates.south)!0.5!(basicpredicates.south)$) (predicateframes) {\textsc{Predicate Frames}};          % RIGHT OF     \node[xshift=1.5cm,leftright,right=of lexicon.south] (basicterms) {basic\\terms};     \node[leftright,right=of basicterms] (derivedterms) {derived\\terms};     \node[xshift=2em,leftright,right=of derivedterms] (termformation) {term\\formation};     \node[fit={(basicterms.west) (derivedterms.east)},spannodes,below=of basicterms] at ($(basicterms.south)!0.5!(derivedterms.south)$) (terms) {\textsc{Terms}};               \node [draw, very thick,inner sep=0,fit={%             (lexicon) (derivedpredicates) (predicateframes) (derivedterms) (terms) (placeholder)         },label=\textsc{Fund}] (fund){};     \begin{pgfonlayer}{background}     \node [draw=blue!100,anchor=south,dashed,fill=green!20,inner sep=0pt,fit={             (basicpredicates) (basicterms) (lexicon)         },label=\textsc{Lexicon}] {};     \end{pgfonlayer}{background}     %\node[above=2cm of basicterms.east] (rightcorner)  {};     %\draw[label=Lexicon] (basicpredicates.south west) rectangle (rightcorner);          % Connect the Lines     \draw[red] (derivedpredicates.north) -| ++(0,1.2) -| (termformation.north);     \draw[blue] (predicateformation.north) -| ++(0,1.4) -| (derivedterms.north);     \draw[red] (predicateformation.east) to (derivedpredicates);     \draw[blue] (predicateformation.south) -| ++(0,-.3) -| (predicateframes.west);     \draw[blue] (termformation.west) to (derivedterms.east);               % Draw Arrows     \draw[myarrow] (fund.south) to (nuclearpredication.north);     \draw[myarrow] (nuclearpredication.south) to (lev1.north);     \draw[myarrow] (lev1.south) to (corepredication.north);     \draw[myarrow] (corepredication.south) to (lev2.north);     \draw[myarrow] (lev2.south) to (syntacticfunctions.north);     \draw[myarrow] (syntacticfunctions.south) to (extendedpredication.north);     \draw[myarrow] (extendedpredication.south) to (lev3.north);     \draw[myarrow] (lev3.south) to (proposition.north);     \draw[myarrow] (proposition.south) to (lev4.north);     \draw[myarrow] (lev4.south) to (pragmaticfunctions.north);     \draw[myarrow] (pragmaticfunctions.south) to (clausestructure.north);     \draw[myarrow] (clausestructure.south) to (expressionrules.north);     \draw[myarrow] (expressionrules.south) to (linguisticexpression.north);                         \end{tikzpicture}\hspace*{-3cm}     \caption{Functional Grammar Model Overview}     \end{figure}               \end{document}      My New Output using article class (diagram inside a `figure` environment) ![New Article Class FG Diagram Output](http://i.stack.imgur.com/6zScw.png) My Old Output: ![FG Diagram Output](http://i.stack.imgur.com/1FVhU.png)


title: Can I add tikzpictures to pages included with pdfpages

text: I would like to decorate pages of some pdf documents with tikzpictures. My idea was to include them with `pdfpages`, and then draw a `tikzpicture` overlay on top of the page.               \documentclass[12pt]{article}          \usepackage{pdfpages}     \usepackage{tikz}     \begin{document}          \includepdf[pages=1]{someinputpdf}     \begin{tikzpicture}[remember picture,overlay]     \node at (current page.center) {test};     \end{tikzpicture}          \end{document}      However, tikzpicture ends up at page 2 of the resulting document. Is there a way to achieve similar functionality?


title: How to insert powerpoint slide into LaTeX file

text: > **Possible Duplicate:**   >  PDF letterhead as document background I have an image stored in powerpoint . I want to use it as my background in my pdf produced from LaTeX. What can I do so that I can export the image in my LaTeX file ?


title: How may i add a paper stucture?

text: > **Possible Duplicate:**   >  PDF letterhead as document background Does anybody know, how to get a paper structure like shown at http://www.tsengbooks.com/showbooks.html ? I've heard this would be possible by using the package `atbegshi` but I have really no idea how to use `atbegshi` to get such a paper structure. Has anybody an idea? Sorry for my poor English.


title: What could cause pdflatex/lualatex to halt compilation and freeze?

text: I am trying to run pdflatex or lualatex from ASP.NET web application using impersonation. The standard output and standard error streams are being redirected and I am saving their contents to the log files. The problem is that either `pdflatex` or `lualatex` stop after creating a zero-size `chart.log` file and do not complete compilation. I can only kill them from task manager. This is what ends up in the stdout log:               This is LuaTeX, Version beta-0.76.0-2013062820 (rev 4627)       \write18 enabled.     (D:/Project1/Latex/chart.tex      The last line is showing the file name and that is it. However when I run the same command line, but without using impersonation and provide domain, user name and password to the Process class instead, it runs fine, producing a PDF. Impersonation is imposed on me, unfortunately. In order to see whether this has to do with my code, or with pdflatex/lualatex, I tried to run a simple command line program that only outputs some text to stdout, and it ran fine. Then I tried running 7zip to compress `chart.tex` instead and it produced `chart.7z` file fine as well. It sounds like the root cause is somewhere in `pdflatex` or `lualatex` programs unless I am missing something. This is how the programs are being invoked:                   Dim p As Process = New Process()              Try             p.StartInfo.FileName = ConfigurationManager.AppSettings("PDFLaTeXPath")             p.StartInfo.WorkingDirectory = "D:\Project1\Latex"             p.StartInfo.Arguments = " --shell-escape -interaction=nonstopmode D:\Project1\Latex\chart.tex 1>nul 2>nul") ' Tried with and w/o redirecting             p.StartInfo.UseShellExecute = False             p.StartInfo.RedirectStandardOutput = True             p.StartInfo.RedirectStandardError = True                  ImpersonatingContextWrapper.impersonateValidUser( _                 ConfigurationManager.AppSettings("RunAsUser"), _                 ConfigurationManager.AppSettings("RunAsDomain"), _                 ConfigurationManager.AppSettings("RunAsPassword") _             )                  p.Start()                  Dim output As String = p.StandardOutput.ReadToEnd()             If Not String.IsNullOrEmpty(output) Then                 My.Computer.FileSystem.WriteAllText("D:\Project1\Latex\stdout.txt", output, True)                 LogEvent(output, EventLogEntryType.Information)             End If                  Dim errors As String = p.StandardError.ReadToEnd()             If Not String.IsNullOrEmpty(errors) Then                 My.Computer.FileSystem.WriteAllText("D:\Project1\Latex\stderr.txt", errors, True)                 LogEvent(errors, EventLogEntryType.Warning)             End If             p.WaitForExit()         Catch ex As Exception             LogEvent("Error running PDFLaTeX compiler: " & ex.Message, EventLogEntryType.Error)             Return False         Finally             ImpersonatingContextWrapper.undoImpersonation()         End Try      **Edit:** **Thanks to Sean's comment** , it became clear that something in the TEX file was causing a hang-up, as when I gave it a file               \documentclass{letter}     \begin{document}     abc     \end{document}      it produced the result fine. However when I ran a file below, it hung up:               \documentclass[border=10pt]{standalone}     \begin{document}     abc     \end{document}      So `standalone` class, which I needed to be able to produce very large documents, printed on multiple pages, is one of the root causes. Further experimenting, I found that loading any package causes a hang up. Is MikTex trying to download packages again and waiting for a confirmation, even though I am running it under my own account which already downloaded the packages?


title: Can \newpage take an argument like \pagebreak?

text: I redefine \subsection in the article class                   \renewcommand\subsection{%     \penalty-8888     %\pagebreak[3]     \@startsection {subsection}{1}{0em}{1\parskip plus 1\parskip minus 1\parskip}{1\parskip plus 1\parskip minus 1\parskip}{\centering\rmfamily\bfseries\scshape}%     }      and at some point in my text, I have a subsection that is near the bottom. With pagebreak[3] enabled and \penalty commented, the subsection begins on the next page but the previous text is dilated towards the bottom. This is expected. Idem, if I use the option with \penalty-8888. If I put a \newpage just before my subsection, I get a blank space at the bottom of the page. This is what is expected and what I want but only if it is necessary (say at two-third of the page); is it possible to moderate its triggering with an argument like \pagebreak has ? PS: actually, I redefine the \subsubsection as well and I have the same problem. I redefine the \section too, but I put explicitly a \newpage in it so all is good.


title: Tabular 3 level header

text: How can I draw a tabular like below using the given script. ![below](http://i.stack.imgur.com/JazyP.png)               \documentclass[12pt]{article}     \usepackage{multirow}     \usepackage{colortbl}          \begin{document}          \begin{figure}       \centering       \begin{tabular}{|*{10}{c|}}         \hline         \multicolumn{2}{|>{}c|}{} & \multicolumn{3}{c|}{TOP.1} & \multicolumn{3}{c|}{TOP.2} \\         \arrayrulecolor{black}         \cline{3-8}         \multicolumn{2}{|>{}c|}{} & TOP.1.1 & TOP.1.2 & TOP.1.3 & TOP.2.1 & TOP.2.2 & TOP.2.3\\         \hline              \multirow{3}{*}{SIDE.1}         & SIDE.1.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         & SIDE.1.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         & SIDE.1.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         \hline              \multirow{3}{*}{SIDE.2}         & SIDE.2.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         & SIDE.2.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         & SIDE.2.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}         \hline            \end{tabular}     \end{figure}          \end{document}


title: labeling underlined text over multiple lines

text: I have a large number of documents I need to create, and there is one very particular need I cannot find a solution for. In these documents, there are pieces of text that are underlined and they must be labelled with a number or letter, placed in the middle of the text immediately below the underline. To do this for short pieces of text, I was using the `\underset` in math mode with the `\ul` command from the `soul` package to do what I needed. This only worked if the items were short and did not go over line breaks. I know the `\ul` command by itself handles line breaks well, but I cannot think of how to get this centered label to work across multiple lines. I need the label to appear below the center of the text on each line of the underlined portion. For example, if I have an underlined sentences labeled "4" that is three lines on paper, it must have the number "4" appearing below the underlined portion on each of the three lines on the page. In particular, if the underlined portion only has a small piece, such as a single word, on one of the lines it appears in, then the label must be centered below that underlined portion, not centered under the whole line in which it appears. I know this is a complicated request, but I hope one of you brilliant folks has a solution for me to do this in latex (or context if there is only a way to do it there). Any suggestions are appreciated.               \documentclass[two column]{article}     \usepackage{amsmath,soul}          \begin{document}          $\underset{4}{\text{\ul{This is short text}}}$          $\underset{5}{\text{\ul{Much longer text in this format will not split properly along lines, which is the effect I would like to produce.}}}$          \ul{But if I only use the ul command, I will not get the propery labelling on each line like I want}.           \bigskip          $\underset{6}{\text{\ul{I want something to look like this text does, but I}}}$ \\     $\underset{6}{\text{\ul{don't want to manually break lines.}}}$ More text here.          \end{document}


title: Spacing within a box, relative to the page

text: I am attempting to place a textbox precisely 75mm from the top edge of a page (to correspond with a cut-out on the cover). On printing this out, I noticed I was getting positioning problems, so got rid of the 75mm space to debug and end up with a ugly space preceding the parbox. ![Ugly space up the top](http://i.stack.imgur.com/6rqmQ.png) The TeX code at this point is:               %% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[a4paper]{geometry}     \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm,headheight=0cm,headsep=0cm,footskip=1cm}     \usepackage{calc}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{url}     \usepackage{graphicx}     \usepackage{enumerate}          \makeatother          \usepackage{babel}     \begin{document}     \thispagestyle{empty}     \newgeometry{layoutsize={210mm,297mm},layoutoffset={0mm,0mm},left=0cm,bottom=0cm,top=0cm,right=0cm,noheadfoot}          \noindent %     \framebox{\begin{minipage}[t][65mm]{133mm}%     \vspace{5mm}               \begin{center}     A beautiful title goes here     \par\end{center}%     \end{minipage}}          \newpage{}          \restoregeometry     \end{document}      Ok, so my next step is to eliminate the 5mm space which nicely formats the text relative to the box. Success! (of sorts) The ugly space is eliminated at the top, but this comes at the expense of the nice formatting space. ![enter image description here](http://i.stack.imgur.com/15ZT0.png) So I have two questions: 1) Why?! 2) How do I format such that I keep the nice formatting space between the text and the box whilst keeping the box flush with the edge of the page? I have the latest geometry package (or so I would think - I downloaded from here http://www.ctan.org/pkg/geometry a couple of days ago). I've read the geometry user manual (and mucked about with \newgeometry) but still can't make sense of it all. I'm also using Lyx 2.0.2 on Ubuntu 12.04 (and also a bit of a noob when it comes to LaTeX).


title: Strange spacing in inline listings (listings package)

text: I am using the `listings` package to typeset some code. I've defined a `lstlisting` environment, based upon the standard `Haskell` environment, and added a number of `literate` replacements, including:               literate={->}{{$\rightarrow{}$}}2      When the symbol `->` appears in a listing environment, my spacing around the symbol is preserved. However, when it appears in an inline listing, the space after the `\rightarrow` gets eaten, resulting in `T a -> a -> a` looking like `T a ->a -> a`. Does anyone know how I can avoid this behavior in the inline listings without also confusing the listing environment?


title: Balloon shape in TikZ

text: Is it possible to make a balloon-like shape in TikZ? Personally, I haven't found anything closer than an ellipse:               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}         \tikzstyle{balloon}=[ball color=red];             \shade[balloon] ellipse (2 and 1);     \end{tikzpicture}     \end{document}


title: Remove white margin from a page tiles with an image?

text: I am trying to tile a page with an image. I have successfully added the image using the command `\TileWallPaper` from the background package, but I am having a problem with a white margin on the left of the paper. Is there a command or a method I can use to shift the tiles to the left so it can cover the whole page? Here is the code I use:               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{fancybox}     \usepackage{fancyvrb}     \usepackage{amssymb}     \usepackage{pict2e}     \usepackage{lscape}     \usepackage[tableposition=top]{caption}     \usepackage[english]{babel}     \usepackage{color}     \usepackage{array}     \usepackage{booktabs}     \usepackage{bm}     \usepackage{times}     \usepackage{multirow}     \usepackage{url}     \usepackage{graphicx}     \usepackage{longtable}     \usepackage[cm]{fullpage}     \usepackage[margin=0.3in]{geometry}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%% FOR TILING %%%%%%%%%%%%%%%%%%%%%%%     \usepackage{wallpaper}     \TileWallPaper{10.0pt}{40.0pt}{tiles.eps}     %%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{rotating}     \usepackage{eso-pic}     \newcommand\BackgroundPic{     \put(0,-10){     \parbox[b][\paperheight]{\paperwidth}{%     \vfill     \centering    \includegraphics[width=18cm,height=20cm,angle=90,keepaspectratio,natwidth=250,natheight=325]{logos/logo.png}     \vfill     }}}     \begin{document}     Anything here     \end{document}      And as you can see I also have an image that is centred in the page, but I believe it has nothing to do with the tiles background.


title: medskipamount, default value in article class

text: What is the default value of `medskipamount` in the `article` class? I have not been able to locate this information. Is there some database where default values of various parameters can be accessed?


title: Help with arrow formation in TikZ flowchart

text: I'm trying to create a simple flowchart (it's actually an archaeological diagram called a Harris Matrix) using TikZ. Below is the code for a small part of the finished diagram which illustrates the problem I'm having. In the current chart the line from the node labeled 7 goes downwards and then touches the node labeled 9 on the right side. What I would like to do is have the line still go downwards from node 7, go to the left, and then go downwards again to touch node 9 on the top. Thanks for any help, I'm quite new to TikZ. What I have now: ![harris_matrix_sample](http://i.imgur.com/rHtkTXI.jpg)               \documentclass{article}           \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}          \tikzstyle{block} = [rectangle, draw, text centered]     \tikzstyle{line} = [draw]          \[ \begin{tikzpicture}          \node [block] (g) {7};     \node [block, below left of = g] (h) {9};     \node [block, below right of = g] (i) {12};          \path [line] (g) |- (h);     \path [line] (g) |- (i);     \end{tikzpicture} \]          \end{document}


title: Using tabular to align pseudocode?

text: > **Possible Duplicate:**   >  Print programs with its proper syntax   >  Line Breaks in Text Mode not Working I need to write some pseudocode. I tried using the `algorithimic` package, but it introduced some errors (particularly indenting the first line, paragraph style, of multi-line statements). I didn't notice these before sending a draft to my academic advisor. He's now specifically asked me to use the `tabular` environment to force indenting (of, for example, the lines executed inside a loop). I can't find any examples out there of this done right, and I'm particularly curious about how to allow content in a table cell to extend to the right edge of the page (even when the cell in question isn't in the rightmost column, as will occur with text that isn't the most indented in the pseudocode segement, if that makes sense?)


title: Review of algorithm-related packages?

text: > **Possible Duplicate:**   >  Print programs with its proper syntax Where can I find (if it exists) an updated review of the most relevant packages for handling with algorithms (pseudocode or _code_ programs)? I know about ~~`algorithms`~~ [see edit below], that seems to be the most complete and suitable to my case, but anyway I would like to know more alternatives. Please, notice that this is _not_ a question about _"which is the best tool..."_. I just wondered if there exists a good and updated review on that subject. * * * EDIT: In fact, I was wrong about my initial decision. The package I found the most useful in my case was `listings`.


title: Format code instructions (CS Theory)

text: I'm new to LATEX and having a tough time doing my homework and properly formatting code. As you see, the spacing is out of whack and the beginning of each line for each instruction does not line up. Could anyone recommend a better way to make sure they line up? Thanks. P.S. - I tried using `\quad`, but it doesn't seem to work when it is the first instruction on a line in a LATEX document.               \indent \indent $IF\ Z_1 \neq 0\ GOTO \ C$\\     $[B]$ \indent $X \leftarrow X - 1$\\     \indent \indent $Y \leftarrow Y + 1$\\      Rendering: ![Rendering](http://i.stack.imgur.com/6W9sc.jpg)


title: What´s the easy way to put algorithms?

text: I was trying with algorithm2e , and I had a little problems, LATEX is so complicated and so tedious. The results are excelent, but... the time and effort is BIG BIG! What´s the easy way to describe algorithms?


title: Print programs with its proper syntax

text: I have defined my own language whose syntax is very close to the one of Pascal. I would like to type the following program for instance. Many people use the packages `algorithmicx` or `algorithm2e` to print programs, but it seems that we have to use their specific keywords of its syntax like `procedure`, `end while`. I just want to indent spaces when needed, and bold some words when I want (sorry that I could not **bold** letters in the following figure). Do I have to use `texttt` for each line? Also, with `verbatim`, I could not **bold** words... Also, as the program is not large, I would need to put it on the left side of the page, and leave space for some explanasion text on its right hand side. So I guss I need to get them all together, and use `multicols`. Could anyone help?               program test                                      some text here     var       i : integer;                                    ...        b : boolean;     begin        i := 1;                                        ...        b := true;        while i < 15 do           i := i  + 1;           b := not b                                  some text here        od     end      **Edit1:** Following @Werner's `tabbing` solution, I have made the code a minipage:               \begin{minipage}[t]{0.48\linewidth}%     \begin{tabbing}     Werner's solution     \end{tabbing}     \end{minipage}\hfill     \begin{minipage}[t]{0.48\linewidth}     a paragraph     \end{minipage}      Actually as the code shows, I want the texts to be another separated minipage on the right hand side of the code. I have then 2 questions:   1. is it reasonable to make `0.48\linewidth` instead of `0.5\linewidth`? `0.48\linewidth` is a conventional choice?   2. is it possible to make a frame around the code, and use `\caption` and `\label` to make it a reference (I prefer figures)?


title: writing part of a pseudocode

text: I have a few pseudocode lines like               for each item in list L       if (item > 50)| (item > 50)|(item > 50)       value=item        break;       Obviously, this is not the exact code :). If I use a package like `algorithm2e`, it would give me a whole algorithm, which i do not want. Is there a way i can write this part in a `pseudocode / algorithm` looking format?


title: Processing data in pgfplots: Elementwise multiplication?

text: I like to process data that I read in from a file within pgfplots. Consider the following example:               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{siunitx}     \usepackage{pgfplots, pgfplotstable}     \usepgfplotslibrary{units}          \begin{document}          \begin{tikzpicture}          \pgfplotstableread{chi_probe.dat}{\data}     \pgfplotstablecreatecol[copy column from table={grid_omega_opt.dat}{0}] {xData} {\data}          \begin{axis}          \addplot[     black     ] table [     x expr = \thisrowno{2}*1.054571726e-34,     y expr = \thisrowno{2}*\thisrowno{1}     ] {\data};          \legend{probe,differential}          \end{axis}          \end{tikzpicture}          \end{document}      What I do is mutiplying the x values with \hbar. The y axis actually should show x*y, which is meant to be an elementwise mutiplication, means Y1=x1*y1, Y2=x2*y2, etc. where Y are the y axis values. To be more general: Is any function applied on a column (e.g. ^2, sqrt, etc.) performed element wise?


title: Navigation bar is too long on progressbar theme, can it wrap?

text: My navigation bar at the top of each slide (that links to each section) has too many sections. I would like to keep the bar and keep each section but I would like to wrap it i.e. have it on two lines. Is that possible? I am using `compress` and I am using `progressbar` as a theme.


title: TeXShop is not compiling

text: I installed MAC OS X 10.6.8 some weeks ago. Whenever I compile `.tex` file the following message turns up: > "Can't find required tool. usr/textbin/pdflatex/simpdftex does not exist. > Perhaps TeXLive was not installed or was removed during a system upgrade. If > so, go to the TeXShop web site and follow the instructions to (re)install > TeXLive. Another possibility is that a tool path is incorrectly configured > in TeXShop preferences. This can happen if you are using the fink teTeX > distribution." All I could has been done. Any help will be welcome.


title: hypcap not working with floatrow

text: I'm trying to get hyperlinks for figures work properly. I mean clicking on a link should take me to the figure (not the caption). It doesn't seem to be working with floats in floatrow. No matter where I put the \capstart, The links always point to the caption instead of figure. The MWE is here.               \documentclass[11pt]{book}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}          \usepackage{lipsum}     \usepackage{floatrow}     \usepackage[hypcap]{caption}     \usepackage{hyperref}          \begin{document}          \begin{figure}       \begin{floatrow}[3]         \capstart\hypertarget{fig:1}{\ffigbox{\rule{3cm}{3cm}}{\caption{Click This Link}}}           \capstart\hypertarget{fig:2}{\ffigbox{\rule{3cm}{3cm}}{\caption{Click This Link}}}         \capstart\hypertarget{fig:3}{\ffigbox{\rule{3cm}{3cm}}{\caption{Click This Link}}}       \end{floatrow}     \end{figure}          \clearpage     \newpage          \section{\protect\hyperlink{fig:1}{Section A}}     \lipsum     \section{\protect\hyperlink{fig:2}{Section B}}     \lipsum[2]     \section{\protect\hyperlink{fig:3}{Section C}}     \lipsum[3]          \end{document}      Surya


title: Labels perpendicular to a c

text: I am new to all this. I intend to make scales some of which are curved. I would like to have the tick marks and the corresponding numbers erected **perpendicularly** to a given 2D curve, e.g. a circle - think of the face of a clock. How can I do that?


title: Questions about Moderntimeline in moderncv

text: Corresponding to this thread and this I tried to create a timeline in my cv. My code is:               \documentclass[11pt,a4paper]{moderncv}     \moderncvtheme[green]{classic}                       \usepackage[utf8]{inputenc}                       \usepackage{floatflt}     \usepackage{fancyhdr}      \usepackage{geometry}     \geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt}      \usepackage{tikz}      \usepackage{wrapfig}     \usepackage{lipsum}      \usepackage{xparse}     \usepackage[firstyear=1996,lastyear=2013]{moderntimeline}               % for timeline          \makeatletter     \pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}     \NewDocumentCommand\tldatelabelcventryn{O{center}O{color1}mmmmmmm}{%     \pgfmathsetmacro\tl@endyear{\tl@lastyear}%     \pgfmathsetmacro\tl@startfraction{(#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%     \pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%      \cventry{\tikz[baseline]{%          \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);          \fill [\tl@runningcolor] (0,0)             rectangle (\hintscolumnwidth,\tl@runningwidth);          \fill [#2] (0,0)             ++(\tl@startfraction*\hintscolumnwidth,0pt)             node [tl@startyear,yshift=5pt,anchor=#1] {#4}             node {$\bullet$};        }     }     {#5}{#6}{#7}{#8}{#9}     }     \makeatother     %     \tltextstart[north]{\scriptsize}     \tltextend[south]{\scriptsize}          %     \firstname{C}     \familyname{N}     \title{Curriculum vit\ae{}}                   \address{}{}       \photo[128pt]{picture}                                  \begin{document}          \makecvtitle     born on .... in xxxxx          \section{school education}     \tlcventry[cyan!60!black]{2000}{2008}{test1}{test}{}{}{grade: 22}     \tlcventry[cyan!60!black]{1996}{2000}{test2}{}{}{}{test}     \section{studies}     \tllabelcventry[cyan!60!black]{2011}{2013}{Oct 01, 2011}{test3}{}{}{}{test}          \tldatelabelcventry[cyan!60!black]{2011}{Apr 06, 2011}{Test4}{}{test}     {test}{}               \tllabelcventry[cyan!60!black]{2009}{2011}{Dec 01,2009--Jan 01,2011}{Test5}{}{}{}{test}               \end{document}      This gives ![t1](http://i.stack.imgur.com/U84Cw.png)   1. test1 and test2 are ok   2. I want to have test3 until today. So that the Oct 01, 2011 is below the line and it goes until today, so it should be `Oct01,2011--today`, but this is not working, also the descirption should be "today"   3. As you can see Test4 is (vertically) not centered? The bold Test4 is too much under the grey line, it is not the same as in the previous cases, how can I have this the way as before? Also I want to have the "Apr 06, 2011" above the grey line.   4. Test 5 does not work. How can I have the Jan 01, 2011 above the grey line. And one general question: Currently I am only specifying the year, so e.g. 2009, although sometimes I add the specific day in the label. Is it possible to also specify the month, so that the cyan bar is drawn excatly at this month and this year, so to distinguish on this very detailed level? EDIT:               \tllabelcventryn[cyan!60!black]{2000}{2008.583}{2000}{Jul 11, 2008}{Test}{Test}{}{}{grade: 1.8}      gives ![t1](http://i.stack.imgur.com/cu1kc.png) but I want to have the "Jul 11, 2008" shifted/pushed to the right, so like this (I did it with paint): ![t2](http://i.stack.imgur.com/Sa8YQ.png) EDIT 2: Further on, I would like to have the Apr 06, 2011 in the same style, so that the label is not centered about the timeline itself but around the dot, so that it looks like: ![te](http://i.stack.imgur.com/Gs7C8.png) So it should have the same alignment as the others, in total they should end at the same border, so that it looks like the following: ![test1](http://i.stack.imgur.com/Wbsso.png)


title: Symbol in plural form of acronym in glossaries package

text: Follow-up question If the plural form acronym is used first then it is printing one `s` after the symbol in parenthesis and this is not desired. For example, if `\glspl{a}` occurs first before any use of `\gls{a}` then it is printing `lattice constants (as)` instead of `lattice constants (a)`. How to solve the issue?


title: Box with rounder corners, but inverted

text: I am a long time LaTeX user, and recently I needed something which I could not figure out by myself, so I would appreciate anyones time and help. I need a box with rounded corners, which is easy to do - for example, this thread shows how: How to draw frame with rounded corners around box and I used the `mdframed` environment to do it. However, now I want to invert the rounded corners, so that the centre of the circle lies in the corner of the box. Actually, what I am trying to achieve is this: ![enter image description here](http://i.stack.imgur.com/xFpc2.jpg) But I don't know how to do it, so I would like to ask for your help. Thanks in advance.


title: Tree in a growing bracket

text: I try to enclose my syntax tree in a growing double bracket using `\left \llbracket ... \right \rrbracket`. However, the tree always sits in the lower half and leaving the upper half blank, which is very ugly... What's more, I cannot make the angle bracket grow with the tree...               \documentclass{article}     \usepackage{stmaryrd}     \usepackage{qtree}     \usepackage{tikz-qtree}     \begin{document}          $\left \llbracket \textbf{\Tree [.S [.S [ [.NP [.N Ann ] ] [.VP [.V smokes ] ] ] ] and [.S [ [.NP [.N John ] ] [.VP [.V drinks ] ] ] ] ]} \right \rrbracket$ \\     $\left \langle \left ( \Tree [.S [.NP [.N Ann ] ] [.VP [.V smokes ] ] ] \right ) \right \rangle$          \end{document}      ![enter image description here](http://i.stack.imgur.com/pR26G.png)


title: Variable parameters in xcolor package

text: This doesn't work and I'm having trouble thinking of a minimum _working_ example, but I'd like to do something like this where I have a _parameter_ to a command as a variable:               \usepackage{xcolor}     \definecolor{mycolor1}{RGB}{126,169,105}     \definecolor{mycolor2}{RGB}{26,69,15}          \newcommand{\ColorVariable1}{mycolor1}     % or     \DeclareRobustCommand{\RobustColorVariable1}{mycolor1}      to allow me to have several places in the body of my document where I do things like this:               \textcolor{\ColorVariable1}{Some text in a variable color}      and I can change the colors of all those colored text portions with one fell swoop by assigning a new color (as below) to the _variable_ rather than replacing mycolor1 with mycolor2 with an editor global search and replace in all the places in the text as I'm doing now.               \newcommand{\ColorVariable1}{mycolor2}      I know that I can do something similar (but not for parameters) in the body of the document:               \def\somestring{Replace \somestring with this text.}      And something also similar with commands, but this doesn't seem to work for parameters:               \newcommand{name}[num][default]{definition}      Is there any way to do something like this in LaTeX?


title: Range chart by category and value

text: Basically I've been writing my work with XeLaTeX enthusiastically now for about a year and love it, but today for the first time I tried to draw a graph and realised I still have a lot to learn. Unfortunately, I couldn't quite work out how to create a chart looking like the one in my (hastily sketched) image, and I couldn't extract the useful information from PGFPlots manual without getting totally lost. The chart (graph?) I want to make should be of distinct categories on the x axis, with lines representing ranges of values on the y. I feel certain this is simple but just can't seem to get a handle on it. ![peculiar graph style](http://i.stack.imgur.com/mczEG.png) Any guidance would be so greatly appreciated.


title: Hide ^^^^-notation from pdftex

text: The following example gives when compiled with pdflatex the error `! Text line contains an invalid character.`               \documentclass{article}     \usepackage{ifluatex}     \ifluatex     \usepackage{fontspec}     \fi     \begin{document}     abc     \ifluatex ^^^^20ac\fi     \end{document}      It is possible to get around the problem by using another char and changing its catcode e.g. inside the `ifluatex`:               \ifluatex{\catcode`\!=7 !!!!20ac}\fi      But I'm wondering: Is there a way to hide such invalid characters from `^^^^`-notation in some way globally in pdflatex?


title: Making one bar in a bar-graph stand out pgfplots

text: I have a grouped bar-chart, in which I would like to highlight in some way the two bars corresponding to EU-24. Perhaps by giving them a different colour, or pattern. Does anything jump to mind? ![enter image description here](http://i.stack.imgur.com/v5UxQ.png)               \documentclass[tikz,border={38pt 12pt}]{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \usetikzlibrary{plotmarks}\definecolor{mycolor1}{rgb}{0,0,0.5625}          \begin{document}     \begin{tikzpicture}[trim axis left, trim axis right]          \begin{axis}[%     width=4.78723958333333in,     height=1.96484375in,     area legend,     scale only axis,     xmin=0,     xmax=12,     xtick={1,2,3,4,5,6,7,8,9,10,11},     xticklabels={IRL,EST,GRC,LTU,CZE,DNK,SVN,ESP,EU-24,GBR,CZE},     xlabel={Country Initials},     ymin=-10,     ymax=10,     ylabel={Percentage},     legend style={draw=black,fill=white,legend cell align=left}     ]     \addplot[ybar,bar width=0.0911855158730159in,bar shift=-0.0569909474206349in,fill=mycolor1,draw=black] plot coordinates{(1,6.50839602446152)     (2,7.18649865479679)     (3,5.69926104853342)     (4,8.86318406286013)     (5,5.96722429393004)     (6,3.21245636089815)     (7,3.90148651103934)     (8,4.11307588009999)     (9,4.55138638324477)     (10,4.87923265464318)     (11,2.66698448311287)};          \addlegendentry{2000-2009};          \addplot [     color=black,     solid,     forget plot     ]     table[row sep=crcr]{     0 0\\     12 0\\     };     \addplot[ybar,bar width=0.0911855158730159in,bar shift=0.0569909474206349in,fill=red!50!black,draw=black] plot coordinates{(1,-7.93058315856087)     (2,-7.26040844811857)     (3,-6.67854407923318)     (4,-5.0031445973415)     (5,-4.37613983512456)     (6,-2.10591746017944)     (7,-2.00034271729993)     (8,-0.903233231259903)     (9,-0.631822488660329)     (10,-0.47632641303218)     (11,-0.222157097491837)};          \addlegendentry{2009-2012};          \end{axis}     \end{tikzpicture}%     \end{document}


title: Cutting a table to fit the available space on a page

text: I have a long list of data, in a CSV file, formatted like this:               tiger, 300, 10.0, 7, 4.0     lion, 200, 15.0, 5, 3.0     bear, 100, 15.0, 3, 1.0     fish, 10, 10.0, 2, 0.1      The first rows are more important than the later rows and I do not need to display all of the data.   * I want to put this data in a table, but only show as much data as can be displayed in the table and fit in a single page, along with a caption.   * If only 20 lines from the table can be displayed on the page, then the rest of the lines are cut and not displayed.   * I do not want to scale any of the text. How can I create a table in ConTeXt which only displays the amount of data from the CSV file which can fit onto a single page?


title: Lyx - quotation mark in C program

text: I have a problem with double quotation marks in program listing. When I load a file.c as a child document in lyx and set it as program listing, I get error: #include "softSPI.h" undefined control sequence. Lyx handles "softSPI.h" as an unknown command. Please help.


title: How to add white space before an item?

text: How to add white space before an item ?               \documentclass[12pt,english]{report}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{babel}          \begin{document}     Dqfnqsdf qsdfjdqs qsdjqsd qsdmqsjdqsd qsd qsdqsdq.     \begin{itemize}     \item One.     \item Two.     \end{itemize}     Dqfnqsdf qsdfjdqs qsdjqsd qsdmqsjdqsd qsd qsdqsdq.     \begin{enumerate}     \item One E.     \item Two e.     \end{enumerate}     \end{document}      Any brilliant suggestion, please? Thanks a lot!


title: Code compilation problem - example on Tikz vectors

text: I would like to use the following code segment: ## Code               \usetikzlibrary{arrows}     \usetikzlibrary{calc}          \begin{tikzpicture}[line/.style={>=latex}]      \coordinate (V1) at (1, 1.3);     \coordinate (V2) at (-1.6, 0.4);     \coordinate (V3) at ($(V1) + (V2)$);     \coordinate (V4) at ($1.4*(V1)$);          \draw[step=10pt, color=black!10] (-2, -1) grid (2, 2);     \draw[<->, line] (-2, 0) -- node [below, very near end] {$x$} (2, 0);     \draw[<->, line] (0, -1) -- node [right, very near start] {$y$} (0, 2);     \draw[->, line, color=orange, thick] (0, 0) -- node [right=2pt, near end]    {$\vec{u}$} (V4);     \draw[->, line, color=blue, thick, densely dashed] (0, 0) -- node [right=2pt] {$\vec{v}$} (V1);          \draw[->, line, color=red, thick] (0, 0) -- node [above] {$\vec{w}$} (V2);     \draw[->, line, color=red, densely dotted] (V1) -- +(V2);     \draw[->, line, color=blue, densely dotted] (V2) -- +(V1);     \draw[->, line, color=green!70!black, thick] (0, 0) -- node [left] {$\vec{z}$} (V3);     \end{tikzpicture}      which is taken from the following link, yet the code does not compile for me and give a different criptic error for each Tex editor I try. Help is appreciated.


title: Problem with wallpaper package

text: I want to show one every page a file as background except the page one, there should be another background. I'm trying to do this with the code below. The problem is, that on the first page the pdf-files are one upon the other and you can see both. Is there a solution, that the first page just show the first file as background ?               \documentclass[paper=a4,oneside]{scrartcl}     \usepackage{lipsum}          \usepackage{wallpaper}     \usepackage[utf8]{inputenc}     \usepackage{helvet}          % Background for the first and the following sides     \newcommand{\setBackground}[2]{         \IfFileExists{#1}{\ThisTileWallPaper{\paperwidth}{\paperheight}{#1}}              \IfFileExists{#2}{\TileWallPaper{\paperwidth}{\paperheight}{#2}}     }          \begin {document}     \setBackground{file1.pdf}{file2.pdf}     \lipsum     \pagebreak     \lipsum     \end{document}


title: Why does \maketitle change the availability of \@title?

text: I am trying to include the document title in a heading using `scrartcl`. For some reason when I call `\maketitle`, the `\@title` variable seems to be unset and all uses of it turn up empty. My document looks something like this (stripped to just a test case):               \documentclass{scrartcl}         \usepackage[english]{babel}         \usepackage[automark,headsepline]{scrpage2}         \pagestyle{scrheadings}              \makeatletter         \ihead{\MakeUppercase{\@title}}         \makeatother              \usepackage{blindtext}          \title{my doc title}          \begin{document}          \blinddocument % headers show the document title on these pages          \maketitle          \blinddocument % these pages have an empty header          \end{document}      As noted, my headings show the document title fine up until the point where I call `\maketitle`, then the field is blank. I have tried re-assigning the header and even title variable after outputting the title to no-avail. How can I get my header back?


title: Controlling the amplitude of the snake function in TikZ

text: I have been using TikZ with some success, but I can't figure out why the following code doesn't produce anything:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing}     \begin{document}              \begin{tikzpicture}         \draw[decorate, decoration=snake, segment length=5mm, amplitude=15mm] (0,0) -- (10,10);         \end{tikzpicture}          \end{document}      except the following error > Latex Error: ./untitled.tex:7 Package pgfkeys Error: I do not know the key > '/tikz/amplitude' and I am going to ignore it. Perhaps you misspelled it. Were I to remove the amplitude option, this would compile. I just tried installing the very latest pgf-TikZ package, but that didn't change anything (the update went well, other features are working correctly). This leads me to believe that this option is somehow outdated, but I can't find anything to remedy this. Does anyone know how to control the 'snake' amplitude in the latest TikZ package?


title: Can a bibtex entry be given more than one reference name?

text: I would like to give some of my `bibtex` entries multiple reference names, without duplicating the entry. Is this possible? My reason is that I have a reference name scheme in my master `bibtex` file, used with the format `\cite{Smith2006:AGreatTitle}`, and this works very well to help me keep organized with my bibliographies. A problem, however, is that I often need to create the `bibtex` entry for my own papers before the year of publication is known, and so I often start with `Hamkins:AGreatPaper`, and then later on when it is accepted for publication and appears, I want to change it to `Hamkins2010:AGreatPaper`. But this causes problems for the early TeX files that cited the old reference name, if I should ever re-`bibtex` them. So the best solution seems to use duplicate names for the same entry. Of course, I realize that I could simply create a duplicate `bibtex` entry, but I don't like this solution so much since I fear that I won't be able to manage it so well, and I will sometimes only update one of them without realizing that the other one needs updating and so on. So the best solution for me would simply be if `bibtex` somehow accepted multiple reference names. Does it?


title: Accessing environment variables within a document

text: Is there a way to access environment variables from within a LaTeX document? Suppose I define a variable in a batch file:               set MY_VAR=HelloWorld      How can I programmatically print the string "HelloWorld" inside my LaTeX document, without resorting to creating a new source document with the string in it?


title: "This page was left intionally blank" on center of page

text: > **Possible Duplicate:**   >  How do I make pages which were "intentionally left blank"? Assuming I am forcing amount of pages to be even using Raphink's solution : http://tex.stackexchange.com/a/69112/7128               \documentclass{article}     \usepackage{lipsum}     \usepackage{ifthen}     \begin{document}     \lipsum          \ifthenelse{\isodd{\thepage}}     {\cleardoublepage\mbox{}}     {}          \end{document}      How to put a nice grey large text in the center of page "This page was left intentionally blank" ? I suppose it's the place where is `\mbox{}`, but how to typeset such information ? (I use pdflatex)


title: Blank pages with a message

text: > **Possible Duplicate:**   >  How do I make pages which were "intentionally left blank"? I want to produce the effects as in a conventional book, wherein you have `\cleardoublepage` with a message like "This page has been intensionally left blank." Is there an easy way to do this in LaTeX? I want to do this with every even numbered page left by `\cleardoublepage`...


title: How do I generate Creative Commons license information?

text: I need to include some licensing information on the back cover of a free CC- licensed book. Instead of frankly mentioning the license ("This work is licensed under CC-by-nc-sa, Google knows more"), I'd like to have complete information about the rights it gives, i.e. comparable to what the license description says on their site, both images and text. I imagined the following to be in the code for that:               \usepackage{creativecommons}     ...     \license[2.5]{by-nc-sa}     ...     % images only     \shortlicense[3.0]{by-nc-sa}      Does anyone know of a package that makes such licensing notices easier?


title: How to clean unused files?

text: I recently edited an existing document to create a new one from it (that is: I copied the whole folder to a new location and started from there). The early document had a lot of figures, but not all of them were used in the new version. Now I have a lot of unused files (jpg, pdf, png) under the `/fig` which I want to get rid of, because they are not called by any `\includegraphics` command. Is there a way to list used or unused files? (I'm not referring to auxiliary files, I'm fine with those.)


title: Using versions environment tags inside a new environment definition

text: I just found out about the `versions` package here and am interested in using it to hide solutions in a problem set document. Recall that, to create versions block, in the preamble, you need               \usepackage{versions}       \excludeversion{sol}       %\includeversion{sol}      and, in the document,               \begin{sol} ... \end{sol}      Here, the blocks labeled "sol" will be excluded. In my document, I define a new environment "Solution" as               \newenvironment{Solution}{\begin{sol} \\ \textbf{Solution: }}{\end{sol}}      This construction works perfectly if I instruct LaTeX to include the "sol" blocks, but chokes if I try to exclude them. For example, the following code chokes and gives an `Incomplete \iffalse` error:               \documentclass{article}       \usepackage{versions}       \excludeversion{sol}       %\includeversion{sol}       \newenvironment{Solution}{         \begin{sol}\\ \textbf{Solution: }}{         \end{sol}}       \begin{document}       \section{Question 1}       What is $2+2$?       \begin{Solution}       It is $2+2=4$.       \end{Solution}       \end{document}      If I change the commenting and include "sol", then this code works as expected. I'm guessing that there's something going on with the way that the versions package works. Any suggestions?


title: naming paths inside a TikZ foreach loop

text: Is it possible to create named paths inside a foreach loop with the name depending on the counter? I want to write something like               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{intersections}          \begin{document}          \begin{tikzpicture}         \foreach \i in {1,2,...,6}             \draw[name path=line\i] (-3,-\i) -- (3,\i);         \draw[name intersections={of=line1 and line2}] (intersection-1) circle (5pt);     \end{tikzpicture}          \end{document}      but this throws the following error:               ! Missing \endcsname inserted.     <to be read again>                         \OT1\i      l.11    \draw (0,3) circle (3);      Is this a bug or am I doing something wrong? What should I do instead?


title: Adding text between Bibliography header and the first bibitem

text: I want to add text in to the Bibliography right after the header and before the first bibitem, so that it is structured as in the following: > References and further reading > > This and that can be found in [1]. The other stuff is particularly well > explained in [2] and [3]. ... > > [1] ... [2] ... (As you can see, I also want to have the header saying "References and further reading", instead of "Bibliography, but this I already managed to do that by renewing the `\bibname` command.) A similar question was discussed and answered here: Headings inside the Bibliography list. The simplest solution was to add the text with the `\item` command, such as: `\item[]\hspace{-\labelwidth}\hspace{-\labelsep}Here is the text.` While this does work for headers, it does not for one or several paragraphs of text, since the layout is messed up. Can anyone tell me how I can do this? Would be glad if there was a simple solution, but am happy for any help, thanks! :) Some more information on my document: I use the `AMSbook` class. The document consists of three parts, where each one has it's own bibliography, created with the `thebibliography` environment. I do use the `\hyperref` package, and want all Bibliographies to be properly displayed (clickable) in the table of content, which works fine as it is now. **EDIT - Comments on the answers of Gonzalo Medina and Guido:** Both these approaches work, thanks! I have chosen to use Guido's approach, since it is simpler as long as one has no problem with using the `natbib` package. Anyway, both methods produce equally good results and fit directly to my needs, thanks! :)


title: Glossaries package a complete simple example

text: I want to give a list of all the math symbols I have used after the table of contents. Can some one please give a complete example using the glossaries package? I want something like this               Symbol    Description        equation number          x         x is a variable     (1.1)      After googling for hours I can not find a complete example which shows how to change the headings. For example, instead of equation number I would like to change to page number as heading. I keep getting something this printed               Notation    Description        Page                                    List          x           x is a variable     ]equation1.1      Here is a template if you have time to answer.               \documentclass{article}          \usepackage{glossaries}     \newglossaryentry{hate}{name=\ensuremath{x}, description={x is a variable, just kidding}, sort=x}     \makeglossaries     \printglosarries     \begin{document}          \begin{equation}      \gls{hate} = \frac{2}{0}     \end{equation}           \printglossaries            \end{document}      O.k I will provide a proper answer later on. But for now here is the deal. unlike other latex packages going \usapackage{glossaries} is not it, this is the catch. You have to further do something like this. Compile latex as normal once then you need to produce a .gls file. For that do makeindex -s myfile.ist -o myfile.gls myfile.glo then latex again. Better to start with reading the beginner's manual here http://ctan.org/pkg/glossaries It will save you time.


title: Intelligently Numbering "remarks" only when multiple are made

text: **Problem.** I am using the `amsthm` package, and have remarks after theorems. If there is only one remark between two theorems, the remark should not be numbered. If there are multiple remarks between two theorems, they should be numbered (with the counter reset with respect to the theorem counter). I have two environments to handle this, `rmk` and `rmk*`, but can I have only one? (If anyone is curious, I'm typesetting some work by Euler, and he does this with Scholium numbering. But I'm also thinking about doing this with my own personal notes, which is why I ask for a robust single environment solution...) **Minimal Working Example.** For what I do now, here's a minimal working example using a workaround. But it's unpleasant when I add more remarks to a theorem to remember to change `rmk*` to `rmk`.               \documentclass{article}          \usepackage{amsthm}     \newtheorem{thm}{Theorem}     \theoremstyle{remark}     \newtheorem{rmk}{Remark}[thm]     \newtheorem*{rmk*}{Remark}          \begin{document}     \begin{thm}     Lorem ipsum.     \end{thm}          % it would be really nice if these could just be "rmk" and     % magically unnumbered...     \begin{rmk*} % only one remark made, so don't number it     It is Latin for "I have boring examples".     \end{rmk*}          \begin{thm}     We see that $\pi$ is an interesting number.     \end{thm}          \begin{rmk} % Multiple remarks require numbering     It's the ratio of the circumference to the diameter of a circle.     \end{rmk}     \begin{rmk}     It's also used when I do my taxes.     \end{rmk}     % snip     \end{document}


title: article.cls not found after last update

text: Latex work fine till I do the last update today. When compiling a text, document, I have an error : > article.cls not found Samething for book and report class. Any idea ? Thanks.


title: What would be the best way to draw this image using latex?

text: I have an assignment which involves drawing the layout of some wiring. I have been using a different program, but the rest of my work is in LaTeX and so I would like to learn how use LaTeX to create the image as well. My image is `here`: ![enter image description here](http://i.stack.imgur.com/HcFjC.png) Essentially the little black squares need to be able to be connected to each other vertically across the gap. I have been using `circuitikz` to try to complete my task, but I haven't yet worked out how to create something that looks similar enough that someone would understand what it represented. I am looking to create the image above, but without the fill or the grid lines, so it would be rows of little boxes with circles inside that could be connected by lines. If anyone has any suggestions to which packages (if not `circuitikz`) or something that I could be doing in `circuitikz` then that would greatly be appreciated. Cheers


title: Compiling kerTeX problem

text: I was trying to compile kerTeX on Mac OSX 10.9 and encountered some problem. I downloaded this get_mk_install.sh from the project home and fed it to `sh`, it worked very well at first for a moment but terminated suddenly, the error message does not make any sense to me:               #========== BUILDING sys/sh1/pkglib     sed -e 's!@@TARGETSHELL@@!/bin/sh!'\                      -e '/^##PKG_SYS_DEPENDENT/r /Users/user/Temp/kertex/kertex_T/sys/sh1/pkglib/./unix.data' /Users/user/Temp/kertex/kertex_T/sys/sh1/pkglib/sh.data\                  | sed -e 's!@@SYS_FTPC@@!ftp!'\                              -e 's!@@SYS_HTTPC@@!ftp!'\           -e 's!@@SYS_SUDOING@@!sudo!'\                              -e 's!@@SYS_ROOT_ID@@!0!' >pkglib.sh          #========== sys/sh1/pkglib DONE (50/50)     Programs that failed to build:     !mpware/sh1/mp2ps     make: *** [all] Error 1      Can any one help on this, or point me to where solutions can be found. My purpose is to port some TeX system to mobile platforms such as Android, iOS, etc., to compile TeX scripts locally. Is this the appropriate solution for my task? If there are ones that are better, please let me know. Thanks.


title: LaTeX verse package no indent for the poem

text: I am typesetting using the `verse` package. I have trouble getting what's inside the `verse` environment not to get indented. In the minimal working example below, I would like the "Blessed are" to be aligned with "This is the regular text that is not indent."               \documentclass[11pt,letterpaper]{article}     \usepackage[utf8]{inputenc}     \usepackage{verse}     \begin{document}     \begin{verse}     Blessed are the poor in spirit, for theirs is the kingdom of heaven.\\     Blessed are those who mourn, for they shall be comforted.\\     Blessed are the meek, for they shall inherit the earth.\\     Blessed are those who hunger and thirst for righteousness, for they shall be satisfied.     \end{verse}     \noindent This is the regular text that is not indented.      \end{document}


title: Collecting environment content with support for xparse arguments

text: I'm trying to create an environment which uses `xparse` style arguments but I have to be able to use the whole environment content in the environment definition, e.g. as an argument. Ideally I'd like to write something like               \DeclareCollectedDocumentEnvironment { env } { o } {         Make use of optional Argument #1 and Content \CollectedBody.     }     \begin{env}[optional]         content     \end{env}      Is there a reason, why `xparse` doesn't provide something like this? Using `\NewEnviron` from the `environ` package does not work for me, because I'm reliant on some of the argument-parsing features `xparse` provides. Currently I've got this working:               \documentclass{article}     \usepackage{xparse}     \usepackage{environ}          \ExplSyntaxOn          \DeclareDocumentCommand { \myenv } { o u\q_nil } {         opt:~#1 \\         content:~#2     }     \cs_set:Npn \myenv_collect:n #1 {         \myenv #1 \q_nil     }     \makeatletter     \DeclareDocumentEnvironment { env } { } {         \Collect@Body \myenv_collect:n     } { }     \makeatother          \ExplSyntaxOff          \begin{document}          \begin{env}[99]         With optional argument     \end{env}          \begin{env}         Without optional argument     \end{env}          \end{document}      This however has some flaws:   * Multiple paragraphs inside the environment cause an infinite loop   * Nesting does not work as expected I've also tried to declare the arguments for `\DeclareDocumentEnvironment` and somehow pass them onto `\myenv_collect:n`, but the behaviour of `\Collect@Body` made it difficult. Is there a solution to my problem, preferably a latex3 one?


title: How to write sentences in an algorithm in latex?

text: Hi I am trying to write an algorithm which looks something like the image below: ![Algorithm](http://i.stack.imgur.com/SHHPu.png) I was wondering how to write the "Step 1 (Update)" and also the rest of the line which says "When an edge e...." should all that be inside the math symbols i.e.. \[\] ?? I am kinda new to latex. Thanks for the help! Also I was wondering what is the difference between algorithm and algorithmic?


title: Emacs key binding open environment

text: On Emacs, I used to have "C-c C-e" as a shortcut to "open an environment with begin and end". I changed my computer and reinstalled emacs: Mac OS 10.9 and Emacs 24.3, and now in LaTeX mode, "C-c C-e" is only closing an already opened environment. (it seems that "C-c C-t" is doing roughly the same as before but not exactly) Similarly, "C-c C-s" is not opening a new section anymore. Finally, "C-c C-;" used to comment region, but is not working anymore. Any idea on how I could come back to the previous behaviour? (I don't know the name of the commands and I fail to rebind C-c C-e...) Thanks!


title: Why does unicode-math break the kerning of accents in combination with amssymb?

text: I am using the following MWE. First time with `unicode-math`, second time without it:               % arara: lualatex          \documentclass{article}     \usepackage{amssymb}     %\usepackage{unicode-math}          \begin{document}     $\tilde\Box \hat\Box \bar\Box$        \end{document}      ![enter image description here](http://i.stack.imgur.com/KPfaX.png) ![enter image description here](http://i.stack.imgur.com/82nNd.png) Where does the difference come from? The kerning is clearly broken. > amssymb.sty 2013/01/14 v3.01 AMS font symbols > > unicode-math.sty 2013/05/21 v0.7e Unicode mathematics support for XeTeX and > LuaTeX ## Edit Barbara Beeton suggested to try the package `latexsym` instead of `amssymb`. This results in worse vertical positioning and the very same effect for I/O `unicode-math`:               % arara: lualatex          \documentclass{article}     \usepackage{latexsym}     %\usepackage{unicode-math}          \begin{document}     $\tilde\Box \hat\Box \bar\Box$        \end{document}      ![enter image description here](http://i.stack.imgur.com/dlQz8.png) ![enter image description here](http://i.stack.imgur.com/aRJAV.png)


title: Straight lines look out thicker than diagonal

text: I am currently creating a graph of connected nodes i tikz. When I draw a diagonal connection using:               \draw[solid] (a) --node[midway,right](){0.3} (b)        the line looks much thinner than when a draw a straight line. Is there any way to get around this?


title: How to write long equation

text: I want to write the following equation in such a way that right align is possible. That is all right most elements are in same column. Here left align is done.               \begin{eqnarray*}     y_{0}&= &(r_{73} + 1)r_{9} + ((r_{73} + 1)r_{93} + r_{73} + 1)r_{108} + ((r_{73} + 1)r_{93} + r_{73} + 1)r_{110} + ((r_{73} + 1)r_{93} + \\           &  &r_{73} + 1)r_{98} + ((r_{73} + 1)r_{93} + (r_{73} + r_{93})r_{115} + r_{73} +1)r_{123} + ((r_{73} + 1)r_{93} + (r_{73} + r_{93})\\           &  &r_{115} + r_{73} + 1)r_{85} + ((r_{73} + 1)r_{93} + (r_{73} + r_{93})r_{115} + ((r_{68} + 1)r_{73} + ((r_{68} + 1)r_{73} + r_{68} \\           &  & + 1)r_{93} +((r_{73} + 1)r_{93} + r_{73} + 1)r_{110} + ((r_{68} + 1)r_{73} + (r_{68} + 1)r_{93} + (r_{73} + r_{93})r_{110})r_{115} \\           &  &+ r_{68} + 1)r_{131} +r_{73} + 1)r_{88} + ((r_{68} + 1)r_{73} + ((r_{68} + 1)r_{73} + r_{68} + 1)r_{93} + ((r_{68}r_{73} + r_{68})\\           &  &r_{93} + r_{68}r_{73} +r_{68})r_{110} + ((r_{68} + 1)r_{73} + (r_{68} + 1)r_{93} + (r_{68}r_{73} + r_{68}r_{93})r_{110})r_{115} + \\           &  &r_{68} + 1)r_{131} + (r_{15} + r_{36} +r_{48} + r_{6} + r_{61} + r_{7})r_{73} + ((r_{73} + r_{93})r_{108} + (r_{73} + r_{93})r_{110} \\           &  &+ (r_{73} + r_{93})r_{98} + (r_{15} +r_{36} + r_{48} + r_{6} + r_{61} + r_{7})r_{73} + (r_{15} + r_{36} + r_{48} + r_{6} + r_{61} \\           &  &+ r_{7} + r_{9})r_{93} + r_{73}r_{9} + 1)r_{115} +((r_{73} + 1)r_{9} + (r_{15} + r_{36} + r_{48} + r_{6} + r_{61} + r_{7})r_{73}  \\           &  &+ r_{15} + r_{36} + r_{48} + r_{6} + r_{61} + r_{7} + 1)r_{93} +r_{103} + r_{11} + r_{113} + r_{12} + r_{128} + r_{14} + r_{15} \\           &  &+ r_{20} + r_{36} + r_{41} + r_{48} + r_{53} + r_{6} + r_{61} + r_{66}+ r_{7} + r_{90}\\      \end{eqnarray*}


title: How to put an algorithm and a tikz drawing (objects of different type) side-by-side in the same float environment?

text: I am trying to put an **algorithm** and a `tikz`' drawing side-by-side inside a **figure** environment. I am aware of this question but I would like to have a single caption for them. For instance, in the text, Figure 1a would refer to the algorithm while Figure 1b would refer to the tikz' drawing.


title: Defining a macro for "real" colored delimiters

text: I recently looked up J. van Hoorn's question on How to color delimiters in Math Mode, and so I decided to test my LaTeX knowledge by trying to define a new appropriate command: `\leftcolor{color}<delim symbol>` and `\rightcolor{color}<delim symbol>`. The MWE is as follows:               \documentclass{article}     \usepackage{amsmath}     \usepackage{xcolor}     %     \newcommand*\leftcolor[2]{%      \color{#1}\left#2\normalcolor%     }     \newcommand*\rightcolor[2]{%      \color{#1}\right#2\normalcolor%     }     %     \begin{document}     \begin{equation*}     %     \leftcolor{red}(\frac{a}{b}\rightcolor{red})^n \neq \left(\frac{a}{b}\right)^n     %     \end{equation*}     \end{document}      The problem can be seen in the result shown below: > ![enter image description here](http://i.stack.imgur.com/HYOKJ.png) I clearly see that the exponent positioning is wrong, but I have no clue on how LaTeX puts that symbol in this way, because I followed the only option possible for the correct coloring (even after searching on the `xcolor` documentation I didn't find anything related to this topic). My guess is that the effective size of the delimiter is "faked" in such a way that the compiler finds more correct to put the exponent as one normal size delimiter rather than the extended one. I don't know if there is some plain TeX or LaTeX string to help about this situation, because the most common solution in these cases involves the making new delimiters such as:               \customdelim{\frac{a}{b}}^n   % these commands are not present in this case      The fact is that _I don't request this kind of macro_ because I want to be able to switch directly from one color to another as a specific argument.


title: How to centralize the tables

text: I have made a table like this               \documentclass[notuble,10pt,a4paper]{leaflet}     \usepackage{color}     \usepackage{flowfram}     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{hyperref}     \usepackage{rotating}     \usepackage{multirow}     \usepackage{array,eqparbox,tabularx}     \pagestyle{empty}     \usepackage[parfill]{parskip}     \newenvironment{tips}     {     \noindent     \begin{tabular}{m{0.2cm} m{\textwidth}}     \rotatebox{90}{\textbf{\resizebox{0.45\textwidth}{!}{FISAT}}}&     }     {\end{tabular}     \bigskip     }          \begin{document}               \begin{tips}     \begin{tabular}{l}     {\resizebox{5cm}{!}{ONE}}\\      {\resizebox{5cm}{!}{MILLION}}\\      {\resizebox{5cm}{!}{CODES TO}} \\      {\resizebox{5cm}{!}{THE COMMUNITY}}\     \end{tabular}      \end{tips}          \end{document}      How could I centralize this


title: Writing an equation in a new line

text: I wish to write an inline equation using `$%math...$`, but the current line is too long, so the equation is broken into two parts, first one in the original line, and the other in a new line. I don't want this situation; I want a whole line, and after it the equation. I don't want to use `\newline{}` or something like that, because it stops the line in the middle and doesn't do the indenting (the spacing which makes all the lines to end on the same vertical line). What can I do?


title: How do determine the arrow form in Tikz

text: I plotted following image: ![enter image description here](http://i.stack.imgur.com/yELGb.png) Using this code:               \documentclass[10pt,a4paper,twocolumn]{article}     \usepackage{bondgraph}                                          %Draw bondgraphs              \usetikzlibrary[petri]                      % Petri nets          \begin{document}     \begin{figure}             \centering         \begin{tikzpicture}[yscale=-1.1,thin,>=stealth, every transition/.style={fill,minimum width=1mm,minimum height=3.5mm}, every place/.style={draw,thick,minimum size=6mm}]         \node[place,tokens=0,label=above:$p_G$] (pG) {};         \node[transition,right=of pG,label=below:$t_{GY}$] (t1) {}             edge[pre] (pG);         \node[place,right=of t1,tokens=0,label=above:$p_Y$] (pY) {};             %edge[pre] (t1);         \node[transition,right=of pY,label=below:$t_{YR}$] (t2) {};         \node[place,right=of t2,tokens=1,label=above:$p_R$] (pR) {};         \node[transition,above=of pY,label=below:$t_{RG}$] (t3) {};         \draw [->] (t1) -- (pY);         \draw [->] (pY) -- (t2);         \draw [->] (t2) -- (pR);         \draw [->] (pR) to [out=315,in=0] (t3);         \draw [->] (t3) to [out=180,in=135] (pG);         %\draw [->] (t3) to [out=0,in=180,bend left] (pG);         \end{tikzpicture}             \caption{Petri net model for traffic lights}             \label{fig:task1pet1}     \end{figure}     \end{document}      How can I change the form of the arrow going from `t_{RG}` to `p_G` such that it is a mirrored version of the arrow from `p_R` to `t_{RG}`?


title: Matrix equation (esp. row vectors)

text: I'd like to write the matrix equation A = (x y) B (x y)^T, where (x y)^T is written as a column vector and B is a 2x2 matrix written as such. I can (almost) do this by, for example, the following:               A = (x \ y) \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}      But I'd like the row vector (x y) to be aligned with the first row of the matrix B. How do I do this?


title: Show information only once in footnotes

text: I am using `citestyle=authortitle-ibid`, but I have to make it work according to these rules:   1. The first time a reference is made, there should be all the information in the footnote (including publisher, author, editor, containing book, year etc.).   2. The second time the same reference is used, even on another page, the footnote should contain author, year and page, unless the information is ambigious without the title. In the latter case, the title should be contained as well. I am wondering how one could achieve this. Personally, I think putting all the information in footnotes is a bad idea, however, I was told to do so.


title: pages number compression with biblatex

text: I'm wondering if there is a way to make the bbx bibliography style automatically convert a pages range (e.g. 167-169) to the compressed form 167-9, so that unchanged digits are not repeated.


title: Prevent extra spacing between lines from \raisebox

text: I create superscripts for indexes for notes manually with `\raisebox`. What I don't like is that Latex changes the line spacing to fit a manual superscript into a line. For instance:               \documentclass{article}\usepackage{setspace}\begin{document}     \scriptsize     \parbox{3cm}{     \begin{spacing}{0.8}     TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST      TEST TEST TEST {\tiny\raisebox{3pt}{b}}TEST TEST TEST TEST TEST      TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST\end{spacing}}     \ \ \ \ \ \ \ \ \      \parbox{3cm}{     \begin{spacing}{0.8}     TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST      TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST      TEST TEST TEST TEST TEST TEST TEST TEST\end{spacing}}     \end{document}      creates (without the black lines) ![](http://i.stack.imgur.com/OSCiu.png) Left `\parbox` with manual superscript (-> too much spacing in line before the superscript), right `\parbox` without (-> equal spacing). How can I get rid of the extra spacing in the left `\parbox`. `\raisebox` can be replaced if there is a better way. It is ok if the superscript overlaps with the text in the previous line.


title: Printing verbatim command inputs in commands

text: I want to define a command `\mydef` that does something like this:               \mydef{\foo{bar}}      produces               \def\foo{bar} \verb|\foo=bar|      The command:               \newcommand{\mydef}[1]{\def #1}      does the first bit, but I don't seem to be able to use verbatim in a command - how do I access the contents of `#1`? In this context I would be happy if I could just discard the first character...


title: Link formatting: colors, underlines in moderncv

text: Following the excellent advice in this site, I have started using `moderncv` for writing the new version of my CV. Unfortunately, after converting to PDF, my http links work (clicking on them leads to the site), but they are formatted as normal text without underline and blue color. Following some searches, I've tried:               \hypersetup{linkcolor=blue}      \href{http://www.wikibooks.org}{wikibooks home}      And some other tags, but nothing seems to work. Any idea how to format the links? Minimal working example:               \documentclass[11pt,a4paper]{moderncv}     \moderncvtheme[blue]{casual}     \usepackage[utf8]{inputenc}                   % replace by the encoding you are using     \usepackage[scale=0.8]{geometry}     \firstname{Adam}     \familyname{Matan}     \email{adam@matan.name}                      % optional, remove the line if not wanted     \homepage{www.matan.name}                % optional, remove the line if not wanted     \makeatletter     \renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}     \makeatother     \begin{document}     \maketitle     \section{Professional network}          % ********************************************     % ***********      Link part       ***********      % ********************************************          \cvline{Linkedin.com}        {\small \href{http://www.linkedin.com/in/adamatan}             {Adam Matan}   - Professional profile and links.    }     \cvline{Stackoverflow.com}   {\small \href{http://stackoverflow.com/users/51197/adam-matan} {Adam Matan}   - My software questions and answers. }      \cvline{twitter.com}         {\small \href{http://twitter.com/justnoticed}                  {@justnoticed} - My tech tweets.}          % ********************************************     % ***********     /Link part       ***********      % ********************************************          \renewcommand{\listitemsymbol}{-} % change the symbol for lists     % Publications from a BibTeX file without multibib\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% for BibTeX numerical labels     \nocite{*}     \bibliographystyle{plain}     \bibliography{publications}       % 'publications' is the name of a BibTeX file     \end{document}


title: \varnothing 'undefined control sequence'

text: I am using `amsmath` and all of my math symbols are appearing using `$ $` block but `\varnothing` is undefined. `\emptyset` ![](http://i.stack.imgur.com/4lOPd.png) works but its symbol is a bit different than `\varnothing` ![enter image description here](http://i.stack.imgur.com/A3v5W.png) Note: images taken from LaTeX wikibook.


title: Memoir chapter styles

text: I'm designing a book collection using the `memoir` class. I want chapter titles to have a page for themselves (before the chapter proper). I'm using the following code for that:               \makechapterstyle{renaccs}{%     \chapterstyle{default}     \def\chapterheadstart{\hbox{}\vspace{6\onelineskip}}     \renewcommand*{\chaptitlefont}{\huge\scshape\bfseries\centering}     \renewcommand{\afterchaptertitle}{\vfill\cleartorecto}     }      The problem is that most other book divisions (TOCs, LOFs, etc.) also get this formatting---as expected. Is there a way for me to only get this results for chapter titles proper, and not for TOCs, LOFs, etc.? (I mean, I could change the formatting locally and manually at the outset of every chapter, but I will to have a class setting for this.) Cheers!


title: Algorithm for 'Plugging in' Values to Tables

text: Simply, if I have a table of the form:                   \begin{tabular}{l r r r r r l r r r r r}         \hline         {}&{}&{}&$n$&{}&{}&{}&{}&{}&$n$&{}&{}\\         \cline{2-6}\cline{8-12}         {}&1&2&3&4&5&{}&1&2&3&4&5\\         \hline     $Q(n+0)$&1&1&2&3&3&$Q(n+100)$&48&54&54&50&60\\     $Q(n+5)$&4&5&5&6&6&$Q(n+105)$&52&54&58&60&53\\     $Q(n+10)$&6&8&8&8&10&$Q(n+110)$&60&60&52&62&66\\     $Q(n+15)$&9&10&11&11&12&$Q(n+115)$&55&62&68&62&58\\     $Q(n+20)$&12&12&12&16&14&$Q(n+120)$&72&58&61&78&57\\     $Q(n+25)$&14&16&16&16&16&$Q(n+125)$&71&68&64&63&73\\     $Q(n+30)$&20&17&17&20&21&$Q(n+130)$&63&71&72&72&80\\     $Q(n+35)$&19&20&22&21&22&$Q(n+135)$&61&71&77&65&80\\     $Q(n+40)$&23&23&24&24&24&$Q(n+140)$&71&69&77&75&73\\     $Q(n+45)$&24&24&32&24&25&$Q(n+145)$&77&79&76&80&79\\     $Q(n+50)$&30&28&26&30&30&$Q(n+150)$&75&82&77&80&80\\     $Q(n+55)$&28&32&30&32&32&$Q(n+155)$&78&83&83&78&85\\     $Q(n+60)$&32&32&40&33&31&$Q(n+160)$&82&85&84&84&88\\     $Q(n+65)$&38&35&33&39&40&$Q(n+165)$&83&87&88&87&86\\     $Q(n+70)$&37&38&40&39&40&$Q(n+170)$&90&88&87&92&90\\     $Q(n+75)$&39&42&40&41&43&$Q(n+175)$&91&92&92&94&92\\     $Q(n+80)$&44&43&43&46&44&$Q(n+180)$&93&94&94&96&94\\     $Q(n+85)$&45&47&47&46&48&$Q(n+185)$&96&96&96&96&96\\     $Q(n+90)$&48&48&48&48&48&$Q(n+190)$&96&128&72&96&115\\     $Q(n+95)$&64&41&52&54&56&$Q(n+195)$&100&84&114&110&93\\         \hline     \end{tabular}     }      is there a way that I can automatically edit the numerical values in the syntax? I'd like to do this so I can just take a table of values in excel and basically 'copy' the values in those tables to this form so that I make all the necessary tables relatively quickly. Thanks in advance.


title: Numbering a "new theorem"

text: I have a (simple?) question. I use the ams `theorem` environment for most of my theorems, but I want to box my definitions and find here a nice way to do it, simpler for me than `mdframed`. My problem is I want the numbering of the theorems to be consistent with each other. More precisely, here is my preamble about the theorem :               \newtheorem{thm}{Th\'eor\`eme}[section]     \newtheorem{prop}[thm]{Proposition}     \newtheorem{lemme}[thm]{Lemme}     \theorembodyfont{\rmfamily}     \newboxtheorem{lem}[thm]{Lemme}     \newboxedtheorem[thcounter=thm,titleboxcolor = white]{defn}{D\'efinition}{thcounter}      Then I tried to change the counter `thcounter` to `thm`, or similar, but it didn't work. Does anybody have any idea of how I can do so that the numbering of my definitions follows the ones of my theorems, lemma...


title: There is a need for (at least) two more dashed arrows in amssymbols : how to produce them?

text: In birational geometry, we often use dashed arrows to insist on the fact that our maps are not defined everywhere. I wonder how can we produce:   1. a mapsto dashed arrow joining `\mapsto` and `\dashrightarrow`;   2. a circle dashed arrow like `\circlearrowleft`?


title: How to change Jabref's copy BibTex context command?

text: In JabRef 2.7, when I right-click an entry, I have the option to copy the cite command `copy \cite{BibTexKey}`. However, as I am working with `biber` I would prefer to have `copy \autocite{BibTexKey}`. Can I change the settings to copy the way I want?! ![enter image description here](http://i.stack.imgur.com/0A1K0.png)


title: Preprocessor for LaTeX?

text: I'm curious to find out whether anybody has suggestions for a preprocessor for LaTeX documents. What I'm thinking of is something like cpp. The motivation for my question is that I'm writing a large document in which I insert comments to myself, such as `\textbf{XXX TO DO: need transition paragraph. Make sure to mention xy's work. XXX}` for example. When I periodically release parts of the (unfinished) document to selected people, I comment out the TO DO's and I replace the detailed Subversion version string in the footer (version, date, time, etc.) by a simpler string that asserts my authorship and that the document should not be distributed. I would be glad if these changes could be automated and something like cpp seems an obvious candidate. I realize that writing a little preprocessor using awk or sed is not that big a deal, but ideally I want to reuse existing software. My digging so far has only found gpp http://en.nothingisreal.com/wiki/GPP and filepp http://www.cabaret.demon.co.uk/filepp/ Both of these seem pretty old judging from dates on the websites, however. Any comments, experience, ideas?


title: BibTeX: How to remove "dot", "comma" and "and" in author name and put year at the end?

text: I use the package `natbib` with the bibliography style `apa`. How I remove dot, comma and "and" after name and then change year position without bracket to the end of reference. > Maniatis, T., Fritsch, E. F., and Sambrook, J. (2001). Molecular Cloning: A > Laboratory Manual.Cold Spring Harbor Laboratory, New York, 3rd edition. I want to make format below : > Maniatis T, Fritsch EF, and Sambrook J. Molecular Cloning: A Laboratory > Manual.Cold Spring Harbor Laboratory, New York, 3rd edition. **2001** or please help me which package for `vancouver` style can be used for author year citation ? for example " biologi is bla bla (James et.al., 2009) "


title: Strange latex error involving bibtex

text: I'm baffled by the recent manner in which my LaTeX has been acting up. I'm using TeXmaker on a Mac. My document was compiling fine, but I had put in some new references, so to get them to show up I compiled my .bib file. There were no errors. After recompiling (I hadn't changed anything since the last time that compile worked; all I did was compile the BibTeX file), I got the following error:               Unicode char \u8:ﬁ not set up for use with LaTeX.      and can no longer compile. However, after clearing out all the `.aux`, etc. files, I can compile just fine...but still without references (and if I compile the `.bib`, I get the same bug again) Can anybody suggest a fix?


title: How to warn if a package hasn't been loaded

text: Is it possible to emit a warning if a package hasn't been loaded? If possible, I would prefer that the solution not require `\usepackage{ifthen}` as it couldn't emit the warning that it was missing the `ifthen` package. EDIT: Thanks Martin and Joseph for the responses. I would like to clarify my question: _is it possible do to this from within the body of a document?_ The `\AtBeginDocument`, `\RequirePackage` and `\@ifpackageloaded` are only available in the preamble. The `ltxcmds` package makes `\ltx@ifpackageloaded` available in the body but then the `ltxcmds` package is required for this to work. The situation where I would like this is I am generating tables with the `xtable` package in `R` and when the `floating.environment='sidewaystable'` argument is used, the `rotating` package is required. To make this easy for users, I would like to allow them to simply `\input{<path_to_xtable>}`. However, if the `rotating` package isn't loaded pdflatex give an error message like               l.3 \begin{sidewaystable}                              [ht]     ?      I would prefer that it issue a more informative warning that the `rotating` package is missing. Is this possible?


title: Is "conditionals" name of package?

text: In some package I have seen construct like this one:               \if\blank{\myMacro}%       %do something     \else       %do something else     \fi      I like it and I want to use it to test if call to a macro has empty result. I have tried it in my code and I have found out that the `\blank` macro does not work until I add `\usepackage{conditionals}` to preamble. Now here is the problem: I have tried to find documentation to package "conditionals" but there seems to be no such package installed (nor available) on my MiKTeX distribution. I have tried search included in MiKTeX package manager but did not find it. Why is that? Where do I find documentation of that package? _Side note:_ I was looking for the documentation because I wanted find opposite macro something like `\notblank`


title: Blackboard bold characters

text: The blackboard bold font in the AMSFonts package only has capital letters. I sometimes wish to use a blackboard bold "1", for which I can use `\usepackage{bbold}`. But this changes the entire blackboard bold font, and I like the original AMSFonts versions of the capital letters better. Is there a simple way for me to get `\mathbb{1}` from one package and and the blackboard bold capitals from another?


title: Best way to typeset the identity operator, or unit?

text: > **Possible Duplicate:**   >  Blackboard bold characters I have seen the unit (or identity operator) typeset via               \newcommand{\unit}{1\!\!1}      Is this really the best way to get a double-stroke 1? The obvious guess, `\mathbb{1}`, does not work. Or is the use of a double-stroke 1 (rather than "Id" or just a simple "1") for this purpose frowned upon?


title: How do I make a blackboard 1?

text: > **Possible Duplicate:**   >  Blackboard bold characters I want to make a blackboard "1" character to show an indicator variable, but `$\mathbb{1}$` doesn't work. How do I do it?


title: How to add several authors with different affiliations in beamer?

text: Is it possible to do this in `beamer`? Or do I have to use other packages?


title: How to linebreak when using \rotatebox inside a tikz node?

text: I would like to know how I can get a linebreak inside a rotated node using tikz. I tried to use the `align=center` option together with `\rotatebox{}{}`, but i get an error. Here is an example of a working code but without the linebreak:               \begin{figure}[h!tp]     \begin{tikzpicture}[generaloptions/.style 2 args={     draw,ultra thick,font={\bfseries},inner sep=0,outer sep=0,minimum height=#1,minimum width=#2}]     \node[generaloptions={3.5cm}{1.5cm},align=center,anchor=south west,font=\footnotesize\bfseries] (l1) at ([xshift=-1.5cm]big.south west) {\rotatebox{90}{Line Break}};     \end{tikzpicture}     \end{figure}       I would like something like this but instead i get an error:               \begin{figure}[h!tp]     \begin{tikzpicture}[generaloptions/.style 2 args={      draw,ultra thick,font={\bfseries},inner sep=0,outer sep=0,minimum height=#1,minimum width=#2}]      \node[generaloptions={3.5cm}{1.5cm},align=center,anchor=south west,font=\footnotesize\bfseries] (l1) at ([xshift=-1.5cm]big.south west) {\rotatebox{90}{Line \\ Break}};      \end{tikzpicture}      \end{figure}      I am I missing something? Thanks!


title: How to modify the indentation before sectioning titles in the table of contents?

text: I'm preparing a document using the `book` class. In the table of contents, the indentation before the subsection title is too long. How to reduce it?


title: List of figures indentation

text: I am writing my thesis and I am experiencing a problem with the space between numbering and the image name. You can see the problem in the picture I include in this question. It starts from 3.10. How can I fix that? ![enter image description here](http://i.stack.imgur.com/uC6Bu.png)


title: Spacing between number and title in List of Tables

text: > **Possible Duplicate:**   >  How to modify the indentation before sectioning titles in the table of > contents? I need to add some space between the number of the table and the title of the table since they overlap in the list of tables.


title: TOC Text - numbers alignment

text: ![alt text](http://i.stack.imgur.com/WibU5.jpg) I am using \tableofcontents to create TOC in my document. however it is appearing as shown in the image. As the numbers increase the gap between the number and text is reducing. Thanks for your help Aku