title: Can not compile TeXStudio’s Letter template

text: I have just created a new file from a template in TeXStudio. I have chosen the letter template. So I have this code generated:               \documentclass[]{letter}               \begin{document}     % If you want headings on subsequent pages,     % remove the ``%'' on the next line:     \pagestyle{headings}          \begin{letter}{TO_ADDRESS}     \address{ADDRESS}          \opening{SALUTATION}          \signature{}          \closing{}          %enclosure listing     %\encl{}          \end{letter}     \end{document}      So far, I don't even touch the code and I can not compile this since I have these errors :               Missing $ inserted \opening{SALUTATION}     There's no line here to end. \opening{SALUTATION}     Missing $ inserted \opening{SALUTATION}     There's no line here to end. \closing{}      Any ideas why? I would like to start from this template, but I don't figure out how to fix this type of errors.


title: Change definition number in beamer

text: In a beamer presentation, I need to redefine one definition (the definition numbers have to be same). How can I do that? Here is my code.               \documentclass{beamer}     \setbeamertemplate{theorems}[ams style]      \begin{document}     \begin{frame}          \begin{definition}[A definition]     Some text.     \end{definition}          \begin{definition}[That definition again]     I need that definition number is repeated (it should be 1 instead of 2).     \end{definition}          \end{frame}     \end{document}


title: Top aligned tabular: \cline equivalent of \firsthline

