title: Several errors concerning lstlisting

text:
In my Bachelor Thesis I'm using highlighted code using `lstlisting`, which comes with the listingspackage. Unfortunately I'm getting some errors and I cannot figure out why they appear. Especially because the output is as expected. Highlighting, caption and refering are working fine in the resulted pdf. Here is my minimum working example:               \documentclass{article}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[super, comma, numbers, square, sort]{natbib}     \usepackage{listings}     \usepackage{color}       \usepackage[svgnames]{xcolor}     \usepackage{caption}     \definecolor{sh_comment}{rgb}{0.12, 0.38, 0.18 } %adjusted, in Eclipse: {0.25, 0.42, 0.30 } = #3F6A4D     \definecolor{sh_keyword}{rgb}{0.37, 0.08, 0.25}  % #5F1441     \definecolor{sh_string}{rgb}{0.06, 0.10, 0.98} % #101AF9     \newcommand{\lstJava}[1]{\lstinline[language=Java,breaklines=true,basicstyle= \listingsfontinline]$#1$}          \begin{document}          % define some fancy Code formatting according to the Java Eclipse formatting     \lstset {         frame=single,         rulesepcolor=\color{black},         showspaces=false,showtabs=false,tabsize=2,         numberstyle=\tiny,numbers=left,         basicstyle= \listingsfont,         stringstyle=\color{sh_string},         keywordstyle = \color{sh_keyword}\bfseries,         commentstyle=\color{sh_comment}\itshape,         captionpos=b,         xleftmargin= -2.0cm, xrightmargin=0.5cm,         lineskip=-0.3em,         escapebegin={\lstsmallmath}, escapeend={\lstsmallmathend},         linewidth=1.25\textwidth     }          \begin{minipage}{\textwidth}         \captionsetup{width=1.25\textwidth}         \lstdefinelanguage{XML}         { % adjust the formatting for XML files           morestring=[b]",           morestring=[s]{>}{<},           morecomment=[s]{<?}{?>},           stringstyle=\color{sh_string},           identifierstyle=\color{sh_comment},           keywordstyle=\color{sh_keyword},           morekeywords={xmlns,version,type, servlet, display, name, xsi, web, app, class, init, param, value, schemaLocation, load, on, startup, mapping, url, pattern, id} % list custom attributes         }         % Here the 1st and 2nd error will appear (line 47)         \begin{lstlisting}[language=XML, caption={xml: Definition of available GET Methods for Java}, label={Jersey}]          <?xml version="1.0" encoding="UTF-8"?>     <web-app xmlns:     "foo"     </web-app>         \end{lstlisting}     \end{minipage}          Refering Listing \ref{Jersey} on Page \pageref{Jersey}. \\          Refering Listing \ref{lst:Jersey_Hello_java} on Page \pageref{lst:Jersey_Hello_java}.           \begin{minipage}{\textwidth}         \captionsetup{width=1.25\textwidth}         % here the 3rd error will appear (line 63)         \begin{lstlisting}[language=Java, caption={Hello.java: Definition der verfügbaren GET Methoden der REST-Schnittstelle mit Jersey für Java}, label={lst:Jersey_Hello_java}]     System.out.println("Hello World");         \end{lstlisting}     \end{minipage}          Refering Listing \ref{lst:Jersey_Test_java}. Refering \ref{lst:Jersey_Test_Ausgabe} on page \pageref{lst:Jersey_Test_Ausgabe}.          \begin{minipage}{\textwidth}         \captionsetup{width=1.25\textwidth}         % here the 4th error will appear (line 73)         \begin{lstlisting}[language=Java, caption={Test.java: Implementierung eines einfachen Jersey Klienten zum Abfragen der Ressource über Volltext, XML und HTML.}, label={lst:Jersey_Test_java}]     System.out.println("Hello World");         \end{lstlisting}     \end{minipage}          \begin{minipage}{\textwidth}         \captionsetup{width=1.25\textwidth}         % here the last error will appear (line 81)         \begin{lstlisting}[language=Java, caption={Konsolen-Ausgabe bei Ausführung von Test.java.}, label={lst:Jersey_Test_Ausgabe}]     Hello World     <?xml version="1.0"?><hello> Hello World</hello>     <title>Hello World</title>
Hello World
         \end{lstlisting}     \end{minipage}          \end{document}      When compiling (if that matters: I'm using the editor sublime text) LaTeX will throw the errors:               There were errors in your LaTeX source          ./test.tex:47: Package Listings Error: Illegal type `s'. [...ble GET Methods for Java}, label={Jersey}]]     ./test.tex:47: Undefined control sequence. [...ble GET Methods for Java}, label={Jersey}]]     ./test.tex:63: Undefined control sequence. [...für Java}, label={lst:Jersey_Hello_java}]]     ./test.tex:73: Undefined control sequence. [... und HTML.}, label={lst:Jersey_Test_java}]]     ./test.tex:81: Undefined control sequence. [...t.java.}, label={lst:Jersey_Test_Ausgabe}]]


title: Texmaker on Mac is lagging

text: So since yesterday, I've had this problem: When I'm typing in my .tex file, suddenly, Texmaker has become very laggy. Both with typing and with selecting text. So I've tried restarting, that didn't help. I thought that maybe my document was too big (even though it is only 68 lines), so, I tried opening a smaller document (only 20 lines), and it too was laggy when typing. I opened a new document, and it seemed fine, until it too got laggy after typing for 3 seconds. Even with complete gibberish (just a few random letters on each line), and without turning it into a file or even naming and saving it, it didn't remove the lag. But: I just downloaded a random file of 173 lines, including ones containing entire paragraphs, and it works fine.. No lag whatsoever. Any idea as to what might be my problem?


title: Lyx document format with "subheader"

text: I am using an article class in a lyx to produce following format ## Company Mr XYZ * * * Client name age <------- "repeated on every page"   Address Contents * * * footer I donot want to include repeatative "subheader" in preamble. How can I do it? * * * * * * MWE * * *               %% LyX 2.0.1 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \newcommand{\lyxaddress}[1]{     \par {\raggedright #1     \vspace{1.4em}     \noindent\par}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead[LO]{Left header, company name}     \fancyhead[RO]{right heade \\ Mr XYZ}     \fancyfoot{Address}          \makeatother          \usepackage{babel}     \begin{document}     \thispagestyle{fancy}               \lyxaddress{I want this\\     CLIENT'S address to be\\     repeated on each page,\\     }          These are my conditions.      \begin{itemize}     \item I donot want to do this with latex editor. I want to use lyx     \item I am exporting latex file because I do not know how to upload lyx     here     \item I do not like my user to use ``preamble'' on lyx as they may change     it by mistake. That is, I want to write the address on lyx frontend,     but the code to make it repeat on each page can be there in the preamble\@.      \item Thanks and regard\end{itemize}          \end{document}


title: Globally change the font size in EPS figures (when using pdfLaTeX with pstool)

text: I have a document where float environments are typeset with \small font (tables, figures). For the tables and most environments in general, this works nicely with               \AtBeginEnvironment{tabular}{\small}      thanks to the etoolbox package. However, it does not work for figures of the form               \begin{figure}     \psfragfig{path/to/some/figure}     \end{figure}      This is because I compile the document using pdfLaTeX and the pstool package. (What pstool does is to create an empty temporary document with only the EPS figure placed on the page without any figure environment. Then, this document is processed in multiple steps, until finally, a PDF file is produced, which is in turn then included as figure in my PDF document.) So my question is: Is there a way to globally define the font size used in psfrag replacements without having to change the individual replacements? For clarification, I do _not_ want to do this:               \psfrag{marker}{\small replacement text}      I thought of somehow changing or inserting the figure environment into the temporary document by modifying one of pstool's macros or modifying the psfrag macro somehow, but I do not know enough about LaTeX to do it that way.


title: Enumerate subsection, but don't print at TOC

text: what I try to achieve is the following: I want all subsections in the appendix have 'normal' numbers (as they currently have), but I don't want them to be displayed in the TOC. When using \subsection*{}, they are not displayed in the TOC but neither have they numbers... Further, if possible: It would though still be nice if they are included in the TOC of the PDF-Viewer (in contrast to the TOC which is really 'printed') Thanks! **EDIT** : Can't get your suggestion to work Tobi:               \documentclass{book}     \begin{document}     \tableofcontents          \chapter{bla}     \section{blipp}     \subsection{blupp}          \setcounter{secnumdepth}{2}% number \part and \chapter in book classes     \addtocounter{tocdepth}{-1}% “delete” lowest level from TOC      \appendix     \chapter{appch}     \section{secasdasd}     \subsection{asd}     \section{secasdfasd}     \end{document}      **EDIT2** : @Gonzalo: Since I was asking for a working example for subsectioning, I just modified your _WORKING_ Example for this purpose:               \documentclass{book}     \usepackage{tocvsec2}     \usepackage[bookmarksdepth=subsection]{hyperref}          \begin{document}     \tableofcontents     \chapter{Test chapter}     \section{Test section one}     \subsection{Test subsection one}          \appendix     \chapter{Test Appendix}     \settocdepth{section}     \section{Test section one}     \subsection{Test subsection one}     \section{Test section one}     \subsection{Test subsection one}     \end{document}      Thanks for providing it!


title: binary representation of an integer

text: Is there a way to get a binary string of an integer calculated by e.g., `\pgfmathparse{pow(2,3)} \pgfmathresult` such that later on I can use the string digits in a foreach loop like .. if it is '1' do this or if the digit is '0' do that? I don't need to use the tikz or pgf packages; if there is any other math engine with programming language features, that would be fine, too. My goal is to generate a table atuomatically.


title: TikZ library automata using option double with shorten

text: I'm trying to draw an automata using TikZ and the library `automata`. An accepting state I would like to denote by a double circle but the distance between the two circles should be larger than the default (which is initially `0.6pt`). I do this by setting `double distance=1.5pt` but this does not play nicely together with the option `shorten >=1pt` as seen in the following minimal example:               \documentclass{minimal}          \usepackage{tikz}          \usetikzlibrary{automata,positioning}          \begin{document}     \begin{tikzpicture}[shorten >=1pt]       \node[state] (1) {1};       \node[state,accepting] (2) [below=of 1] {2};       \path[->] (1) edge (2);     \end{tikzpicture}     %     \begin{tikzpicture}[shorten >=1pt,accepting/.style={double distance=1.5pt}]       \node[state] (1) {1};       \node[state,accepting] (2) [below=of 1] {2};       \path[->] (1) edge (2);     \end{tikzpicture}     %     \begin{tikzpicture}[shorten >=1pt,accepting/.style={double distance=1.5pt}]       \node[state] (1) {1};       \node[state,accepting] (2) [below=of 1] {2};       \path[->,shorten >=1.9pt] (1) edge (2);     \end{tikzpicture}     \end{document}      In the second automata the arrow touches the double circle of the accepting state. I can manually fix the problem by adding the missing `0.9pt` to the shorten parameter but this is somehow tedious and error prone. Is there some automagically way how to handle this situation?


