title: Problem importing a table containing dollar signs in pgfplots

text: I use pgfplot for plotting (obviously). I load a table from a file, but I have the problem that my columns can have a dollar sign in them and then LaTeX complains: > ! Extra }, or forgotten $.               \documentclass{beamer}          \usepackage{pgfplots}     \pgfplotsset{compat=1.5}          \def\myplot#1{     \foreach \file in {#1} {             \begingroup             \pgfplotstableread{\file}\report             \pgfplotstableforeachcolumn \report \as {\colname}{                  \ifnum\pgfplotstablecol=0 %                 \else         \begin{frame}             \begin{tikzpicture}             \begin{axis}[                 title=\file,                 xlabel={Recall},                 ylabel={Precision},                 ymin=0,                 ymax=1,                 legend entries={\colname},             ]                      \addplot table[ y = \colname] {\file};                            \end{axis}             \end{tikzpicture}         \end{frame}         \fi     }             \endgroup         }     }          \begin{document}          \myplot{reports/report.csv}               \end{document}      Report.csv:               Recall  org/apache/tools/ant/helper/ProjectHelperImpl$ProjectHandler/results.json     0.0 1.0     0.1 0.5252788975806337     0.2 0.5242015649572856     0.30000000000000004 0.5212258417099329     0.4 0.5148570391086534     0.5 0.5132710775465511     0.6000000000000001  0.4835666797890683     0.7000000000000001  0.4736173712634098     0.8 0.4705726571519701     0.9 0.46958229692873316     1.0 0.46958229692873316      I tried using `\texttt`, but then it complains as well with a different message: > ! Missing \endcsname inserted. It seems to me that I somehow need to escape the `$`, but how, seeing that I get them from a file?


title: Should a negative kern be added after a degree symbol if followed by punctuation?