text: When aligning `tabular` environments with the `[t]` option, one can use `\firsthline` (from the array package) instead of `\hline` when a line is required at the top of the table. Like so:               \documentclass{article}     \usepackage{array}          \begin{document}     Tabular with hline:      \begin{tabular}[t]{ll}       \hline A & B \\ C & D \\ \hline     \end{tabular}     and with firsthline:     \begin{tabular}[t]{ll}       \firsthline A & B \\ C & D \\ \lasthline     \end{tabular}      But what if I want only some cells of the first line to have a line above them, like this:               Tabular with cline:     \begin{tabular}[t]{ll}       \cline{2-2} A & B \\ C & D \\ \hline     \end{tabular}     and what it should look like:     \raisebox{.8em}{       \begin{tabular}[t]{ll}         \cline{2-2} A & B \\ C & D \\ \hline       \end{tabular}     }     \end{document}      And the compiled result: ![Vertical alignment problem illustrated](http://i.stack.imgur.com/mLeOj.png) Is there any easy way to achieve this effect without manually tweaking the vertical offset with `\raisebox`?


title: How may I keep my logo at the front of my slide

text: May be the title is confusing. Let me explain what I want: I am using beamer to create my slide and on the first page, in order to match my school style, I fill up the entire first slide with red color. Now I want to add the school logo in the first slide. I am using code               \titlegraphic{     \begin{textblock*}{100mm}(0\textwidth,8.5cm)     \includegraphics[height=.8cm,width=14cm]{logo-polito-heng}      \end{textblock*}}      this code works good at the rest of my slide, of course, without `\titlegraphic` part. However, at the front page, my logo is totally missing... I guess it is covered by red color which I am using to fill up my first page... Now the question is, how may I keep my logo at the front of my slide? Any comments would be very thankful!!!!


title: How to use luatex callbacks to generate a verbatim copy of the input file

text: I'm trying to devise a LuaTeX solution for the question Extracting the contents of text in a specified environment into a new file, but it is turning more difficult than expected. To begin, I need to solve a problem which seemed simple enough, but I'm unable to solve properly. I want to use some of the LuaTeX callbacks or _hooks_ to dump into a file a copy of each line of the main document file. My first approach was to hook into `process_input_buffer`, with this code:               -- luafuncions.lua     f = io.open(tex.jobname .. "-copy.tex", "w")          letpass = function(line)         f:write(line.."\n")       return nil     end     callback.register("process_input_buffer",letpass)      When I use the following tex document:               \directlua{dofile("luafunctions.lua")}     % Example.tex     \documentclass{article}     \usepackage{fontspec}     \usepackage{lipsum}          \begin{document}     1. \lipsum[1]     2. \lipsum[2]     3. \lipsum[3]     \end{document}      And compile it through `lualatex`, I get:   1. The expected `Example.pdf` file in which all looks correct   2. The file `Example-copy.tex` which I expected to contain a copy of `Example.tex` (except perhaps for the first line) However, I get a 1.4Mb file (gasp!) which starts and ends with:               % Example.tex     \documentclass{article}     \usepackage{fontspec}     %%     %% This is file `article.cls',     %% generated with the docstrip utility.          %... 33750 lines omitted          \begin{document}          %... 4874 lines omitted          1. \lipsum[1]     2. \lipsum[2]     3. \lipsum[3]     \end{document}     \relax      So, sort of worked :-) But I guess that what is happening is that all the lines read from `.cls`, `.sty`, `.def`, `.aux` etc... are being processed by the calback too, and thus they are being dumped. I want to avoid that. So I hoped that I could hook some other callback to the event of an external file being open (and closed), and set a boolean to let my function know that it should not write those parts. However I cannot figure which callback can be useful to do this. Callbacks `open_read_file` and `close` look promising, but apparently I have to provide a reader if I use those callbacks. I would hoped that if my hooks returned `nil`, the default readers will be used, but it is not that way. Is there a simple solution for this problem?


title: Errors using Algorithm

text: When I run the following code, the pdf is getting generated but I get errors.                \documentclass[12pt,a4paper,oneside,oldfontcommands]{memoir}      \usepackage{algorithm2e}      \usepackage{algorithmicx}          \begin{document}          The following is an example algorithm              \begin{algorithm}[ht!]     \caption{Algorithm}      Set count = 1 \linebreak          \While{count $\le$ V}{          count $\gets$ count + 1       }           \While{dataa $\ne \phi$}{         \For{V $\epsilon$ data}             {   \For{a \textless d}                  {   \If{ccc}                          {                             statements;                              }                     \ElseIf{cond2}                         {                             statements;                         }                     \EndIf             }   \EndFor         }   \EndFor           }     \end{algorithm}     \end{document}


title: How can I use webpage citing in BibTeX?I'm trying but they don't show up in my document

text: How can I use BibTeX to cite a web page? I'm trying but they don't show up in my document. http://www.engineersgarage.com/               @misc{WinNT,     title = {{MS Windows NT} Kernel Description},     howpublished = {\url{http://http://www.engineersgarage.com}},     note = {Accessed: 2010-09-30}     }      How can I use BibTeX to cite a web page?


title: Timing response of externally called commands via write18: blocking or not?

text: I was wondering: when we use `\immediate\write18{...}` to run commands in an external shell from Latex, is the `\write18` a blocking call or not? In other words, will it wait for the external code to complete and return (with success, or not) - or will Latex just initiate execution in a separate thread in a non-blocking manner, and continue immediately afterwards? Can an example be supplied that illustrates this?


title: How to modify \titlecontents{part}?

text: For the moment, I have ![enter image description here](http://i.stack.imgur.com/ajY9B.png) and I would like to change the part entry to obtain something like that ![enter image description here](http://i.stack.imgur.com/NyBiL.png) Can you help me to modify the code below? * * *               \documentclass{book}          \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}      \usepackage{titletoc}          \titlecontents{part}[0pt]{\normalsize\bfseries\protect\addvspace{15pt}}%     {}{\partname{} }%     {\enspace\titlerule\contentspage}%          \begin{document}          \tableofcontents          \part{This is the title of part 1}     \chapter{Chapter 1}     \section{Section 1.1}     \section{Section 1.2}          \end{document}


title: Windows-Terminal commands to have information about LaTeX distribution

text: I'm looking for command to use in one terminal so as to know the following facts.   1. Is there one LaTeX distribution installed ?   2. What is the path where to put local classes or packages ? In my Mac, I know that it is `'/usr/local/texlive/texmf-local/tex/latex'`. The command will be used by one Python script so as to automate the installation of my personnal little classes or packages. The solutions given in the following comments work well on Mac, and I think that this works also under Linux, **but I don't know how to do under Windows**...


title: apa6, latex, and biber - cannot get the workflow down. and when it does work it appears faulty

text: Sorry for the nebulous title, but I have several problems (all related which is why there is a single post). **My Setup** : I am using Win32 + TeXworks with MiKeTeX. I _believe_ everything is up-to-date. I am trying to use `\documentclass[man]{apa6}` with `biber` as the back-end. I am VERY new to LaTeX, so please **do treat** me like an idiot at this point because I don't have a clue what's going on with LaTeX. references.bib masterone.tex // this is my 'master' tex file. I then break up the sections into separate files. introduction.tex // one of the sections with a citation in it. NB: I HAVE tried to compile the shortsample and longsample files that come with apa6, and I get the same painful results noted below. I'm starting to think something isn't installed correctly, but I don't know for sure or how to check. I do biber version is 1.5. Not sure on MiKeTeX/LaTeX but it was whatever was available to download in early Oct, 2013. // **Problem-1** : Because I have references in a `*.bib` file, I am running latex (at the cmd line) against my `mainthesisdoc.tex`. Then running `biber mainthesisdoc`, then `latex mainthesisdoc` again... **Question-1** : I'm assuming this is what I NEED to do (else script it out). If that is true, what is occurring in the backend that requires me to run `latex`, `biber`, then `latex` again? I would have thought this process would have been a single step? // **Problem-2** : I'm doing something wrong, but I can't figure it out. Sometimes the above process works and generates the references section, sometimes it doesn't. I'd post output, but I don't want to spam anyone. **Question-2** : Can someone suggest what I might post up or why it will sometimes generate and other times it wont? // **Problem-3** : In using `apa6`, the results are... not desirable. I'm seeing issues where citations aren't working and the reference page isn't being generated. Using `\parencite` it creates a cite like this: > blah blah blah ( **Dougger2008** ) Notice the intentional cite reference where in my .tex file it has `\parencite{Dougger2008}` It should look like: > blah blah blah (Dougger, 2008). Notice that it's not bolded, it's [Last Name], [Year] and then there is no trailing whitespace at the end of [Year] and the ending parens (like in the above example). **Question-3** : Is this a symptom that suggests the `biber` step didn't work? Is this related to why I am not getting a reference page on most runs? // **Problem-4** : In the above example, the citation is bolded in the resultant PDF. **Question-4** : How do I remove the bold from every citation? That's not APA-6th ed. at all and I can't fathom why this is desirable. Thank you in advance, and please don't shoot/hate me for the long post. This is a weeks long battle being vented on tex.sx. **UPDATE/SOLUTION** : I don't know how or why, but based on the answers I got from Werner I suspected that something wasn't installed correctly. Everything I was doing, even running the examples, wasn't working. If you have come to this question because you have installed MikTeX and are unable to make a reference section, and `Biber` isn't giving you a *.bbl file, you might want to download Biber directly and replacing C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\biber.exe (or wherever you installed it). As soon as I did this and followed the steps of running `latex` -> `biber` -> `latex` `latex` it worked flawlessly and my reference section popped up!


title: IEEEeqnarray page breaks

text: I am using IEEEeqnarray and have an equation of many lines. LaTeX insists on placing this equation on a new page as there is not enough space remaining at the bottom of the current page for it to fit. I would rather the equation begin on the current page and spill over to the new page in order to avoid a large white space at the bottom of the current page. How may I achieve this? Thanks...


title: Beamer: \nonumber equivalent for slides?

text: Is there an equivalent command to `\nonumber` when one doesn't want to include certain slides in the numbering? I would like to leave outline and title slides out of my numbering, and instead just number slides with actual content. Other workarounds would be nice to know about as well. Edit: Since a MWE example was requested, here is one. Suppose I have a title page and two other slides. The code below gives a slide counter that goes up to 3, and the title slide is slide 1. I would prefer to have the title slide not be numbered, the counter go up to 2, and the the numbering start at the slide after the title. Here is some code.               \documentclass{beamer}          \mode<presentation>      {        \usetheme{Dresden}      }           \setbeamertemplate      {footline}{\quad\hfill\insertframenumber/\inserttotalframenumber\strut\quad}                \begin{document}          \begin{frame}      \titlepage     \end{frame}          \begin{frame}     Some actual content here     \end{frame}          \begin{frame}     Some more actual content here     \end{frame}          \end{document}


title: Copying italics text from Word to LaTeX

text: I'm copying text from Microsoft Word and pasting it into my LaTeX editor. I've been manually replacing all instances of _`italics`_ with `\emph{}`, but is there a way to do it faster? The process would need to be able to find all chunks of italics text (both isolated words and strings of multiple words), then add an `\emph{` to the beginning and a `}` to the end. (I realize this may not be a TeX question directly, but I'm sure other TeX users will find it helpful.)


title: Output for date ranges of publication in biblatex-apa

text: Please consider the following               \RequirePackage{filecontents}          \begin{filecontents*}{mybib.bib}     @book{test1,         address = {Edinburgh},         title = {I and thou},         publisher = {T. \& {T}. {Clark}},         author = {Buber, Martin},         translator = {Smith, Ronald Gregor},         year = {1937},         origdate = {1923/1924}     }     @incollection{test2,         address = {Cambridge, {MA}},         title = {Deliberation and democratic legitimacy},         booktitle = {Deliberative democracy: {Essays} on reason and politics},         publisher = {MIT {Press}},         author = {Cohen, Joshua},         editor = {Bohman, James and Rehg, William},         year = {1997/1998},         origdate = {1989},         pages = {67--91}     }     }     \end{filecontents*}          \documentclass[a4paper]{article}               % Set the values for the bibliography     \usepackage[         style=apa,         backend=biber,         isbn=false,         url=false,         doi=false,         eprint=false,         hyperref=true,         backref=false,         firstinits=false,     ]{biblatex}          % Recommended by biblatex     \usepackage[utf8]{inputenc}     \usepackage{csquotes}     \usepackage{xpatch}          % Set language     \usepackage[british]{babel}     \DeclareLanguageMapping{british}{british-apa}          \addbibresource{mybib.bib}          \begin{document}          \cite{test1}           \cite{test2}          \printbibliography     \end{document}      and note how the data range is printed ![enter image description here](http://i.stack.imgur.com/uhksw.png) The data range in APA style (I guess) should be printed like: `Someauthor, 1997-1998`. The problem with `biblatex-apa` style with date ranges is that the `year` field is rendered as `1997/1998`instead of `1997/1998`, while the data ranges for `origdate` is rendered only with the first year `1997`. How to tweak the style so to output the MWE above as ![enter image description here](http://i.stack.imgur.com/zweD1.png) ?


title: Drawing Sphere to represent a black hole

text: Can anybody tell me how to draw up a sphere inside a sphere? What I mean is something like this: ![enter image description here](http://i.stack.imgur.com/cRdbd.gif) Also where it says the different horizons be able to insert a mathematical expression? Also not in these poor colours something that looks kind of professional. Any help much appreciated.


title: How to cite a translation of works published across multiple years?

text: I am using `biblatex-apa` and `biber` as backend. According to Biblatex package documentaiton for the field origdate` > Date ranges are given as yyyy-mm-dd/yyyy-mm-dd (p. 34) Still I am not sure how to print it because if I have a translation then with the data range the in-text citation would be `Someauthor (1929-1939/1965)`; a bit messy. The `biblatex-apa` style doesn't support date range for original date: it prints only the first year. But in any case how would you print it? Would you keep both the first and last year of the range or just the last one?


title: Fraction in brackets

text: I want to have a fraction in brackets. Something like: `$${\log C \brack \log 2}$$`, but with the line in the middle. I know this possibility: `$$\left[\frac{\log C}{\log 2}\right]$$`. Nonetheless, does something easier exist?


title: Problem with counter and \pause

text: I am trying to create a manual continuation annotation for my presentations (because I need more flexibility than provided by the automatic splitting feature of beamer). What I thought of is, for each sequence of slides create a counter and then increment and print its value on each successive slide of the sequence. If I do that "manually", everything works fine. Then I tried to automate things a little bit more, as shown below. The `countslides` command takes an argument, constructs a counter using the argument for its name (if it does not exist) and then increments and prints its value. Unfortunately, the code produces an error "Missing number, treated as zero" on the first slide (even though the result is correct). The error goes away if I remove the `\pause` command on this slide (or if I remove the `\resetcounteronoverlays` from my command definition, but I cannot afford this). Maybe my code is wrong, but I cannot see how (and it has worked fine in all other cases).               \documentclass{beamer}     \usepackage{ifthen}     \begin{document}          \makeatletter     \newcommand{\countslides}[1]{%       \ifthenelse{\expandafter\isundefined\csname c@cnt#1\endcsname}%         {\newcounter{cnt#1}%          \resetcounteronoverlays{cnt#1}%         }%         {}%       \stepcounter{cnt#1}%       {~\footnotesize (\arabic{cnt#1})}%     }     \makeatother          \begin{frame}     \frametitle{Hello \countslides{abc}}     A     \pause     B     \end{frame}          \begin{frame}     \frametitle{Bye \countslides{abc}}     C     \pause     D     \end{frame}          \end{document}


title: Float reference only appears when using [h] here float placement

text: I'm typesetting an article using PNAS' template for two-column articles: http://www.pnas.org/misc/PNASTWO.CLS My problem is that if I include a figure or table:               \begin{figure}     \caption{my figure}     \label{fig:myfig}     \end{figure}      and reference my figure or table,               I now reference Figure \ref{fig:myfig}, a decent figure      the Figure number does not appear: > I now reference Figure , a decent figure However, if I specify float placement with the               \begin{figure}[h]      option, the number appears: > I now reference Figure 1, a decent figure [tbh], [thbp] will not work, but all variants starting with [h] give float number, like [htb]. Pdflatex does not give any warnings when the float reference do not show, not even the normal ??. The problem with using [h] is that the [h] figure placement is sub-optimal, making my article longer than the 6-page limit for PNAS. The pnastwo.cls style file is behind this somehow, because when using a normal article style the reference numbers appear. I'm not asking anyone to correct the pnas style file, but I would be glad if anyone has any ideas about what is happening here.


title: Short documents

text: I need to write a short informal note-type document with a description of my new idea and a few equations - 2 pages max. I use the article document class, but it seems to be an overkill - the title and author take 1/3 of the first page, etc. Could someone recommend a more suitable document type?


title: Tex and pdf synchronization

text: I'm trying to make backward and forward search work between my `pdf` output in `skim` and my `tex` file in `macvim` with 'vim latex suite' using `PDFSync`. I think I did everything well, as when I `CMD-SHIFT-CLICK` my pdf file I get into the `tex` file. Two issues :   * if `autofold` is set in `macvim` it does not automatically defold my file when jumping the cursor. This would be useful especially when browsing my `pdf` file for errors and not have to defold every section in my `tex` file by hand.   * disregarding previous folding issue, the cursor appears on the correct line in my `tex` file. I'd like to have it on the right word. Especially when the sentence covers several lines. Basically, I'd like to have the same behavior I had when using `texshop` with its internal editor and using `CMD-CLICK`.


title: Emergency stretch hook

text: Is there a way to automatically set parameters when emergency stretch is required? Here is my situation. After I implemented the solution chosen for unbreakable spaces in Bible verse references, I get some overfull boxes due to verse references at the end of lines. To fix these overfull lines, I can allow hyphenation between the book name and the chapter, as an exception (I don't want to allow it unless it is really necessary). I've made myself two macros to make this easier. For example, I'll use:               (\BRallowhypbch\ibibleverse{Ac}(4:13)\BRforbidhypbch).      To allow hyphenation between `Actes` and `4.13` in `Actes 4.13` as an exception. I'm wondering if, when LaTeX gets down to use `\emergencystretch` (because other methods of justifications have failed), there is a way to trigger a hook that would call my two macros before and after the problematic paragraph (or line if possible) to fix it.


title: Rotate ctable, manipulate sideways

text: When using ctable and sideways, the tables are rotated automatically.               \documentclass[10pt,b5paper,twoside]{report}     \usepackage[lmargin=25mm,rmargin=25mm,tmargin=27mm,bmargin=30mm]{geometry}     \usepackage{hyperref}     \usepackage[pagestyles]{titlesec}     \usepackage{ctable}      With some of the tables I would like to adjust the angle myself (so it rotates 270 instead of 90 degrees). Any way I can do this?               \ctable[caption= Descriptive statistics, label=desc_stat_fut, doinside=\small \renewcommand\arraystretch{1.5}, center, sideways]{XXXXXXXXXXXXXX}{\tnote[]{The sample totals 1728 observations. THIS NOTE IS VERY LONG!}}{     \toprule      \multicolumn{14}{c}{Descriptive statistics} \\     & Mean. & Med & Min & Max & StDev & Skew & Kurt & $\rho_{1}$ & $\rho_{5}$ & $\rho_{12}$ & JB & Q(10) & PP \\       \midrule     $P_{t}$ & 58.23 & 56.48 & 25.19 & 145.29 & 25.73 & 1.07 & 0.91 & 1.00 & 0.99 & 0.97 &      397.72 & 17285.06 & -1.62 \\      $\log(P_{t})$ & 3.97 & 4.03 & 3.23 & 4.98 & 0.42 & 0.15 & -0.70 & 1.00 & 0.98 & 0.97 &      43.09 & 17217.45 & -1.83 \\       $P_{t}-P_{t-1}$ & 0.02 & 0.02 & -10.52 & 16.37 & 1.55 & 0.42 & 11.83 & -0.03 & -0.02 & 0.07 &      10368.48 & 16.37 & -43.10 \\        $\log\left(\frac{P_{t}}{P_{t-1}}\right)$ & 0.00 & 0.00 & -0.13 & 0.15 & 0.03 & -0.07 & 3.42 & -0.04 & -0.04 & 0.09 & 862.62      & 32.05 & -43.68 \\      $\left(\log(\frac{P_{t}}{P_{t-1}})\right)^{2}$ & 0.00 & 0.00 & 0.00 & 0.02 & 0.00 & 6.56 & 59.28 & 0.17 & 0.20 & 0.21 &      271607.31 & 1041.23 & -40.44 \\     \bottomrule     }


title: Postprocessing PDF presentations

text: Few years ago I had been successfully using `ppower4` for PDF postprocessing. It seems that it is no longer maintained, do you know a good replacement for this?


title: Arrays inside a subfigure

text: I'd like to know how to put an array inside a subfigure (if it can be done). I have no problem putting the following code inside a figure statement but in subfigure it fails miserably and I cannot figure out why. For example this compiled fine:               \documentclass[]{article}          \usepackage{subfigure}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}                         % Input encoding     \usepackage{listings}               % Code Formatting     \usepackage{amsmath}                                    % Math     \usepackage{tikz}                   % TikZ library for graphs     \usetikzlibrary{calc,arrows}          \newcommand{\tikzmark}[1]{%       \tikz[overlay,remember picture] \node (#1) {};}          %opening     \title{}     \author{}          \begin{document}               \begin{figure}         \centering         \[             \begin{array}{*{3}{c}}             \tikzmark{a} 1 & 2 & 3 \\             \\             8 & * & 4 \\             \\             7 & 6 & 5 \tikzmark{b} \\                        \end{array}         \]         \tikz[overlay,remember picture] \draw[-triangle 45] ($(b.south west)+(0.2,-0.1)$) -- ($(a.north east)+(-0.3,0.2)$);     \end{figure}          \end{document}      But this fails to compile without errors:               \documentclass[]{article}          \usepackage{subfigure}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}                         % Input encoding     \usepackage{listings}               % Code Formatting     \usepackage{amsmath}                                    % Math     \usepackage{tikz}                   % TikZ library for graphs     \usetikzlibrary{calc,arrows}          \newcommand{\tikzmark}[1]{%       \tikz[overlay,remember picture] \node (#1) {};}          %opening     \title{}     \author{}          \begin{document}               \begin{figure}         \centering         \subfigure[]{         \[             \begin{array}{*{3}{c}}             \tikzmark{a} 1 & 2 & 3 \\             \\             8 & * & 4 \\             \\             7 & 6 & 5 \tikzmark{b} \\                    \end{array}         \]         \tikz[overlay,remember picture] \draw[-triangle 45] ($(b.south west)+(0.2,-0.1)$) -- ($(a.north east)+(-0.3,0.2)$);         }     \end{figure}          \end{document}      Update, subfig package also does not work.               \documentclass[]{article}          \usepackage{subfig}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}                         % Input encoding     \usepackage{listings}               % Code Formatting     \usepackage{amsmath}                                    % Math     \usepackage{tikz}                   % TikZ library for graphs     \usetikzlibrary{calc,arrows}          \newcommand{\tikzmark}[1]{%       \tikz[overlay,remember picture] \node (#1) {};}          %opening     \title{}     \author{}          \begin{document}               \begin{figure}         \centering         \subfloat[]{         \[             \begin{array}{*{3}{c}}             \tikzmark{a} 1 & 2 & 3 \\             \\             8 & * & 4 \\             \\             7 & 6 & 5 \tikzmark{b} \\             \end{array}         \]         \tikz[overlay,remember picture] \draw[-triangle 45] ($(b.south west)+(0.2,-0.1)$) -- ($(a.north east)+(-0.3,0.2)$);         }     \end{figure}          \end{document}      Any ideas?


title: Pdf sync with TeXShop

text: I am using TexShop on a Mac OS X Lion. I can sync between the `pdf` file and the `tex` file by a right click on "Sync" on the mouse. My question is the following: Is it possible also when I compile a `tex` file (by pressing "Typeset") to get the `pdf` file opened exactly at the corresponding string (or page) which I just wrote in the `tex` file? Should I change anything in the LaTeX settings in order to get this feature?


title: dtx file: how to run it?

text: I want to clarify first that I am a beginner, and thus my question might be imprecise or inadequate. Anyway: I found this documentation file for the package microtype, can be easily found on ctan. It is `microtype.pdf`. I like the format of the document and the font of the document, so I downloaded the `.dtx` file and try to see how they got it. Of course, I cannot understand almost anything about the code. Anyway I try to compile it with pdfLaTex. But this does not work, as a series of errors and warnings appear. I report the last lines of the log file, if they are useful               [1{C:/Users/User/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}     ! pdfTeX error (font expansion): auto expansion is only possible with scalable      fonts.     \AtBegShi@Output ...ipout \box \AtBeginShipoutBox                                                    \fi \fi      l.767 %\newpage          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on microtype.log.     texify: pdflatex.exe failed for some reason (see log file).


title: "Extra \else" and inserted "\inaccessible" when using textbf with pgffor

text: I'm getting errors whenever I try to make `\textbf` interact with `pgffor` and `xparse`. Here's an MWE that gives `ERROR: Extra \else` and `ERROR: Missing control sequence inserted` at the end of the `\coljoin` invocation (the missing control sequence turns out to be `\inaccessible`). Using `\flang` in place of `\textbf` works as expected.               \usepackage{pgffor}          \newcommand{\coljoin}[1]{%       \let\acc\empty%       \foreach \x in #1 {%         \xdef\acc{\acc & \textbf{\x}}}%       \acc}          \newcommand{\llist}{a,b,c,d,e}     \newcommand{\flang}[1]{#1+1}          \begin{tabular}{cccccc}       \coljoin{\llist}     \end{tabular}      Does anyone have insight as to what `\textbf` is doing that interacts with the programming utilities? The actual goal is to have some list of data whose changes propagate throughout the document without me having to do extra column counting etc. I'd like to bold some of the rows that would be generated in this way. I would most appreciate solutions that allow `\coljoin` to take an optional argument that is mapped over the data before it is joined (i.e. invoke as `\coljoin[\textbf]{\llist}` or `\coljoin[\flang]{\llist}`). Extra attempts: I have tried using the same accumulator strategy, but with `\multido` and `docsvlist`. They both behave normally for non-bolded values and give the `\inaccessible` error for the bolded value.


title: Two encoding files for one font in pdftex.map

text: What does it mean when pdftex.map has two encoding files in the entry of one font? Background: I am one of the maintainers of matplotlib, a Python plotting library. One feature of matplotlib is that it can process all text strings through TeX, read the resulting dvi file and embed the results in the plot. When implementing this functionality, I found out that the fonts referenced in dvi files have to be looked up in a map; out of the few map files available in a typical TeX distribution I chose pdftex.map, which is documented in Chapter 5 of the pdftex manual. That manual specifies the following format for each line in this map file:               tfmname basename fontflags special encodingfile fontfile      It says that the `special`, `encodingfile`, and `fontfile` fields can be in any order, and that `encodingfile` can be left out, but it does not say that there can be more than one `encodingfile`. Now some users are reporting that TeX Live 2010 installs a pdftex.map file that has the following line:               pbkdo8y URWBookmanL-DemiBold ".167 SlantFont TeXnANSIEncoding ReEncodeFont" <texnansi.enc <8r.enc <ubkd8a.pfb      Is this a bug in TeX Live, and what does pdftex do with this information? Does it include an embedded PostScript interpreter that reads both encoding files, parses the `special` field and decides that texnansi.enc contains the encoding that needs to be applied?


title: Add text and arrows in this tikz picture

text: I am trying to create a small scheme for the so called Goldbeter-Koshland loop. I'm almost done, but I have to include the text $E_1$ above the arrow that goes from P to P* and a small arrow that goes from the base of the text to the middle of the arrow. How can I do that? So far I have the following code:               \begin{figure}     \centering     \begin{tikzpicture}     [bend angle =60,inner sep=0pt, minimum size =10mm,very thick,     from/.style={<-},     towards/.style={->},     protein/.style={circle,draw=black,very thick},     reaction/.style={}]     \node[protein] (p) at (-2,0) {$P$};     \node[protein] (ps) at (2,0) {$P^*$}     edge [towards, bend left] (p)     edge [from,bend right] (p) ;     \end{tikzpicture}     \end{figure}      I would like the figure to look something like:                  E_1         |        --->     P1      P2       <---          |        E_2      Thanks in advance!


title: How to create a warning box like this (see the figure to get the idea)?

text: # Scenario I want to create a warning box (or pitfall box) that satisfies the following creteria:   1. It can be broken across pages.   2. It can contain images, displayed equations, `begin{minipage}`, `\begin{multicols}` and `\lstinputlisting`.   3. It occupies the whole width of the page.    4. It is enclosed by a red frame.   5. It looks like the following figure but the background color should be yellowish. # Bird's View ![alt text](http://i.stack.imgur.com/Pp5xU.png) # Zoomed-in View ![alt text](http://i.stack.imgur.com/cKTnq.png)


title: hiding equation with fcolorbox won't work

text: I'm learning some formulas and in order to hide them (=print white) within my pdf-document using fcolorbox. I tried to create some macro, here's my mwe:               \documentclass[a4paper]{scrartcl} \nonstopmode     \usepackage{commath}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{calc}     \usepackage{mathtools}     \usepackage{xcolor}     \newcommand\f[2]{     %    \text{#1: } & #2 \\ % works fine         \text{#1: } & \fcolorbox{white}{white}{#2} \\ % won't work     }     \begin{document}         \begin{align*}             \f{Pythagoras}{a^2 + b^2 &=& c^2}             \f{Plank Equation}{E &=& \hbar\,\omega}         \end{align*}     \end{document}      You can see I indicated two lines with comments. Why does the first line produce the expected output, but the second one yields errors? Namely: Missing $ inserted. Is there a better command to colorize/hide equations? I tried `\phantom{}` which works fine but only without ampersands…


title: Gantt chart is not drawn and give "! LaTeX Error: Environment gantt undefined."

text: I am writing a report for FYP in Ubuntu 13.10 in TexMaker, with document class and use different files use for chapters. I write the code below in the chapter1.tex for draw a gantt chart               \documentclass{Thesis}     \usepackage{gantt}     \usepackage{pdflscape}          \begin{document}     \begin{landscape}     \scalebox{0.6}{     \begin{gantt}[xunitlength=1cm,fontsize=\large,titlefontsize=\large,drawledgerline=true]{13}{32}     \begin{ganttitle}       \titleelement{\Large \textbf{September}}{4}       \titleelement{\Large \textbf{October}}{4}       \titleelement{\Large \textbf{November}}{4}       \titleelement{\Large \textbf{December}}{4}       \titleelement{\Large \textbf{January - 14}}{4}       \titleelement{\Large \textbf{February}}{4}       \titleelement{\Large \textbf{March}}{4}       \titleelement{\Large \textbf{April}}{4}          \end{ganttitle}          \begin{ganttitle}     \titleelement{\LARGE \textbf{Weeks}}{32}     \end{ganttitle}          \begin{ganttitle}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}       \numtitle{1}{1}{4}{1}     \end{ganttitle}     \ganttbar{Litreature Review}{2}{17}     \ganttbar{Project Plan}{5}{10}     \ganttbar{Field Survey}{15}{3}     \ganttbar{Data Collection}{20}{3}     \ganttbar{Database Design}{15}{5}     \ganttbar{Framework Design}{}{}     \ganttbar{Prototype}{}{}     \ganttbar{Implementation}{}{}     \ganttbar{Testing}{}{}     \ganttbar{Deployment}{}{}     \end{gantt}     }     \end{landscape}     \end{document}      and I use packages in my main.tex file, but I got these errors when I run my main.tex file,               ! LaTeX Error: Environment gantt undefined.


title: What are \notes{} for in beamer?

text: I cannot put a lot of text in `\notes{}` so I wonder what it is used for. I mean I would like to add comprehensive explanations to frames. But if I write too much text, a segmentation fault occurs. I use Texmaker 3.5 to typeset the presentation and the language of notes is Russian. Is it a limitation of beamer or a bug of Texmaker? How to assemble more compact notes in beamer?               \documentclass{beamer}     \setbeameroption{show only notes}     \usepackage[T1,T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[russian]{babel}     \usetheme{Warsaw}     \setbeamercovered{transparent}     \beamertemplatenavigationsymbolsempty          \begin{document}     \begin{frame}     Оценка воздействия на окрущающую среду лесозаготовительной и лесохозяйственной деятельности     \begin{block}{Уровни}     \begin{itemize}     \item Ландшафтный     \note {\textbf{Цель и объект сохранения на ладншафтном уровне}:      Сохранение крупномасштабной динамики экосистем, планетарных функций лесов; крупные малонарушенные массивы}     \item Сообществ     \item Локальный     \end{itemize}     \end{block}     \note {Оценка воздействия на окружающую среду (ОВОС) - выявление, анализ и учет прямых, косвенных и иных последствий воздействия на окружающую среду планируемой хозяйственной и иной деятельности в целях принятия решения о возможности или невозможности ее осуществления. ОВОС способствует принятию экологически и социально ориентированного управленческого решения о реализации намечаемой хозяйственной и иной деятельности посредством определения возможных неблагоприятных воздействий, оценки экологических последствий, учета общественного мнения, разработки мер по уменьшению и предотвращению воздействий.}     \note {ОВОС должна учитываться при разработке системы лесного хозяйства и лесопользования, подготовке плана лесоуправления (проекта освоения лесов) и другой проектной документации. Оценка включает в себя исследования на уровне ландшафта и определение воздействия на окружающую среду лесозаготовительной и дорожной техники и оборудования. ОВОС должна проводиться перед началом любых мероприятий, которые могут привести к нарушению природной среды.}     \end{frame}     \end{document}      I updated Texmaker to 3.5.1 and the segmentation fault disappeared. As you can see my notes for a frame cannot accomodate one page. My question is still the same: What is the purpose of the `\notes{}`? **What is a fair use of this command? How much text can I put in a note?**


title: how to place text on fraction for accounting formulas?

text: Sorry for the bad grammar. English is not my native language. I want to have text on a fraction type line to show up in an accounting formula, here's an example of what I want: ![enter image description here](http://i.stack.imgur.com/cklKm.jpg) So, I've tried using the math way with `\frac` but I end up whit so many errors. Is there a specific way to put text on the `\frac` code ? Or is there a specific code to put text on a fraction?


title: Hanging punctuation with quotation marks in left margin?

text: Plain TeX has a method of creating hanging punctuation, where a punctuation mark/character immediately to the left of some text sits effectively in the margin. I want to do this with quotes, so that the body of the quotation text is indented on both sides, but the opening quotation marks are to the left of the opening character. This is the effect I want:               ``Lord Bacon, in 'the true marshalling of the sovereign degrees of       honor,' assigns the first place to 'the Conditores Imperiorum,        founders of States and Commonwealths'; and, truly, to build up from        the discordant elements of our nature the passions, the interests,        and the opinions of the individual man, the rivalries of family, clan,        and tribe, the influences of climate and geographical position, the       accidents of peace and war accumulated for ages,– to build up from these        oftentimes warring elements a well-compacted, prosperous, and powerful        State, if it were to be accomplished by one effort or in one generation       would require a more than mortal skill.''      I can do this with `quote`:               \begin{quote}     {}\hspace{-5pt}{``}Lord Bacon, in 'the true marshalling          would require a more than mortal skill.''        \end{quote}      but that seems clumsy. Is there a better method?


title: Line Numbering from .tex file lines

text: Is it possible to have a feature similar to the `lineno` package that outputs the .tex file line number that the pdf line came from?               \documentclass[11pt]{article}     \usepackage[english]{babel}     \usepackage{lineno, blindtext}     \begin{document}         \blindtext              \begin{linenumbers}             \blindtext % the lineno output numbers here show 8                  \blindtext % the lineno output numbers here show 10         \end{linenumbers}     \end{document}      In other words, I do not want the paragraph to number the lines 1..N, just show 8 on the first numbered paragraph line (or all of the associated pdf output lines) and 10 for the following paragraph. I realize this gets difficult with `\input` or `\include` entries also. I believe this feature does not exist right now, but I am curious if it is even possible with `pdflatex`.


title: Adding a label to a bent arrow in TikZ

text: In this question Is there a TikZ equivalent to the PSTricks \ncbar command? Jake provided a very nice TikZ version of the PSTricks `\ncbar` command. With normal node connections in TikZ, I can use the `[auto]` parameter to automatically place nodes along paths. I'd like to be able to do this using the `\ncbar` path, but I'm not sure how. So in the code below, I'd like to add a C node along the bent arrow similar to the C node added to the straight arrow.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}          \tikzset{         ncbar angle/.initial=90,         ncbar/.style={             to path=(\tikztostart)             -- ($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)             -- ($(\tikztotarget)!($(\tikztostart)!#1!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztotarget)$)!\pgfkeysvalueof{/tikz/ncbar angle}:(\tikztostart)$)             -- (\tikztotarget)         },         ncbar/.default=0.5cm,     }     \begin{document}             \begin{tikzpicture}[auto]        \node (A) at (1,4) {A};        \node (B) at (3,4) {B};        \draw[->] (A) to  node {C} (B);        \draw[->] (A) to [ncbar=-1.5em] node {C} (B); % can I get this to work?        \end{tikzpicture}          \end{document}      ![output of code](http://i.stack.imgur.com/TjER4.png)


title: \hslash with other letter

text: I would like to know how to make a character like `\hslash`, but with a 'd' instead of an 'h'. I know that `\hbar` is defined using `\mathchar'26`, might there be a similar character for the slash in `\hslash`?


title: Removing a backslash from a character sequence

text: For indexing I wanted to write a macro `\macroname` that removes leading backslashes from macro names but leaves the names of environments untouched. That is               \macroname{\relax}   -->  relax     \macroname{itemize}  -->  itemize      where the `-->` is meant to be read as "expands to". From my understanding, the following should work:               \newcommand\removebs[1]{\if#1\char92\else#1\fi}     \newcommand\macroname[1]{%       \expandafter\removebs\detokenize{#1}}      However, its outcome is               \macroname{\relax}   -->  \relax   % literally     \macroname{itemize}  -->  itemize      By chance, actually, I found out that if I change the catcode of the backslash to "other" during the definition of the `\removebs` macro, it works:               {       \catcode`\|=0       |catcode`|\=12       |global|def|removebs#1{|if#1\|else#1|fi}     }          \newcommand\macroname[1]{%       \expandafter\removebs\detokenize{#1}}      Why is that? From _TeX by Topic_ I'd expect that the comparison made by `\if` is what Philipp Lehman calls "category code agnostic". Thanks for your answers!


title: Reading the contents of a box

text: Is it possible to take a box and retrieve the following information from it:   * A list of all "top level" internal boxes;   * All intervening space (kerns and glue: did I forget another type of space?)? You might wonder why I want this. The reason is that I would like to be able to write, in a natural manner, a piece of text, but then to place each character inside a TikZ node without changing the spacing. The reason for _that_ is so that I can refer to individual terms in a formula (say, for the purpose of putting arrows between them). Currently I achieve this by doing the following:               \documentclass{article}     \usepackage{tikz}     \usetikzpackage{chains}     \begin{document}          \tikzstyle{node text}=      [start chain,       every node/.append style = {        on chain, inner sep = 0pt, outer sep = 0pt,        execute at begin node = \strut},        node distance = 0pt]          \newcommand{\NodeTextCell}[2][]{      \node [inner sep = 0pt, outer sep = 0pt, #1] (my node)      \tikz[node text]{       \foreach \letter [count = \n] in {#2}        \node (my node*\n) {\letter};      }     }          \begin{tikzpicture}      \NodeTextCell{A, {}\otimes{}, B, {}\otimes{}, C}      \draw (my node*1.north) to[bend left=30] (my node*3.north);     \end{tikzpicture}     \end{document}      That's a little clunky, but I can live with it if necessary. If you can think of a better way to do just this with TikZ, that would also serve as an answer. Thanks!


title: How to shorten the length of an arrow?

text: I use `tkz-graph.sty` from Altermundus. When I make an arrow from vertex A to vertex B, the arrow is too long: it goes from the center of A to the center of B. Can I shorten the arrow on both ends by a factor? In PSTricks, I used `nodesep`, but that doesn't work in a `tikzpicture`.


title: How to make a plus sign with arrowheads on each of the four endpoints?

text: There is a common operation in the sparse-direct literature (see pg. 7) called an "extend-add", and it is usually denoted with a particular symbol that looks like a large plus sign with arrowheads on each tip. ![enter image description here](http://i.stack.imgur.com/9ctJO.png) I falsely assumed that I could simply overlap `$\updownarrow$` and `$\leftrightarrow$` via the `mathtools` package's `\mathllap` and friends, but the results were far from pleasing (everything was too jumbled). Is there a simpler way to generate such a symbol?


title: How to access style files in texlive-publishers from Kile

text: I installed `texlive-publishers` for Ubuntu 11.10 but I don't know where all the class files got installed. They look to be installed under `/usr/share/texmf-texlive/tex/latex`. So with my rudimentary knowledge of linux I added `/usr/share/texmf- texlive/tex/latex` to my path in my `.bashrc` file. I am assuming that Kile should be able to access stuff from this folder if I include a `\documentclass[...]` in my file. I just want confirmation that what I did was correct because off late I've been messing up with my linux files and folders quite bad!


title: custom luatex format file

text: I have to process a big number of files with the same preamble. Therefore I try to build a custom format file. The biggest »time eater« is font loading in lualatex, so I try to load the fonts in the format file. I copied lualatex.ini and modified it slightly, so that it loads my preamble just before dumping: mylualatex.ini:               % [...]     % the next line is added by me     \input mypreamble.tex          % restore \dump for derived formats (mylatex, etc) that might use it     \let\dump\DUMP     \let\DUMP\undefined     \dump      mypreamble.tex:               \documentclass[11pt]{scrartcl}     \usepackage[libertine={Ligatures=TeX,Numbers=OldStyle}]{libertineotf}      When I try to use the generated format file, I get an segfault:               > luatex \&mylualatex.fmt             This is LuaTeX, Version beta-0.70.1-2011061416 (rev 4277)       restricted \write18 enabled.     [3]    4569 segmentation fault  luatex \&mylualatex.fmt      TIA, Marcus


title: Center a Node Vertically TikZ

text: I'm using TikZ to create the following drawing: ![drawing](http://i.stack.imgur.com/uDTn0.png) So far so good, but now I'd like to center the node with the gray background vertically. Here's its code:               \setlength{\arraycolsep}{2pt}     \draw[xshift=-3cm,yshift=(current bound box.center)]       node[align=left,right,rounded corners,fill=black!10,inner sep=1ex]       {$         \left\{           \begin{array}{llc}             h &=& \overline{AF}\\             l &=& \overline{BF}\\             l'&=& \overline{AB}\\             d &=& \overline{CE}           \end{array}         \right.       $};      It's being pushed to the left by `xshift`, thus I could equally use `yshift` with a measure to center it. However, is it possible to do it dynamically (by retrieving the bounding box height)? That's, if the drawing grows, it will remain centered.


title: Hide section number for a specific section

text: I'd like to hide the number of a specific section, but it's subsections should keep the right numbering, as should the labels and numbers that appear in the PDF's bookmarks (I think it's the `hyperref` package that does the bookmarks). I was hopeful that the advice contained in the thread hide section numbering but continue adding-up would help, but the results I'm getting are similar to simply using the `\section*{}` variant. Any suggestion?


title: How to avoid bad box with long words with no hyphenation?

text: I know there are planty of similar questions, but I haven't found the answer to this particular one. I have a long word (say some long acronym like ABCDEFGH). It happens to be at the and of the line in the text, going over the margins and creating a bad box. How can I avoid this, and force the acronym into the new line, but **without breaking it** ? The concreete example is displayed in the attached image. ![enter image description here](http://i.stack.imgur.com/i9VlV.png)


title: Black and white emphasis for \boxed?

text: I am using `\boxed` to place emphasis on important equations in an assignment I am typing up, and would like to give the final answer a bit of extra emphasis. I'm using `\begin{equation} ... \end{equation}` to number each line, so that I can put in references in the text. There are some very nice looking boxes in the answers to Attractive Boxed Equations and framed equations, but both rely on colour, when I have a black and white printer. I was thinking of a double line around the final equation, but I'll take other answers if they are easier to code or look better. I would love it if either the balanced boxes or the full width boxes were incorporated into the answer, but this is optional. It is a class assignment that the TA will look at for all of 10 minutes, not a publication. Minimal Working Example:               \documentclass[letterpaper]{article}     \usepackage{kpfonts}     \usepackage{amssymb,mathtools}          \begin{document}     \begin{equation} \frac{M}{R} \propto R^2 \rho  \end{equation}     \begin{equation} \label{eqn:density} \boxed{ \rho \propto \frac{M}{R^3} } \end{equation}     \end{document}


title: Turn off equation numbers when using 'preview' package

text: I am trying to export all of the equations from my document. I have added               \usepackage[active,displaymath,tightpage]{preview}      then compiled, and then from a command line run:               pdfcrop output.pdf     gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4 -dSAFER -q -dNOPAUSE -sOutputFile=Equation_%d.png output-crop.pdf -dBATCH      but the result I get is a very long line with the equation as well as the equation number. Is there a way to turn off equation numbers only when running with this package (i.e. without changing every `{equation}` to `{equation*}`?)


title: Problem with the alignment of stage directions when using dramatist

text: I've been writing scripts using the dramatist package and followed the guide on these forums to make the justification of the names and dialogue nice. Justification when using the dramatist package My problem is that when using the solution the stage directions within the drama environment are aligned with respect to the dialogue column of text and not the page. Stage directions outside of the drama environment are aligned to the page as expected.                \documentclass[a4paper,12pt]{article}                             \usepackage{dramatist}      \usepackage{etoolbox,enumitem}           \makeatletter      \renewenvironment{drama}        {\if@lnpa        \PackageWarning{dramatist}{\lnpwarning{a}}        \fi        \if@lnps        \PackageWarning{dramatist}{\lnpwarning{s}}        \fi        \begin{itemize}[labelwidth=\speakswidth,leftmargin=!]}        {\end{itemize}}      \patchcmd{\speaker}{\item[#1\speaksdel]}{\item[\speaksfont#1]}{}{}      \patchcmd{\@character}{\item[#1\speaksdel]}{\item[\speaksfont#1]}{}{}      \makeatother           \begin{document}      \Character[The milkman]{Milkman}{milk}      \settowidth{\speakswidth}{\speaksfont{Milkman}\speaksdel\hspace{\speechskip}}      \Scene{Milkman Arrives}      \StageDir{\begin{center}Some stage directions.\end{center}}      \begin{drama}      \milkspeaks{Some text. Some text. Some text. Some text. Some text. Some text. Some text.}      \StageDir{\begin{center}Some more stage directions.\end{center}}      \end{drama}      \end{document}      ![enter image description here](http://i.stack.imgur.com/IwclH.png) Is there a way to fix this?


title: Spread tab and Calculation in Table

text: I tried the following,               \documentclass[a4paper,12pt]{article}     \usepackage[inner=0.75in,outer=0.65in,top=0.75in,bottom=0.65in]{geometry}     \usepackage{multirow}     \usepackage{spreadtab}     %\usepackage[sc]{mathpazo}     %\usepackage[onehalfspacing]{setspace}          \begin{document}          \begin{table}[htp]      \centering      \caption{Sample} \vspace{3pt}      \begin{spreadtab}{{tabular}{|c|l|l|c|c|c|c|c|c|}}       \hline        @\multirow{2}{*}{Sl No.} &        @\multicolumn{2}{c}{\multirow{2}{*}{\textbf{something}}} &       @\multicolumn{4}{|c|}{\textbf{s}} & @\textbf{a~/~b} &       @\multirow{2}{*}{\textbf{Total}} \\       \cline{4-7}       & @\multicolumn{2}{|c|}{} & @\textbf{x} & @\textbf{y} & @\textbf{z}       & @\textbf{m} & @\textbf{/~c} & \\        \hline       @\multirow{3}{*}{1} & @\multirow{2}{*}{1.1} & @x & 2 & 3 & 2 & 1 & 3 &       \STcopy{v}{d3+e3+f3+g3+h3}       \\ \cline{3-9}        & & @y &  & 6 & 32 &  & 45 &       \\       \cline{2-9}        & \multicolumn{2}{|l|}{@\textbf{Sub Total}} &        {\fontseries{b}\selectfont}\STcopy{>}{d3+d4} & \textbf{:={}} & \textbf{:= {}}        &\textbf{:={}}  &\textbf{:={}} & \textbf{:={}} \\ \hline       @\multirow{2}{*}{2} & @\multirow{2}{*}{1.2} & @z &6 &3 &5 & 1 & 3&       \\        \cline{3-9}        &  & @k & 61 & 53 &  & 18 & 39 &        \\       \cline{2-9}        & \multicolumn{2}{|l|}{@\textbf{Sub Total}}  &        {\fontseries{b}\selectfont}\STcopy{>}{d6+d7} & \textbf{:={}} & \textbf{:={}}        &\textbf{:={}}  &\textbf{:={}} & \textbf{:={}}\\ \hline \hline       @\multicolumn{1}{|c}{} & @\multicolumn{2}{l|}{\textbf{Total}} &        {\fontseries{b}\selectfont}\STcopy{>}{d5+d8}  & \textbf{:={}} & \textbf{:={}}         &\textbf{:={}}  &\textbf{:={}} & \textbf{:={}}\\ \hline        \end{spreadtab}       \end{table}             \end{document}      I have left some elements as blank, so as to check if I will that will be taken as zero during computation as I don't want zero to be displayed in the table.   * I am getting the following error ,'You can't use '\end' in internal vertical mode \end{spreadtab}' Is there a solution?   * When using floating points for computation with spreadtab, is there any way to output a specified number of digits after the decimal place, for uniformity.


title: TikZ lines not going "all the way"

text: Consider the following TikZ drawing: ![enter image description here](http://i.stack.imgur.com/hvSRF.png) Why do the lines not go "all the way"? And why does that line appear below what is supposed to look like a water tank?               \documentclass{memoir}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing}          \begin{document}     \def\balloonheight{1.5}     \def\ballooonwidth{1}     \def\vwidth{0.3}     \def\vheight{3}     \def\vpos{-3}     \centering     \begin{tikzpicture}         \tikzstyle{balloon}=[ball color=red];         \shade[balloon] ellipse (1 and 1.5);              \coordinate (bottom) at (0,-1.5);              \coordinate (vtop) at (0,\vpos);         \coordinate (vbottom) at (0,{\vpos - \vheight} );         \coordinate (vtopright) at (\vwidth, -3 );         \coordinate (vtopleft) at (-\vwidth, -3 );              \draw[rounded corners=8pt, thick,black] (vtopright) |- (vbottom) -| (vtopleft);              \draw[fill=blue!50!white] decorate [blue,decoration={snake}] {(vtopleft)++(0,-0.5) -- ++(2*\vwidth, 0 )} [rounded corners=8pt] |- (vbottom) -| (vtopleft)++(0,-0.5);              \draw[orange] (bottom) -- coordinate[midway] (ropemid) (vtop) -- ++(0,-1);              \coordinate (current) at (4,-1.5);              \path (current) -- ++(0,0.3) node (current+) {};         \path (current) -- ++(0,-0.3) node (current-) {};              \draw[thick] (current+) -- +(-0.5,0) -- ++(0.5,0);         \draw[thick] (current-) -- +(-0.2,0) -- ++(0.2,0);              \path (vbottom) -- ++(0,-0.5) node (belowvbottom) {};         \path (vtopleft) -- ++(0,-1.5) node (+entrance) {};         \path (vtopright) -- ++(0,-1.5) node (-entrance) {};              \draw[rounded corners=8pt,thick] (current+) |- ++(1,1) |- (belowvbottom) -- ++(-1,0) |- (+entrance);         \draw[rounded corners=8pt, thick] (current-) |- (-entrance);              \draw[thick,rounded corners=8pt] (ropemid) -- ++(2,0)          node[fill=white, draw, rectangle,rounded corners,align=center] (pico) {PicoScope} -| (current-);          \end{tikzpicture}     \end{document}


title: Add fancy design to pgfplots (shadows, rounded corners, reflections)

text: In our company we would like to run the client reportings in LaTeX, which works quite well, but we are struggeling with the design requirements for plots - we use `pgfplots`. Our aim is to get those fancy "kind of reflecting" plots, which also could use some shadow, so it looks a bit three-dimensional. The only shadow we can get is this drop shadow, but it should look like the glowing shadow in the TikZ/PGF reference (v2.1 p.418), which seems only available for circles (at least for me). For the reflection I tried fadings, but this leeds to problems with the shadow. Also the fading does not work equal for all bars, but depends on their heights. Last points are the round corners, which work, but for the top corners and the bottom corners (intererstingly not for the shadow). This also looks strange and it would be prefered to only get round top corners. Below I attached a small sample with our current status and I would be glad for suggestions.               \documentclass{article}     \usepackage{pgfplots}     \usetikzlibrary{shadows}          \begin{document}          \tikzfading[name=fade down,         top color=transparent!30,         bottom color=transparent!0]          \begin{tikzpicture}         \begin{axis}[axis x line*=bottom,                 axis y line*=left, drop shadow]          \addplot[ybar, blue, fill,path fading=fade down, rounded corners=2pt]         coordinates{(1,2.9) (2,1.7) (3,4.2) (4,5.1) (5,4) (6,2.2)};     \end{axis}     \end{tikzpicture}          \end{document}


title: Create a service using Automator to compile .tex file in Mac

text: I'm using _Mac OS 10.9.3_ , _TeXLive-2013_ and _Scrivener_ to write my papers. I'd like to use Apple's Automator in order to create a service (available from the Finder's right-click menu over a file) called "Compile TeX file" that runs a simple command using the selected file as an _input_. Exemple:   1. Inside a folder (/Volumes/Data/TeX_docs/) I've an _exemple.tex_ file created by Scrivener that is ready for compiling with LaTeX.   2. I'd like to right click this file and from the Finder's Service menu choose the option "Compile TeX file"   3. Once chosen, this service will execute the command `latexmk -pdf -bibtex exemple.tex` and so compile the .tex file inside the same folder, creating a .pdf file (This Terminal command is working perfectly right now, so the need to automate this action!)   4. After compiling the .tex file, a dialog box appears and asks if I want to delete all the temporary files with a `Yes` or `No` option. If `Yes` is chosen, it deletes all TeX temp files (.aux,.bbl,.bcf,.fdb_latexmk,.fls,.log,.out,.run.xml) and keep only the original exemple.tex and the new exemple.pdf file. Otherwise, it does nothing more and I have all the files in the end!


title: A theorem and its proof in different places

text: I have a couple of theorems, proofs of which are quite boring and longish. I would like to place theorem formulations in a usual place and stack up the proofs at the end of the chapter. How to do this? In particular I would like to:   * keep the original theorem numbering - the same number should be visible in both places, where the theorem is formulated originally, and at the end of the chapter,   * if possible, copy the original formulation of the theorem right before the proof is given without having to write the text twice


title: How can I add numbers to specific equations in an eqnarray*?

text: I know how to use `\nonumber` or `\notag` in `\begin{eqnarray}` `\end{eqnarray}` environment. But is there something like `\addnumber` or `\addtag` in `\begin{eqnarray*}` `\end{eqnarray*}` environment ? For example, if I want only the second equation below be tagged, what should I do?               \begin{eqnarray*}     a &=& b\\      c &=& d  \addnumber\\      e &=& f\\     g &=& h\\     i &=& j     \end{eqnarray*}


title: In-line \verb -- overfull hbox problem

text: I'm having a problem that I've had before and I'm tired of hacking my way through it and hope that there is some supported solution. I'll go ahead and create a document for example:               \documentclass {article}     \begin{document}     \section {Introduction}     In the introduction of the document, you will find plenty of verbatim \verb|texts     that| have an hard time wrapping.     \end{document}      So, the problem here is that the `\verb` environment doesn't wrap well (unlike the example I posted above where I put in the return to aid in viewing). There is an overfull hbox error. How can I make the `\verb` command wrap and justify with its surroundings better? I would expect LaTeX to just increase or decrease the spacing around the `\verb` command. Is it just too much smooshing or stretching for LaTeX to agree to do it? Thanks in advance for any help. [EDIT] After reading When should one use \verb!! and when \texttt{} I think that `\texttt` may be the right way to go here. This considerably covers the question above, but the question still stands: What about `\verb`? [EDIT] Also see the related question about `\texttt{}` \texttt overfull hbox problem


title: How to combine another sans-serif math font with helvet for text?

text: The existing question Typeset WHOLE document in sans-serif, Including Math Mode uses the `sansmath` package to use `helvet` glyphs also in math-mode. But being not designed for use in math mode, the results don't look convincing. According to this survey of free math fonts, it seems to be possible to use another font (mentioned are `cmbright` and `lxfonts` as similar) for math-mode in combination with `helvet` for text-mode. However, I cannot find pointers on how to setup the document appropriately. (How) can it be done? The obligatory MWE:               \documentclass{article}          \usepackage{helvet} % for text-mode     \renewcommand{\familydefault}{\sfdefault}          % \usepackage{cmbright} % one of these for...     % \usepackage{lxfonts}  % math-mode only          \usepackage[math]{blindtext}     \begin{document}     \blindmathpaper     \end{document}


title: disabling line breaks in datatool table

text: I have a csv file containing a list of names with addresses. I'm using the `datatool` package to load these and output stickers (using the `labels` package) for envelopes. This is done using `\DTLforeach`. Sometimes a name is too long for one line so I manually include a `\\` in the csv as to not hyphenate a name. I also want to print a complete list of all recipients using `\DTLdisplaydb`. For my stickers this works very well, but of course this breaks my table listing all recipients. As an MWE, save this as data.csv:               Name,Street,City     John Doe,Street 1,A City     Osop Eskobmr Sempeg Cotbadt\\Demnoskoywar,Street 9,B City     Jeeta Ex,Street 2,A City      and use               \documentclass{article}     \usepackage{labels}     \usepackage{datatool}     \begin{document}     \DTLloaddb{address}{data.csv}     \DTLforeach{address}{\name=Name,\street=Street,\city=City}%     {\addresslabel{\name\\ \street\\ \city}}          \DTLdisplaydb{address}     \end{document}      I guess I could insert a special command like `\mybreak` and define it as empty or as `\newline` depending on the situation. But I would prefer to keep the data as is.


title: Change caption style of listings package without "caption" package

text: Is there a way to change style of a caption in listings without the `caption` package (make it smaller and non-bold)? I am using `\lstnewenvironment` to create my own customized environment and then use listings via this new environment. I tried to do it with the `caption` package with `\captionsetup[lstlisting]{font={scriptsize,tt}}` and it worked, but the problem is that I cannot use `caption` package as it messes up captions in the rest of the document (as soon as I "include" it), and I have to use predefined class. Thank you for your help! (EDIT) Class: http://www.acm.org/sigs/publications/sig-alternate.cls (EDIT) MEW:               \documentclass{sig-alternate}          %\usepackage{caption}     \usepackage{listings}          \begin{document}          \title{The Title}          \numberofauthors{1}     \author{     \alignauthor            John Doe\\            \affaddr{Lorem ispum}\\            \affaddr{Lorem ispum}\\            \affaddr{Lorem ipsum}\\            \email{john.doe@example.com}     }     \date{30 July 1999}     \maketitle                    \lstnewenvironment{mycode}[1][]     {       \minipage[b]{0.3\textwidth}       \lstset{         captionpos=b,         language=C,         numbers=left,         basicstyle=\tiny\ttfamily,         columns=fullflexible,         showstringspaces=false,         numbersep=3pt,         #1       }     }     {       \endminipage     }     %\captionsetup[lstlisting]{font={small,tt}}          \begin{mycode}[title=Awesome C program,label=code:AwesomeC]       int main(int argc, char* argv[]) {         return 0;       }     \end{mycode}          If I use "caption" package, caption of the figure changes style (it is no longer bold). Otherwise I cannot change caption of the code...          \begin{figure}       \centering       This is a figure       \caption{Caption of the figure}       \end{figure}          \end{document}


title: Custom header in LaTeX

text: I have a header template that is based on boxes, which looks like this:                   \documentclass[10pt,a4paper]{article}         \usepackage[MeX]{polski}         \usepackage[utf8]{inputenc}              \setlength{\parindent}{0pt}              \usepackage[           top    = 1.50cm,           bottom = 1.50cm,           left   = 1.50cm,           right  = 1.50cm,         ]{geometry}              \usepackage{tabularx}              \pagestyle{empty}              \renewcommand{\familydefault}{\sfdefault}              \newcommand{\datasprzedazy}{3.03.2006}         \newcommand{\terminplatnosci}{17.03.2006}         \newcommand{\nrfaktury}{3/2006}          \newcommand{\netto}{1000.00}          \newcommand{\vat}{220.00}         \newcommand{\brutto}{1220.00}         \newcommand{\slownie}{jeden tysiąc dwieście dwadzieścia złotych}              \begin{document}              \renewcommand\arraystretch{1.3}         \renewcommand\tabcolsep{0pt}                   \setbox0=\vtop{           \hrule height 0pt           \hbox{\fbox{%             \begin{minipage}[t]{0.47\textwidth}             \begin{tabular}[t]{ l l }               Company Name & Logo\\               Address & \\               Street & \\               Tax ID &\\               Other Info             \end{tabular}             \end{minipage}%           }}% end the \fbox and the \hbox           \hrule height 0pt           }% end the \vtop              \setbox2=\vtop to \dp0{           \hrule height 0pt           \hbox{\framebox[0.47\textwidth]{\textbf{Faktura VAT nr \nrfaktury}}}           \vfill           \hbox{\begin{tabular}{lr}             Data sprzedaży: & \datasprzedazy \\             Data wystawienia: & \datasprzedazy           \end{tabular}}           \vfill           \hbox{\framebox[0.47\textwidth]{\textbf{ORYGINAŁ}}}           \hrule height 0pt           }              \leavevmode\box0\hfill\box2\par         \end{document}      However, when I try to use it with fancyhdr, like this:                   \documentclass[10pt,a4paper]{article}         \usepackage[MeX]{polski}         \usepackage[utf8]{inputenc}              \setlength{\parindent}{0pt}              \usepackage[           top    = 1.50cm,           bottom = 1.50cm,           left   = 1.50cm,           right  = 1.50cm,         ]{geometry}         \usepackage{fancyhdr}              \usepackage{tabularx}              \pagestyle{empty}         \pagestyle{fancy}              \renewcommand{\familydefault}{\sfdefault}              \newcommand{\datasprzedazy}{3.03.2006}         \newcommand{\terminplatnosci}{17.03.2006}         \newcommand{\nrfaktury}{3/2006}          \newcommand{\netto}{1000.00}          \newcommand{\vat}{220.00}         \newcommand{\brutto}{1220.00}         \newcommand{\slownie}{jeden tysiąc dwieście dwadzieścia złotych}              \chead         {         \setbox0=\vtop{           \hrule height 0pt           \hbox{\fbox{%             \begin{minipage}[t]{0.47\textwidth}             \begin{tabular}[t]{ l l }               Company Name & Logo\\               Address & \\               Street & \\               Tax ID &\\               Other Info             \end{tabular}             \end{minipage}%           }}% end the \fbox and the \hbox           \hrule height 0pt           }% end the \vtop              \setbox2=\vtop to \dp0{           \hrule height 0pt           \hbox{\framebox[0.47\textwidth]{\textbf{Faktura VAT nr \nrfaktury}}}           \vfill           \hbox{\begin{tabular}{lr}             Data sprzedaży: & \datasprzedazy \\             Data wystawienia: & \datasprzedazy           \end{tabular}}           \vfill           \hbox{\framebox[0.47\textwidth]{\textbf{ORYGINAŁ}}}           \hrule height 0pt           }         \leavevmode\box0\hfill\box2\par         }              \begin{document}              \renewcommand\arraystretch{1.3}         \renewcommand\tabcolsep{0pt}         Content         \end{document}      I get parse errors like these:                   Runaway argument?         { \setbox 0=\vtop { \hrule height 0pt \hbox {\fbox {\begin {minipage}\ETC.         ! Paragraph ended before \@ychead was complete.      Is there a simpler way to make this header appear on every page?


title: Errors in passing a previously concatenated string to foreach

text: ### Motivation While attempting to answer Pie chart with values as angles not percent, I stucked on passing a string to a `foreach`. ### The context To makes things clear, I briefly introduce the context. That question asks for degrees rather than percentages in the chart, so my idea was to convert angles into percentages and call then the usual `\pie` command from `pgf-pie`. ### The issue The code:               \documentclass[tikz,border=10pt]{standalone}          %\usepackage{pgf-pie}          \newcommand{\anglepie}[1]{%       \gdef\elements{}       \foreach \ang/\lab[count=\xi] in {#1}{          \pgfmathtruncatemacro\perc{(\ang*100)/360}          \ifnum\xi=1            \xdef\elements{\perc/\lab}          \else            \xdef\elements{\elements, \perc/\lab}          \fi       }       %\pie{\elements} % ideally call this       \node{\elements};     %  \foreach \x/\y in {\elements}     %  \node[draw] at (\x/10,-1) {\y};     }          \begin{document}     \begin{tikzpicture}     \anglepie{10/A, 20/V, 30/C, 40/D}     \end{tikzpicture}     \end{document}      in principle works because the macro `\elements` contains a string in the right form to be passed to the `foreach` (following the same reasoning of Hobby path realization in convex hull approach). This has been verified thanks to `\node{\elements};`: ![enter image description here](http://i.stack.imgur.com/8wTAw.png) However, uncommenting:               \foreach \x/\y in {\elements}     \node[draw] at (\x/10,-1) {\y};      rise as errors:               ! Package PGF Math Error: Unknown function `A' (in '2/A').     ! Package PGF Math Error: Unknown function `V' (in '5/V').     ! Package PGF Math Error: Unknown function `C' (in '8/C').      My feeling is that the string `\elements` is not interpreted correctly by the `foreach`, but I have no clues on the motivation behind. What's going on there?


title: Change the background color of line numbers in a lstlisting?

text: Consider the following code which deals with a `lstlisting`.               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage{listings}     \usepackage{xcolor}     \lstset{basicstyle=\small\ttfamily,keywordstyle=\color{blue},language=C++,showstringspaces=false,tabsize=2,numbers=left}     \begin{document}          \begin{lstlisting}     #include <stdio.h>     int main(void) {       printf("Hello World!");       return 0;     }     \end{lstlisting}          \end{document}      Is there a way to coulour the background of line numbers (in grey for example) but not the background of the code ?


title: Emacs-org-mode and latexmk

text: After getting to know org mode here, I tried it out. It seems to be, indeed, very helpful. However, I want it to work smoothly with LaTeX, and as a compiling script I want to use `latexmk`. I followed the instruction here trying to make org-mode use `latexmk` as the compiling engine/script. Unfortunately, this doesn't work for me. The resulting `.tex` file is perfect and I can manually compile it using `latexmk`, but it won't work directly.


title: What is the code for creating a space for the name and date for a child's worksheet?

text: For example I want my worksheet to look like this:               Name: ____________     Date: ____________                                             Vowels and Consonants


title: How to make star Exercise and its environment answer?

text: At here How to make an environment star Exercise?, I posted make star Exercise. How to make star Exercise and its environmet answer? Example, with Exercise 1.1, we have Answer 1.1, with Exercise 1.5*, we have Answer 1.5*.


title: Draw a trapeze in left corner of the page

text: I want to do draw a trapeze in position in the left corner of the page (as shown on the picture below). How can I do that? ![layout](http://i.stack.imgur.com/jbEus.png)


title: How to change text to bold when font does not support bold

text: I have a 100 page document, I used colored text many places to highlight with below command in my preamble               \newcommand\bluetext[1]{\textcolor{blue}{#1}}      its working great however did not realize at the time of writing that i would require color printer for this. I wanted to change colored text to bold - I change the above command as below                \newcommand\bluetext[1]{\textbf{#1}}      It removed the colors but did not give me any bold letters, is it because of the font? or I am doing anything wrong? I am using sanskrit 2003 font. ![Bold_image](http://i.stack.imgur.com/TYGYa.jpg) In the attached image all the circled text should have appeared bold. Thanks for your help - Here is the MWE               \documentclass[24pt]{article}     \usepackage{fontspec}     \usepackage{polyglossia}     \usepackage{color}     \usepackage{amstext, amsmath}     \setmainfont[Script=Devanagari]{Sanskrit2003}     \setdefaultlanguage{sanskrit}     \newcommand\bluetext[1]{\textcolor{blue}{#1}}      %\newcommand\bluetext[1]{\textbf{#1}} % Blue Text     \begin{document}     १.१.१\bluetext{वृद्धिः}\textsuperscript{१/१} आत्\textsuperscript{१/१} ऐच्\textsuperscript{१/१}     \\     १.१.२     अत्\textsuperscript{१/१}  एङ्\textsuperscript{१/१} गुणः\textsuperscript{१/१}     \\     १.१.३     \bluetext{इकः}\textsuperscript{६/१} \bluetext{गुणवृद्धी}\textsuperscript{१/२}    \\      १.१.४     \bluetext{न}\textsuperscript{०/०} धातुलोपे\textsuperscript{७/१} आर्धधातुके\textsuperscript{७/१}    \\     १.१.५     क्क्ङिति\textsuperscript{७/१} च\textsuperscript{०/०}     \\     \end{document}


title: How thick a rule does \hline produce?

text: How thick a rule does `\hline` produce (in a bog-standard `tabular` environment) ?


title: Starting a proof with \paragraph

text: I would like to break a proof into paragraphs, but I don't seem to be able to start a proof with a paragraph.               \documentclass{article}     \usepackage{amsthm}          \begin{document}     \begin{proof}     \paragraph{This bit in bold.} Now this part of the proof.     \end{proof}     \end{document}      It seems to be fine if I insert text before the \paragraph, but otherwise I get the following error:               Something's wrong--perhaps a missing \item.      What is the simplest way to start a proof with a paragraph?


title: Global transition effect in beamer

text: Is it possible to set a global transition effect for all frames instead of specifying the effect again for each frame?


title: Creating a question box

text: We are writing a book for kids, and it has some question & answer boxes like the following, ![enter image description here](http://i.stack.imgur.com/QLagh.png) I'm not sure how to achieve this. Is there any built-in command for this purpose? Or should I create a box and put my text into this box along with a `questionMark.eps`? Since I'm going to use this very often, I want to make a shortcut too. Something like the following,               \questionBox{Lorem ipsum lorem ipsum lorem ipsum?}


title: \label inside the \pagecommand inside \includepdfmerge does not seem to work

text: \includepdfmerge[       nup=1x2,       frame,       landscape,       scale=0.8,       pagecommand={{\chapter{fracture}\section{Theoretical}},{\label{sect:frac-theor}}}]     {icm-model.pdf,1,/Fractal-Fracture-SE.pdf,1}      will result in the wrong entry when `\ref{sect:frac-theor}` is subsequenly invoked and does not even point to the correct page. A similar problem encountered with               \includepdf[       scale=0.8,       frame,       page=1,       pagecommand={{\section{Fluid-Fracture Interaction}},{\label{sect:fluid-fracture}}}]     {c:/Victor/Research/Pdf-Library/Saouma/slowik-dynamic-uplift.pdf}


title: Overfull \hbox warning when using tabular

text: I keep getting this warning                Overfull \hbox (0.63303pt too wide) in paragraph at lines xxx--xxx`      wherever I have this line in the code                \begin{tabular}{p{2cm}|p{4cm}|p{3cm}|p{3cm}}      It does not stop me from working on and creating documents but I was just wondering why I keep getting that.


title: Different bibstyles for bibentry vs. bibliography

text: Using `natbib`, `bibentry`. I would like if possible to render the bibentries in a different style than that in the Bibliography section in the end. A particularity with this is that bibentry copies verbatim the style used for the entire bibliography and with the `bst`s like that of `savetrees.bst` (my case) or `IEEEtran.bst` or the like it creates a problem. Specifically, the repeated author(s) across two or more bib items that follow each other are replaced with a long dash `---` except for the first bib item in such a sequence. When I use a `\bibentry` for some of these in the main body the dash is preserved, whereas I need the author(s) name(s) in the case of `\bibentry` while keeping it as it is in Bibliography with the dash. ## MWE               \documentclass{article}          \usepackage{lipsum}     \usepackage{filecontents}     \usepackage[numbers]{natbib}     \usepackage{bibentry}     \nobibliography*          \begin{filecontents}{\jobname.bib}     @misc     {       death-star,       author       = {Bevel Lemelisk and Wilhuff Tarkin and Darth Vader and Darth Sidious},       title        = {{Death Star}},       howpublished = {Alderaan and Yavin 4},       year         = {0 BBY}     }     @misc     {       death-star-2,       author       = {Bevel Lemelisk and Wilhuff Tarkin and Darth Vader and Darth Sidious},       title        = {{Death Star II}},       howpublished = {Endor},       year         = {4 ABY}     }     \end{filecontents}          \begin{document}          \lipsum[1]     They first built~\cite{death-star}.          \begin{enumerate}       \item \textbf{Have:}\\     \bibentry{death-star-2}       \item \textbf{Need:}\\     B. Lemelisk, W. Tarkin, D. Vader, and D. Sidious, ``Death Star II,'' Endor, 4 ABY     \end{enumerate}          \lipsum[2]          %\bibliographystyle{savetrees}     \bibliographystyle{IEEETran}     \bibliography{\jobname}          \end{document}


title: Create custom colored PGFPlots ybar with consistent spacing

text: I am trying to create a `ybar` graph that has consistent spacing between a set of columns. I have obtained the color scheme I need in the following example, based off guidance from this question on here               \documentclass{memoir}     \usepackage[left=1.5in, right=1in, top=1in, bottom=1in, headsep=0.1in, head=0.4in, includehead, includefoot, marginparsep=0in, marginparwidth=0in,footskip=0.4in]{geometry}     \usepackage{graphicx}     \usepackage{pgfplots}     \usepackage{xcolor}     \pagecolor{black}     \pgfplotsset{width=7cm,compat=1.5.1}     \usepackage{siunitx}     \sisetup{inter-unit-product={}\cdot{},sticky-per=true,multi-part-units=single,separate-uncertainty=true,list-units=single,range-units=single,detect-all,detect-weight=true,detect-inline-weight=math}          \DeclareSIUnit\calorie{cal}     \DeclareSIUnit\kcal{\kilo\calorie}     \DeclareSIUnit\kcalpmole{kcal\per\mole}          \definecolor{hoyemagenta}{HTML}{FF3FFF}     \definecolor{hoyegreen}{HTML}{31FF31}          \begin{document}     \begin{tikzpicture}         \begin{axis}[             color=white,             width=\textwidth,             ybar,             enlarge x limits=0.07,             ylabel={Free Energy Difference (\si{\kcalpmole})},             ylabel/.style={color=white},             xtick={1,2a,2b,3,4a,4b,5a,5b,6a,6b,6c,7},             every axis/.style={color=white},             ymax=40,             ymin=-110,             xtick pos=left,             nodes near coords,             nodes/.style={color=white},             nodes near coords align={vertical},             x tick label style={rotate=45,anchor=east,color=white},             symbolic x coords={1,2a,2b,3,4a,4b,5a,5b,6a,6b,6c,7}             ]             \addplot[fill=hoyegreen,]             coordinates{             (1,-48.93)             (2b,-13.62)             (4b,-46.85)             (5b,-42.27)             (6b,-55.74)};             \addplot[fill=hoyemagenta]             coordinates{                     (2a,-26.90)             (3,31.78)             (4a,-49.25)             (5a,-49.71)             (6a,-44.14)             (6c,-51.07)};             \addplot[fill=yellow]             coordinates{(7,-97.69)};         \end{axis}     \end{tikzpicture}     \end{document}      However, as you can see, because I am using 3 different plots, each x value makes room for all 3 plots, which is obviously not what I want. I found this question, describing the use of a custom style with created `discard if` and `discard if not` commands. My attempt at that is not successful (code below). I keep getting warnings about no coordinates left, or they've all been filtered away. I thought I could use this method, and just have an individual plot with a `discard if not` call for each plot.               \documentclass{memoir}     \usepackage[left=1.5in, right=1in, top=1in, bottom=1in, headsep=0.1in, head=0.4in, includehead, includefoot, marginparsep=0in, marginparwidth=0in,footskip=0.4in]{geometry}     \usepackage{pgfplots}     \usepackage{xcolor}     \usepackage{filecontents}     \pagecolor{black}     \pgfplotsset{width=7cm,compat=1.5.1}     \usepackage{siunitx}     \sisetup{inter-unit-product={}\cdot{},sticky-per=true,multi-part-units=single,separate-uncertainty=true,list-units=single,range-units=single,detect-all,detect-weight=true,detect-inline-weight=math}          \DeclareSIUnit\calorie{cal}     \DeclareSIUnit\kcal{\kilo\calorie}     \DeclareSIUnit\kcalpmole{kcal\per\mole}          \definecolor{hoyemagenta}{HTML}{FF3FFF}     \definecolor{hoyegreen}{HTML}{31FF31}          \pgfplotsset{         discard if/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{#1}}                 \edef\tempb{#2}                 \ifx\tempa\tempb                     \def\pgfmathresult{inf}                 \fi             }         },         discard if not/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{keyword}}                 \edef\tempb{TestDetails}                 \ifx\tempa\tempb                 \else                     \def\pgfmathresult{inf}                 \fi             }         }     }               \begin{document}          \begin{filecontents}{data.csv}     {Compound},{Energy}     1,-48.93     2a,-26.90     2b,-13.62     3,31.78     4a,-49.25     4b,-46.85     5a,-49.71     5b,-42.27     6a,-44.14     6b,-55.74     6c,-51.07     7,-97.69     \end{filecontents}     \pgfplotstablegetrowsof{data.csv}          \begin{tikzpicture}         \begin{axis}[             color=white,             width=\textwidth,             ybar,/pgf/bar shift=0pt,             enlarge x limits=0.07,             ylabel={Free Energy Difference (\si{\kcalpmole})},             ylabel/.style={color=white},             xtick={1,2a,2b,3,4a,4b,5a,5b,6a,6b,6c,7},             every axis/.style={color=white},             ymax=40,             ymin=-110,             xtick pos=left,             nodes near coords,             nodes/.style={color=white},             nodes near coords align={vertical},             x tick label style={rotate=45,anchor=east,color=white},             xticklabels={1,2a,2b,3,4a,4b,5a,5b,6a,6b,6c,7}             ]             \addplot[fill=hoyegreen,discard if not={Compound}{1}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{2a}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyegreen,discard if not={Compound}{2b}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{3}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{4a}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyegreen,discard if not={Compound}{4b}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{5a}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyegreen,discard if not={Compound}{5b}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{6a}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyegreen,discard if not={Compound}{6b}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyemagenta,discard if not={Compound}{6c}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};             \addplot[fill=hoyegreen,discard if not={Compound}{7}] table[x expr=\coordindex,x index=0, col sep=comma]{data.csv};         \end{axis}     \end{tikzpicture}     \end{document}      Here is code for the plot without any coloring, but the ideal format and spacing that it should look like:               \documentclass{memoir}     \usepackage[left=1.5in, right=1in, top=1in, bottom=1in, headsep=0.1in, head=0.4in, includehead, includefoot, marginparsep=0in, marginparwidth=0in,footskip=0.4in]{geometry}     \usepackage{graphicx}     \usepackage{pgfplots}     \usepackage{xcolor}     \pagecolor{black}     \pgfplotsset{width=7cm,compat=1.5.1}     \usepackage{siunitx}     \sisetup{inter-unit-product={}\cdot{},sticky-per=true,multi-part-units=single,separate-uncertainty=true,list-units=single,range-units=single,detect-all,detect-weight=true,detect-inline-weight=math}          \DeclareSIUnit\calorie{cal}     \DeclareSIUnit\kcal{\kilo\calorie}     \DeclareSIUnit\kcalpmole{kcal\per\mole}          \begin{document}     \begin{tikzpicture}         \begin{axis}[             color=white,             width=\textwidth,             ybar,             enlarge x limits=0.07,             ylabel={Free Energy Difference (\si{\kcalpmole})},             ylabel/.style={color=white},             xtick=data,             every axis/.style={color=white},             ymax=40,             ymin=-110,             xtick pos=left,             nodes near coords,             nodes/.style={color=white},             nodes near coords align={vertical},             x tick label style={rotate=45,anchor=east,color=white},             xticklabels={1,2a,2b,3,4a,4b,5a,5b,6a,6b,6c,7}             ]             \addplot[fill=white] table [                 x expr=\coordindex, % Use the row number as x coordinate                 header=false    % Do not assume the first row to contain column names             ] {             nmeimid         -48.93             co2lactone      -26.90             co2carbene      -13.62             n2               31.78             meNCOlactone    -49.25             meNCOcarbene    -46.85                     cs2lactone      -49.71             cs2carbene      -42.27             meNCSlactoneS   -44.14             meNCScarbene    -55.74             meNCSlactoneN   -51.07                               colactone       -97.69             };         \end{axis}     \end{tikzpicture}     \end{document}      So how do I merge the ideas to get consistent spacing and the correct numbering on the bottom, while achieving the color scheme that I need?


title: \dimexpr gives 0pt

text: Why on earth does the following expression give me `0.0pt`?               \edef\x{\the\dimexpr 3ex-1ex\relax}      I assume `ex` is a LaTeX unit, as it isn't in the TeXbook. Please where is it defined in the kernel? **EDIT** Many thanks for the answers. Ah, Joseph Wright had told me about `\nullfont` in my early days with TeX. I was trying to complete the list `{A_1ex,A_3ex,A_...,A_10ex}` by using a scheme that is different from (and may be faster than) that used by `\foreach`. `\foreach` can't complete this list or `{A_1pt,A_3pt,A_...,A_10pt}`. The following usually fails:               \newcount\cnta     \cnta\z@     \foreach \p in {A_1pt,A_3pt,A_...,A_10pt}{%       \global\advance\cnta\@ne       \typeout{Doing \romannumeral\cnta=\p}%     }      I made the test in the package and hence `\nullfont` was in effect. I will remove font-dependent units from the permissible units, or make their use conditional on being in document body. I said "may be faster" above because I have found that `\foreach` looks for ellipsis (`...`) in every element of the list, via:               \def\pgffor@scanned{%       \ifx\pgffor@value\pgffor@stop         \let\pgffor@next=\pgffor@after       \else         \expandafter\pgffor@dots@in@           \pgffor@value\pgffor@dots@...\pgffor@dots@@\pgffor@stop         \ifpgffor@dots@in@           \let\pgffor@next=\pgffor@handledots         \else           \let\pgffor@next=\pgffor@handlevalue         \fi         <more>     }      **EDIT** In the following definition in `\foreach`, two `\relax` are missing. Or is it deliberate? I don't think so.               \def\pgffor@makealphabetic#1{%       \pgfutil@tempcnta=#1\relax%       \ifnum\pgfutil@tempcnta>95\relax%         \advance\pgfutil@tempcnta by-96%         \expandafter\def\expandafter#1\expandafter%         {\pgffor@alpha\pgfutil@tempcnta}%       \else%         \advance\pgfutil@tempcnta by-64%         \expandafter\def\expandafter#1\expandafter%         {\pgffor@Alpha\pgfutil@tempcnta}%       \fi%     }      **EDIT** (2012/09/08) In               {A_1ex, A_3ex, A_..., A_10ex}      my scheme recovers and uses `ex` (the original unit) in the completed/filled list. As percusse has pointed out, PGF's scheme requires               {A_1ex, A_3ex, A_...ex, A_10ex}      My scheme can also parse, e.g.,               {A_1pt-2bp*3+(3cc-2ex)/2, A_1pt-3bp*3+(3cc-2ex)/2, A_..., A_1pt-12bp*3+(3cc-2ex)/2}      but, because parsing this type of expression is expensive and unlikely to be passed by any user, I haven't included it in the relevant macros. I have retained it in the package as a future tool. What makes, e.g., `1pt-2bp*3+(3cc-2ex)/2` expensive to parse is the need to safely confirm that it is 'dimensionable'. A simple counter or dimension assignment will not always work in this case. I welcome some ideas in this regard. One point: you can't reconstitute the syntax               1pt-2bp*3+(3cc-2ex)/2      after evaluation. Even PGF's scheme can't conceivably do it, for what are you going to put at the positon of X in               {A_1pt-3bp*3+(3cc-2ex)/2, A_1pt-9bp*3+(3cc-2ex)/2, A_...X, A_1pt-27bp*3+(3cc-2ex)/2}      There is not one unit (like `pt` or `ex`) to retain. Maybe there is a need for something like               {A_1pt-3bp*3+(3cc-2ex)/2, A_1pt-9bp*3+(3cc-2ex)/2,       A_...1pt-?bp*3+(3cc-2ex)/2, A_1pt-27bp*3+(3cc-2ex)/2}      Note `?`. But won't that go ridiculously too far? TeX isn't theory.


title: How can I indent part of a line of text and have subsequent lines with the same indent?

text: I'm trying to produce a set of questions and answers. I want the question's label and text to start on the same line, but have the text slightly indented. I then want subsequent lines of the text to be indented by the same amount. I initially used the `changepage` package as advised in this post:               \textbf{(a)} \begin{adjustwidth}{1cm}{1cm}A coin is flipped 1000 times at the result is a 70/30 split between heads and tales, respectively.  What could possibly have contributed toward this result, without referencing the supernatural?     \end{adjustwidth}      However the result is that 'A coin...' begins on a new line after (a). I made a second attempt using the advise around `\par`, given on this post, but it produces the same result as just allowing the text to jump to a new line. Finally, I defined a new environment that uses a list with `\setlength` to define the indent (modified the instructions given here). But again, because it's using a list the question text is bumped onto a new line. Ultimately, what I want is for (a) and 'A coin is...' to start on the same line, and for the text on the second line to be in line with 'A coin is...' on the line above. I feel like I'm 90% of the way to figuring it out, but I'm tired and have run out of oranges. Any help is much appreciated.


title: How can I define (user defined) functions in math mode?

text: I am used to define some complicated and frequent mathematical expressions to be able to use them easily in my papers. For example I have defined `\def\c{{\mathbb{C}}}` for `$\mathbb{C}$` (the field of complex numbers). However sometimes there are more complicated formulas and mathematical expressions which involve one, two, or more variables (or parameters). For example, consider `$Hom_{\mathbb{Z}} (M,N)$` which involves two variables `$M$` and `$N$`. My question is "how can I define such expressions generally with the ability to change the variable inside them.


title: XeLaTeX on Mac OSX: Using User Fonts

text: I recently started using XeLaTeX on Mac OSX, and was not able to get XeLaTeX to recognize the fonts that I had installed. After opening Font Book, bringing up the Preferences dialog, and opting to install the fonts into the system- level directory (`/System/Library/Fonts`) instead of the user-level directory (`~/Library/fonts`), everything worked well. However, I prefer not to mix the fonts that I download with the fonts that come with the operating system. In the future, I may also wish to have XeLaTeX use fonts in arbitrary directories on my system (say, some subdirectory within a local Git repository). I am very naively guessing that the reason XeLaTeX is not finding my user-level fonts is that they are not in the OS font cache. However, invoking `fc-cache` on my user-level font directory still does not update the output I get from `fc-list` with my User fonts. So, here's my question: how can I get XeLaTeX to use TTF and OTF fonts located in arbitrary directories on my system? Currently, I can only get XeLaTeX to work with System fonts. Thank you for your insight!