title: LuaLaTeX, sprint verbatim text

text: The code below, uses the `lua`, `socket.http` library to pull a web page (for simplicity I have used a link to a text file). I have used `tex.sprint` to pass it back to the typesetting engine. However I would have preferred to print within a `verbatim` environment or preferably using the `listings` environment. Any suggestions as to how I can achieve this?               \documentclass{article}     \usepackage[utf8]{luainputenc}     \begin{document}     \bgroup     \catcode`\%=12     \catcode`\_=12     \catcode`\^=12     \catcode`\&=12     \directlua{                    local http = require("socket.http")     function url_encode(str)       if (str) then         str = string.gsub (str, "\string\n", "\string\r\string\n")         str = string.gsub (str, "([^%w ])",             function (c) return string.format ("%%%02X", string.byte(c)) end)         str = string.gsub (str, " ", "+")       end       return str     end     function url_decode(str)       str = string.gsub (str, "+", " ")       str = string.gsub (str, "%%(%x%x)",           function(h) return string.char(tonumber(h,16)) end)       str = string.gsub (str, "\string\n", "\string\n")       return str     end      local page  = http.request( 'http://mirror-cybernet.lums.edu.pk/pub/ctan/dviware/screenview/vms/test.txt' )     tex.sprint(page)                    }     \egroup     \end{document}      Note, the MWE contains two functions that I haven't used, for encoding and decoding the url. I left them in case you want to try a different `url`. As a sideline I find it amazing that old 'TeX' in new clothes can talk to the web.


title: TeX templates for mathematical articles

text: I'm currently trying to write an article on a method of finding infinite series for some known functions. However, I'm finding it very difficult to:   1. Get a good guidance on how to structure the document. (I guess this is rather a question for math.SE)   2. Formatting the LaTeX to get the document done. This is why I'd enjoy getting a pre formatted file (like a template) for simple undergraduate articles to get a feeling of how they should be. I've found this link but it states "This article is the third in an occasional series intended for graduate students.", which explains why it's a little bit too long (or is it?). I'm mostly stuck because I know very little about Latex and my formatting is poor. Anyways, my main concern now points 1. and 2. Thanks in advance.


title: How can I manually reuse KOMA variables?

text: I am attaching/embedding an `invoice` environment to the end of a `scrlttr2` letter. I am improvising a header atop and outside the `invoice` environment with 3 `minipage` environments. In the last of these, I want to restate my name and address. How do I reuse the `\setkomavar` `{fromname}`, `{fromaddress}`, etc., without having to define new commands? Failing that, if new commands like `\myname`, `\myphone`, etc. are best way to do this, how do I make them inherit the `\setkomavar`?


title: How to get proper kerning with XeTeX and special characters?

text: I would love to switch to XeTeX to make use of my professional Adobe fonts that were shipped with Creative Suite 6. I use MikTeX on a Win 8 machine, and TeXniXcenter + XeTeX. However, kerning seems to an issue, especially with special characters, in my case _German Umlaute_. Spacing seems wrong, at least for characters `W`+`ü`. Actually, on a sidenote, I don't understand why `\--` does not give me a long dash... Here is my MWE (UTF8) and a screenshot showing the wrong kerning:               \documentclass{scrartcl}     \usepackage{fontspec}     \setmainfont{Minion Pro}     \usepackage{listings}     \begin{document}          Wäre -- Könnte -- Wüste          \end{document}      ![enter image description here](http://i.stack.imgur.com/cPQX0.png)


title: Legend as Table under a Table

text: There are two tables, where the second one is the legend of the first one. How can I combine these easily without destroying the first or second table's layout?               \begin{table}[htbp]       \begin{tabular}{|lccccc|}         \small{333333333333333333} & E1111MP & EMP       & EMP  & adddW        & SOW          \\          \small{4444444444444444}   & CsssON  & 222d2EMP  & D    & HAAAddddddW  & Erad23P      \\          \small{555555}             & EEEP    & BRxxxxxRR & TTMP & TTxxxxxxxxMP & EMXxx xxxxXP \\        \end{tabular}     \end{table}     \begin{table}[htbp]       \begin{tabular}{|lcc|}          \small{444444 4444444444} & Csddddddddss ddd dddddddd & dasadafasdfa               \\          \small{555555}            & EEEP                      & BRxxxxxxxxxxxxxxxxxxxxxxRR \\        \end{tabular}     \end{table}


title: Pgfplots: let legend show two linestyles

text: I do have a double axis plot which which compares two different things (part 1 on the left axis in solid, part two on the right axis in dashed) for different paramters which are common for both plots. Now, since in general the legend is crowed (more than 6 entries) I would like to join some legend entries. Meaning 2 lines (one from left and one from right) which have the same parameter should also be joined in the legend. Meaning, It would be nice to have two linestyles (solid and dashed) combined in one legend entry. Here is my MWE for double axis plot:               \documentclass{standalone}     \usepackage{amsmath,tikz,pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[       width=\linewidth,       xmin=-5,xmax=5,       ymin=0,ymax=25,       axis y line*=left,       axis x line*=bottom,       ]       \addplot[solid] {x^2};       \addlegendentry{plot A};     \end{axis}     \begin{axis}[       width=\linewidth,       xmin=-5,xmax=5,       ymin=0,ymax=25,       axis y line*=right,       axis x line*=bottom       ]       \addplot[dashed] {1.1*x^2};       \addlegendentry{plot A};     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/0sBkp.png) The perfect outcome would be a legend entry like this:               _______     ------- plot A


title: Problem drawing curved paths with TikZ

text: I'm trying to draw small process flow graph, but I'm having two problems with the layout:   * The edges from the bottom nodes B, C should curve out and around back to A, not go directly on the inside. I thought that `bend left` and `bend right` would do this, but they don't seem to have any effect.   * The text on some edges needs more isolation from other elements. Can I specify an offset from the drawn edge to place the text?              \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows}     \begin{document}     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,node distance=2.5cm,auto,main node/.style={rectangle,rounded corners,draw,align=center}]          \node[main node] (1) {$A$};     \node[main node] (2) [below left of=1] {$D$};     \node[main node] (4) [below of=2] {$B$};     \node[main node] (3) [below right of=1] {$E$};     \node[main node] (5) [below of=3] {$C$};          \path     (1) edge node [left] {$d$} (2)         edge node [right] {$e$} (3)     (2) edge node [below] {$b$} (4)     (3) edge node [below] {$c$} (5)     (4) edge node [bend left] {$a$} (1)     (5) edge node [bend right] {$a$} (1);          \end{tikzpicture}     \end{document}


title: \subsubsection in a report style document

text: I am trying to make a subsubsection in a report document. It does this successfully, however it removes the subsection from the contents section of the document. Is there anyway to rectify this? I tried using, for example, `\addcontentsline{toc}{subsubsection}{Photoelectric Effect}` but this does not work. Nothing shows up.


title: Basic table creation

text: I'm having problems creating a basic table. I'm using an R package to produce LaTeX output. This is what it gives me:               \begin{tabular}{rlrrr}     \hline     Disorder & Correlation & StDev & N \\      \hline     GAD & 0.31 & 0.16 &  48 \\      OCD & 0.40 & 0.20 & 126 \\      SAD & 0.26 & 0.13 &  81 \\      PTSD & 0.35 & 0.16 & 175 \\      Agoraphobia & 0.25 & 0.16 &  21 \\      \hline     \end{tabular}      I'm sure there are various errors here--any ideas? Thanks for your time!


title: Altering the chapter command causes bibliography to be treated as a chapter