text: Not sure why I have not noticed this before, but spacing between a degree unit and punctuation seems strange as shown in red. Should a manual `\kern` be added (as shown in blue)? ![enter image description here](http://i.stack.imgur.com/Q76Pq.png) ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{siunitx}          \begin{document}     {\noindent\bfseries Default:}          If the sum of the interior angles of a polygon is \textcolor{red}{\ang{180},}     then the polygon is a triangle.     The sum of interior angles in a triangle is \textcolor{red}{\ang{180}.}          \medskip     {\noindent\bfseries With \verb|\kern-2pt|:}          If the sum of the interior angles of a polygon is \textcolor{blue}{\ang{180}\kern-2pt,}     then the polygon is a triangle.     The sum of interior angles in a triangle is \textcolor{blue}{\ang{180}\kern-2pt.}     \end{document}


title: Gap between xaxis and bars in tikzpicture

text: I am adding a bar chart with tikzpicture and I am getting a strange gap between the bars and the y axis. Am I doing something obviously wrong? Because my other bar charts works fine... Should I specify the yaxis domain or something?                \begin{tikzpicture}     \begin{axis}[      ybar=8pt,%=8pt, % configures ‘bar shift’          enlargelimits=0.25,         ylabel={Number of Instances},     symbolic x coords={PRtest, PRtrain, POtest, POtrain},     xtick=data,     nodes near coords,     ]     \addplot coordinates {(PRtest, 10) (PRtrain, 117)(POtest, 35) (POtrain, 218)};     \addplot coordinates {(PRtest, 30)(PRtrain, 243)(POtest, 5) (POtrain, 142)};     \end{axis}     \end{tikzpicture}      ![Output](http://i.stack.imgur.com/rBsoY.jpg)


title: void-variable latex-mode-abbrev-table

text: I'm using `auctex` \+ `Emacs`(OSX) Problem: If I open an `LaTeX` file, it works right. But if I open an `plain tex` file, it complains.               Debugger entered--Lisp error: (void-variable latex-mode-abbrev-table)       plain-TeX-common-initialization()       plain-tex-mode()       tex-mode()       set-auto-mode-0(tex-mode nil)       set-auto-mode()       normal-mode(t)       after-find-file(nil t)


title: How do I fix 'org-reftex-citation: No bibliography defined in file' error?

text: I am using Debian Wheezy with Emacs24.4.50.1 and Org-Mode 8.2.6. I am using Kieren Healy's Emacs Starter Kit for the Social Science. http://kieranhealy.org/resources/emacs-starter-kit/ With this Starter Kit it is necessary to rename the **kjhealy.org** file and customize things like the bibliography. I am trying to get my bibliography working in a test document.When I try to insert a reference with **C-c C-x [** I get the error:                 org-reftex-citation: No bibliography defined in file      The **kjhealy.org** file looks like this:               ;; Make RefTex able to find my local bib files     (setq reftex-bibpath-environment-variables     '("/Users/kjhealy/Library/texmf/bibtex/bib"))          ;; Default bibliography     (setq reftex-default-bibliography     '("/Users/kjhealy/Documents/bibs/socbib.bib"))      My username.org looks like this:               *** Local RefTeX Settings     Tell RefTeX where the bibliography files are.              ;; Make RefTex able to find my local bib files         (setq reftex-bibpath-environment-variables         '("/home/username/Dropbox/bibliography/references.bib"))              ;; Default bibliography         (setq reftex-default-bibliography         '("/home/username/Dropbox/bibliography/references.bib"))      Kieren Healy is working on a Mac. I suspect I am doing something wrong with the reftex-bibpath-environment-variables. Debian doesn't have 'Library' in the /home directory. I am not sure how to find the /texmf/bibtex/bib folder on Debian or its equivalent. Any suggestion on how to correct this will be appreciated.


title: Change position of prenote when ibid (if statement in \DeclareCiteCommand)

text: The referencing guide that I follow requires the `prenote` to come after the 'Ibid' literal in cases where ibid is appropriate. For example:               s 1 Really Awesome Statute.     s 3 Ibid demonstrates awesome stuff << wrong     Ibid s 3 demonstrates awesome stuff << correct      I am attempting to achieve this by altering the `footcite` command. The command was originally defined as:               \DeclareCiteCommand{\footcite}[\mkbibfootnote]       {\bibsentence        \usebibmacro{prenote}}       {\usebibmacro{citeindex}%        \usebibmacro{cite}}       {\multicitedelim}       {\usebibmacro{cite:postnote}}      I am attempting to use:               \DeclareCiteCommand{\footcite}[\mkbibfootnote]       {           \bibsentence           \ifthenelse{\shoulddoibid}{%           }{%                   \usebibmacro{prenote}           }       }       {           \usebibmacro{citeindex}%           \usebibmacro{cite}       }       {           \multicitedelim       }       {           \ifthenelse{\shoulddoibid}{%             \usebibmacro{prenote}           }{%           }           \usebibmacro{cite:postnote}       }      with               \newcommand{\shoulddoibid}{\ifciteibid\AND\NOT\iffirstonpage}      However, this appears to completely break `footcite`:   * I get lots of `∆=∆` symbols (eg `Ibid ∆=∆, 293`)   * `Ibid` appears in the wrong place   * `prenote` and `cite:postnote` are replaced with `∆=∆` even where they are not defined My guess is that my problem is with the definition of `shoulddoibid`, or with the `DeclareCiteCommand` (likely the latter). Does anyone have any ideas?


title: PGFPlots: importing data from a txt file

text: So I imported data from two `txt` files. However, I would like to plot the mean of the data and then the standard deviation bars. How can this be done?               \documentclass[tikz, convert = false]{standalone}     \usepackage{pgfplots}%                                                                 \pgfplotsset{compat = 1.8}%                                                            \begin{document}     \pgfplotstableread{FRETData.txt}     \datatable%                                                                            \pgfplotstableread{FRETData2.txt}     \datatabletwo%                                                                         \begin{tikzpicture}       \begin{axis}[ymin = 0.16,         ymax = 0.22,         minor y tick num = 5,         xmin = -6.7,         xmax = -6.2         ]         \addplot table[y = 1] from \datatable;         \addplot table[y = 1] from \datatabletwo;       \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/fnxfF.png) From the picture, we see that `pgfplots` has connected two separate experiments. ~~How can I remove the line?~~ Can `pgfplots` calculate the mean for each experiment and put standard deviation bars? **Edit 1:** So to remove the lines, I added only marks option.


title: Align environment {amsmath} inside subfigure {subcaption} breaks figure numbering

text: When I put an equation in align environment into a subfigure, it breaks figure numbering. In the example below, the whole figure gets number 2, not 1 as I want. How do I fix it?               \begin{figure}     \begin{subfigure}[b]{.6\linewidth}     \centering     % array* or flalign or similar here breaks numbering     \begin{flalign*}     a& = b \\     c& = d     \end{flalign*}     \subcaption{\label{fig:tb}}     \end{subfigure}%     \caption{\label{fig:toffoli}Toffoli gate.}     \end{figure}      The example can be viewed at https://www.writelatex.com/read/xkhkknjnfvdq .


title: Layered graph with variable number of nodes on each layer

text: I have created some Tikz code to product he diagram below (slightly simplified). This is my first real shot at Tikz and its taken me about 8 hours now to get this far. But I don't really begrudge the time, time spent learning is time well spent. it is loosely based on this Texample. I would like to have a different (variable) number of nodes in each layer, and would like to maintain the connection. My current idea was to have a list of lists like `{{1..3},{1..5},{1..7},{1..4},{1..3}}` then I guesss i could use a nested `for-each`off the index. But that has 2 problems: I would loose my layer number, which i could get around by using `count`. secondly, more majorly, I don't seen a good way of knowing how big the next layer is (to make the connections). ![Neural Net](http://i.stack.imgur.com/bO8f3.png)                \documentclass{article}     \usepackage{mathptmx}     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{calc}     \begin{document}               \def\layersep{3.5cm}     \def\topnum{5}     %\font\nullfont=cmr10     \begin{tikzpicture}[shorten >=1pt,->,draw=black!50, node distance=\layersep]         \tikzstyle{neuron}=[circle,draw,fill=white!25,minimum size=25pt,inner sep=0pt]         \tikzstyle{bias neuron}=[neuron,dashed]                   \foreach \y in {2,...,4}                     \foreach \x in {1,...,5}                 \path   node[neuron] (L_\y_\x) at (\x cm,\y*\layersep) {$\sigma(\cdot)$};               %          \foreach  \x in {1,...,5}                 \path  node[neuron] (L_1_\x) at (\x cm,1*\layersep) {$x_\x$};              \foreach  \x in {1,...,5}                 \path  node[neuron] (L_5_\x) at (\x cm,5*\layersep) {$s_{m}(\cdot)$};                   %Add Biases         \foreach \y in {1,...,4}         {             \path node[bias neuron] (B_\y) at (6 cm, 0.55*\layersep+\y*\layersep) {1};             \pgfmathtruncatemacro\nextlayer{\y+1}             \foreach \dest in {1,...,5}                 \path (B_\y) edge[dashed] (L_\nextlayer_\dest.south);         }                   % Connect every node in the input layer with every node in the         % hidden layer.         \foreach \layer in {1,...,4}             \pgfmathtruncatemacro\nextlayer{\layer+1}             \foreach \source in {1,...,5}                 \foreach \dest in {1,...,5}                     \path (L_\layer_\source) edge (L_\nextlayer_\dest);               \end{tikzpicture}     \end{document}


title: the error Missing number, treated as zero in tabular

text: there is my code               \documentclass[a4paper,12 pt,adobefonts]{ctexart}     \usepackage{xeCJK}     \usepackage{caption}     \usepackage{multirow}%跨行表格     \usepackage{bigstrut}     \renewcommand{\arraystretch}{1.3}     \usepackage{booktabs}%设置跨列横线的行数     \pagestyle{plain}%版式设置无页眉，页码底部居中     \usepackage{indentfirst}%设置首行缩进     \usepackage[top=2.5 cm, bottom=2.5 cm, left=2.5 cm, right=2.5 cm]{geometry}%设置页边距     \setlength{\parindent}{2.5em}%设置缩进量为相对2.5个字符，\noindent让取消某一段首行缩进取消     \defaultfontfeatures{Mapping=tex-text}     \setmonofont[Scale=MatchLowercase]{Andale Mono}%设置等宽字体     %\usepackage{overcite}%让参考文献引用上标但没有［］     \usepackage{setspace}%设置行间距     \setstretch{1.5}%设置行间距为任意倍数  此处为1倍     \setCJKmainfont[BoldFont={黑体}]{宋体}     \usepackage[center]{titlesec}%让标题居中     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     \begin{tabular}{|c|c|c|c|c|}     \hline     Monday&Tuesday&Wednesday&Thursday&Friday\\     \hline     \multirow{2}{c}{微观经济学 \\ 第1-15周 \\ 杨民 \\ D220} & \bigstrut \\ \cline{2-2}& \multirow{2}{c}{毛概 \\ 第1-16周 \\ 杜利平 \\ A124} & \bigstrut \\ \cline{2-2}& \multirow{2}{c}{大学生职业规划 \\ 第1-7周 \\ 常建军 \\ D425}     \hline     \multicolumn{5}{|c|}{中午}\\     \hline     \end{tabular}     \end{document}      and I can't compile, the error is               Missing number, treated as zero.     <to be read again>                         c     l.25 ...经济学 \\ 第1-15周 \\ 杨民 \\ D220}                                                        & \bigstrut \\ \cline{2-2...          ?


title: make a table with flexible column count

text: I have a file which I would like to be able to generate two documents, one with narrow pages and one with wide pages. I have a figure in the document with several narrow equations, and to save space in the wide document, I would like to put them side by side. So, ideally, the output would look something like this in the wide document:               a = foo    wx = bar     b = baz    yz = quux      and like this in the narrow document:               a  = foo     b  = baz     wx = bar     yz = quux      Of particular import: I'd like the equals signs to align in the narrow document, and each column of the wide document should stick together (e.g. the ordering "a, wx, b, yz" in the narrow document would be less preferable). I had an idea that I could do this using `tikz`'s `\foreach`; an attempt that cuts out as many irrelevant details as possible follows:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \newcommand{\makeatable}[1]{\begin{tabular}{lr}#1\end{tabular}}     \newcommand\sidebyside[1]{\foreach \l/\r in {#1}{\l & \r\\}}     \newcommand\toptobottom[1]{%         \foreach \t/\b in {#1}{\t\\}         \foreach \t/\b in {#1}{\b\\}     }          \newcommand\contents{{foo/bar},{baz/quux}}     \makeatable{\sidebyside \contents}     \makeatable{\toptobottom\contents}     \end{document}      Unfortunately emitting `&` or `\\` from a `\foreach` seems to cause problems (there are dozens of errors; I'll be happy to include a transcript if that seems helpful). Is there a way to make this work with `\foreach`? Or, what other things could I try?


title: Citing disorder

text: Good afternoon. For execution of paper references I use BibTeX. When writing text citing links are arranged in order. But when I transfer the part of the text with the cite (e.g. 13) to another place (e.g. after 14), renumbering not occurs. Recompiling and reloading does not help. LaTeX does not change the order of cite links, and I see the following: text...[11]... text...[12]...text...[ **14** ]...text...[ **13** ]...text...[15]... What am I doing wrong? Thanks in advance


title: Which package defines \smash?

text: I sometimes see `\smash` used to control local vertical alignment. Which package defines it?


title: expand macro in single byte encoded code

text: In this minimal (not) working example, I try to use single-byte `latin10`-encoded source file, and expand a command-macro containing a character with `\catcode254`:                   % -*- mode: latex; unibyte: t; coding: iso-8859-16 -*-         \documentclass[a4paper,10pt]{report}              \usepackage[T1]{fontenc}         \usepackage[latin10]{inputenc}              \newcommand\mwe{Lista de demonstrații}              \begin{document}                \chapter{Oscilații}                \xdef\MWE{\mwe}                \MWE              \end{document}      but I get this "`\crcr`" error in the log:                   ! Illegal parameter number in definition of \MWE.         <to be read again>                             \crcr          l.14 \xdef\MWE{\mwe                            }      If ( _file is **not** UTF-8!_) I replace the `ț` (`\catcode254`) with `ș` (`\catcode186`), same error. Instead, if I replace with `â` (`\catcode226`) or with just `t`, the error disappears. These `latin10` letters are for Southeastern European languages. The useful code I need for a `\LaTeX` class is related with `\addcontentsline`; here is another example:                   % -*- mode: latex; unibyte: t; coding: iso-8859-16 -*-              \documentclass[a4paper,10pt]{report}              \usepackage[T1]{fontenc}         \usepackage[latin10]{inputenc}              \newcommand\mwe{Lista de demonstrații}         \newcommand\toc[2]{\addcontentsline{toc}{section}{#1}}              \begin{document}                \makeatletter           \@expandtwoargs\toc{\mwe}{}           \makeatother              \end{document}      and the log:                   ! Illegal parameter number in definition of \reserved@a.         <to be read again>                             \crcr          l.14 \@expandtwoargs\toc{\mwe}{}      What is about this behavior? I appreciate any help. Thank s. Unicode (i.e., `\usepackage[utf8]{inputenc}`) is not a solution here, since these `latin10`-encoded lines come from `\TeX` text input streams (`\immediate\read`), hence the single-byte constraint.


title: Underbrace multiple math lines

text: I have to underbrace multiple lines in an align-environment with _one_ brace. Meaning something like               \begin{align*}      A ={}& B + \underbracemultiline{C + D + E \\           & + F + G \\           & + H + I \\           & + J + K}_{=:M} + L     \end{align*}      results in (a nice version of)   ![http://www.phoenixes.de/Bsp.png](http://www.phoenixes.de/Bsp.png)   Another possible syntax would be               \begin{align*}      A ={}& B + \under{brace}{line}{dots}{C + D + E} \\           & \under{dots}{brace}{dots}{+ F + G}_{=:M} \\           & \under{dots}{line}{dots}{+ H + I} \\           & \under{dots}{line}{brace}{+ J + K} + L     \end{align*}      where the macro               \under{begin}{middle}{end}{What to under"line"}      is as needed for the example. How can I do this? Thx


title: Name a section in Latex TOC (add subtitle to contentsline)

text: I have my Latex document (documentclass is `article`) which consists of several `\section`s and `\subsection`s. The `\tableofcontents` command generates my TOC as I want (in this case: hyperreffed, with page number, with dots etc.), but for the sections, I would like to add a "section subtitle". As an example: my current TOC looks like               1 Layout         1.1 Main Window         1.2 Footer     2 Navigation         2.1 Basic structure         2.2 Overview page      Now I want to add a subtitle to every section, which I expected to work like `\section{Layout}{this section describes the layout}`, which appearently doesn't work. What I want:               1 Layout - this section describes the layout         1.1 Main Window         1.2 Footer     2 Navigation - here you will get information on foobar         2.1 Basic structure         2.2 Overview page


title: Write a question in LaTeX

text: I'm writing a report and would like to put several questions in a `\subsubsection{}` with the following format (questions appear in the middle of the page) 1.2. Questions                                         *This is the question one*      This is the answer for question one.                                         *This is another question*      This is the answer for the question two.


title: pdfpages doesn't center pdf on page, using Thesis.cls

text: I am using the Thesis-template from http://www.latextemplates.com/template/masters-doctoral-thesis. I have several LaTeX-documents to include in the Appendix. The best solution seems to be compiling each document and using `pdfpages` to include them. I tried `combine`, but there were too many conflicts. The problem is that, although default `pdfpages`-behaviour should be to center the pdf on the page, it places it in the top-left corner. Trying to offset it displaces the pages unevenly, as I am using twosided page layout. I assume this is due to a conflict with the `Thesis.cls`, that it somehow removes any margins and applies it manually for only its own elements. Any idea how I could either:   * Use the `offset` to place the document appropriately   * Introduce margins for just the pages with the PDF. Usage:               \includepdfset{pages=-,pagecommand=\thispagestyle{fancy}}          \includepdf[fitpaper=true]{./../Forstudierapport/forstudierapport.pdf}      Result: As you can see, the header is properly placed, but the PDF is displaced. ![Image of the page](http://i.stack.imgur.com/4Ss9z.png) Notes: `\usepackage{geometry}` removes margins from the entire document. Env: Using BasicTeX 2011 from MacTeX. I'm on Mac OS X.7.


title: Can't link any files in JabRef anymore

text: When I started using JabRef, I managed to link some files (like 5 or so), a few via `Alt+F`, a few manually. Then something happened in between and now I am unable to link files anymore, either via `Alt+F` or manually. I don't know what the problem appear. I mark some entry I know I have the pdf file for and hit `Alt+F`. The Windows file manager pops up so I can select the file manually. Once I find it and click `Open`, first this pops up ![enter image description here](http://i.stack.imgur.com/RV8PY.png) (translation: `Error when opening file 'D:\Studium\[...]function.pdf`) and then this: ![enter image description here](http://i.stack.imgur.com/wPLRd.png) My .bib file certainly doesn't have any brace errors so the error text               Error in line 6: Expected { or ( but received 65533      probably relates to something else. The various pdf files I tried are certainly not the origin of the error either. Has anyone else encountered this problem If so, were you able to solve it? Does anyone else have an idea how to solve it? (I have already made a bug report for it but so far no replies of any kind.)


title: How to use maximum space of page to include long tables

text: I am writing a report and facing similar problem. I want to included a long table (spreading over many pages) in the appendix of the report. The tale contains around 100 columns but only four rows. I want to include maximum columns in a page. I am using the following latex command line. I would be grateful for a favorable consideration.               \begin{landscape} \setlength\LTleft{2pt} \setlength\LTright{2pt}     \begin{table}[htbp] \caption*{}      \begin{longtable}{|l|p{4in}|l|p{4in}|}\hline HS2&Description&HS2&Description \\      \hline 01&Live animals&20&Vegetable, fruit, nut, etc food preparations \\      \hline 02&Meat and edible meat offal&21&Miscellaneous edible preparations \\      \hline 03&Fish, crustaceans, molluscs, aquatic invertebrates nes&22&Beverages, spirits and vinegar \\      \hline 04&Dairy products, eggs, honey, edible animal product nes&23&Residues, wastes of food industry, animal fodder \\      \hline ... .... (up to 100 times)     \end{longtable}      \end{table}     \end{landscape}


title: Business letter template with letterhead on the side

text: Is there a template for a letter that allows for the letterhead to have some of its elements on the side (in the left/right margin) in a vertical column or sidebar including a business logo? Somewhat like ![enter image description here](http://i.stack.imgur.com/2Zs4n.gif) or ![enter image description here](http://i.stack.imgur.com/OHQZ8.gif) If there is no such template, what would be the best way to create one (for someone who has not created a LaTeX template before)?


title: scrlttr2 : header and footer on every page does not appear correctly

text: I am using **scrlttr2** to write the letter (code below). The header and footer appear correctly on the first page but on the second page and so on, the layout is not the way it should be ... that is header is scrambled and footer is in italics and is at incorrect position. Can anyone help correct the code? Thanks               \documentclass[         fontsize=11pt,          % fontsize         paper=a4,               % page size a4         firsthead=on,           % display header on first page         firstfoot=on,           % display footer on first page         pagenumber=off,         % position of the page number         parskip=half,           % Use indent instead of skip, half, false         enlargefirstpage=on,    % more space on first page         fromalign=left,         % placement of name in letter head         fromrule=afteraddress,  % separate the address with a line in letter head, false or aftername         fromemail=off,          % turn on email of sender         fromurl=off,            % print URL of sender         fromphone=off,          % turn on phone of sender         fromlogo=off,           % turn on logo of sender         addrfield=on,           % address field for envelope with window, on or true         subject=titled,         % placement of subject, beforeopening or titled         foldmarks=off,          % print foldmarks         numericaldate=off,      % display date in numbers only         KOMAold]{scrlttr2}          % http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguien.pdf          \usepackage[T1]{fontenc}     \usepackage[dvips]{graphicx}     \usepackage[english]{babel}     \usepackage{lipsum}     \usepackage{lmodern}     \usepackage{lastpage}     \usepackage[rgb]{xcolor}     \usepackage{hyperref}     \hypersetup{%         pdfborder=0 0 0,         pdfauthor={},         pdftitle={},         pdfsubject={},         pdfkeywords={},         pdfpagemode={UseOutlines},         bookmarksopen,         pdfstartview={FitH},         colorlinks,         linkcolor={blue},         citecolor={red},         urlcolor={blue}       }          % Information in the header     \firsthead{\parbox[b]{\linewidth}{\noindent         \fbox{     %        \includegraphics[width=0.1\linewidth]{logo.eps}         }       \hfill         \fbox{             \parbox[b]{0.5\linewidth}{\centering University \\ 123 Street, \\ City, State 12345}         }       \hfill         \fbox{     %        \includegraphics[width=0.1\linewidth]{logo.eps}         }         }         \vspace*{0.5ex}     %    \hrule\hrule         \vspace*{0.5ex}         \centering\scriptsize{Institute or Corporation}}          \nexthead{\parbox[b]{\linewidth}{\noindent         \fbox{     %        \includegraphics[width=0.1\linewidth]{logo.eps}         }       \hfill         \fbox{             \parbox[b]{0.5\linewidth}{\centering University \\ 123 Street, \\ City, State 12345}         }       \hfill         \fbox{     %        \includegraphics[width=0.1\linewidth]{logo.eps}         }         }         \vspace*{0.5ex}     %    \hrule\hrule         \vspace*{0.5ex}         \centering\scriptsize{Institute or Corporation}}          % Information in the footer     \firstfoot{\parbox[b]{\linewidth}{\hrule\vspace*{0.5ex}\centering\scriptsize{name | organization | phone | email | web | copyright number: 12\,345\,678 \hfill \textcolor{blue}{\thepage}/\pageref{LastPage}}}}     \nextfoot{\parbox[b]{\linewidth}{\hrule\vspace*{0.5ex}\centering\scriptsize{name | organization | phone | email | web | copyright number: 12\,345\,678 \hfill \textcolor{blue}{\thepage}/\pageref{LastPage}}}}          % \removereffields % removes reference fields     % \makeatletter     % \@setplength{refvpos}{\useplength{toaddrvpos}}     % \makeatletter          \setkomavar{location}{\hspace{4em}\parbox[b]{\textwidth}{\today \\  Ref. No.}}     \setkomavar{customer}[]{Through proper channel}     \setkomavar{date}[]{} % Removes date          \makeatletter     \@setplength{sigbeforevskip}{8ex} % 0ex space after the signature     \makeatother          \makeatletter     \@addtoplength{firstheadvpos}{0mm} % 4.5mm position of header     \@addtoplength{firstfootvpos}{0mm} % -8mm or -1ex position of footer     \makeatother          \setkomavar{subject}{title of the subject}          % \setkomafont{title}{\normalfont\rmfamily\bfseries\Large} % changes the font of title     % \setkomavar{title}{\MakeUppercase{To whom it may concern}}          \begin{document}     \pagestyle{myheadings}          \setkomavar{fromname}{Your Name,\newline 123 Street, \newline City, State 12345 \\[0.5ex] Email: username@domain.com \\ Phone: +00-123-456-7890} % Your name     \setkomavar{fromaddress}{123 Street, \\ City, State 12345}     \setkomavar{fromemail}{username@domain.com}     \setkomavar{fromphone}{+00-123-456-7890}     \setkomavar{signature}{\usekomavar{fromname}}          \begin{letter}{Director, \\ Corporation, \\ 123 Street, \\ City, State 12345} % Addressee name and address     \vspace*{0ex} % Correct for vertical displacement     \opening{Dear Sir/Madam,}          \lipsum[3-8] % generates dummy text, scratch that and write the letter contents          \closing{Sincerely,}          \cc{Chancellor, 123 Street, City, State 12345}          \end{letter}     \end{document}


title: Using memoir and hyperref, can I get a "\subref" in the caption of a figure?

text: I am writing a document using the `memoir` class. I would like to create a figure with two subfigures and to display a caption like "Plot of Y vs X with z=1 (a) and with z=2 (b)", where "(a)" and "(b)" are references to the subfigures. I read How to reference subfigure in caption and Customize referencing of subcaptions in “memoir”?. The following example based on Werner's code solve my problem.               \documentclass{memoir}     \newsubfloat{figure}     \usepackage[demo]{graphicx}     \usepackage{xstring}     \usepackage{xspace}          \newcommand*{\subfigref}[1]{(\StrBetween{\ref{#1}}{(}{)})\xspace}%          \begin{document}          \begin{figure}[ht]     \centering     \subbottom[This is a subfigure\label{fig:label:a}]{\includegraphics{figure1}} \qquad     \subbottom[This is a subfigure\label{fig:label:b}]{\includegraphics{figure2}}     \caption{These are some awesome figures: \protect\subfigref{fig:label:a} and \protect\subfigref{fig:label:b} }     \label{fig:label1}     \end{figure}          \end{document}      How can I make the previous example work with `hyperref` ? In Customize referencing of subcaptions in “memoir”?, egreg seems to know how to do this but I do not understand enough his answer to use it for this particular problem. **EDIT** Note that I would also like to keep references such as "in Figure 0.1(a)" outside the figure.


title: Kerning in \Cref of cleveref

text: When I use the `\Cref` command of `cleveref` package, it doesn't apply the corresponding kerning: Here is a minimal example:               \documentclass{scrartcl}     \usepackage[thref]{ntheorem}     \usepackage{cleveref}          \newtheorem{thm}{Teorema}          \begin{document}     \begin{thm}\label{thm}         Teorema     \end{thm}     Te \\     \Cref{thm}     \end{document}      There is no kerning between the `T` and the `e` of `Teorema`. ## How can I solve this? Is this a bug? ![enter image description here](http://i.stack.imgur.com/LTQpE.png)


title: Equation number in denominator of fraction instead of the margin

text: can you please give me a hint on the following problem: I have a bunch of numbered equations in a paper, however the following equation appears with the equation number in the denominator of a larger, however still fitting fraction, instead of appearing at the margin.               \begin{equation}     \beta _2^*\geq \frac{\kappa _5\left(q_H^2-s_L^2\right)}{\left(q_H-s_L\right)\Delta _H-\eta (\lambda -1)\left\del\left(\Delta     _1-2q_H\left(1-r_H\right)\Delta _4\right)}     \end{equation}      What can I do to make the equation number appear at the document margin and remove it from the denominator? Searched through all kinds of posts on Latex problems without solution so far. Thank you so much in advance!


title: Poetry layout by page rather than verse

text: I am setting a book of poetry that is one long continuous poem. Some of the verses have quite short line lengths. Others have quite long line lengths. Is there a way to have LaTeX find an optimal horizontal position for the lines on any given page rather than for the individual verse? There are no lines long enough that they need to be broken. Ideally the text box would be centred, but a rough approximation of centre would also suffice. I have used both memoir's own poetry functions often, and I have also used the verse package. Neither of these offer an option to set lines page by page rather than verse by verse. I have no minimum working example at the moment, because I'm not even sure how to approach the problem.


title: Updating LuaTeX version in MiKTeX

text: I have MiKTeX 2.9, which comes packaged with LuaTeX version beta-0.70.2-2012060719. I'd like to compile a file using the latest stable version. I've downloaded the binary, but what do I do with it?


title: Page layout not in accordance with pdf printout

text: For my thesis, the rule for page layout is determined as:               \usepackage[lmargin=1.5in, rmargin=1.0in,tmargin=1.0in,bmargin=1.0in]{geometry}      But when I compile to produce PDF and take a print out and measure with a ruler, I find the left is short by 0.1 inch, that is 1.4in and the right is more by 0.1 inch. Is this normal when we take a printout or am I defining the boundary incorrectly ?


title: Include logo in thesis using \maketitle

text: I'm writing my thesis using a custom made class, namely ecsthesis.cls (available here https://www.sharelatex.com/templates/thesis/university-of- southampton-thesis/). I want to include the university logo in order to have something like ![enter image description here](http://i.stack.imgur.com/aLIeB.jpg) I'm using \maketitle to make the frontpage which from the .cls should be                   \renewcommand\maketitle{       \btypeout{Title Page}       \hypersetup{pdftitle={\@title}}       \hypersetup{pdfsubject=\subjectname}       \hypersetup{pdfauthor=\authornames}       \hypersetup{pdfkeywords=\keywordnames}       \thispagestyle{empty}       \begin{titlepage}         \let\footnotesize\small         \let\footnoterule\relax         \let \footnote \thanks         \setcounter{footnote}{0}         \null\vfil         \vskip 60\p@         \begin{center}           \setlength{\parskip}{0pt}           {\large\textbf{\UNIVNAME}\par}           \bigskip           {\normalsize \FACNAME \par}           \smallskip           {\normalsize \deptname \par}           \vfill       \bigskip           \bigskip           \bigskip           \bigskip       {\large \bf \@title \par}           \bigskip           {\Large by \par}           \bigskip           \bigskip           {\large \textbf{\authornames} \par}           \vfill           {\large Thesis for the degree of Doctor of Philosophy\par}                \bigskip           \bigskip           \bigskip           {\large \@date \par}           \bigskip         \end{center}         \par         \@thanks         \vfil\null       \end{titlepage}       \setcounter{footnote}{0}%       \global\let\thanks\relax       \global\let\maketitle\relax       \global\let\@thanks\@empty       \global\let\@author\@empty       \global\let\@date\@empty       \global\let\title\relax       \global\let\author\relax       \global\let\date\relax       \global\let\and\relax       \cleardoublepage     }      How can I redefine it in order to include the logo? Here is my MWE               \documentclass[twoside]{ecsthesis}      % Use the Thesis Style     \graphicspath{{../Figures/}}   % Location of your graphics files     \usepackage[toc,page]{appendix}     \usepackage[sort &compress]{natbib}  % Use Natbib style for the refs.\part{title}     \usepackage{amssymb}     \usepackage[noprefix]{nomencl}     \usepackage{chemmacros}     \usepackage{chngcntr}     \counterwithin{reaction}{chapter}     %\usepackage{mhchem}     \usepackage{longtable}     \usepackage{wasysym}     \usepackage{hyperref}     \usepackage{cleveref}     %\usepackage{caption}           \usepackage{upgreek}     \usepackage{epigraph}     \usepackage{tipa}     %\captionsetup{labelsep=space,justification=justified,singlelinecheck=off}     \usepackage{array}     \usepackage{minitoc}     \usepackage{multirow}     \usepackage{rotating}          %          %     \setlength\epigraphwidth{8cm}     \setlength\epigraphrule{0pt}                                             \setlength{\parindent}{1cm}               %% ----------------------------------------------------------------     \begin{document}     \frontmatter     \title      {Three years wasted}          \authors    {\texorpdfstring                  {\href{ciao@ecs.soton.ac.uk}{Mickey Mouse}}                  {Mickey Mouse}                 }     \department  {}     \group       {}     \addresses  {\groupname\\\deptname\\\univname}     \date       {\today}     \subject    {}     \keywords   {}     \maketitle          \begin{abstract}     blablabla          \end{abstract}               \tableofcontents     \listoffigures     \listoftables               \cleardoublepage     %% -----------------------     %% lstpatch.sty     %% -----------------------     %% lstpatch cannot be distributed with these files. I believe it is only needed if the     %% \lstlistoflistings is used. So this has been turned off by default. Re-add if required:     %% \usepackage{lstpatch}     %% \lstlistoflistings     %% You will need to download lstpatch, possibly from:     %% http://web.mit.edu/texsrc/source/latex/listings/lstpatch.sty     %% -----------------------     % -----------------------     % Authorship declaration     % -----------------------     % Either include citations like below (as many as required spaced with commas or 'and').     \authorshipdeclaration{}     % Or state no citations like below     % \authorshipdeclaration{}          \mainmatter               \include{Introduction}          \include{LitteratureRewiev}               \backmatter     \bibliographystyle{apalike}     \bibliography{ECS}     \end{document}


title: Define quotation environment without indentation of the first paragraph

text: I want to have a `quotation` environment that does not indent the first paragraph.               \documentclass{scrbook}           \begin{document}          \makeatletter     \renewenvironment{quotation}                {\list{}{\listparindent 1.5em%                         \itemindent    \listparindent                         \rightmargin \leftmargin                         \parsep        \z@ \@plus\p@}%                 \item\relax}                {\endlist}     \makeatother          This is normal text. This is normal text. This is normal text.     This is normal text. This is normal text.      \begin{quotation}          This is a sentence that is devoid of any meaning. It should not be indented.          This ia another sentence. It should be indented. The other one shouldn't.     Some more text here. Some more text here. Some more text here. Some more text here.           \end{quotation}     This again normal text. This again normal text. This again normal text.     This again normal text.          \end{document}      (A separate question would be how the environment can be modified so that the quote is not indented at the righthand side but instead aligned with the normal text.)


title: Using \pgfplotsinvokeforeach in foreach loop

text: I am trying to run a `\pgfplotsinvokeforeach` loop in a `\foreach` loop to plot the variables var1_roll1 - var1_roll10 in one plot and var2_roll1 - var2_roll10 in another. Both loops work fine individually but a combination of both gives the following error: > ! Illegal parameter number in definition of \pgffor@body. Can anyone help? Here is the Code. Thanks!               \begin{figure}         \foreach \dt in {1,2} {         \begin{tikzpicture}             \begin{axis}[]                \pgfplotsinvokeforeach {1,2,...,10} {                  \addplot[]  table[x=x,y=var\dt_roll#1] {../plot/test.txt};                 }             \end{axis}         \end{tikzpicture}         }     \end{figure}


title: xeCJK Source Han Sans problem

text: I am having some trouble using the new Source Han Sans font (SourceForge; Github) released by Google and Adobe in latex documents. I compile using XeLaTeX and have the TeX Live installation. I have spent the last 4 hours or so looking for a solution but couldn't find one. My code is the following:               \documentclass{article}     \usepackage{xeCJK}     \setCJKmainfont{Source Han Sans J Normal}     \renewcommand{\arraystretch}{1.5}     \setlength\parindent{0pt} % Removes all indentation from paragraphs     \topmargin=-0.45in     \evensidemargin=0in     \oddsidemargin=0in     \textwidth=6.5in     \textheight=28cm     \headsep=0.25in      \footskip = 20pt     \begin{document}     \thispagestyle{empty}     日本     \end{document}      Now when I run this it doesn't give me an outright error. However when I try to open the compiled pdf it tells me it is broken. When I look at the log file I find this at the bottom (the file name is "Core 1000 1-10.tex"):               Error 1 (driver return code) generating output;     file Core 1000 1-10.pdf may not be valid.      The complete `.log` file can be found here: `.log` file When I comment out the line `\setCJKmainfont{Source Han Sans J Normal}` it works correctly again. I have installed all the fonts in the family and did the procedure to load new fonts into LaTeX using TeX Live-manager. Is this font maybe just not supported by xeCJK or am I doing something wrong?


title: Commands for beamer environment

text: Could you help in adjusting this list of commands? It gives me several errors, but I don't understand why.               \documentclass{beamer}     \usepackage{graphicx}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{verbatim}     \usepackage{color}     \usepackage{xcolor}     \usepackage{bbm}     \usepackage{framed}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage[demo]{graphicx}     \usepackage{subfig}     \usepackage{tabularx}     \usepackage{caption}     \usepackage{enumerate}     \usepackage{mathrsfs}          \setbeamertemplate{footline}     {     \begin{beamercolorbox}{author in head/foot}     \usebeamerfont{authorinhead/foot}     % \vskip3pt \hskip3pt \insertshortauthor     \vskip2pt \hskip5pt \insertsection \hfill     (\insertframenumber/\inserttotalframenumber) \hskip3pt     \end{beamercolorbox}     }          \newcommand{\Def}{\color[rgb]{0,0,0}} %Black%     \newcommand{\Blue}{\color[rgb]{0,0,1}}     \newcommand{\beginbackup}{        \newcounter{framenumbervorappendix}        \setcounter{framenumbervorappendix}{\value{framenumber}}     }     \newcommand{\backupend}{        \addtocounter{framenumbervorappendix}{-\value{framenumber}}        \addtocounter{framenumber}{\value{framenumbervorappendix}}      }     \newtheorem{proposition}[theorem]{Proposition}     \newcommand{\highlight}[1]{\colorbox{yellow}{$\displaystyle #1$}}               \DeclareCaptionStyle{mystyle}{name=}     \captionsetup[figure]{style=mystyle}     \begin{document}     \begin{frame}     blah blah     \end{frame}     \end{document}


title: Organization of a commentary book

text: I am writing a commentary book made of about 500 pages, where each page contains up to 3 sections (different commentaries on the same verse), "a" "b" and "c". In each page, the content length of each section is different: in page 1, for example, there may be a long "a", no "b", and a short "c"; In page 2, there may be a medium "a", a short "b", and a long "c", etc. I would like to layout the sections on each page, so that the page area is used efficiently. Here is an example of a NON efficient layout, that I want to prevent:               aaa bbb ccc     aaa     ccc     aaa     ccc             ccc             ccc      As you can see, there is a lot of wasted area. Initially, I tried to create columns and control their widths according to the content length, for example:               aaa b ccccc     aaa b ccccc     aaa b ccccc      This is more efficient, however, column "b" is too narrow and difficult to read. Another thing I tried is to keep the width constant and use floats. For example, suppose I only have columns "a" and "b":               aaa bbb      aaaaaa       If I had only two columns, this could be quite simple:   * If a is much longer than b, then make b float right;   * If b is much longer than a, then make a float left;   * If they are approximately the same length, then make them two adjacent columns. However, this becomes much more complicated when there are 3 columns, as there are many possible combinations. Is there a general solution to this problem?


title: Custom environment move to end of chapter

text: I have written a custom `example` environment for formatting mathematical worked examples. These are currently included in the sections they are related to, however are sometimes looking a bit cluttered. I am considering grouping all the examples at the end of each chapter. Can you think of a simple way I can rewrite my custom environment so that it moves all of the text to the end of each chapter, displaying them in the order they were written in? (Kind of like some of the endnotes packages I suppose!) Thanks! **EDIT** \- adding MWE requested in comments...               \documentclass{book}     \usepackage[english]{babel}     \usepackage{blindtext}               %%%%% SET UP THE ENVIRONMENT HERE %%%%%     \newcounter{examplecounter}     \setcounter{examplecounter}{0}         \newenvironment{example}[1]{             \refstepcounter{examplecounter}%             \vspace{3mm}\hspace{3mm}\\%             \noindent\rule{\textwidth}{0.07cm}\\%             \textbf{Worked Example \arabic{examplecounter}: #1}\\         }{             \hfill\\%             \noindent\rule{\textwidth}{0.07cm}         }               \begin{document}         \chapter{First Chapter}             \blindtext                  \begin{example}{Some are several pages}                \blindtext[10]             \end{example}                  \section{First Section}                 \blindtext                 \begin{example}{Others are shorter}                     Second Example                 \end{example}     \end{document}


title: Margin note over body text

text: I'm interested in putting marginal notes that seems like a post-it in the margin of a document. No problem at all if they are simply made with `\marginpar` and playing with margin width and separation. But my question is: how can I make the marginal note wider and make it invade the main body of the document? how will it wrap the body text? Let me clarify with a sample:               |   asdfasdfasdfasdfasfs        |     |   sadfasdfasdfasdfasas        |     |   asdfajhdfasfd               |     |   jhfasdjfasdfj +----------+  |     |   asdfasdfasdfa | asdasdfa |  |     |   jkasdfjasdfas | sdfadfas |  |     |   jhfasdjfasdfj +----------+  |     |   asdfajhdfasfd               |     |   asdfasdfasdfasdfasfs        |     |   sadfasdfasdfasdfasas        |      I'd be interested in some solution, also considering some aspect I don't know about the `wrapfig` package. And... what about double sided documents (book class)?


title: Possible bug with \implies and \Longrightarrow -- there's a dot in the middle of it

text: I'm using TeXShop 2.43 on Mac OSX 10.6.8 and one of the latest LaTeX releases (I ran an update a few weeks back). My long implication arrows have a dot on either the top or bottom line (see attached photo). It happens with `\Longrightarrow`, `\implies`, and `\Longleftarrow`. The shorter arrows don't have it. It happens with all fonts sizes. Is this a known issue? I googled it and I looked for it here, but I came up with nothing. Perhaps it's something with my system or version of LaTeX? On TeXShop under Preferences - Typesetting it says the default script is PDFTeX. I'm sorry if I'm not supplying enough info here, I'm not very behind-the- scenes TeX savvy. ![enter image description here](http://i.stack.imgur.com/mEBwf.png)


title: Neper number into postscript code

text: I need to plot this function:               f(x)=e^(5,61+x/1000)      using `pst-plot`, where `e` is Euler's costant but I don't know how to write it in postscript code. Anyone knows how?


title: How can I draw a border around a title page?

text: I want to draw a red page border only on the title page and signature page of my thesis. How can I achieve this. I tried the `fancybox` package but it has some conflict with `fancyhdr` package and displayed some of the page headings out of place.


title: What do these cross-referencing and code macros mean?

text: I was searching around my editor and found some templates that I never used before and I was just wondering exactly what do they mean and do. Someone can edit the title is you have a better suggestion.               %%Definitions for Figure-References     \newcommand{\fig}[1]{(figure \ref{#1})}     \newcommand{\FIG}[1]{figure \ref{#1}}          %%Definitions for Table-References     \newcommand{\tab}[1]{(table \ref{#1})}     \newcommand{\TAB}[1]{table \ref{#1}}          %%Definitions for Page-References     \newcommand{\page}[1]{(page \pageref{#1})}     \newcommand{\PAGE}[1]{page \pageref{#1}}          %%Definitions for Code     \newcommand{\precode}[1]{\textbf{\footnotesize #1}}     \newcommand{\code}[1]{\texttt{\footnotesize #1}}


title: Increase textblock size in memoir document

text: I'm using the `memoir` document class to style my document. I'm using a two side layout. Now I simply want to increase the textblock width (in Figure 2.2 of documentation labeled with `\textwidth`). There are so many settings influencing this width and I'm a little bit lost how to start. I assume it is not enough to set `\textwidth` to a new value, right? Do I have to calculate all values manually? And if I have to calculate them, what are the best/correct scales to do that? When searching Tex SE, there are `pt`, `pb` etc. Thank you!


title: Incompatibility of caption and cleveref package

text: The following code produced a `TeX capacity exceeded` error               \documentclass{scrbook}     \usepackage{caption}     \usepackage{cleveref}     \begin{document}     \begin{figure}       Text       \label{fig:figures:1}     \end{figure}     \end{document}      If either caption or cleverref are not loaded the error does not happen. Versions are:               caption.sty    2011/11/10 v3.2e Customizing captions (AR)     cleveref.sty    2011/10/24{} v0.18{} Intelligent cross-referencing      I have contacted the authors of both packages, but if someone here can provide an intermediate solution I would appreciate it.


title: how to create a fully-expandable environment

text: I know `DeclareDocumentCommand` from the package `xparse`. I am wondering if there is a version for environment ? I could also imagine a trick based on :   * declare the environment with `DeclareDocumentEnvironment`   * then redefine the "begin" part of the environment with `DeclareExpandableDocumentCommand` How safe is it ? **EDIT1** The aim of this the following : i have a macro `\content` which i need to fully expand (in a `\edef`). Unfortunately, the replacement text of this macro contains several commands and environments. For example               \newcommand{\content}{blabla \textbf{text} blabla \othercommand[3]{text}    \begin{tabular} AA&BB\\CC&DD \end{tabular} blabla ...}      I just need to extract the arguments of each command and environment contained in `\content`. For this i redefine them, eg               \def\textbf#1{<bold>#1</bold>}      For the commands with optional parameters, I redefine them with `DeclareDocumentCommand`. But for environments, i don't knoy how to proceed.


title: How to format multiple algorithms so that they appear together

text: How can I have multiple algorithms be tied together so that they all appear next to each other. Currently LaTeX places the algorithms to far from each other.


title: Change position of glossary title

text: I am a total beginner with LaTeX and I can't find a way to solve the following problem. I have a glossary which I have printed in two columns by adding the code that I have included at the end. The problem is that the title of the glossary appears included in the first column. What I would like is that the title stays out, and the two column format begins after the title is printed. Is there an easy way to do this? Thank you very much for your help!               \documentclass[10pt,a4paper]{book}     \usepackage[hyperfirst=true,acronym]{glossaries}     \usepackage{multicol}          \let\glsaltpl\glsuseri     \let\glsing\glsuserii          %%Formatos para la lista de acrónimos     \newglossarystyle{EstiloGlosario}{%     \glossarystyle{listgroup}% Estilo base     %Estilo de las entradas: Entrada en negrita, descripcion normal     \renewcommand*{\glossaryentryfield}[5]{%     \item[]{\bf{\glstarget{##1}{##2}}}\;\;\;\relax     \space{\footnotesize ##3}% Description,     {,}     {\footnotesize ##5}     % Page list     \vspace{-0.2mm}% end of row     }%     %Cabecera con regla debajo de la letra inicial     \renewcommand*{\glsgroupheading}[1]{\setlength{\itemsep}{0mm}\item[{\:}{\:}{\Large        \glsgetgrouptitle{##1}}]\setlength{\itemsep}{-2.5mm}     \item[\rule{3cm}{0.02 cm}]\setlength{\itemsep}{-0mm}}     }          \makeglossaries     \begin{document}         \begin{multicols}{2}         \printglossary[type=main,style=EstiloGlosario]         \newpage         \end{multicols}              \newglossaryentry{ppm}{name=ppm,description={parts per million}} The units are expressed in \gls{ppm}.     \end{document}


title: Citation with Harvard as an argument throws error

text: I'm trying to include the source citation everytime I use an image in my thesis. I have a self-written command to ease that process (code at the end of the post):               \bild[citation]{label for refs}{file}{name of the image}{size in cm}      When I try to include citation as a \cite-command (using the harvard-package), latex throws following error:               <argument> \cite                       {ferstl_grundlagen_2008}     \equal #1#2#3->\TE@throw \def \@tempa {#1                                              }\def \@tempb {#2}\noexpand \ifx \@...          \NROrg@ifthenelse ...eval \the \toks@ \TE@endeval                                                        }\endgroup \@gtempa \expan...          \\bild ...-0.3cm\ifthenelse {\equal {#1}{\empty }}                                                        {\caption [{#4}]{#4}} {\c...     l.12 ...en/aufgabenstruktur}{Aufgabenstruktur}{12}          ?       The command I used was following:               \bild[\cite{ferstl_grundlagen_2008}]{aufgabenstruktur}{FeSi-Aufgaben/aufgabenstruktur}{Aufgabenstruktur}{12}      I think this is a problem of the harvard implementation of \cite, as I recently used this piece of code with the bibgerm-package, where it worked like a charm. What am I doing wrong here? Is there any easy way to fix this problem? Thanks in advance, Uli EDIT: Code of the \bild-macro:               \newcommand{\bild}[5][\empty]{%       \begin{figure}[htb]%         \begin{center}%           \includegraphics[width=#5cm]{images/#3}%           \vskip -0.3cm%         \ifthenelse{\equal{#1}{\empty}}             {\caption[{#4}]{#4}}                 {\caption[{#4} \newline \small{\textit{Quelle: #1}}]{#4}}%           \vskip -0,2cm%           \label{#2}%         \end{center}%       \end{figure}%     }      Used packages & document class:               \documentclass[a4paper, 12pt]{article}     \usepackage{german}     \usepackage[latin1]{inputenc}     \usepackage{fancyhdr}     \usepackage[T1]{fontenc}     \usepackage{ae}     \usepackage{listings}     \usepackage{color}     \usepackage{listings}     \usepackage{harvard}     \usepackage{wrapfig}     \usepackage{helvet}     \usepackage{txfonts}     \usepackage{geometry}     \usepackage{setspace}     \usepackage{hyperref}     \usepackage{sectsty}     \usepackage{acronym}     \usepackage{eurosym}


title: Define command that returns true/false (multiple conditions)

text: While using the `datatool`-package I encountered something strange. I have a loop, and each iteration it defines some variables that are later used by the command `\DTLforeach` from the `datatool`-package. The command has an optional argument, those are conditions which are different for each iteration and thus need to be declared using a command (instead of copying the table 14 times). I'll use the package `ifthen` instead of the `datatool`-package because it's more commonly used.               \documentclass{article}     \usepackage{ifthen}          \def\One{abc}     \def\Two{cde}          \def\condition{\equal{\One}{\One} \AND \equal{\Two}{\Two}}          \begin{document}          \ifthenelse{\condition}{% if condition returns true       True.     }{% if condition returns false       False.     }          \end{document}      This results in an error:               ! Undefined control sequence     <argument> \AND          l.11 \ifthenelse{\condition}                                 {% if condition returns true      However, it works if you copy-paste the contents of `\condition` into the first argument of `\ifthenelse`. Replacing `\AND` with its lowercase version `\and` doesn't work either. The error message just gets more complex, but it's still an undefined control sequence. A possible solution is to define 2 separate conditions. This is however not a preferred way of doing it because the number of conditions is not always limited to 2, I'll not always use `\AND`, I'd have to iterate through them inside the `\ifthenelse` (which I don't know if possible), and so on. Also, it would make the code less clear, so if there is a possible way of defining several conditions in one variable that would be great. (I also tried the `\setboolean`, but it only accepts the strings `true` or `false` and no real conditions)


title: Biblatex: Add comments only to one bibliography

text: I have to add two different bibliographies to my thesis: One commented, which adds the comments above the paper and consists of my own publications and one general in the end, which contains all publications cited. Using the `\AtEveryBibitem{\printfield{note}\clearfield{note}\item` command (from this thread), I can read out the `note` field from the `.bib` and get the comment to the place where I need to have it. The problem with this is, that my "standard" bibliography is build up from the records of the PubMed and contains notes for every entry. I don't want to display this notes in the normal bibliography, is there a way to show them in the "List of original publications" and suppress them in the normal bibliography? My MWE looks like this:               \documentclass{scrreprt}     \usepackage[bibstyle=authoryear, backend=bibtex8]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{jobname.bib}     @misc{A2011,       author = {Author, A.},       year = {2011},       title = {A short title.},       note = {Some information from the journal}          }     @misc{A2012,       author = {Buthor, B.},       year = {2012},       title = {Systems biology and personalized medicine are two emerging research areas, which promise to transform our health system.},       note = {This gives some additional information},       keywords = {test}     }     @misc{A2013,       author = {Cuthor, C.},       year = {2013},       title = {This title is short.},       note = {This is a comment to this article.},       keywords = {test}     }     @misc{C2000,       author = {Duthor, D.},       year = {2000},       title = {Title for this reference.},       note = {No further comment.}     }     \end{filecontents}     \addbibresource{jobname.bib}          %add the note field before each entry in the "Original Publications" bibliography     \AtEveryBibitem{\printfield{note}\clearfield{note}\item}           \begin{document}      \defbibnote{myprenote}{This thesis is based on the following original publications:}      %\begin{refsection}       \printbibliography[prenote=myprenote,title={List of original publications}, keyword=test]      %\end{refsection}           \section*{Test}       This is a chapter to \textcite{A2011} and also cite some other publications \parencite{A2012, A2013, C2000}            \printbibliography     \end{document}


title: I need a customized verbatim environment

text: I would need a verbatim environment with the following behaviour:   1. It is centered (left and right distance to the page edge should be equal).   2. It can be much wider than the regular text, almost using the whole page width. I know how to define my own environment, but not how to achieve these goals. And I have an additional (sub)question: 2a. What is the minimal margin I have to leave at the page edges?


title: Existing solution for biblatex

text: @daniel I did run `biber` and it does not show any mismatch in version @moewe. Here is the result. ![enter image description here](http://i.stack.imgur.com/epQ6u.jpg) Result of `\listfiles`: ![enter image description here](http://i.stack.imgur.com/wLOx6.jpg)               \documentclass[a4paper,12pt,twoside,openright]{report}     \usepackage{times}     \usepackage{setspace}     \usepackage[top=2.5cm,bottom=2.5cm,left=3.5cm,right=2.5cm,includefoot,asymmetric]{geometry}     \usepackage[centertags]{amsmath}     \usepackage{amssymb}     \usepackage[backend=biber,authordate]{biblatex-chicago}     \newpage     %input "XBib.bib"     %\setlinespacing{1.44}     %\bibliographystyle{chicago}.     \printbibliography     %\bibliography{XBib}     \end{document}      BIBLIOGRAPHY FILE               @article{glashow,       author       = {Glashow, Sheldon},       title        = {Partial Symmetries of Weak Interactions},       journaltitle = {Nucl.~Phys.},       date         = 1961,       volume       = 22,       pages        = {579-588},     }


title: How to use vlc as an `externalviewer' in Beamer?

text: I have generated an avi file with matlab and it turned out that QuickTime was not able to play it. VLC was able to play it. My objective is to include this avi file in my presentation using beamer. I'd prefer the avi to be embedded; if it is not possible, I'd like at least to play it externally. Hence, I wanted to use the `externalvierwer' vlc to play it. Here is the code I entered                    \movie[height=4cm,width=8cm,externalviewer]{}{example.avi}      When reading the pdf file in adobe reader 10.1.3, it only gives me the possibility to play the avi file by using                    QuickTime Player.app      It does not give me other possibilities such as vlc, or QuickTime Player 7.app which are installed and launched. So how can I play my avi file using vlc from acrobat reader?


title: File icon (folded corner rectangle) frame around text

text: I would like to present code listings with a "file icon box". Something like this: ![source code with "file icon box"](http://i.stack.imgur.com/KlvAH.png) I'm aware of listings package allowing rectangle frames. My interest is in the specific shape of the frame. I think it is not specific to source code. If it does not exist off-the-shelf, I'm not afraid of some coding to achieve this.


title: \bibunits errors in a twocolumn memoir

text: First, I am having trouble generating a MWE at this moment. I will continue to try get one set up. In the meantime, I am hoping someone will recognize the problem based on my description: I have a paper with two `bibunit` environments from the `bibunits` package. When I am writing and editing, I have the document prepared in `twocolumn` format, but I switch to a single column for my boss to review. Yesterday, both column counts worked fine. Today's draft, however, has errors when I try to compile with `twocolumn` enabled. The errors in the bu1.aux file:               You can't use `\spacefactor' in vertical mode \@     Missing $ inserted \@     You can't use `\spacefactor' in math mode \@      or in the .tex file at the line containing `\end{bibunit}`:               Extra }, or forgotten $ \end{bibunit}     Missing $ inserted \end{bibunit}     Missing } inserted \end{bibunit}      When I look at the error lines in bu1.aux, I see this:               \@LN@col{1}     \@LN@col{2}      I thought I'd fix it by flanking my `\end{bibunit}` command with `\makeatletter` and `\makeatother`, which indeed stopped the errors but resulted in my first citation in that bibunit having `LN@col2LN@col1LN@col2LN@col1` in front of it (in the output pdf). I'm out of ideas. If can get a MWE without having to post my paper, I will do so ASAP. EDIT: I figured out the problem was a conflict with the `lineno` package which numbers lines. Commenting out that packaged fixed the problem. _But_ I'd still like to know how to fix the conflict. I will still try to get an MWE if it helps people solve this problem.


title: ConTeXt manual ToC style

text: How can i replicate the table of contents style from the ConTeXt manual with ConTeXt? In particular, I like that page numbers are not aligned right und sections have no line breaks between them. Looking at the sources, i cannot figure out how to reproduce that.


title: Is pict2e a replacement for picture?

text: I'm confused by the role the `pict2e` package plays vis-a-vis the `picture` package. I used to believe that it is an enhanced replacement, but that's obviously not the case as the following example compiles with `picture` but not with `pict2e` in both, pdflatex and xelatex:               \documentclass[a5paper]{report}          \usepackage{picture}     \usepackage{eso-pic}          \usepackage{fp-basic}     \usepackage[cam,noinfo,center]{crop}          \usepackage{tikz}          \AddToShipoutPictureBG{%         \put(1cm,1cm){%             \tikz\node[rectangle, minimum height=2cm, minimum width=2cm, draw=black, fill=black] {};%         }%     }%          \begin{document}     Hello World!     \end{document}      Can someone please enlighten me?


title: Increase the spacing of rows in equations

text: I have a formula and I want to increase the space between the rows to make the reading easier.               \begin{equation}     \begin{flalign*}     \epsilon \bm{\Xi}_n & = M_\epsilon(\bm{x}_{\epsilon,n-1} )  - M(\bm{x}_{n-1})  = \\   &=M_\epsilon(\bm{x}_{\epsilon, n-1} )  - M(\bm{x}_{\epsilon, n-1} ) + M(\bm{x}_{\epsilon,n-1})-M^n(\bm{x}) =  \\     &=\epsilon \bm{\xi}_n + M( M(\bm{x}_{\epsilon, n-2} ) +\epsilon \bm{\xi}_{n-1})  - M^n(\bm{x}) = \\     &=\epsilon \bm{\xi}_n + \epsilon DM(\bm{x}_{n-1}) \bm{\xi}_{n-1}+ M^2\left( M(\bm{x}_{\epsilon, n-3} + \epsilon \xibf_{n-2} \right) -M^n(\bm{x})  + O(\epsilon^2) \\     & = \epsilon \bm{\xi}_n + \epsilon DM(\bm{x}_{n-1})\bm{\xi}_{n-1}+\epsilon DM^2( \bm{x}_{n-2}) \bm{\xi}_{n-2} +      M^3( \bm{x}_{\epsilon, n-3} )-M^n(\bm{x}).     \end{flalign*}     \end{equation}      I read this post Temporarily increase line spacing but there are a lot of different methods. Some of ones works only for text. I use the following packages:               \usepackage{ws-rotating}          \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{mathtools}


title: How to create multiple indices with imakeidx?

text: I want to create two indices with the package imakeidx, using the splitindex option:               \documentclass{scrartcl}          \usepackage[splitindex]{imakeidx}     \makeindex     \makeindex[name=foo,title=Test]          \begin{document}     Test1\index{Test1}     Test2\index[foo]{Test2}     \newpage     Test3\index{Test3}     Test4\index[foo]{Test4}          \printindex     \printindex[foo]     \end{document}      The result isan error message `Input index file foo-foo.idx not found`. Which seems quite irrtating, since `\jobname` is not `foo`. If I omit the `splitindex` option, the indices are created, but both now have the name `Test` and both include all indexes, regardless of the option to the `\index`-command. I use pdfLaTeX version 3.1415926-2.4-1.40.13 (TeX Live 2012) and version 1.2b of imakeidx.


title: Timeline with automatized hours and minutes

text: Some time ago I've asked a question about Timelines, many solutions were given, but in the end I decided to go with TikZ and also presented my solution. But I couldn't have done it without Torbjørn T.'s comment, where he suggested to make the creation of dates automatic, and this helped since I didn't need to type all of that myself and above all, it saved space in my Tex document. The solution was1:               \documentclass[10pt]{article}          \usepackage[a4paper, landscape]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{rotating}     \usepackage{pgfplots}     %\usepackage{changepage}     \usepackage{tikz}     \usetikzlibrary{arrows,backgrounds,snakes}          \begin{document}              \begin{tikzpicture}                 %draw horizontal line               \draw[|->, -latex] (0,0) -- (17,0);            \draw[-, dashed] (-1,0) -- (0,0);                 %draw years                 \foreach \x [evaluate=\x as \year using int(1790+\x*10)] in {0,1,...,17}{                       \draw (\x,0) node[below=7pt,anchor=east,xshift=0,rotate=45] {$\year$};                  }                 \draw[] (0,-0.1) -- (0,0.1);            \draw[] (1,-0.1) -- (1,0.1);            \draw[] (2,-0.1) -- (2,0.1);            \draw[] (3,-0.1) -- (3,0.1);            \draw[] (4,-0.1) -- (4,0.1);            \draw[] (5,-0.1) -- (5,0.1);            \draw[] (6,-0.1) -- (6,0.1);            \draw[] (7,-0.1) -- (7,0.1);            \draw[] (8,-0.1) -- (8,0.1);            \draw[] (9,-0.1) -- (9,0.1);            \draw[] (10,-0.1) -- (10,0.1);            \draw[] (11,-0.1) -- (11,0.1);            \draw[] (12,-0.1) -- (12,0.1);            \draw[] (13,-0.1) -- (13,0.1);            \draw[] (14,-0.1) -- (14,0.1);            \draw[] (15,-0.1) -- (15,0.1);            \draw[] (16,-0.1) -- (16,0.1);             \end{tikzpicture}          \end{document}      The result was: ![screenshot](http://i.stack.imgur.com/ioMVa.png) ... And it continues (too long to fit here). Now I want to recreate this but with hours and minutes, so that at the bottom of the line I can see `00:00` then `01:00` and so on. This could be indefinite, as I have the intention of making a long horizontal document (not going to be printed, only digital use so no problem). I have tried tweaking that code and searching this site but to no avail. How should I go about it? Is the code good for years but not for time as I want it? I really don't know where to start. * * * 1: This is actually a minimal working example. I'm referring to the lines reported in the comment.


title: datatool and pgfmath option

text: Compiling this file               \documentclass{article}     %\usepackage[math=fp]{datatool}     \usepackage[math=pgfmath]{datatool}          \DTLloaddb{scores}{sample-student-records.csv} % http://www.ctan.org/tex-archive/macros/latex/contrib/datatool/samples          \begin{document}          \DTLmeanforcolumn{scores}{Assignment 1}{\averagescore}%     \averagescore\%.          \end{document}      I get               ...           ! Missing number, treated as zero.     <to be read again>                     p     l.11 ...olumn{scores}{Assignment 1}{\averagescore}                                                       %     ! Undefined control sequence.     <argument> ...@tmpcpz 0}\let \@dtl@chopzeroesnext                                                        =\@dtl@gobbletonil "     l.11 ...olumn{scores}{Assignment 1}{\averagescore}                                                       %     ! Argument of \@dtl@gobbletonil has an extra }.     <inserted text>                      \par      l.11 ...olumn{scores}{Assignment 1}{\averagescore}                                                       %     Runaway argument?          ...      but if I use the option `math=fp` everything is fine.


title: xcolor black isn't black enough

text: I'm making a poster (using baposter) where I wish to include some microscopy images. To make the fluorescent signals stand out better, I changed the background of that cell to "pitchblack", which I have defined as               \definecolor{pitchblack}{cmyk}{0,0,0,1}      I've also tried this with               \definecolor{pitchblack}{rgb}{0,0,0}      However, with my microscopy images in the foreground, I find out that "black" isn't really black: ![enter image description here](http://i.stack.imgur.com/jP6Zl.jpg) The `baposter`class brings `xcolor` and `tikz` along for the ride, so I'm assuming my color issue is with those packages. So my question is, how I can make the "black" of the background frame black enough to match the background of these images? Full code of the frame:               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \headerbox{Preliminary Images}{name=prelim,column=2,row=0,boxColorOne=pitchblack}{     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{center}     \renewcommand{\arraystretch}{0}     \begin{tabular}{@{}c@{}c@{}c@{}}     \raisebox{-2ex}{     \parbox[t]{0.25\textwidth}{\scriptsize\color{white} Representative volume renderings of HeLa cells imaged using TALEs     against the $\beta$-globin locus. Signals are approximately 0.3$\mu$m     in diameter.}} &     \imagetop{\includegraphics[width=0.3\textwidth]{dataimages/5_02_volume_view.jpg}} &      \imagetop{\includegraphics[width=0.3\textwidth]{dataimages/5_04_volume_view.jpg}} \\      \imagetop{\includegraphics[width=0.3\textwidth]{dataimages/5_05_volume_view.jpg}} &      \imagetop{\includegraphics[width=0.3\textwidth]{dataimages/5_07_volume_view.jpg}} &      \imagetop{\includegraphics[width=0.3\textwidth]{dataimages/5_10_volume_view.jpg}}     \end{tabular}     \end{center}     }      As a final note, the problem appears to be independent of the pdf viewer (i.e. it looks this way in evince,acroread,and gimp).


title: Page numbering at wrong place

text: I am quite new to TeX. I'm writing my thesis and I want to place the page numbers at bottom left for even pages and bottom right for odd pages. I've done this and it works for even pages, but the odd ones have the page number at the center. Any idea what I'm doing wrong?               \documentclass[11pt, twoside]{book}     \usepackage{geometry, amsmath, float, fancyhdr, standalone}     \geometry{a4paper}     \usepackage[parfill]{parskip}     \pagestyle{fancy}     \fancyhf{}     \fancyfoot[LE,RO]{\thepage}


title: Equation reference undefined when using \cref and package{amsmath}

text: When I attempt to reference an equation using `\cref{..}` while also using the package amsmath the references appear as `??` in the outputted pdf. For example               \documentclass[]{article}     \usepackage{graphicx}     \usepackage{cleveref} %for cref     \usepackage{amsmath} %for sub equation numbers and words within equations (\text)          \begin{document}               \section{Introduction}              \begin{equation}\label{eq:solve}         x^2 - 5 x + 6 = 0          \end{equation}                   Ref: \ref{eq:solve}              CRef: \cref{eq:solve}          \end{document}      I get the output: ![enter image description here](http://i.stack.imgur.com/hBn2K.png) However if the `\usepackage{amsmath}` is commented out the `\cref` works correctly. ![enter image description here](http://i.stack.imgur.com/ng317.png) Is it possible to use both together successfully?


title: Macro \verb inside tabu environment

text: I would like to use the `\verb` command inside of a `tabu` enviroment. Here is my example               \documentclass{article}          \usepackage{tabu}          \begin{document}          \begin{tabu}{lll}     a & \verb+\wedge+ & b\\     c & d & e     \end{tabu}          \end{document}      I get the following compiler error: > `! Missing $ inserted`. Is it possible to use inline listings within a `tabu` enviroment?


title: Dealing with Large Tables/Figures in The "Narrow" Documentclass Book

text: ![Formula protruding outside a paragraph](http://i.stack.imgur.com/62qRK.png) I am writing a document that involves several lengthy mathematical expressions, tables that have to be adjacent, and large algorithms. The documentclass in use is 'book'. Despite the many attempts to alter the margins using the the 'geometry' package, I am unable to arrive at a universal solution for the entire document. Either I find a scattered text with unfavorable white-spaces, an equation protruding outside a paragraph, or an improperly positioned table(s)/figure(s)/algorithm. I have already tried commands like               \newgeometry{margin = 2cm}     % Some text/figure goes here     \restoregeometry      Here is a minimum working example:               \documentclass[11pt]{book}     \usepackage[utf8]{inputenc}     \usepackage{lipsum}     \usepackage[table]{xcolor}  % Modern color package (used for text and tables)          \begin{document}     \chapter{Introduction}     \lipsum          \begin{table}[H]     \begin{center}     \begin{tabular}{|c|c|c|c|c|c|}      \hline      1 & 2 & 3 & 4 & 5 & 6 \\      \hline      7 & 8 & 9 & 10 & 11 & 12 \\      \hline      13 & 14 & 15 & 16 & 17 & 18 \\      \hline      19 & 20 & 21 & 22 & 23 & \cellcolor{green!25}24 \\      \hline      25 & 26 & 27 & 28 & 29 & 30 \\      \hline      31 & 32 & 33 & 34 & 35 & 36\\      \hline     \end{tabular}     $\Longrightarrow$     \begin{tabular}{|c|c|c|c|c|c|}      \hline      1 & 2 & 3 & $2 \cdot 2$ & 5 & $2 \cdot 3$ \\      \hline      7 & $2 \cdot 2 \cdot 2$ & $3 \cdot 3$ & $2 \cdot 5$ & 11 & $2 \cdot 2 \cdot 3$ \\      \hline      13 & $2 \cdot 7$ & $3 \cdot 5$ & $2 \cdot 2 \cdot 2 \cdot 2$ & 17 & $2 \cdot 3 \cdot 3$ \\      \hline      19 & $2 \cdot 2 \cdot 5$ & $3 \cdot 7$ & $2 \cdot 11$ & 23 & \cellcolor{green!25} $2 \cdot 2 \cdot 2 \cdot 3$ \\      \hline      25 & $2 \cdot 13$ & $3 \cdot 9$ & $2 \cdot 2 \cdot 7$ & 29 & $2 \cdot 3 \cdot 5$ \\      \hline      31 & $2 \cdot 2 \cdot 2 \cdot 4$ & $3 \cdot 11$ & $2 \cdot 17$ & 35 & $2 \cdot 2 \cdot 2 \cdot 3 \cdot 3$\\      \hline      \end{tabular} \par     \bigskip     \caption{Example of factoring using sieving by $p = 2$ three times, then by $p = 3$.\label{Table:FactoringBySieving}}      \end{center}     \end{table}          \section{Historical background}          \lipsum          \end{document}      Any suggestions?


title: Avoiding \bibentry to be shown in regular \bibliography, using natbib

text: In an earlier question - bibentry in documents body \- I was looking for a possibility to have `\bibitems` appear in in my documents body. This was solved using the `bibentry` package. As a follow-up I would now like to have the `\bibitem` appear in the body _only_ , and not in the regular reference list in the end at all. Is it possible to define something like a `\bibentry*` that prevents the entry from being shown? Or any other way to get what I want? I cannot get around using natbib...


title: Shaped pdf page

text: I don't think this is possible but, is the PDF format able to stand shaped pages? The idea is to produce documents giving a _reading experience_ like this one's: ![enter image description here](http://i.stack.imgur.com/iG1Vi.jpg) but to bee seen on a screen. Should I give up and settle with a black mask around the content?


title: Drawing rays in tikz

text: Is there a way to draw rays using TikZ? By ray I mean a line that has a defined starting point but no defined end. So I would like to draw a straight line, that starts at point A, crosses point B and has a lenght of l. Is this possible?


title: Aligning and centering a lstlisting with two columns on a page

text: Consider the following code taken from here to produce a fancy listing :               % PACKAGES     \documentclass[11pt,a4paper]{book}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}     \usepackage{lmodern}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{xcolor}     \usepackage{tcolorbox}     \tcbuselibrary{skins,listings}     \definecolor{nicedarkgreen}{RGB}{0,127,0}     \definecolor{nicedarkblue}{RGB}{0, 0, 102}          % LISTINGS     \newtcblisting{cpplisting}[1][]{%       enhanced,       arc = 0pt,       outer arc = 0pt,       colback = blue!5,       colframe = nicedarkblue,       listing only,       fonttitle = \bfseries,       listing options = {%         basicstyle=\tiny\ttfamily,         keywordstyle=\color{blue},         language = C++,         commentstyle=\color{nicedarkgreen},         tabsize=2,         morekeywords={constexpr},         multicols = 2,         numbers = left,         xleftmargin = 0.5em,         showstringspaces = false,       },       overlay = {%         \fill[gray!30]            (interior.north west)           rectangle            ([xshift = 1.25em]interior.south west);         \fill[gray!30]            ([xshift = -1em]interior.north)           rectangle            ([xshift = 0.25em]interior.south);         \draw[ultra thick, nicedarkblue]           ([xshift = -1em]interior.north) --            ([xshift = -1em]interior.south);        }       /utils/exec = {%         \def\thelstnumber{%           \texttt{\csname two@digits\endcsname{\the\value{lstnumber}}}}},       title = {\centering\ttfamily #1}     }          % TEST     \begin{document}     \lipsum[1]     \begin{cpplisting}[An example of C++ file]     // Include     #include <iostream>          // Example     int main()     {         std::cout<<"Hello World"<<std::endl;         std::cout<<"This is just an example"<<std::endl;         std::cout<<"With two columns"<<std::endl;         return 0;     }     \end{cpplisting}     \end{document}      ![listing_result](http://i.stack.imgur.com/gCype.png) With :   * **alpha** : one-column text width   * **beta** : first column width   * **gamma** : second column width   * **mu** : number column width   * **nu** : distance between numbers and text   * **sigma** : **mu+nu**   * **phi** : distance between title and first line   * **psi** : distance after last line It looks great ... but the alignment is not and it causing me headaches... Instead of the current result, I want :   * **beta = gamma** : same total column width (so the blue line in the middle will correspond to the middle of the page)   * **mu** : to be adjusted to contains 3 digits (and when a number is three digit-long I want it to be centered on **mu** )   * **phi = psi** : same top and bottom margin To know exactly the logic, it would be great if all of that would be achievable programmatically using :               \newlength{...}     \setlength{...}{...}      or something similar. How to achieve this ?


title: Bold and italic subsection title with custom font size

text: I have defined fontsize, and even with your answered question help I solved the situation in this way:               \usepackage{titlesec}          \titleformat{\chapter}                 {\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}          \titleformat{\section}                 {\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}          \titleformat{\subsection}                 {\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesubsection}{1em}{}      Now i have to add only to the subsection an italic style .How can I do?? Thank you so much for your attention and your precious help!


title: Problem with fraction

text: I have a problem with the appearance of a fraction which has in its numerator another fraction. It is not very beautiful as the second fraction is small, even though I use `\displaystyle`. How can I have both fraction as big as they should be? And why this is happening even though I use `\displaystyle`? Thanks! The code I use is like this:               $\displaystyle \frac{\frac{a}{b}-c}{d}$


title: Can spaces at the beginning of a line ever cause problems?

text: To structure my sourcecode, I often use spaces for padding:               \newcommand{\st}[1]{%       \begin{tabular}{lr}         \emph{Student} & \emph{Score}\\         #1       \end{tabular}%     }      Can this ever cause problems? Like putting no `%` at the end some lines.


title: Is there anyway to put Existing Text in Math Mode with Texmaker

text: There is provision to make existing text bold by simply selecting the text and pressing `CTRL+B`. There is a keyboard shortcut of `CTRL+ALT+M`, but instead of putting existing content in Math mode, it erases the highlighted content and creates a place holder for the writing contents in Math mode. I was wondering, does a keyboard shortcut exist to achieve what I want?


title: Alignement in columns and spacing between columns of an equations environment

text: (Too) Long ago, I had some problems with some equation. I wanted them to look like this ![enter image description here](http://i.stack.imgur.com/Lv89M.jpg) (this is how they looked in LyX), but when compiled they looked like this: ![enter image description here](http://i.stack.imgur.com/a1KaT.jpg). What botheres me compared to how it looks in LyX is that   1. way too much spacing between the columns is used in the compiled version.    2. there isn't a space after the "="   3. the last column is aligned to the right (not to the left, as I wanted it to be). Because only now I found time, to post this question here, I unfortunately don't remember the name of the environment used for this (I only kept the screenshots). But I remember that I tried out all of the AMS environments( align, alignat etc.) as well as the `eqnarray` environment and not a single one provided me with an output that looks like the one in LyX. Has anyone an idea how I could get LaTeX make these (test)equations look like the LyX screenshot ?


title: How to append code to a section?

text: In my `scrartcl` document I want to change the spacing between sections and the first paragraph. Since I am using the `parskip` package, the parskip is set to a non-zero value. The `\section` command uses `\parskip` as well, but I want to remove that. This could be achieved with the following code:               \section{Introduction}     \vskip-\parskip      This works perfectly fine. How can I append that code to the `\section` command in LaTeX without redefining all the rest? There is the etoolbox with commands like `\appto`, but applying it as follows results only into errors:               \appto{\section}{\vskip-\parskip}      I guess because `\section` takes arguments, what would be right command or is there an alternative solution?


title: Sorting the nomenclature description

text: I am using nomencl package to prepare the nomenclature for my thesis. In that, the package sorts the symbols as shown in Figure. ![symbol_sorted](http://i.stack.imgur.com/4LvRF.jpg) But I want the desription of the symbols in Right hand side to be sorted in alphabetical order without using prefix option as shown in Figure. ![Desription_sorted](http://i.stack.imgur.com/5k2ZL.jpg) using of prefix option work consumes lot of time and manual effort. Kindly suggest solution. **MWE code:**               \documentclass[a4paper]{report}     \usepackage{nomencl}     \makenomenclature     \begin{document}     \nomenclature{$\omega$}{Absolute Frequency}     \nomenclature{HOA}{Acetic acid}     \nomenclature{Al}{Aluminium}     \nomenclature{ASTM}{American Standard Testing Machine}     \printnomenclature     \nocite{*}     \bibliographystyle{thesis}     \bibliography{refpapers}     \end{document}


title: End quotes and punctuation when using biblatex

text: This seems like a rudimentary question but I haven't been able to find a clear answer. The cultural context in question is American English. When putting citations in footnotes in biblatex (I'm using `biblatex- chicago`), the rule I've been following is to put the citation commands where they would go if the citation were parenthetical: after the end quote and before the final punctuation mark. The end result, however, has the punctuation mark after the quote, e.g. "this is my quote".1 The correct punctuation should be "this is my quote."1 How can this be accomplished automatically? Here is an example document:               \documentclass[]{article}      \usepackage[]{setspace}      \usepackage[utf8]{inputenc}      \usepackage[american]{babel}      \usepackage[]{csquotes}      \usepackage[backend=biber,bibencoding=utf8]{biblatex}     \usepackage[]{hyperref}      \bibliography{mybib}      \begin{document} ``This is a quote''\autocite[1]{mysource}.      \end{document}


title: Opposite product signs in the sense that black and white are interchanged

text: In a special algebra I use with `amssymb` the products               \newcommand{\bDiamond}{\mathbin{\Diamond}}     \newcommand{\bLozenge}{\mathbin{\blacklozenge}}     \newcommand{\bCircledast}{\mathbin{\circledast}}     \newcommand{\bOdot}{\mathbin{\odot}}      See also the two earlier answered questions sign for multiple $\Diamond$-product and Filled \Diamond-product sign. The two product signs `\bDiamond` and `\bLozenge` are opposite or partners in the sense that black and white are interchanged. Now I would like to have   * a partner sign for `\bCircledast`, i.e. a white asterisk on a black disk (the shape should be the same as `\bCircledast`) and   * a partner sign for `\bOdot`, i.e. a white dot on a black disk (the shape should be the same as `\bOdot`) Thanks in advance for your help!


title: Option clash for package geometry

text: I am writing a document in which I wish to switch to landscape part way through. I thought I could use the line `\usepackage[a4paper,landscape]{geometry}` to accomplish this but I get an error. I suspect that this is due to apa6e. Is there a workaround for this that still allows me to use `apace` and have portrait and landscape in the same document?               \documentclass[leavefloats]{apa6e}     \usepackage[american]{babel}     \usepackage{csquotes}          \usepackage[a4paper,landscape]{geometry}          \abstract{This is an example of of an abstract in APA.  }     \begin{document}     \title{A Template for APA Papers}     \shorttitle{APA: A Template}     \author{John}     \authornote{\dots}     \date{\today} % or \date{24Jan11} for example     \maketitle     \end{document}


title: Issue with Springer spbasic

text: I'm using natbib for an article to be published in a Springer journal. These are their official TeX/bibtex styles, which include a tex template and some bibtex/natbib styles. If I use `[smallextended]{svjour3}` and the `spbasic.bst` style file, adding `natbib` to the header of the file, I get entries without dots after pp and the authors' initials: > Chevalier J, Mayzlin D (2006) The Effect of Word of Mouth on Sales: Online > Book Reviews. Journal of Marketing Research pp 345–354 Instead of > Chevalier J., Mayzlin D. (2006) The Effect of Word of Mouth on Sales: Online > Book Reviews. Journal of Marketing Research, pp. 345–354. Similarly, I get `et al` in the text instead of `et al.`. This happens even with a minimal example, adding one entry to the official template.tex. If I don't add `natbib` to the .tex file, I get even worse results, such as: > [Chevalier and Mayzlin(2006)] Chevalier J, Mayzlin D (2006) The Effect of > Word of Mouth on Sales: Online Book Reviews. Journal of Marketing Research > pp 345–354 I've seen this issue before, but I can't track it down. I'm sure it happens to other authors too. Any idea?


title: Indent first paragraph after section and don't indent new lines!

text: I would like to indent the first paragraph after a new section, but I don't want indent new lines.... I know indentfirst and parskip packages but they don't work together! I would like to combine the features of both, but parskip overrides indentfirst.... Thank you in advance! * * * Here it is a code example:               \documentclass[a4paper, oneside]{report}     \usepackage{indentfirst}     \begin{document}     %This is going to indent (ok):          This life, which had been the tomb of his virtue and of his honour, is but a walking shadow; a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing.          %This is going to indent (bad):          This life, which had been the tomb of his virtue and of his honour, is but a walking shadow; a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing.     \end{document}                         \documentclass[a4paper, oneside]{report}     \usepackage{parskip}     \begin{document}     %This is not going to indent (bad):     This life, which had been the tomb of his virtue and of his honour, is but a walking shadow; a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing.          %This is not going to indent (ok):          This life, which had been the tomb of his virtue and of his honour, is but a walking shadow; a poor player, that struts and frets his hour upon the stage, and then is heard no more: it is a tale told by an idiot, full of sound and fury, signifying nothing.     \end{document}


title: Equation with note and tag

text: Given the following set of equations as an example:               `...     \begin{align}         x &= y^2 + 3 \\         y + 3 &= 11     \end{align}`      The equations will be center aligned with respect to the "=" sign and tagged on the left with equation numbers. Is there a way I can add a note to the side of one of the equations without affecting the positioning of the equations (i.e. not shifting the group of equations upon insertion of the note)? I've tried '{flalign}', but the group of equations shifts upon addition of the note. I've tried to find a way to add an additional tag on the right, but have come up empty. I've used '\qquad', but that, too, shifts the group of equations. Here is the reason: aesthetics. If I have two groups of equations that are centered (using gather or similar), the group of equations that includes the note will be shifted from the other groups of equations. I just think this looks sloppy... call me picky. Example output:               (left)         (center)           (right)     (1)            xyz = abc     (2)            abc = xyz     {next math group}     (3)            cba = abc     (4)            yzx = cba        some text      Thanks in advance.


title: How to use empheq with unicode-math?

text: I tried to change the engine from `pdfLaTeX` to `XeLaTeX`, but I can't compile a simple project:               \documentclass[10pt]{article}          \usepackage{polyglossia}         \setdefaultlanguage{english}          \usepackage{unicode-math}     \usepackage{fontspec}     \setmainfont[         Ligatures=TeX,         Extension=.otf,         UprightFont= *-regular,         BoldFont=*-bold,         ItalicFont=*-italic,         BoldItalicFont=*-bolditalic]{texgyrepagella}     \setmathfont[Extension=.otf]{texgyrepagella-math}          \usepackage{empheq}          \author{}     \title{}     \date{}          \begin{document}         \maketitle     \end{document}      But it produces error:               Command \dddot already defined. \hbox{\normalfont ...}\vss}}}}     Command \ddddot already defined. \hbox{\normalfont....}\vss}}}}     Extended mathchar used as mathchar (4203026) \mathchardef\std@minus\mathcode`\-\relax     Command \overleftrightarrow already defined. ...palette{\overarrow@\leftrightarrowfill@}}     Command \underrightarrow already defined. ...athpalette{\underarrow@\rightarrowfill@}}     Command \underleftarrow already defined. \mathpalette{\underarrow@\leftarrowfill@}}     Command \underleftrightarrow already defined. ...alette{\underarrow@\leftrightarrowfill@}}


title: Changing options based on generated document length

text: I am creating lots of letters using the `scrlttr2` package and some variables that change per letter. The contents of these variables might cause the letter to take up an additional page that I would like to avoid. For example, some people have addresses that take up more lines than others, but there are other variables that can cause this to happen as well. When I have room, I want to set `\KOMAoptions{parskip=full}` because it looks nicer, but if I'm out of space I would like to set `\KOMAoptions{parindent}`. Is there a good way to do this automatically? Here are some options I thought of:   1. Define a command with the body of the letter. Use `\KOMAoptions{parskip=full}` and `\savebox` with the address and the body command to get its height. If the height is over a certain amount, then set `\KOMAoptions{parindent}`. Then use the body command again to output the actual letter. I'm not sure how to get the height and switch on it, and defining the whole letter and its included environments in a single command sounds clunky.   2. Make two versions of the document. In my Makefile, somehow identify the length in pages (how?) of the `parskip` version and substitute the `parindent` version if necessary   3. Just set another variable to define this, and set it manually for each letter (this is what I am doing now). Other ideas welcome.


title: Tikz: question about arrow tips color and width of paths

text: 1. Why 4-6, 4-7, 7-5 get these colorings? More precisely, what is the difference between [draw=green, fill=green] to [color=green]?   2. Why the 4-5 arc has a slightly bigger width that 7-6? You can see a faint black outerline in the 4-5 arc. This is a minimal example with my questions:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows, positioning, trees, mindmap, calc}     \begin{document}     \begin{tikzpicture}          \tikzset{every node/.style={minimum size=5pt, inner sep=0pt, outer sep=0pt, node distance=25pt}}     \tikzset{black circle/.style={every node, shape=circle, draw=black, fill=black, text=white}}     \tikzset{thick edge/.style={-, black, fill=none, thick, text=black}}     \tikzset{thick arc/.style={->, black, fill=none, thick, >=stealth, text=black}}          \node[black circle] (4) {4};     \node[black circle, below=of 4] (5) {5};     \node[black circle, right=of 5] (6) {6};     \node[black circle, above=of 6] (7) {7};          \draw[thick arc] (4) -- (5);     \draw[thick arc, green] (7) -- (6);     \draw[thick arc, color=green] (4) -- (6);          \draw[thick arc, draw=green] (7) -- (5);          \draw[thick arc, draw=green, fill=green] (4) -- (7);          \draw[thick arc, green] (4) -- (5);          \end{tikzpicture}     \end{document}      ![](http://i.stack.imgur.com/5t5m7.png)