text: I have redefined the chapter command to autolabel all chapters:               \renewcommand\chapter[1]{       \capitalizewords[q]{#1}       \noblanks[q]{\thestring}       \origchapter{#1}\label{chap:\thestring}}      This works great, except I find that it causes a bibliography, created with **biblatex** and the `\bibliography` command, to be rendered incorrectly as a chapter rather than as the bibliography. The bibliography title page is messed up (says "Chapter WHATEVERCHAPTERNUMBER: *") and the table of contents lists "*" as a chapter. Otherwise the bibliography is rendered correctly. Anyone know what is causing this? I will be happy with a hacky solution, like an if statement in the `renewcommand` block that prevents just calls the original chapter command when it's handling the bibliography. ### Minimal Working Example The bibliography is being generated with a template. I have extracted the following code from the template file to create a minimal working example. Compiling the code below won't produce a table of contents, but it does produce the Bibliography as a Chapter named "*":               \documentclass[11pt]{report}     \usepackage{amsmath}     \usepackage{stringstrings}     \usepackage[noadjust,verbose,sort]{cite} %   arranges reference citations neatly          \begin{document}          \newcommand{\ls}[1]        {\dimen0=\fontdimen6\the\font         \lineskip=#1\dimen0         \advance\lineskip.5\fontdimen5\the\font         \advance\lineskip-\dimen0         \lineskiplimit=.9\lineskip         \baselineskip=\lineskip         \advance\baselineskip\dimen0         \normallineskip\lineskip         \normallineskiplimit\lineskiplimit         \normalbaselineskip\baselineskip         \ignorespaces        }          \def\thebibliography#1{     \ls{1}     \chapter*{Bibliography\@mkboth       {BIBLIOGRAPHY}{BIBLIOGRAPHY}}       \markright{}       %\thispagestyle{myheadings} % commented out to force page numbers to bottom center (8/11/07 change by C. St. Jean)       %\thispagestyle{empty}       \pagebreak       \vskip 50pt       \vspace*{0.61 in}%{0.75in}       \centerline{\Large \bf Bibliography}\par \nobreak       %\vskip 40pt       \vskip 55pt       \list       {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth         \advance\leftmargin\labelsep         \usecounter{enumi}}         \def\newblock{\hskip .11em plus .33em minus .07em}         \sloppy\clubpenalty4000\widowpenalty4000         \sfcode`\.=1000\relax}          \let\origchapter=\chapter     \renewcommand\chapter[1]{       \capitalizewords[q]{#1}       \noblanks[q]{\thestring}       \origchapter{#1}\label{chap:\thestring}}            % \tableofcontents            \chapter{The Story of Life}       Let there be light! \cite{Amaral:2007ua}            \bibliographystyle{plain}       \bibliography{testbib}          \end{document}      You'll also need to put this in a bibtex file `testbib.bib`               @article{Amaral:2007ua,     author = {Amaral, DG and Lavenex, P.},     title = {{Hippocampal neuroanatomy}},     journal = {The Hippocampus Book},     year = {2007},     volume = {1},     number = {3},     pages = {37--114}     }


title: Table Border Line with \cline bleaches out

text: I draw line with \cline in my table starting from the second column, because the first two rows are a merged cell. That works well as long as I do not use coloring of the cells. If I colorize the rows the \cline drawn line kind of bleaches out. I still can see some very faint border on the screen which presumably vanishes entirely if printed. Does anyone knows a way around that problem? Here is my minimal working example:                  \documentclass{article}       \usepackage{longtable}     \usepackage{array}     \usepackage{rotating}     \usepackage{hhline}     \usepackage{colortbl}     \usepackage{multirow}     \usepackage{titlesec}               \begin{document}            \newcounter{magicrownumbers}     \newcommand\rownumber{\stepcounter{magicrownumbers}\arabic{magicrownumbers}}           \begin{table}     \centering     \begin{tabular}{|r|l|l|l|}     \hline     \rowcolor[gray]{.90}         \multirow{2}{*}{\centering\rownumber}& \multicolumn{3}{c|}{\begin{minipage}{14cm}{\vspace{2mm}The text here\vspace{2mm}}\end{minipage}} \\     \cline{2-4}     \rowcolor[gray]{.90}          & Score: 1 & Remark: XXX & Substitute: KKKKK\\       \hline     % rowcolor[gray]{.90}         \multirow{2}{*}{\centering\rownumber}& \multicolumn{3}{c|}{\begin{minipage}{14cm}{\vspace{2mm}The text here\vspace{2mm}}\end{minipage}} \\     \cline{2-4}     %\rowcolor[gray]{.90}          & Score: 1 & Remark: XXX & Substitute: KKKKK\\       \hline     \end{tabular}     \end{table}          \end{document}


title: Protecting references in section headings from capitalization

text: I am using the ACM SIG alternate style, which automatically converts all section titles to upper case. I would like to include a reference in one of the section titles ( _Proof of Lemma X_ ). The obvious way (shown in the MWE below) results in the following warning:               LaTeX Warning: Reference `SEC:INTRODUCTION' on page \thepage  undefined on input line 9.      Apparantly the argument of `\ref` is converted to upper case before the reference is generated. Is there a way to fix this without changing the label to upper case?               \documentclass{sig-alternate}     \begin{document}          \section{Introduction}     \label{sec:introduction}     The introduction.          \section{The section after Section~\ref{sec:introduction}}          \end{document}


title: Migrating LaTeX (MiKTeX 2.9) from one computer to another

text: I have an old computer (Windows XP Pro x64) with LaTeX (MiKTeX 2.9) installed and setup as I want it. I have a new computer (same operating system), and I want to be able to transfer MiKTeX to the new machine without having to reinstall MiKTeX . Is there a simple way to do this? Neither machine has internet connection.


title: Putting an arrow on an arrow in Tikz

text: In the MWE below:               \documentclass{report}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[T1]{fontenc}     \usepackage{tikz,pgf}               \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols,automata}          \begin{document}          \begin{center}     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto, node distance=3cm ,semithick]              \node [draw,  rounded corners=2pt,rectangle, initial, initial text=\textbf{Query},initial where=above](timing) {Timing};         \node [draw,  rounded corners=2pt,rectangle](indep)[right of=timing] {Independent};         \node [draw,  rounded corners=2pt,rectangle](caching)[right of=indep] {Caching};         \node [draw,  rounded corners=2pt,rectangle](pc)[right of=caching] {PC Logging};              \node [draw, node distance=3cm, rounded corners=2pt,rectangle](stp)[right of= pc] {STP};              \path (timing) edge[]   node{} (indep);              \path (indep) edge[]   node{} (caching);              \path (caching) edge[]   node{} (pc);              \path (pc) edge[]   node{} (stp);          \end{tikzpicture}\\     \end{center}          \end{document}      How can I put a vertical arrow, that is pointing upwards, on the arrow (preferably at its mid point) between the `PCLogging` and `STP` boxes ?


title: Customise to a more fancier chapter opening

text: In the previous question, I tried to ask for one style per chapter. This time I would like to ask for customise the chapter opening. However, my case is a bit complicated, let us see the MWE first.               \documentclass[12pt,a4paper,headinclude,openright]{scrbook}     \usepackage{etoolbox}     \usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}     \usepackage{microtype}     \usepackage{graphicx}     \definecolor{color00}{HTML}{3F3A7D}     \definecolor{color01}{HTML}{660033}     \definecolor{color02}{HTML}{DC143C}     \definecolor{color03}{HTML}{FF4500}     \definecolor{color04}{HTML}{FF8000}     \definecolor{color05}{HTML}{FFD700}     \definecolor{color06}{HTML}{CCCC00}     \definecolor{color07}{HTML}{176C2E}     \definecolor{color08}{HTML}{20B2AA}     \definecolor{color09}{HTML}{00CED1}     \definecolor{color10}{HTML}{1E90FF}     \definecolor{color11}{HTML}{0000CD}     \definecolor{color12}{HTML}{800080}     \usepackage{tikz}     \usetikzlibrary{positioning}     \usetikzlibrary{backgrounds}     \usetikzlibrary{fit}     \usetikzlibrary{shapes}     \usetikzlibrary{scopes}     \clearscrheadfoot     \usepackage{scrpage2}     \usepackage{tikz}     \lehead{\begin{tikzpicture}[remember picture,overlay]       \node[         inner sep=0pt,         fill=\chapterbackcolor,         font=\fontsize{40}{48}\selectfont\color{white}\sffamily,         anchor=north east,         align=center         ]         (chapimage)         at (current page.north east)          {\includegraphics[height=1.5cm,width=3cm]{\hdicons}};        \node[          inner sep=0pt,          anchor=south east,          font=\color{\chapterbackcolor}\sffamily        ]         (mark)            at ([xshift=-1em]chapimage.south west)             {\rightmark};            \draw[\chapterbackcolor,line width=1pt]           ([xshift=12em]mark.south east) -- ++(-\paperwidth-12em,0);       \end{tikzpicture}%}     \lohead{\begin{tikzpicture}[remember picture,overlay]       \node[         text width=2cm,         text height=0.5cm,         text depth=1.5cm,         fill=\chapterbackcolor!20,         font=\Large\sffamily,         anchor=north east,         align=center         ]         {\thepage};       \end{tikzpicture}}     \lefoot{...}     \rofoot{...}     \pagestyle{scrheadings}     % chapter style     \newcommand\hdicons{}     \renewcommand\hdicons{%     \ifcase\value{chapter}Icon00\or Icon01\or Icon02\or Icon03\or Icon04\else Icon\fi}     \renewcommand\chapterbackcolor{%     \ifcase\value{chapter}color00\or color01\or color02\or color03\or color04\or color05\or color06\or color07\or color08\or color09\or color10\or color11\else color12\fi}     \def\@chapter[#1]{\begin{tikzpicture}[remember picture,overlay]                       \node(hd)at (current page.north west){\thechapter};                       \begin{scope}[on background layer]                       \node[text width=21cm,minimum height=10cm,fill=\chapterbackcolor,fit=(hd)]at(current page.north) {};                       \end{scope}                   \end{tikzpicture}%                   \ifnum \c@secnumdepth >\m@ne                          \refstepcounter{chapter}%                          \typeout{\@chapapp\space\thechapter.}%                          \addcontentsline{toc}{chapter}%                                    {\protect\numberline{\thechapter}#1}%                     \else                       \addcontentsline{toc}{chapter}{#1}                     \fi                     \addtocontents{lof}{\protect\addvspace{10\p@}}%                     \addtocontents{lot}{\protect\addvspace{10\p@}}%                     }     \usepackage[listings,theorems,skins,breakable]{tcolorbox}     % for examples     \begin{document}     \frontmatter     \chapter*{Table of contents, figures and tables}     \tableofcontents     \mainmatter     \part{Part ONE}     \chapter{Sample Chapter 1}     \section{Section ONE}     \backmatter     \end{document}      The MWE is about the code I would like customise for a chapter opening. Given that I know in order to change the chapter opening style per each one is by define style variables (e.g. bgcolors etc.), I would like to know the followings:   * Does `\thechapter` represents the chapter heading in the opening?   * I would like to make a background under the chapter heading, how would the MWE modified so makes this possible? _Note:_   * _As I am sticking on the koma-script, I would like the answer using the koma-script-compatible packages._   * _Please allow me acknowledge where the code comes from, which arehere and here._


title: How to make horizontal lists?

text: This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one?


title: Graph with date x-axis: How to show non-military time?

text: Sample code:               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \pagestyle{empty}     \usepgfplotslibrary{dateplot}          \begin{document}     % requires \usepgfplotslibrary{dateplot} !     \begin{tikzpicture}       \begin{axis}[         date coordinates in=x,         xtick=data,         xticklabel style=         {rotate=90,anchor=near xticklabel},         xticklabel=\day. \hour:\minute,         date ZERO=2009-08-18       ]       \addplot coordinates {         (2009-08-18 09:00,  050)         (2009-08-18 12:00,  100)         (2009-08-18 15:00,  100)         (2009-08-18 18:35,  100)         (2009-08-18 21:30,  040)         (2009-08-19,        020)         (2009-08-19 3:00,   000)         (2009-08-19 6:0,    035)       };       \end{axis}     \end{tikzpicture}          \end{document}      I want to change the `xticklabel` to not show military time; I'd like the PM/AM notation. Is this possible? ![enter image description here](http://i.stack.imgur.com/LixGo.png)


title: \pause won't generate extra slides in a containsverbatim frame

text: It seems that the `[containsverbatim]` option when applied to a frame prevents beamer from generating intermediate slides if text animation is wanted in it. Only the first step of the animation is printed as a result. Sample code:               \documentclass{beamer}     \begin{document}      \begin{frame}[containsverbatim]       \frametitle{Tests anim}       blah       \pause       blah²      \end{frame}     \end{document}      My question then comes in two parts:   1. Is this a bug or did I miss something?   2. If it's a bug, is there a workaround?


title: \lstMakeShortInline with @ delimiter

text: I'm including a fair amount of inline C++ code in a beamer presentation I'm making, and I want to be able to use the short syntax for \lstinline. My code displays fine if I use, for example, the ! character as my delimiter, like               \lstMakeShortInline!     !cout << "This C++ displays fine";!      But when I try to use the @ character as my delimiter, because it will hardly ever appear in C++ code, the line is displayed unformatted, with literal @s surrounding it. As far as I know, @ is not a special character in LaTeX, so why is this happening? Edit: I did not test the example I gave, and on further inspection, the _only_ character that I can get to work as a delimiter is ~, as demonstrated with this example:               \documentclass{beamer}     \usepackage{listings}     \lstMakeShortInline[language=C++,basicstyle=\ttfamily]~     \begin{document}     \begin{frame}     ~cout << "This C++ displays fine";~     \end{frame}     \end{document}      However, other delimiters (such as |) seem to work in the article documentclass, is this an issue with beamer?


title: How to reverse the changes in the headline formatting in scrbook?

text: A friend asked me for help, as there have been some changes in the formatting that `scrbook` provides, which is not good for an updated edition of a book. Currently, I am tweaking his sources in order to have the pdf look similar to the old version. Particularly page breaks should be consistent. Mainly the chapter headlines seem to have changed (also the itemize parsep...) such that there are ending points in the numbers and the font seems to have gotten wider but thinner. Also the parsep after a headline has increased significantly. See pic (where I already removed the point). ![picture](http://i.stack.imgur.com/ASJJ3.jpg) **Does anyone have an idea how to get to the old look for the headlines?** A simple               \setkomafont{disposition}{\bfseries}      has no effect. Seems that this should already be fat... compile output for the versions i use right now:               This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)     ...     (./master.tex     LaTeX2e <2009/09/24>     ...     Document Class: scrbook 2010/06/17 v3.06 KOMA-Script document class (book)      please don't ask for the old version, i have no clue.


title: Nomencl and Algorithm2e Incompatibility

text: This code produces no errors and displays the nomenclature correctly.               \documentclass{article}     \usepackage{nomencl}     \makenomenclature     \begin{document}     \nomenclature{$c$}{a constant}     \printnomenclature     \end{document}      If I add the algorithm package:               \usepackage[]{algorithm2e}      I get:               Undefined control sequence. [\begin{thenomenclature}]      and no nomenclature. Is there a conflict between the packages? How can I debug this? ## Edit Using Tex Live 2012               Package: nomencl 2005/09/22 v4.2     Package: algorithm2e 2008/00/00 v3.10      ## Solved Upgrading algorithm2e to version 5.00 (2013/01/06) fixes the problems.


title: EPS Figure is cutoff on right when built to pdf, .eps is fine

text: I have to make an .eps file from a large png for publication in PRL. When viewing the .eps in ghostscript/inkscape/illustrator/... it looks fine, but when I build it into a pdf using latex -> DVI -> PDF in TexnicCenter/TexMaker its got a big white block covering the right side. I generated the latex using LyX export, and have been trying to get it to compile as well as it did in LyX. The figures look perfect when compiled with pdflatex in LyX, so there must be something different with my build profile that's obscuring my figures? Any tips? EDIT: The minimal example below produces a 'file not found' for the graphic file using pdfLaTeX, and compiles with the figure cutoff on the right when compiled with latex -> DVI -> PDF. Some of my other .eps figures display perfectly when placed in that float, while others don't show at all. However, the .eps all look fine when viewed on their own, and appear to have good bounding boxes in ghostview.               \documentclass{paper}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{float}     \usepackage{amsmath}     \usepackage{graphicx}     \makeatletter     \makeatother     \usepackage{babel}     \begin{document}     \title{Blah}     \author{Bleh}     \begin{abstract}     Abstract goes here.     \end{abstract}     \maketitle     \begin{figure*}[t!]     \begin{centering}     \includegraphics[width=0.75\textwidth]{phasediagramstogether2}     \end{centering}     \caption{This figure is cutoff on the right, with a big white box}%     \label{RDFsandSamples}     \end{figure*}     \end{document}      The error log generated using pdfLaTeX: http://pastebin.com/MRGtUsQJ The error log for latex -> DVI -> PDF: http://pastebin.com/QA4tVuzY


title: Is there a switch to turn off LaTeX counters from inside a box?

text: I know that `amsmath` typesets at least twice its material, the first one for measurement and that it takes measures (sic) to avoid some counters being updated twice. Is there a switch a macro writer could use to inform LaTeX not to update counters (which are global in LaTeX) when it is needed to typeset some unknown contents `#1` inside a box, which will be discarded later? * * * update from info gathered from `egreg`'s answer and a (belated) look in the sources. It is not as I said above that `amsmath` avoids for _some_ counters to be updated; it avoids it for all, because it uses a list of _all_ counter names which is kept up-to-date by the latex kernel, and designed to allow anyone using it to do things with **all** these names. The conclusion is thus that `amsmath` defines the macro pair `\savecounters@/\restorecounters@` because it needs the functionality, but that anyone can copy their definitions (`\savecounters@` defines what `\restorecounters@` will do) and use them with the same effect without having to load `amsmath` or even any portion of it. Just replace `\@nx` by `\noexpand`.


title: tikz connection label and node distance

text: Is it possible to have `tikz` **automatically** determining the distance between two nodes based on a third node used to connect them? For instance, in the following picture the arrow used to connect the nodes are too short. Can `tikz` calculate its length automatically so that its label fits it better?               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}       \node [rectangle,draw] (a) {source program};       \node [rectangle,draw] (b) [right=of a] {token list};       \draw [->] (a.east) -- (b.west) node[above] {lexical analysis};     \end{tikzpicture}          \end{document}      ![connection too small for its label](http://i.stack.imgur.com/6zOC0.png)


title: Re-parse the content of a box register

text: I'll ask the question first and then explain why it is so. I have the following .tex file:               \documentclass{article}         \newsavebox{\myquote}     \setbox\myquote=\hbox{\begin{normalsize}\verb.'.\end{normalsize}}          \usepackage{upquote} % convert verbatim ' from left single quote to a "normal" single quote          \begin{document}     Test: \verb.'. vs \usebox{\myquote}     \end{document}      In this tex file, the `\verb.'.` turns out as a `'`, and the `\usebox{\myquote}` looks like a curly left single quote. This is because even though I `\usepackage{upquote}` (which converts the curly left single quote to the straight single quote within verbatim/verb), it's loaded in _after_ the definition of `\myquote` so it's too late for the `upquote` package to affect what sort of quote happens in `\myquote`. **Question: assuming I can _only_ put code _after_ the `\setbox` line, is there some way to make the quote mark in `\myquote` appear as a straight single quote?** I am basically looking to add a command like `\edef\myquote\myquote` after the `\usepackage{upquote}`, so that the definition of `\myquote` is basically re- evaluated before assigning it back to `\myquote`. The re-evaluation will cause the `\verb.'.` to be parsed according to the modifications made in `\usepackage{upquote}`, causing the quote to be a single quote again. You may ask why I don't use load `upquote` before I define `myquote`; well, I am using a document generation package called Sweave (for the language R). I basically can embed write R code into my (otherwise LaTeX-looking) document, call Sweave on it, and it will produce a .tex file with the code (& results) nicely printed within. Sweave inserts all of these `\newsavebox` commands _before_ the preamble that I put in the original document. That is, **I cannot change the order of the`\newsavebox` command to be after the `\usepackage{upquote}`**. As a last resort I can copy/paste the `\setbox\myquote=\hbox...` that gets generated by Sweave into my own document preamble (i.e. after the `\usepackage{upquote}`), but then should the Sweave package change their definition of `\myquote` (say they change the `normalsize` to something else) I'll have to change my definition to remain in sync. It'd be preferable to do the re-definition as if I **only** knew the command was `\myquote` (and knowing it has `\verb.'.` in it somewhere so that I know the `upquote` package will have effect) and not its actual definition. I hope that makes sense.


title: Box/Table surrounded by a pattern/symbols?

text: I have a box for tips, but I would like to have a pattern surrounding it like in the example picture. ![Example](http://i.stack.imgur.com/YgUmn.png) Thank you for your help!               \documentclass[ngerman]{scrbook}     \usepackage{fontspec}     \usepackage{babel}     \usepackage{tabularx,colortbl,multirow,dcolumn}         \renewcommand\tabularxcolumn[1]{b{#1}}     \usepackage{xcolor}     \usepackage{calc}     \usepackage{titletoc,titlesec,enumitem}                    \newenvironment{Test}{     \begin{center}     \begin{sffamily}     \setlength\arrayrulewidth{0.75pt}\arrayrulecolor{white}     \renewcommand{\arraystretch}{1.3}         \begin{tabular}[h!]{p{\textwidth-2\tabcolsep}}         \rowcolor[gray]{0.6} \textbf{{\color{white}Testbox}} \\         \hline         \rowcolor[gray]{0.90} }         {\\          \end{tabular}     \end{sffamily}     \end{center}     }          \begin{document}          \begin{Test}     Content     \end{Test}          \end{document}


title: Weird error with eqnarray

text: The following piece of code               \begin{eqnarray*}     \expval[\mathcal{N}] &= \frac{\rho_0}{\rho_1} ~, &     \var(\mathcal{N}) &= \frac{\rho_0}{\rho_1} + 0.280 \, \frac{\rho_0^2}{\rho_1^2} ~, \\     \expval[\mathcal{L}] &= \frac{\rho_0}{2 \rho_1^{3/2}} ~, &     \var(\mathcal{L}) &= \frac{\rho_0}{\pi \rho_1^2} + 0.147 \, \frac{\rho_0^2}{\rho_1^3} ~.     \end{eqnarray*}      gives the following error.               ! Missing $ inserted. <inserted text>                      $ l.34 \var(\mathcal{N}) &= \frac{\rho_0}{\rho_1}                                                     + 0.280 \, \frac{\rho_0^2}{\...      I have defined `\expval` and `\var` in the document preamble as follows.               \newcommand{\expval}{\mathbb{E}}     \newcommand{\var}{\mathrm{Var}}      Just wondering what the issue could be.


title: Draw Vertices of Regular Polygon

text: I am trying to draw just the nodes (no sides) at the vertices of a regular hexagon. This answer should be easily modified to accomplish what I want, but I am such a novice that I have difficulty understanding the example. Ideally, each vertex would be a separate _named_ node so that I can easily draw edges between them (I will be making several different graphs using these same nodes).


title: TeXShop equivalent on Windows

text: I'm using TeXShop on Mac. I will need to co-operate with a Windows user. What LaTeX distribution or package shall he install to   * be able compile my TeXShop LaTeX files without the need to install LaTeX extensions, and   * have an integrated editor - LaTeX build environment?


title: TikZ: compiling a standalone picture

text: I am not sure if this is recreate-able through a MWE. Whenever I compile a standalone `TikZ` picture, it compiles all my standalone figures in the same folder. I am using Ubuntu 13.04 and Emacs with server mode running. ![enter image description here](http://i.stack.imgur.com/IBEZ0.png) Some of this information may be irrelevant, but I am not sure what is needed to troubleshoot such an issue. From the screen shot, I have the main document on the left and my `TikZ` picture I am creating on the right. As you can see, I compiled the figure and `Latexmk` compiled every other standalone `.tex` file too.               Output written on sunplanetspacecraft.pdf (1 page, 1117 bytes).     SyncTeX written on sunplanetspacecraft.synctex.gz.     Transcript written on sunplanetspacecraft.log.     Latexmk: Log file says output to 'sunplanetspacecraft.pdf'     Latexmk: All targets (sunplanetspacecraft.pdf) are up-to-date     Latexmk: All targets (transferchoices.pdf) are up-to-date     Latexmk: All targets (transfergeoa.pdf) are up-to-date     Latexmk: All targets (transfergeob.pdf) are up-to-date     Latexmk: All targets (trigidentities.pdf) are up-to-date     Latexmk: All targets (twobodies3D.pdf) are up-to-date     Latexmk: All targets (unitvec.pdf) are up-to-date     Latexmk: All targets (velcomp.pdf) are up-to-date          Latexmk finished at Thu Jul 25 14:12:06      I am compiling `sunplanetspacecraft.tex` and none of the files are related to the to this `.tex` file but yet they still were compiled. I looked through the log file, but I didn't see anything that related to the other files `Latexmk` compiled. Below is my preamble in case that helps.               \documentclass[convert = false]{standalone}          \usepackage[utf8]{inputenc}     \renewcommand{\rmdefault}{ppl}                                       \linespread{1.05}               \usepackage[scaled]{helvet}                                       \usepackage{courier}                                                         \usepackage{eulervm}                            \normalfont     \usepackage[T1]{fontenc}     \usepackage{textcomp}          \usepackage[usenames, dvipsnames, svgnames, table]{xcolor}                                                  \usepackage{tikz}     \usetikzlibrary{arrows}      The reason I want to resolve this is because one of the another `standalone TikZ` pictures takes about 2minutes to compile which slows down compiling a simple picture. * * * This problem cropped up with another document. This time my document that calls all my `standalone`s in it tried calling an unrelated `standalone` just because it was in the same folder. So a MWE (concept) would be to have a a folder, in the folder at a `main.tex`, in the `main.tex`, you need have `\usepackage{standalone}`, then we have two cases:   1. create two `standalone`s to be called in the `main.tex` and compile the first one. When you compile the second one, it will also compile the first one. This wont cause the problem I am having since you are probably creating simple documents (not an issue though). Just check the output to see if it compile the other one too. This will be the first issue at the top I mention. Create a folder called test. main.tex                  \documentclass{article}         \usepackage{standalone}         \usepackage{tikz}         \begin{document}         test         \includestandalone{test1}         \includestandalone{test2}         \end{document}      test1.tex                  \documentclass[tikz, convert = false]{standalone}         \begin{document}         \begin{tikzpicture}           \draw (0, 0) -- (2, 0);         \end{tikzpicture}         \end{document}      test2.tex                  \documentclass[tikz, convert = false]{standalone}         \begin{document}         \begin{tikzpicture}           \draw (0, 0) -- (-2, 0);         \end{tikzpicture}         \end{document}      So if I compile `test2.tex`, `test1.tex` compiles also. This hardly causes a slow down but you get the idea.   2. create a standalone not called in the `main.tex`, but this time don't add anything in the file. Just name it and save it no preamble. Even though this file isn't being called by the `main.tex`, compiling the `main.tex` file will try and compile this file that doesn't even have a preamble. It calls because it has a `.tex` extension. In the same folder, create `test3.tex` which is blank no pre-amble or code and save it. Now add a line to `main.tex` and compile. This should cause the error no `\begin{document}` in the main file. The document will compile fine though but will constantly have that error. `main.tex` is forcing the compiling of a blank `.tex` file even though it isn't included. > >     ;; ============ Latexmk setup ==============   >     (defun run-latexmk () >       (interactive) >       (let ((TeX-save-query nil) >             (TeX-process-asynchronous nil) >             (master-file (TeX-master-file))) >         (TeX-save-document "") >         (TeX-run-TeX "latexmk" >                      (TeX-command-expand "latexmk -pdf %O %S" 'TeX-master- > file) >                      master-file)) >         (if (plist-get TeX-error-report-switches (intern master-file)) >             (TeX-next-error t) >           (progn >             (demolish-tex-help) >             (minibuffer-message "latexmk: done.")))) >   >     (add-hook 'LaTeX-mode-hook (lambda () >         (push >          '("Latexmk" "latexmk -pdf %S" TeX-run-TeX nil t >            :help "Run Latexmk on file") >          TeX-command-list))) >   * * * `.latexmkrc` setup: > $pdflatex = 'pdflatex --shell-escape -interaction=nonstopmode %O %S -file- > line-error -synctex=1';


title: Tables with colored cells and dashed lines

text: I would like to draw a table with some colored cells and dashed horizontal lines. Here is my first attempt using the `colortbl` package and the `arydshln` package:               \documentclass[12pt]{article}     \usepackage{colortbl}     \usepackage{arydshln}     \begin{document}     \begin{tabular}[t]{|l|c|c|c|c|c|}     \cline{1-4} \cdashline{5-5} \cline{6-6}     & $b_1$ & $b_2$ & $b_3$ & \hspace{0.4in} & $b_n$\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     $a_1$ & \cellcolor[gray]{0.85} & & & &\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     $a_2$ & & \cellcolor[gray]{0.85} & & &\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     $a_3$ & & & \cellcolor[gray]{0.85}  & &\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     \multicolumn{1}{:c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{}\\     \multicolumn{1}{:c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{}\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     $a_n$ & & & & & \cellcolor[gray]{0.85}\\     \cline{1-4} \cdashline{5-5} \cline{6-6}     \end{tabular}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Ln0er.png) The problem is that the lines above the colored cells disappear, as has already been noticed in other questions here. I learned from the answers to those questions that I should use the `hhline` package, so here is my second attempt:               \documentclass[12pt]{article}     \usepackage{colortbl}     \usepackage{arydshln}     \usepackage{hhline}     \begin{document}     \begin{tabular}[t]{|l|c|c|c|c|c|}     \cdashline{5-5} \hhline{----~-}     & $b_1$ & $b_2$ & $b_3$ & \hspace{0.4in} & $b_n$\\     \cdashline{5-5} \hhline{----~-}     $a_1$ & \cellcolor[gray]{0.85} & & & &\\     \cdashline{5-5} \hhline{----~-}     $a_2$ & & \cellcolor[gray]{0.85} & & &\\     \cdashline{5-5} \hhline{----~-}     $a_3$ & & & \cellcolor[gray]{0.85} & &\\     \cdashline{5-5} \hhline{----~-}     \multicolumn{1}{:c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{}\\     \multicolumn{1}{:c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{} & \multicolumn{1}{c:}{}\\     \cdashline{5-5} \hhline{----~-}     $a_n$ & & & & & \cellcolor[gray]{0.85}\\     \cdashline{5-5} \hhline{----~-}     \end{tabular}     \end{document}      ![enter image description here](http://i.stack.imgur.com/OaaMm.png) So I have succeeded in getting lines above the colored cells, but now the vertical lines run short in the uppermost row. (It seems that the vertical size of each row has increased a little bit, but the vertical lines have stayed the same while attached to the bottommost line; you can kind of see this by comparing the appearance of the vertical dashed lines in the two versions.) By googling, I have found the information that the `arydshln` package and the `hhline` package are incompatible. Does anyone know a way out?


title: Two landscape tables in columns

text: I am trying to include two landscape tables on one page, with the first one being in the left column and the other placed in the right one. I have tried several solutions including the minipage solution. I could not 'force' the second one into the right column with minipage, any suggestions? I have the following code:               \begin{landscape}     \begin{table}[ht]     \begin{minipage}[b]{0.5\linewidth}\centering     \begin{tabular}{|c|c|c|}     \hline      1&1&1\\     \hline     2&2&2\\     \hline     \end{tabular}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.5\linewidth}     \centering     \begin{tabular}{|c|c|c|}     \hline     1&1&1\\     \hline     2&2&2\\     \hline     \end{tabular}     \end{minipage}     \end{table}     \end{landscape}      This is the standard twocolumn-setup in landscape mode, I am trying to rotate the tables (landscape) but displayed horizontally in a minipage setup. I dont know if this is the correct approach, but its the closest I've got.


title: The macro 'Bibliography' in Texshop

text: Apparently the macro 'Bibliography' does not work properly when one compiles with the option 'Tex and DVI'. It seems to work only with `pdftex`. How to fix this ?


title: Same ymin in loglogscale

text: I want to obtain the same y axis for multiple plots. Here is a MWE:               \documentclass[preview=true]{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{preview}     \begin{tikzpicture}     \begin{axis}[        xmode=log,ymode=log,ymin=0,ymax=450, log ticks with fixed point,     ]     \addplot table {     1 10     2 20     4 25     };     \end{axis}     \end{tikzpicture}%     \begin{tikzpicture}     \begin{axis}[        xmode=log,ymode=log,ymin=0,ymax=450, log ticks with fixed point,     ]     \addplot table {     1 100     2 200     4 450     };     \end{axis}     \end{tikzpicture}     \end{preview}     \end{document}      ![enter image description here](http://i.stack.imgur.com/j2mf6.png) In the figures above, the y axes are not same although the `ymax` and `ymin` values are same.


title: Misalignment of equations using amsmath

text: I would like all my equations to be aligned to the left on the same margin ie. move the first one forwards or the other two backwards. ![1](http://i.imgur.com/z9rm2Xi.png) The second 2 equations are inside an enumerate package though:               \begin{align*}     \frac{4}{5} + \frac{3}{2}     \end{align*}     \begin{enumerate}     \item Find equivalent fractions with the same denominator:     \begin{align*}     \frac{4}{5} + \frac{3}{2}=\frac{8}{10} + \frac{15}{10}     \end{align*}     \item Add the numerators:     \begin{align*}     \frac{8}{10} + \frac{15}{10}=\frac{23}{10}     \end{align*}     \end{enumerate}      So I am unsure how to get them to lineup as I believe the enumerate has a natural indent built in? Code for testing (must be compiled using LuaLaTex):               \documentclass[14pt,extrafontsizes]{memoir}     \usepackage[margin=10px, paperwidth=640px, paperheight=720px]{geometry}     \usepackage[fleqn]{amsmath}     \usepackage{multicol}     \usepackage{enumerate}     \usepackage{titlesec}     \usepackage{mathptmx}     \usepackage[T1]{fontenc}     \titleformat*{\section}{}          \begin{document}     \section*{\Huge \underline{Addition of Fractions}}     \LARGE     \begin{align*}     \frac{4}{5} + \frac{3}{2}     \end{align*}     \begin{enumerate}     \item Find equivalent fractions with the same denominator:     \begin{align*}     \frac{4}{5} + \frac{3}{2}=\frac{8}{10} + \frac{15}{10}     \end{align*}     \item Add the numerators:     \begin{align*}     \frac{8}{10} + \frac{15}{10}=\frac{23}{10}     \end{align*}     \end{enumerate}     \end{document}


title: Video in Beamer with multimedia package not playing

text: I am trying to use the multimedia package in Beamer to play a local, non- embeded, video. The file compiles without errors; however, when I click on the place-holder image, it simply moves to the next slide. The MWE can be seen below, and the files can (tex, image, and video) can be downloaded here: https://www.dropbox.com/s/29upcupxzlnoc8v/beamervideo.tex https://www.dropbox.com/s/h2b0jce86xhm4yg/sintel.avi https://www.dropbox.com/s/5fl0q2b78yeg5s1/sintel.jpg https://www.dropbox.com/s/0phqobyb8nwrusn/sintel.mp4               \documentclass{beamer}     \usepackage{multimedia}     \title{Video in Beamer presentation}     \begin{document}     \frame{\maketitle}     \begin{frame}         \frametitle{\textit{Sintel} trailer 480p MP4}             \begin{center}             \movie[width=\textwidth,showcontrols=true]             {\includegraphics[width=\textwidth]{sintel.jpg}}{sintel.avi} \\             Click on picture to play the movie         \end{center}     \end{frame}     \end{document}      Does this work for anyone? I am not sure if maybe my PDF viewer (evince, Ubuntu) is not compatible, or if I am just using the multimedia package incorrectly? I found the example online and assumed it worked for the author. While other packages can embed movies/animations easily, they often require the use of Adobe Acrobat and result in very large PDFs. My motivation for using the multimedia package is to **avoid using Adobe Acrobat**. Edit: I included mp4 and avi versions of the video and tried both, but no luck.


title: dictionary marks in biblatex

text: I want to make dictionary style pagemarks using biblatex. Consider the following example:               \documentclass{memoir}     \usepackage[sorting=nyt,style=ieee-alphabetic,backend=biber]{biblatex}     \begin{filecontents}{\jobname.bib}     @inbook{IEEEexample:incollectionwithseries,       author        = "J. B. Anderson and K. Tepe",       title         = "Properties of the Tailbiting {BCJR} Decoder",       booktitle     = "Codes, Systems and Graphical Models",       series        = "{IMA} Volumes in Mathematics and Its Applications",       publisher     = "Springer-Verlag",       location      = "New York",       year          = "2000"       }          @book{IEEEexample:inbookpagesnote,       author        = "B. K. Bul",       title         = "Theory Principles and Design of Magnetic Circuits",       publisher     = "Energia Press",       loction       = "Moscow",       year          = "1964",       pages         = "464",       note          = "(in Russian)"     }          @book{IEEEexample:bookwitheditor,       editor        = "J. C. Candy and G. C. Temes",       title         = "Oversampling Delta-Sigma Data Converters Theory,                        Design and Simulation",       publisher     = "{IEEE} Press.",       location      = "New York",       year          = "1992"     }          @article{IEEEexample:articlelargepages,       author        = "A. Castaldini and A. Cavallini and B. Fraboni                        and P. Fernandez and J. Piqueras",       title         = "Midgap Traps Related to Compensation Processes in                        {CdTe} Alloys",       journaltitle  = "Phys. Rev. B.",       volume        = "56",       number        = "23",       year          = "1997",       pages         = "14897-14900"     }          @article{IEEEexample:TBPmisc,       author        = "M. Coates and A. Hero and R. Nowak and B. Yu",       title         = "Internet Tomography",       journaltitle  = "IEEE J. Selected Areas Commun.",       month         = 05,       year          = "2002",       note          = "to be published"     }          @book{IEEEexample:book_typical,       author        = "B. D. Cullity",       title         = "Introduction to Magnetic Materials",       publisher     = "Addison--Wesley",       location      = "Reading, MA",       year          = "1972"     }          @inbook{IEEEexample:incollectionmanyauthors,       author        = "R. M. A. Dawson and Z. Shen and D. A. Furst and                        S. Connor and J. Hsu and M. G. Kane and R. G. Stewart and                        A. Ipri and C. N. King and P. J. Green and R. T. Flegal                        and S. Pearson and W. A. Barrow and E. Dickey and K. Ping                        and C. W. Tang and S. Van. Slyke and                        F. Chen and J. Shi and J. C. Sturm and M. H. Lu",       title         = "Design of an Improved Pixel for a Polysilicon                         Active-Matrix Organic {LED} Display",       booktitle     = "{SID} Tech. Dig.",       volume        = "29",       year          = "1998",       pages         = "11-14"     }          @inproceedings{IEEEexample:presentedatconf,       author        = "S. G. Finn and M. M{\'e}dard and R. A. Barry",       title         = "A Novel Approach to Automatic Protection Switching                        Using Trees",       eventtitle    = "{IEEE} International Conference on Communications",       location      = "Montreal, Que., Canada",       year          = "1997"     }          @manual{IEEEexample:motmanual,       title         = "{FLEXChip} Signal Processor ({MC68175/D})",       organization  = "Motorola",       year          = "1996"     }          @inbook{IEEEexample:incollection_chpp,       author        = "P. Hedelin and P. Knagenhjelm and M. Skoglund",       editor        = "W. B. Kleijn and K. K. Paliwal",       title         = "Theory for Transmission of Vector Quantization Data",       booktitle     = "Speech Coding and Synthesis",       publisher     = "Elsevier Science",       location      = "Amsterdam, The Netherlands",       year          = "1995",       chapter       = "10",       pages         = "347-396"     }          @patent{IEEEexample:jppat,       author        = "U. Hideki",       title         = "Quadrature Modulation Circuit",       type          = "patentjp",       number        = "152932/92",       year          = "1992-05-20"     }          @periodical{IEEEexample:periodical,       title         = "IEEE Personal Commun. Mag., Special Issue on                        Wireless {ATM}",       volume        = "3",       year          = "1996-08",     }          @misc{IEEEexample:standard,       title         = "Wireless {LAN} Medium Access Control {(MAC)} and                         Physical Layer {(PHY)} Specification",       howpublished  = "{IEEE} Std. 802.11",       year          = "1997"     }          @online{IEEEexample:electronhowinfo,       author        = "V. Jacobson",       title         = "Modified {TCP} Congestion Avoidance Algorithm",       howpublished  = "end2end-interest mailing list",       url           = "ftp://ftp.isi.edu/end2end/end2end-interest-1990.mail",       year          = "1990-04"     }               @report{IEEEexample:techrep,       author        = "R. Jain and K. K. Ramakrishnan and D. M. Chiu",       title         = "Congestion Avoidance in Computer Networks with a                         Connectionless Network Layer",       institution   = "Digital Equipment Corporation",       location      = "MA",       number        = "DEC-TR-506",       year          = "1987-08",       type          = "techreport"     }          @article{IEEEexample:TBParticle,       author        = "N. Kahale and R. Urbanke",       title         = "On the Minimum Distance of Parallel and Serially                        Concatenated Codes",       journaltitle  = "IEEE Trans. Inf. Theory",       note          = "submitted for publication"     }          @report{IEEEexample:techrepstdsub,       author        = "S. Kandala",       title         = "Changes to {A}nnex {D}",       institution   = "{IEEE} 802.11 {TGe}",       number        = "02/680r0",       year          = "2002-10",       type          = "techreport"     }          @thesis{IEEEexample:masterstype,       author        = "A. Karnik",       title         = "Performance of {TCP} Congestion Control with Rate                        Feedback: {TCP/ABR} and Rate Adaptive {TCP/IP}",       institution   = "Indian Institute of Science",       type          = "M. Eng. thesis",       location      = "Bangalore, India",       year          = "1999-01"     }          @patent{IEEEexample:frenchpatreq,       author        = "F. Kowalik and M. Isard",       title         = "Estimateur d'un D{\'e}faut de Fonctionnement                         d'un Modulateur en Quadrature et {\'E}tage de Modulation                        l'Utilisant",       language      = "french",       type          = "French Patent Request",       number        = "9500261",       year          = "1995-01-11"     }          @thesis{IEEEexample:phdurl,       author        = "Q. Li",       title         = "Delay Characterization and Performance Control of                        Wide-area Networks",       institution   = "Univ. of Delaware",       location      = "Newark, NJ",       type          = "phdthesis",       year          = "2000-05",       url           = "http://www.ece.udel.edu/~qli"     }          @thesis{IEEEexample:masters,       author        = "Nin C. Loh",       title         = "High-Resolution Micromachined Interferometric                        Accelerometer",       institution   = "Massachusetts Institute of Technology",       location      = "Cambridge, MA",       type          = "mathesis",       year          = "1992"     }          @online{IEEEexample:electronorgadd,       author        = "D. H. Lorenz and A. Orda",       title         = "Optimal Partition of {QoS} Requirements on Unicast                        Paths and Multicast Trees",       institution   = "Dept. Elect. Eng., Technion",       location      = "Haifa, Israel",       url           = "ftp://ftp.technion.ac.il/pub/supported/ee/Network/lor.mopq98.ps",       year          = "1998-07"     }          @book{IEEEexample:book,       author        = "S. M. Metev and V. P. Veiko",       editor        = "Osgood, Jr., R. M.",       title         = "Laser Assisted Microtechnology",       edition       = "2",       publisher     = "Springer-Verlag",       location      = "Berlin, Germany",       year          = "1998"     }          @report{IEEEexample:techreptypeii,       author        = "D. Middleton and A. D. Spaulding",       title         = "A Tutorial Review of Elements of Weak Signal Detection                        in Non-{G}aussian {EMI} Environments",       institution   = "National Telecommunications and Information                        Administration ({NTIA}), U.S. Dept. of Commerce",       type          = "NTIA Report",       number        = "86-194",       year          = "1986-05"     }          @inproceedings{IEEEexample:confwithpapertype,       author        = "B. Mikkelsen and G. Raybon and R.-J. Essiambre and                        K. Dreyer and Y. Su. and L. E. Nelson and J. E. Johnson                        and G. Shtengel and A. Bond and D. G. Moodie and                        A. D. Ellis",       title         = "160 {Gbit/s} Single-channel Transmission Over 300 km                         Nonzero-dispersion Fiber With Semiconductor Based                        Transmitter and Demultiplexer",       booktitle     = "Proc. {ECOC}'99",       location      = "Nice, France",       year          = "1999",       pages         = "28-29"     }          @article{IEEEexample:articledualmonths,       author        = "Y. Okada and K. Dejima and T. Ohishi",       title         = "Analysis and Comparison of {PM} Synchronous Motor and                        Induction Motor Type Magnetic Bearings",       journaltitle  = "IEEE Trans. Ind. Appl.",       volume        = "31",       year          = "1995-09/1995-10",       pages         = "1047-1053"     }          @unpublished{IEEEexample:unpublished,       author        = "T. J. Ott and N. Aggarwal",       title         = "{TCP} over {ATM}: {ABR} or {UBR}",       howpublished  = "Unpublished"     }          @report{IEEEexample:techreptype,       author        = "J. Padhye and V. Firoiu and D. Towsley",       title         = "A Stochastic Model of {TCP} {R}eno Congestion Avoidance                        and Control",       institution   = "Univ. of Massachusetts",       location      = "Amherst, MA",       type          = "CMPSCI Tech. Rep.",       number        = "99-02",       year          = "1999",     }          @book{IEEEexample:inbook,       author        = "H. E. Rose",       title         = "A Course in Number Theory",       publisher     = "Oxford Univ. Press",       location      = "New York",       year          = "1988",       chapter       = "3"     }          @patent{IEEEexample:uspat,       author        = "Ronald E. Sorace and Victor S. Reinhardt and                        Steven A. Vaughn",       holder        = "Hughes Aircraft Company",       location      = "Los Angeles, CA",       title         = "High-Speed Digital-to-{RF} Converter",       type          = "patentus",       number        = "5668842",       yearfiled     = "1995-02-28",       year          = "1997-09-16",     }          @inbook{IEEEexample:incollection,       author        = "W. V. Sorin",       editor        = "D. Derickson",       title         = "Optical Reflectometry for Component Characterization",       booktitle     = "Fiber Optic Test and Measurement",       publisher     = "Prentice--Hall",       location      = "Englewood Cliffs, NJ",       year          = "1998"     }          @online{IEEEexample:electronhowinfo2,       author        = "V. Valloppillil and K. W. Ross",       title         = "Cache Array Routing Protocol v1.1",       howpublished  = "Internet draft",       url           = "http://ds1.internic.net/internet-drafts/draft-vinod-carp-v1-03.txt",       year          = "1998"     }          @inproceedings{IEEEexample:confwithpaper,       author        = "M. Wegmuller and J. P. von der Weid and P. Oberson                        and N. Gisin",       title         = "High Resolution Fiber Distributed Measurements With                        Coherent {OFDR}",       booktitle     = "Proc. {ECOC}'00",       year          = "2000",       location      = "Munich, Germany",       pages         = "109"     }          @inproceedings{IEEEexample:confwithvolume,       author        = "M. Yajnik and S. B. Moon and J. Kurose and D. Towsley",       title         = "Measurement and Modeling of the Temporal Dependence in                        Packet Loss",       booktitle     = "Proc. {IEEE} {INFOCOM}'99",       volume        = "1",       location      = "New York",       year          = "1999-03",       pages         = "345-352"     }          @inproceedings{IEEEexample:confwithadddays,       author        = "M. S. Yee and L. Hanzo",       title         = "Radial Basis Function Decision Feedback Equaliser                        Assisted Burst-by-burst Adaptive Modulation",       booktitle     = "Proc. {IEEE} Globecom '99",       address       = "Rio de Janeiro, Brazil",       year          = "1999-12-05/1999-12-09",       pages         = "2183-2187"     }     \end{filecontents}          \addbibresource{\jobname.bib}     \nocite{*}          \pagestyle{ruled}          \clearplainmark{bib}          \begin{document}     \printbibliography[heading=bibintoc]     \end{document}      Now i want a header containing the label (IEEE bib label) of the first entry on the page and of the last entry on the page eg. [HKS95] -- [MV98] (from the example). Traditionaly you can implement this using the technique for marking index entries:               \newcommand*{\dictionarymark}{%       \ifthenelse{\equal{\leftmark}{\rightmark}}         {\rightmark}         {\rightmark -- \leftmark}}          \makeevenhead{ruled}{\scshape Bibliography}{}{\dictionarymark}     \makeoddhead{ruled}{\dictionarymark}{}{\scshape Bibliography}      and at each entry you add a call to `\markboth{}{}`. Now my question is: how can you implement this behaviour in biblatex? More specifically how can I add a call to markboth for each entry in the bibliography containing the current label.


title: Magnify document

text: I've written about a hundred or so lectures in LaTeX, all of which include a separate preamble document for consistency and ease of maintenance. Now that I have a SMARTboard in my classroom, I would like to import the lecture PDFs into the SMARTboard's software (called Notebook). I can drag-and-drop the PDFs into Notebook and it imports them automatically, which is great. But the documents are sized all wrong for the SMARTboard. Everything is too small to be legible by the class. So I need to magnify the documents (by about 140%) so that the resulting PDF is sized appropriately for the SMARTboard. And I'd like to do this magnification from within the preamble so that all of my lectures are magnified consistently. Here's what I've tried so far:   1. I tried the `\mag` command, but I get an "incompatible magnification" error, and besides, I've since learned that using `\mag` is discouraged.   2. I tried `\fontsize{18}{20}\selectfont`, but it has to be after `\begin{document}` instead of in the preamble, and it doesn't affect things like `\section` and `\subsection`. So that's no good. Any ideas?


title: Group statements, avoid pagebreak

text: I make an FAQ document, for this I redefined environments like               \newenvironment{question} % no indenting, bold and new paragraph     {\setlength\parindent{0pt}\bfseries}     {\par}          \newenvironment{answer} % v spacing at the end     {}     {\vspace*{10pt}}      (This is likely to change in the near future.) In the document, I have brief questions and answers:               \begin{question}         Why?     \end{question}     \begin{answer}         I don't know!     \end{answer}      How can I "group" question and answer in order to not have a pagebreak between question and answer?


title: Fonts that look alike as text and as math

text: What fonts give similar look when used as text and within math environment? I'm particularly interested in sans serif fonts, but serif fonts are also very welcomed.


title: How can I modify the settings of the margin item in a list?

text: In the `article` class I have this section of code               \if@twocolumn       \setlength\leftmargini  {2em}     \else       \setlength\leftmargini  {2.5em}     \fi     \leftmargin  \leftmargini     \setlength\leftmarginii  {2.2em}     \setlength\leftmarginiii {1.87em}     \setlength\leftmarginiv  {1.7em}     \if@twocolumn       \setlength\leftmarginv  {.5em}       \setlength\leftmarginvi {.5em}     \else       \setlength\leftmarginv  {1em}       \setlength\leftmarginvi {1em}     \fi     \setlength  \labelsep  {.5em}     \setlength  \labelwidth{\leftmargini}     \addtolength\labelwidth{-\labelsep}     \@beginparpenalty -\@lowpenalty     \@endparpenalty   -\@lowpenalty     \@itempenalty     -\@lowpenalty     \renewcommand\theenumi{\@arabic\c@enumi}     \renewcommand\theenumii{\@alph\c@enumii}     \renewcommand\theenumiii{\@roman\c@enumiii}     \renewcommand\theenumiv{\@Alph\c@enumiv}     \newcommand\labelenumi{\theenumi.}     \newcommand\labelenumii{(\theenumii)}     \newcommand\labelenumiii{\theenumiii.}     \newcommand\labelenumiv{\theenumiv.}     \renewcommand\p@enumii{\theenumi}     \renewcommand\p@enumiii{\theenumi(\theenumii)}     \renewcommand\p@enumiv{\p@enumiii\theenumiii}     \newcommand\labelitemi{\textbullet}     \newcommand\labelitemii{\normalfont\bfseries \textendash}     \newcommand\labelitemiii{\textasteriskcentered}     \newcommand\labelitemiv{\textperiodcentered}      that set the margins and type of items for the diferent list environments. How can I modify this to obtain a first margin item equal to `0pt`?


title: Altering vertical space between lines of one breqn (dmath) equation

text: The breqn documentation says that > It also makes it possible to specify different vertical space values for the > space between lines of a long, broken equation and the space between > separate equations in a group of equations. This suggests you can adjust the vertical space between the lines of one `dmath` environment, but what is that command? I can't find it in the documentation.


title: bm and pxfonts conflict in beamer

text: This is pretty much the same question as No room for a new \mathgroup, with the difference that the proposed solutions do not work when using the beamer class. The code:               \documentclass{beamer}      \usepackage{pxfonts}      \usepackage{bm}            \begin{document}       \begin{frame}         $\frac{1}{2}$       \end{frame}     \end{document}      gives a `no room for a new \mathgroup` error. Is this solvable?


title: Providing graphics with own package

text: Is it possible to provide graphics with own packages? I have modified a beamer style and added a graphic to each page by using `\includegraphics`:               \addtobeamertemplate{frametitle}{}{       \begin{textblock*}{200mm}(.84\textwidth,-8mm)         \includegraphics[height=7mm]{myGraphic}       \end{textblock*}     }      I want to make use of this style in diferent presentations. So, I decided to create a package (`.sty`) out of it. This is working fine but the graphic is only found if placed in the folder of the presentation. I would realy like to place the graphic with the package. Is it possible? And if it is, how?


title: Unicode characters not displaying in XeTeX

text: I am trying to get Unicode characters to compile into a PDF file using XeLaTeX. My MWE looks like this:               \documentclass[11pt]{article}     \begin{document}          Here is α, β, and finally γ.          \end{document}      When I compile to PDF I get               Here is , , and finally .      My Unicode characters do not show up. Could anyone point out my problem?


title: How to fix the node size in TikZ?

text: I am simply looking for a way to fix the size of my node (block) regardless of the text inside. I find several posts similar, but not the same. All the solutions given make use of `minimum width=0.1cm` line. But this is NOT the solution that I am looking for. What I want is to take one block as the reference and make all the others same-size as that. I have tried the following, but failed.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{backgrounds,calc,positioning}     \begin{document}     \begin{tikzpicture}[block/.style={draw, fill=white, rectangle, minimum width=0.4*\columnwidth, anchor=south}, font=\small]     \node[block, minimum width=0.9*\columnwidth, minimum height = 5cm, fill=green, opacity=0.3, text opacity=1](sensors) at (0,0){};     \node[block, fill=white, minimum width=0.1cm, above right=0.1cm and 0.1cm of sensors.south west](acc){Accelerometer};     \node[block, fill=white, minimum width=\widthof{acc}, above right=0.1cm and 0.1cm of acc.north west](gyro){Gyroscope};     \node[block, fill=white, minimum width=\widthof{acc}, above right=0.1cm and 0.1cm of gyro.north west](mag){Magnetometer};     \end{tikzpicture}     \end{document}      In my code, I wish the `acc` block to be the reference block.


title: Rule in the header

text: How can I insert a rule in the header of all pages without the `fancyhdr` package? Is it necessary to use the `fancyhdr` package?


title: Set certain fontsize for a certain part of my document

text: I'm embedding a figure into my document which contains several `\put{}`-commands to place texts and formulas over the PDF-figure. The code looks of `BLA.pdf_tex` looks like this:               %% Creator: Inkscape 0.48.3.1, www.inkscape.org     %% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010     %% Accompanies image file 'BLA.pdf' (pdf, eps, ps)     %%     %% To include the image in your LaTeX document, write     %%   \input{.pdf_tex}     %%  instead of     %%   \includegraphics{.pdf}     %% To scale the image, write     %%   \def\svgwidth{}     %%   \input{.pdf_tex}     %%  instead of     %%   \includegraphics[width=]{.pdf}     \begingroup%       \makeatletter%       \providecommand\color[2][]{%         \errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%         \renewcommand\color[2][]{}%       }%       \providecommand\transparent[1]{%         \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%         \renewcommand\transparent[1]{}%       }%       \providecommand\rotatebox[2]{#2}%       \ifx\svgwidth\undefined%         \setlength{\unitlength}{547.7bp}%         \ifx\svgscale\undefined%           \relax%         \else%           \setlength{\unitlength}{\unitlength * \real{\svgscale}}%         \fi%       \else%         \setlength{\unitlength}{\svgwidth}%       \fi%       \global\let\svgwidth\undefined%       \global\let\svgscale\undefined%       \makeatother%       \begin{picture}(1,1.61511777)%         \put(0,0){\includegraphics[width=\unitlength]{BLA.pdf}}%         \put(0.25579697,0.87675735){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{EIN TEXT HIER}}}%         \put(0.25579697,0.8563082){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{eine formel hier: $g_{lim} > Gmin$}}}%       \end{picture}%     \endgroup%      Embedded via:               \begin{figure}[thb]     \centering     \hfill     \subfloat[htb][BLA]{\fcolorbox{plotBord}{plotPadd}{     \def\svgwidth{0.95\textwidth}       \input{BLA.pdf_tex}     }\label{fig:blaaaaaaa}}     \hfill\null\\     \caption{ASD}\label{fig:ASD}      \end{figure}      I tried myself by using a `group` like this:               \begingroup     \fontsize{10pt}{12pt}\selectfont     \begin{figure}[thb]     \centering     \hfill     \subfloat[htb][BLA]{\fcolorbox{plotBord}{plotPadd}{     \def\svgwidth{0.95\textwidth}       \input{BLA.pdf_tex}     }\label{fig:blaaaaaaa}}     \hfill\null\\     \caption{ASD}\label{fig:ASD}      \end{figure}     \endgroup      But it doesn't work. I don't want to put a `\footnotesize` into each `\put`-command - and then maybe later I've got to change it back again to another fontsize for some reason. Is there a simple solution? Thanks in advance


title: Magnified subfigures with scalebar

text: According to the post How to create magnified subfigures and corresponding boxes for portions of a large image and using subfloatrow I've put three images next to each other with the 1-1 zoombox under each. I would like to add a scale bar to the original and the zoomed subfigures as well, however I've failed to combine my present code with the instructions at How to add a scalebar to an image. Is there a way to add scale bars on both original and the zoomed images?               \documentclass[a4paper,12pt]{report}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{color}     \usepackage{tikz}     \usepackage{floatrow}     \usepackage{subfig}     \usetikzlibrary{spy,calc}          \newif\ifblackandwhitecycle     \gdef\patternnumber{0}          \pgfkeys{/tikz/.cd,     zoombox paths/.style={         draw=orange,         very thick     },     black and white/.is choice,     black and white/.default=static,     black and white/static/.style={          draw=white,            zoombox paths/.append style={             draw=white,             postaction={                 draw=black,                 loosely dashed             }         }     },     black and white/static/.code={         \gdef\patternnumber{1}     },     black and white/cycle/.code={         \blackandwhitecycletrue         \gdef\patternnumber{1}     },     black and white pattern/.is choice,     black and white pattern/0/.style={},     black and white pattern/1/.style={                 draw=white,             postaction={                 draw=black,                 dash pattern=on 2pt off 2pt             }     },     black and white pattern/2/.style={                 draw=white,             postaction={                 draw=black,                 dash pattern=on 4pt off 4pt             }     },     black and white pattern/3/.style={                 draw=white,             postaction={                 draw=black,                 dash pattern=on 4pt off 4pt on 1pt off 4pt             }     },     black and white pattern/4/.style={                 draw=white,             postaction={                 draw=black,                 dash pattern=on 4pt off 2pt on 2 pt off 2pt on 2 pt off 2pt             }     },     zoomboxarray inner gap/.initial=5pt,     zoomboxarray columns/.initial=2,     zoomboxarray rows/.initial=2,     subfigurename/.initial={},     figurename/.initial={zoombox},     zoomboxarray/.style={         execute at begin picture={             \begin{scope}[                 spy using outlines={%                     zoombox paths,                     width=\imagewidth / \pgfkeysvalueof{/tikz/zoomboxarray columns} - (\pgfkeysvalueof{/tikz/zoomboxarray columns} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray columns} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap} -\pgflinewidth,                     height=\imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} - (\pgfkeysvalueof{/tikz/zoomboxarray rows} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray rows} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap}-\pgflinewidth,                     magnification=3,                     every spy on node/.style={                         zoombox paths                     },                     every spy in node/.style={                         zoombox paths                     }                 }             ]         },         execute at end picture={             \end{scope}             \node at (image.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-image}}{\phantomimage}};             \node at (zoomboxes container.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-zoom}}{\phantomimage}};      \gdef\patternnumber{0}         },         spymargin/.initial=0.5em,         zoomboxes xshift/.initial=1,         zoomboxes right/.code=\pgfkeys{/tikz/zoomboxes xshift=1},         zoomboxes left/.code=\pgfkeys{/tikz/zoomboxes xshift=-1},         zoomboxes yshift/.initial=0,         zoomboxes above/.code={             \pgfkeys{/tikz/zoomboxes yshift=1},             \pgfkeys{/tikz/zoomboxes xshift=0}         },         zoomboxes below/.code={             \pgfkeys{/tikz/zoomboxes yshift=-1},             \pgfkeys{/tikz/zoomboxes xshift=0}         },         caption margin/.initial=4ex,     },     adjust caption spacing/.code={},     image container/.style={         inner sep=0pt,         at=(image.north),         anchor=north,         adjust caption spacing     },     zoomboxes container/.style={         inner sep=0pt,         at=(image.north),         anchor=north,         name=zoomboxes container,         xshift=\pgfkeysvalueof{/tikz/zoomboxes xshift}*(\imagewidth+\pgfkeysvalueof{/tikz/spymargin}),         yshift=\pgfkeysvalueof{/tikz/zoomboxes yshift}*(\imageheight+\pgfkeysvalueof{/tikz/spymargin}+\pgfkeysvalueof{/tikz/caption margin}),         adjust caption spacing     },     calculate dimensions/.code={         \pgfpointdiff{\pgfpointanchor{image}{south west} }{\pgfpointanchor{image}{north east} }         \pgfgetlastxy{\imagewidth}{\imageheight}         \global\let\imagewidth=\imagewidth         \global\let\imageheight=\imageheight         \gdef\columncount{1}         \gdef\rowcount{1}         \gdef\zoomboxcount{1}     },     image node/.style={         inner sep=0pt,         name=image,         anchor=south west,         append after command={             [calculate dimensions]             node [image container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-image] {\phantomimage}             node [zoomboxes container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-zoom] {\phantomimage}         }     },     color code/.style={         zoombox paths/.append style={draw=#1}     },     connect zoomboxes/.style={     spy connection path={\draw[draw=none,zoombox paths] (tikzspyonnode) -- (tikzspyinnode);}     },     help grid code/.code={         \begin{scope}[                 x={(image.south east)},                 y={(image.north west)},                 font=\footnotesize,                 help lines,                 overlay             ]             \foreach \x in {0,1,...,9} {                  \draw(\x/10,0) -- (\x/10,1);                 \node [anchor=north] at (\x/10,0) {0.\x};             }             \foreach \y in {0,1,...,9} {                 \draw(0,\y/10) -- (1,\y/10);                        \node [anchor=east] at (0,\y/10) {0.\y};             }         \end{scope}         },     help grid/.style={         append after command={             [help grid code]         }      },     }          \newcommand\phantomimage{%     \phantom{%         \rule{\imagewidth}{\imageheight}%     }%     }     \newcommand\zoombox[2][]{     \begin{scope}[zoombox paths]         \pgfmathsetmacro\xpos{             (\columncount-1)*(\imagewidth / \pgfkeysvalueof{/tikz/zoomboxarray columns} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray columns} ) + \pgflinewidth         }         \pgfmathsetmacro\ypos{             (\rowcount-1)*( \imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray rows} ) + 0.5*\pgflinewidth         }         \edef\dospy{\noexpand\spy [             #1,             zoombox paths/.append style={                 black and white pattern=\patternnumber             },             every spy on node/.append style={#1},             x=\imagewidth,             y=\imageheight         ] on (#2) in node [anchor=north west] at ($(zoomboxes container.north west)+(\xpos pt,-\ypos pt)$);}         \dospy         \pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},\rowcount+1,\rowcount)}         \global\let\rowcount=\pgfmathresult         \pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},1,\columncount+1)}         \global\let\columncount=\pgfmathresult         \ifblackandwhitecycle             \pgfmathtruncatemacro{\newpatternnumber}{\patternnumber+1}             \global\edef\patternnumber{\newpatternnumber}         \fi     \end{scope}     }                 \begin{figure}[h]     \RawFloats     \ffigbox{     \begin{subfloatrow}[3]%            \ffigbox{\begin{tikzpicture}[zoomboxarray, zoomboxes below,  zoomboxarray columns=1, zoomboxarray rows=1]      \node [image node] { \includegraphics[width=0.3\textwidth]{Figure1} };     \zoombox[magnification=3.5]{0.5,0.6}     \end{tikzpicture}}{\subcaption*{\color{red}{BFP}}}%     \ffigbox{\begin{tikzpicture}[zoomboxarray, zoomboxes below, zoomboxarray columns=1, zoomboxarray rows=1]     \node [image node] { \includegraphics[width=0.3\textwidth]{Figure2} };     \zoombox[magnification=3.5]{0.5,0.6}     \end{tikzpicture}}{\subcaption*{\color{limegreen}{Na\textsuperscript{+}-channels}}}%     \ffigbox{\begin{tikzpicture}[zoomboxarray, zoomboxes below, zoomboxarray columns=1, zoomboxarray rows=1]     \node [image node] { \includegraphics[width=0.3\textwidth]{Figure3} };     \zoombox[magnification=3.5]{0.5,0.6}     \end{tikzpicture}}{\subcaption*{Merge}}%     \end{subfloatrow}       }{\caption{Neurons}\label{fig:psuper}}          \end{figure}     \end{document}


title: BibTeX style always uses ampersand regardless of choice in makebst

text: I've now twice generated a `bst` file using `makebst`. Regardless of my choice when asked whether to use "and" or "&" for 3+ authors in the reference list, the style always uses "&". I would very much prefer "and" to be spelled out. Any idea how to fix this? I am using `harvard`, not `natbib`, but could be persuaded to change. What initially led me to generate a new style was that kluwer.bst which I was previously using somehow didn't use "et al." for in-text citations (again for sources with 3+ authors) when the publication type is _tech report_ but instead put all names into the citation, while it works fine for articles. A remedy for that would also be helpful. I've looked into the `.bst` files, but I have really no idea what to change. Any help or hints towards a solution would be greatly appreciated as I really have to finish this article.


title: Clear column on a double column document

text: How do I clear a column in a double column document? I have two floats, and I want each to occupy a different column. `\clearpage` before the second float puts it on a new page, while `\pagebreak` does nothing (puts the two floats on the same column). MWE               \documentclass[twocolumn,english]{article}     \begin{document}          \begin{figure}     \caption{}     \end{figure}          \newpage{}          \begin{figure}     \caption{}     \end{figure}          \end{document}


title: more margin before block

text: I have the following:               \documentclass{beamer}          \usepackage{graphicx}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{xcolor}          %\usepackage{colordef}     % local package?     %\usepackage{beamerdefs}   % local package?     %\usepackage{lvblisting}   % local package?          \begin{document}     \frame{     \frametitle{Test}     \begin{itemize}     \item mtest     \item test test test test           \begin{block}{Methods}     \item the variance/covariance     \item historical simulation     \item \fcolorbox{red}{white}{Monte Carlo simulation}     \end{block}     \end{itemize}    % missing line     }     \end{document}      The problem is that the `block` part has the wrong indentation, so it is too much on the left and not on the same line as the text before, how can I change this? I tried `\hspace` but it does not work.