title: \overbrace with square bracket

text: I'm trying to put a nice square bracket over a complex text, it should look like an `\overline` but with ending like `\ulcorner` and `\urcorner`. The presence of `\overrightarrow` and `\overleftarrow` makes me believe that is possible to decorate the end of the `\overline` bar. I know the existence of `\overbrace`, but I need a square bracket; moreover, `\overbrace` takes too much vertical space


title: Why do my "to path" arrowheads disappear when I upgrade to PGF 2.10?

text: Since I upgraded to PGF 2.10, some of my arrows drawn with `to` don't look right anymore. For instance, they are missing arrow-heads, and some other styles I applied to them have also disappeared. For example:               \begin{tikzpicture}         \draw (0,0) to[->, line width=2mm] (3,1);     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/F9Fqb.png) I'm not getting any error messages nor anything relevant in the log file. This example compiles correctly with PGF 2.00.


title: Using \item within \newcommand

text: I tried defining a new command `\Quest` as follows but the error               Lonely \item--perhaps a missing list environment      appears.               \def\solnversion{0} %%set this to 1 to get solutions     \newcommand\Quest[3]{\item\ifnum\solnversion=1 #3\else #2\fi}      But if the `\item` command is removed, the error               Something's wrong--perhaps a missing \item      appears instead. How should the code be corrected?


title: how to put figures on a page in exam class!

text: **I am trying to put four figures in one page**. I have tried using `\clearpage`, `\afterpage{\clearpage}` with `afterpage` package as suggested and worked successfully in many other cases. I have also tried scaling down the image, using `h`, `H`, `p` etc. with `figure` command. None did work in my case. **Help me please putting these four pictures on a page. My code at present is:**               \documentclass[addpoints,11pt]{exam}     \usepackage{graphicx} %to display graphics!     \usepackage{afterpage}     \firstpagefootrule     \begin{document}     \begin{questions}     \question[] True/False questions.     \label{label:a}         \begin{parts}             \part[2] True or False.             An image:             \begin{figure}[h]                 \centering                 \includegraphics[scale=0.5]{test}                 \caption{Figure of Q.\ref{label:a}}                 \label{label:q1}             \end{figure}         \end{parts}          \question[] True/False questions.         \begin{parts}             \part[2] True or False.             An image:             \begin{figure}[h]                 \includegraphics[scale=0.5]{test}                 \caption{Figure of Q.2}                 \label{label:q2}             \end{figure}         \end{parts}          \question[] True/False questions.         \begin{parts}             \part[2] True or False.             An image:             \begin{figure}[h]                 \includegraphics[scale=0.5]{test}                 \caption{Figure of Q.3}                 \label{label:q3}             \end{figure}         \end{parts}          \question[] True/False questions.         \begin{parts}             \part[2] True or False.             An image:             \begin{figure}[h]                 \includegraphics[scale=0.5]{test}                 \caption{Figure of Q.4}                 \label{label:q4}             \end{figure}         \end{parts}     \end{questions}     \end{document}      I am unable to upload the image `test.jpg` ( _of size 168x126_ ) as well as the pdf I have created by running the above code. I am sorry for not able to upload the output I got.


title: Elementary introduction to creating BibTeX styles?

text: Are there any good introductory references for the syntax to create a BibTeX style (.bst) file, whose ease of reading is closer to an introductory text for a programming language than to a formal specification document for a programming language? Obviously, as modifying bibliography styles is an advanced topic for a single facet of the TeX ecosystem, there's not going to be the same kind of pedagogical literature on the subject as _e.g._ for LaTeX. But I'm hoping for something that would allow me to grok, and write, a style file after an hour or two of reading rather than after a day or two of study.


title: How to change color in an environment?

text: I have an environment defined as follows:               \usepackage{framed}     \usepackage{listings}     \usepackage{color}     \usepackage{tikz}     \usetikzlibrary{shapes.arrows}     \usetikzlibrary{backgrounds}     \usetikzlibrary{positioning}     \usetikzlibrary{arrows}     \definecolor{gray}{gray}{0.3}     \definecolor{darkgreen}{rgb}{0,0.55,0}     \definecolor{purple}{rgb}{0.5,0,1}          \newenvironment{comment}{       \medskip       \begin{framed}         \color{red}         {\textbf{I say: }}     }{     \end{framed}       \medskip     }      After leaving the environment the color is not restored and so it is still red. Should I restore it explicitly somewhere?


title: Multiple graphics images on a page

text: I was trying to use your suggestion for multiple graphics on a single page using `subfigure`, and I get the multiple boxes, but they are black and do NOT contain my images. Do you have any suggestions?


title: How do I display the actual image rather than black boxes?

text: I'm trying to use the following code to insert three pictures horizontally - the code compiles perfectly, but the images are coming out as black boxes/rectangles. I've made sure that the images are in the same file as the `.tex` document - what am I doing wrong? I would really appreciate and help I can get.               \documentclass[english]{article}     \usepackage[demo]{graphicx}     \usepackage{babel,blindtext}          \begin{document}               \begin{figure}[!htb]     \minipage{0.32\textwidth}       \includegraphics[width=\linewidth]{delete_gesture.png}       \caption{A really Awesome Image}\label{fig:awesome_image1}     \endminipage\hfill     \minipage{0.32\textwidth}       \includegraphics[width=\linewidth]{ok_gesture.png}       \caption{A really Awesome Image}\label{fig:awesome_image2}     \endminipage\hfill     \minipage{0.32\textwidth}%       \includegraphics[width=\linewidth]{settings_gesture.png}       \caption{A really Awesome Image}\label{fig:awesome_image3}     \endminipage     \end{figure}               \end{document}


title: Inserting B/W .jpg image causes image to be entirely black

text: I am working with `.jpg` images that are all B/W. Here is an example image I am using: ![Sample image](http://i.stack.imgur.com/jC3Aq.png) and here is what I am using to put the image into my document:               \begin{figure}[!htb]     \centering     \includegraphics[width=0.5\textwidth]{1980image}     \caption[Sample Caption]{Sample Caption}     \end{figure}      However, when I run, the image becomes entirely black. Here is a screenshot from my document: ![All black image](http://i.stack.imgur.com/kZDSO.png) Has anyone seen this before? Changing the filetype to `.png` does not fix anything.


title: Macro concatenation via expansion multiple times with some tokens protected?

text: In the MWE below, I want to create a `\doPlotCoords` macro from scratch, by appending `\addplot` commands:               \documentclass{article}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{adjustbox}          \usepackage{tikz}     \usetikzlibrary{pgfplots.groupplots}     \usetikzlibrary{shapes}     \usetikzlibrary{positioning}     \usetikzlibrary{decorations.pathreplacing}          \xdef\doPlotCoords{}     \foreach \r in {0,1,...,10}{%       \xdef\tempCoords{} %       \foreach \c in {0,1,...,10}{ %         \xdef\tempCoords{\tempCoords (\r,\c)\space}       } % end \foreach \c       % just \xdef concatenating gives "! Undefined control sequence." for \addplot; use \protected@edef     %   \xdef\doPlotCoords{ \doPlotCoords     %   \noexpand\addplot+[color=blue,mark=*,mark options={blue},] coordinates{ \tempCoords };}       % with "\protected@xdef", I get "! You can't use a prefix with `the character @'.":       \makeatletter %       \protected@xdef\doPlotCoords{ \doPlotCoords       \protect\addplot+[color=blue,mark=*,mark options={blue},] coordinates{ \tempCoords };}       \makeatother     } % end \foreach \r          \begin{document}     \show\doPlotCoords     \end{document}      Eventually, I'd like the `\doPlotCoords` macro to contain:               \addplot+[color=blue,mark=*,mark options={blue},] coordinates{ (0,0) (0,1) ... };     \addplot+[color=blue,mark=*,mark options={blue},] coordinates{ (1,0) (1,1) ... };     ...      ... so I could just use `\doPlotCoords` as a "subroutine" to execute all those `\addplot`s; however, currently it fails with:               ! You can't use a prefix with `the character @'.     <to be read again>                         @     l.26 }            % end \foreach \r      I think the main problem is that: upon the first `\xdef`, `\protect`/`\noexpand` may be obeyed; but when concatenating, the `\doPlotCoords` already contains the `\addplot`, so when the `\xdef` tries to expand `\doPlotCoords`, it also wants to expand the `\addplot` inside. But I cannot really see what the "You can't use a prefix with `the character @'." should refer to, when using `\protected@xdef` (got that via Minimal \protected@edef example). So how could I build a macro using a `\edef\mymacro{\mymacro something else}` type concatenation, such that the protected tokens inside `\mymacro` are not expanded when the `\edef` runs multiple times on `\mymacro`? (I kind of think that this "multiple times" might justify calling this approach "recursive macro concatenation"; but I'm not sure, as this isn't a "real" recursion of the function-calling-itself kind...)


title: problems with hyperref when \thethm points to undefined reference

text: Consider the following three minimal examples. I do not understand why the first doesn't work while the second and third is fine. Can anyone tell me? Hyperref seems to have problems when \thethm is pointing to an undefined reference. Please don't ask why pointing to an undefined reference makes sense. I do have a good reason for that but it has nothing to do with this question. First example (produces strange error):               \documentclass{article}          \usepackage[thmmarks,hyperref]{ntheorem}      \usepackage{hyperref}          \newtheorem{thm}{Theorem}                                 \newtheorem{prop}[thm]{Proposition}          \begin{document}     \begingroup     \def\thethm{\ref{a}'}     \addtocounter{thm}{-1}     \begin{prop}      yyy     \label{test}     \end{prop}     \endgroup     \end{document}      Second example, hyperref removed, otherwise identical code (works fine):               \documentclass{article}          \usepackage[thmmarks]{ntheorem}           \newtheorem{thm}{Theorem}                                 \newtheorem{prop}[thm]{Proposition}          \begin{document}     \begingroup     \def\thethm{\ref{a}'}     \addtocounter{thm}{-1}     \begin{prop}      yyy     \label{test}     \end{prop}     \endgroup     \end{document}      Third example, code as in the first example but \thethm is changed (also works well):               \documentclass{article}          \usepackage[thmmarks,hyperref]{ntheorem}      \usepackage{hyperref}          \newtheorem{thm}{Theorem}                                 \newtheorem{prop}[thm]{Proposition}          \begin{document}     \begingroup     \def\thethm{1'}     \addtocounter{thm}{-1}     \begin{prop}      yyy     \label{test}     \end{prop}     \endgroup     \end{document}


title: Math symbols not being printed.

text: I am having problems printing an equation. I have the following definitions:               \documentclass{scrreprt}          \usepackage{mathspec}     \defaultfontfeatures{Mapping=tex-text,BoldFeatures={Weight=2}}          \setmathfont[         Scale=0.95,         Extension=.otf,         UprightFont= *-regular,         BoldFont=*-bold,         ItalicFont=*-italic,         BoldItalicFont=*-bolditalic,     ]{texgyrethermes}          \usepackage{unicode-math}          \begin{document}         \begin{equation}              \label{constraint:inference}              D \models C \iff V(D) \models \top \Longrightarrow V(C) \models \top          \end{equation}     \end{document}      This is the putput that I am getting: ![enter image description here](http://i.stack.imgur.com/iFLH2.png)


title: Change the chapter style in scrbook

text: Is there a way to change the chapter style in `scrbook` like in `memoir` with `\chapterstyle{}`?


title: Repeating preamble in LaTeX tabular

text: The TeX primitive `\halign`, on which every tabular etc. is built, allows repeated preambles. The easiest explanation of what it is comes by looking at the output of the code below.               \documentclass{article}     \usepackage{array}     \newcolumntype{\repeat}{<{\span\doublenextamp}}     \def\doublenextamp#1&{#1&&}     \begin{document}          First test.     \begin{tabular}{c\repeat lr}         a   & b   & d     &e   & f     & apsdoi \\         cde & def & erasd &arp & sefoi & wp          \end{tabular}          \end{document}      This saves a lot of typing, and, for automatically generated tables, a lot of counting-myself-the-number-of-columns. However, I could only manage to make it work in LaTeX when the repetition starts from the second column or more, not to repeat the whole preamble. That is because LaTeX (or rather the `array` package?) inserts a lot of stuff before anything that the user could put, but TeX wants the extra `&` (which marks the repetition) to come first. Two questions:   * Is there a packaged solution ?   * Is there a custom solution with a clean user interface ?


title: Missing $ inserted on blank line

text: I get the message "Missing $ inserted" just on a blank line. After this:               1108. a) Avläsning av kruvan $f_{B}(x)$ vid x = 8 ger att $f_{B}(8)$ ≈ 28$.\\     b) \text{Genom att undersöka var kurvan $f_{A}(x)$ skär linjen $T=20$ ser vi att $x \approx {4.3}$ då $f_{A}(x) = 20$}.\\     c) \text{Att lösa ekvationen innebär skärningspunkten mellan kurvorna. Avläsning i diagrammet ger att $x \approx {7,1}$}.      And on this line I get the message. Why is there a message on a line without text? Where is my mistake?


title: Persian Thesis Template

text: Is there any M.Sc. Thesis LaTeX template available ? It would be nice if it is according to rules of Sharif University in writing Thesis!


title: What does \marks do?

text: Recently I had cause to define a macro called `\marks`. If I try something like               \newcommand{\marks}{fred}      I get the error               ! LaTeX Error: Command \marks already defined.      In LaTeX, if I do `\show\marks` I get `> \marks=\marks`, which I think means it's a TeX primitive, but if I execute the same show command in TeX, I get `> \marks=undefined.` I can't find `\marks` in any documentation that I have. What does it do?


title: TikZ: child inheriting arrows

text: I am trying to draw some Feynman diagrams using TikZ but seem to run into trouble where the arrow of a parent is also applied to the child, giving me two arrows on one line. (I have been using the example here as a base for creating my own) Here's what my output look like (I am aware this diagram is incorrect): ![enter image description here](http://i.stack.imgur.com/WEmr8.png) As you can see the position line has two arrows overlapping, it seems it is only the arrows that are inherited. Code:               \documentclass[10pt]{revtex4-1}          \usepackage{tikz}          \begin{document}          \usetikzlibrary{decorations.pathmorphing,decorations.markings,trees,positioning,arrows}              \tikzset{         photon/.style={,decorate, decoration={snake}, draw=red},         particle/.style={,draw=blue, postaction={decorate},             decoration={markings,mark=at position 0.5 with {\arrow[draw=blue]{>}}}},         antiparticle/.style={,draw=blue, postaction={decorate},             decoration={markings,mark=at position 0.5 with {\arrow[draw=blue]{<}}}},         gluon/.style={,decorate, draw=black,             decoration={snake,amplitude=4pt, segment length=5pt}}          }          \begin{tikzpicture}[             thick,             level/.style={level distance=2cm},             level 2/.style={sibling distance=2cm},         ]     \begin{scope}     \node{}             child[grow=right]{                 edge from parent [particle]                 child []{                     edge from parent [photon]                     node [above=2pt, anchor=south,shift={(0.2,0)}] {$\gamma$};                 }                 child[] {                     edge from parent [antiparticle]                     node [above=2pt, anchor=south] {$e^+$};                 }                 node [above=3pt](gam) {$e^-$}              };       \end{scope}     \end{tikzpicture}          \end{document}


title: Placement of rules at the top or bottom of a page

text: I am writing a two-column document and I use `\hrule` to separate different sections. Once the `\hrule` reaches the top or the bottom of the page it stays there. Shouldn't for aesthetic reasons be placed elsewhere so to have text above and below it? Tex shouldn't take this for account so to place the rules accordingly? I don't know if this the right thing to do when someone typesets a document but that's how it seems to me. Am I wrong? I don't want to change something in my document so I don't want a solution for the code or another solution. My question's purpose is what is the right thing to do when trying to typeset a document like that? You should leave a rule at the top or the bottom of the page or you should try to fix it because of a typesetting aesthetic "rule"? Moreover TeX shouldn't do something for it (if that is indeed wrong), like when we have an underful or overful box that gives warning ? ![enter image description here](http://i.stack.imgur.com/aNpqS.png)


title: Missing year in bibliography entry

text: The publisher and year for one of the book entries in my bibliography don't show up when I compile. What is wrong? Here is what I have:               @book{Gray1999,         author  ={Alfred Gray},         title  = {Modern Differential Geometry of Curves and Surfaces with Mathematica},         edition = {2nd}.         publisher = {CRC Press},         year = {1999},     }          @book{Stewart2008,         author    = {James Stewart},         title     = {Calculus: Early Transcendentals},         edition = {6th},         publisher      = {Thompson Brooks/Cole},         year      = {2008},      }      The Stewart book compiles correctly, but the Gray book does not.


title: Truncated body in tabular array mode

text: I have the following format :               \documentclass[12pt]{book}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsmath}          %\usepackage{graphicx}          \usepackage[total={7in,10in},top=1in, left=0.6in,right=0.6in, includefoot]{geometry}.     \newpage          \newcommand{\matrix}[1]{\begin{array}{ccc}#1\end{array}}     \newcommand{\dbkt}[1]{\left|#1\right>}     \newcommand{\bkt}[3]{\left#1 #2\right#3}     \newcommand{\eqnn}[2]{\begin{equation}#1\label{eq:#2}\end{equation}}     \newcommand{\cchapter}[1]{\chapter[#1]{\centering #1}}     \begin{document}          \begin{array}{ll}     blaaah !!\\          &\begin{array}{l}     blaah !!     \end{array}          \end{array}     \end{document}\\      I don't understand why the body doesn't get extended into the next page. Thanks in advance.


title: Referencing an enumeration item with redefined \labelenumi

text: I've got the following problem. I redefined the `\labelenumi` command to get an alphabetic first-order enumeration. If I label an item in this enumeration and generate a reference to it, the number of the item and not the modified label. A minimal example:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8x]{inputenc}     \renewcommand{\labelenumi}{\alph{enumi}.)}          \begin{document}     \begin{enumerate}      \item\label{part1} This is the first part.       \item We have seen in~\ref{part1}, that this does not work.     \end{enumerate}               \end{document}      gives:                  a.) This is the ﬁrst part.        b.) We have seen in 1, that this does not work.      What needs to be refined that `\ref` prints the character and not the number?


title: Fonts in Abstract

text: I am using AMS Latex Article template and I have this problem: The word "ABSTRACT" in the abstract section is, by default, all capitalized and not bold. I want to change that to bold and capitalize only the first letter of the word abtract. Can anyone help please?               \documentclass[timesroman11pt, reqno]{amsart}      \renewcommand\abstractname{\textbf{Abstract}} \usepackage[left=1.1in,top=1in,right=1.1in,bottom=1in]{geometry}      \usepackage{graphicx} \usepackage{times}      \usepackage{mathptm}      \makeatletter      \def\specialsection{\@startsection{section}{1}%      \z@{\linespacing\@plus\linespacing}{.5\linespacing}%      % {\normalfont\centering}}% DELETED      {\normalfont}}% NEW      \def\section{\@startsection{section}{1}% \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%      % {\normalfont\scshape\centering}} % DELETED      {\normalfont\bfseries\Large}}% NEW      \makeatother


title: non centered slides with Prosper

text: I use MixTeX 2.9 with Windows. I have a problem when compiling with the Prosper document class. My code begins as follows:               \documentclass[pdf,distiller]{prosper}     \usepackage{amsmath}     \usepackage{Sweave}     \usepackage{xkeyval}     \title{Multiple Response Optimization}     \subtitle{}     \author{St\'ephane Laurent}          \begin{document}          ...      I compile with 1) latex, 2) dvips, and 3) ps2pdf. In the pdf file the slide is not well centered: ![slide](http://i.stack.imgur.com/o8kGi.jpg) I have tried several options with dvips but nothing changes.


title: boxing a matrix column with tikzpicture, how to ensure sides don't bend around contents?

text: When using `tikzpicture` to draw a rectangle around subsets of matrix elements, how can I be sure of getting a rectangle, rather than a shape that has wonky sides because it takes account of the varying widths of the elements ? For example:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,positioning}     \begin{document}     \begin{tikzpicture}     \matrix [matrix of math nodes] (m)     {1 & 1 & 1 \\     1 & 1 & -2 \\     1 & 1 & 1 \\};     \draw[rounded corners,ultra thick][color=blue]     (m-2-2.north west) -- (m-1-2.north west)     -- (m-1-3.north east) -- (m-2-3.south east) -- (m-2-2.south west) -- (m-2-2.north west);     \end{tikzpicture}     \end{document}      ...gives a rectangle with a wonky right hand edge. This can be fixed by adding a white minus sign before the middle 1 in the top row (`\color{white}-\color{black}1`), but this unattractive kludge messes up the position of the 1! Thanks for any help with this. # UPDATE Many thanks to Heiko for the answer which solved the given example. But there remains a problem when a mid-row has long contents, e.g.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,positioning,fit}     \begin{document}     \begin{tikzpicture}     \matrix [matrix of math nodes] (m)     {1 & 1 & 1 \\     1 & 1.618034 & -2 \\     1 & 1 & 1 \\};     \node[draw=blue,inner sep=0pt,ultra thick,rounded corners,     fit=(m-1-2.north west) (m-1-3.north east)       (m-3-2.south west) (m-3-3.south east)     ]{};     \end{tikzpicture}     \end{document}


title: Fancyhdr, even and odd

text: I want to add the chapter name to the header of even pages and section name to odd. But the output show me just the name of section in every page (odd or even). In below, you can find the sample of the code, could you please help me to fix this issue? Thanks in advance.                 %%% Fancy Header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % Fancy Header Style Options     \usepackage{fancyhdr}                    % Fancy Header and Footer          \pagestyle{fancy}                       % Sets fancy header and footer     \fancyfoot{}                            % Delete current footer settings               \fancyhf{}          \fancyhead[LE,RO]{\bfseries\thepage}    % Page number (boldface) in left on even     % pages and right on odd pages     \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}          \fancyhead[RE]{\bfseries\nouppercase{\leftmark}}      % Chapter in the right on even pages     \fancyhead[LO]{\bfseries\nouppercase{\rightmark}}     % Section in the left on odd pages          \let\headruleORIG\headrule     \renewcommand{\headrule}{\color{black} \headruleORIG}     \renewcommand{\headrulewidth}{1.0pt}     \usepackage{colortbl}     \arrayrulecolor{black}          \fancypagestyle{plain}{     \fancyhf{}       \fancyhead{}       \fancyfoot{}       \renewcommand{\headrulewidth}{0pt}     }


title: How can I make the space between figures and text triple space when the space already is double for writing thesis?

text: How can I make the space between figures and text triple space when the space already is double for writing thesis ? is there anyone can help me? Minimal working example:               \documentclass{article}      \usepackage[labelsep=space]{caption}      \begin{document}      Here, I want to put a figure but the point the figure has to be triple space      from the text that I have written, So in this case what should I do to meet      this required.     \begin{figure}      \includegraphics[scale=1]{V11}      \caption{Picture}     \end{figure}      Moreover, the form of writing is double space.      \end{document}


title: tabular bibliography with biblatex

text: I’m working on a custom biblatex style as I have to meet very special requirements. The citation part (cbx) works really well, but I have a problem with the bibliography definition. I need a _tabular_ bibliography (for an example see this template produced with _BibTeX_ ). I cannot use a `tabular` environment as the `&` within a bibliograpghy line produces an error. Other approaches using e. g. `list` failed, too. Do you have an idea how to produce a tabular bibliography with biblatex?


title: Header content higher than header heigth

text: **Edited:** based on the discussion below I created an interactive file to help people to understand the margins. I'd like to get your opinion about that. You can access it here: Geogebra file to configure margins on LaTeX (tested on Chromium). I hope you enjoy it. * * * I know that there are many commands to adjust the size of margins, text width and so on. But I'm not able to understand what happens with the header and body when we insert some box on the header that is higher than the value of header height. So I drew the image below and I'd like to know which one describes the behavior. The green box is the higher box and the blue one is a box which fits inside the header area. Thanks in advance. ![enter image description here](http://i.stack.imgur.com/F5Wpd.png)


title: Drawing Arrows in Tables

text: What is the best way to draw a diagonal line through the following table?               \begin{center}     \begin{tabular}{*{9}{c}}     $e_{1}$ & = & $0$ & $.$ & $d_{1}^{1}$ & $d_{1}^{2}$ & $d_{1}^{3}$ & $d_{1}^{4}$ & $...$ \\     \\     $e_{2}$ & = & $0$ & $.$ & $d_{2}^{1}$ & $d_{2}^{2}$ & $d_{2}^{3}$ & $d_{2}^{4}$ & $...$ \\     \\     $e_{3}$ & = & $0$ & $.$ & $d_{3}^{1}$ & $d_{3}^{2}$ & $d_{3}^{3}$ & $d_{3}^{4}$ & $...$ \\     \\     $e_{4}$ & = & $0$ & $.$ & $d_{4}^{1}$ & $d_{4}^{2}$ & $d_{4}^{3}$ & $d_{4}^{4}$ & $...$ \\     $...$ \\     \end{tabular}     \end{center}      I want the arrow to hit `$d_{1}^{1}$`, `$d_{2}^{2}$`, etc.


title: biblatex doi setting refsection

text: I am using `biblatex` with biber to create multiple bibliographies within one document. Generally, I want the doi to be printed. Hence, I set `doi=true`. But for one particular bibliography, created within `\refsection`, I want to suppress the doi. Is it possible to change the doi setting for one refsection only? I could use an alternative bibfile for this section and remove all doi- entries from this files. But just changing a setting would be more convenient. Any ideas?


title: How to add an image in second column after some text of a two-column article

text: In a two column article, after some text in the second column I want to add an image. While the pace has required space for it, but it is skipped and it is shown in next page (in case if I use `figure*` otherwise it is not shown). Using the `wrapfigure` give me the image in next page either. I have used `multicols` package. after the `columnbreak` I have some lines of text as below:               Text here text here             Text here text here     Text here text here             Text here text here     Text here text here             Text here text here     Text here text here             **IMAGE SHOULD GO HERE**     Text here text here


title: Path problem with included file inside of a standalone file

text: How can I get the current path inside an included standalone file? **1. Theoretical Example:** let's assume the following directory structure:               main.tex     img/      |-standalonefile.tex      |-data      **standalonefile.tex** :               \documentclass{standalone}          \begin{document}         \somecommand{data}     \end{document}      **main.tex** :               \documentclass{article}          \usepackage{standalone}          \begin{document}         \includestandalone{img/standalonefile}     \end{document}      Now `standalonefile.tex` compiles, but `main.tex` can't find `data`. I couldn't find a way to use path from `\includestandalone` somehow inside `standalonefile.tex`. **2. Practical example with`pgfplots` (MWE)** (I'm looking for a general solution) directory structure:               main.tex     plots/      |- plot1/          |- plot1.tex          |- data.csv      **main.tex**               \documentclass{article}          \usepackage[subpreambles]{standalone}          \begin{document}         \includestandalone{plots/plot1/plot1}     \end{document}      **plot1.tex**               \documentclass{standalone}          \usepackage{pgfplots}          \begin{document}         \begin{tikzpicture}         \begin{axis}             \addplot table [x=x, y=y, col sep=semicolon]{data.csv};         \end{axis}         \end{tikzpicture}          \end{document}      **data.csv**               x;y     0;0     1;1      Now `plot1.tex` compiles fine, but with `main.tex` the `data.csv` can't be found. **Ideas for a solution**   * a command like `\mystandalonedir` that would return      * the relative path to the main file, if included with `\includestandalone`     * nothing, if not included   * change the base dir somehow with the `\includestandalone`   * (or something else ;) )


title: How to place two bar charts beside each other

text: There are two tikz barcharts in this snippet. I'm able to display barcharts one after another but when i use subfigure/subfloat its giving an error               \documentclass[preprint,12pt,3p]{elsarticle}     \usepackage{graphicx}     \usepackage{float}          \usepackage{epstopdf}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{xcolor}     \usepackage{pgfplots}     \usepackage{tikz}     \pgfplotsset{compat=1.10}     \usetikzlibrary{decorations.pathreplacing}          \begin{document}          \begin{figure}[ht!]         \centering         \subfloat{             \begin{tikzpicture}         \begin{axis}[             ybar,             ymin=0,             width  = 12cm,             height = 5cm,             bar width=5pt,             ylabel={$\mathcal{J}$ of WM},             nodes near coords,             xticklabel style={rotate=90},             xtick = data,             table/header=false,             table/row sep=\\,             xticklabels from table={\footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               \footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               \footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               }{[index]0},             enlarge y limits={value=0.2,upper}           %  legend pos=north west         ]          \legend{1\%, 5\%}         \addplot table[x expr=\coordindex,y index=0]{1\\2\\3\\4\\4\\2\\3\\4\\4\\2\\3\\4\\};         \addplot table[x expr=\coordindex,y index=0]{3\\2\\8\\4\\4\\2\\3\\4\\4\\2\\3\\4\\};         \pgfplotsinvokeforeach{0,3,4,7,8,11}{\coordinate(l#1)at(axis cs:#1,0);}         \end{axis}         \coordinate(bbs)at(current bounding box.south);         \foreach[count=\i,evaluate={\s=int(4*\i-1)},evaluate={\e=int(4*(\i-1)}] \text in {Axial,Coronial,Sagittarial}            \draw[decorate,decoration=brace]([xshift=8pt]l\s|-bbs)--node[below=5pt]{\text}([xshift=-8pt]l\e|-bbs);     \end{tikzpicture}         }         % A blank line here like a new paragraph so next picture is placed below         \subfloat{              \begin{tikzpicture}         \begin{axis}[             ybar,             ymin=0,             width  = 12cm,             height = 5cm,             bar width=5pt,             ylabel={$\mathcal{J}$ of WM},             nodes near coords,             xticklabel style={rotate=90},             xtick = data,             table/header=false,             table/row sep=\\,             xticklabels from table={\footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               \footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               \footnotesize               wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\               }{[index]0},             enlarge y limits={value=0.2,upper}           %  legend pos=north west         ]          \legend{1\%, 5\%}         \addplot table[x expr=\coordindex,y index=0]{1\\2\\3\\4\\4\\2\\3\\4\\4\\2\\3\\4\\};         \addplot table[x expr=\coordindex,y index=0]{3\\2\\8\\4\\4\\2\\3\\4\\4\\2\\3\\4\\};         \pgfplotsinvokeforeach{0,3,4,7,8,11}{\coordinate(l#1)at(axis cs:#1,0);}         \end{axis}         \coordinate(bbs)at(current bounding box.south);         \foreach[count=\i,evaluate={\s=int(4*\i-1)},evaluate={\e=int(4*(\i-1)}] \text in {Axial,Coronial,Sagittarial}            \draw[decorate,decoration=brace]([xshift=8pt]l\s|-bbs)--node[below=5pt]{\text}([xshift=-8pt]l\e|-bbs);     \end{tikzpicture}         }              \caption{Accuracies Comparision}         \end{figure}     \end{document}


title: How to label complex edges with graph library?

text: I would like to use `graph` TikZ-library from CVS version (sourceforge or tlcontrib) to draw flowcharts. Something like the one shown in chapter 5 from TikZ manual. In this tutorial, some styles are declared to easily draw loops and corners between nodes. I would like to add some label to this lines but `edge label` option doesn't work with these kind of edges. It seems to work with straight paths but not with complex ones. Next example shows the problem:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{arrows,graphs,matrix}          \begin{document}     \begin{tikzpicture}[>=stealth',         font=\sffamily\small,         every node/.style={align=center},         skip loop left/.style={to path={-- ++(-#1,0)|- (\tikztotarget)}},         skip loop right/.style={to path={-- ++(#1,0)|- (\tikztotarget)}},         hv path/.style ={to path={-| (\tikztotarget)}},        vh path/.style ={to path={|- (\tikztotarget)}},     ]          \matrix[column sep=1cm,row sep=1cm] (mymatrix)  {     \coordinate (A11) {}; & \node[draw] (A12) {A12};\\     \node[draw] (A21) {A21}; & \coordinate (A22) {};\\     };          \graph[use existing nodes] {      A21->[edge label=A]A12;      A21->[hv path, edge label=B] A12;  %<- this label is not shown      A21--[edge label=C]A11->A12;      };     \end{tikzpicture}     \end{document}      The result shows labels A and C, but not B. Label C is shown because the edge is divided into two straight edges. I can always use something like that, but do you know a better solution? ![enter image description here](http://i.stack.imgur.com/xHFec.png)


title: How to open AdobeReader with arara?

text: ... strange question you will think and you are right, but there are some features, that are not shown in the PDF-Viewer from TeXworks, tooltips for example. I tried this rule, which executes an arbitrary commandline-order. I added the last line!               !config     # Console rule for arara     # author: Clemens Niederberger     # requires arara 3.0+     identifier: console     name: Console     command: <arara> @{command}     arguments:     - identifier: command       flag: <arara> @{parameters.command}       default:  <arara> @{getBasename(file)}.pdf      It did not have success:               Running Console...                I'm sorry, but the command from the 'Console' task could not be     found. Are you sure the command 'testfile.pdf' is correct, or even     accessible from the system path?     C:\texlive\2013\bin\win32\runscript.tlu:650: command failed with exit code 1:     java.exe -jar c:/texlive/2013/texmf-dist/scripts/arara/arara.jar testfile.tex --verbose --log


title: Wrong axes in PSTricks figure using \psaxes

text: Consider the following example:               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{figure}      \centering       \begin{pspicture}(-0.8,-0.8)(6.3,6.3)         \psaxes[           dx = 1.25,           Dx = 1.25,           dy = 0.5,           Dy = 0.5,           xLabels = {,\frac{U_{0}}{2},\frac{U_{1}}{2},\frac{U_{2}}{2},\frac{U_{3}}{2}},           yLabels = {,\frac{U_{0}}{5},\frac{U_{1}}{5},\frac{U_{2}}{5},\frac{U_{3}}{5}}         ]{->}(0,0)(-0.2,-0.2)(5.5,5.5)[$X$,0][$Y$,90]       \end{pspicture}     \end{figure}          \end{document}      ![output](http://i.stack.imgur.com/JB9YN.jpg) I would like to fix the following issues:   1. Remove the three `.2`.   2. Put the labels next to the ticks. P.S. I thought I knew how to do this but I can't make it work now.


title: `float` package not playing nice with `sidecap` package?

text: In trying to answer this question, I thought it would be easy to add a new float environment using the `float` package. However, the labeling of the caption is not getting correctly formatted. Because I'm creating a new float that I want labeled with a side caption, I dug into the `sidecap` package and created a new environment to match the new float. Here's a MWE:               \documentclass{book}               %% setting up new float     \usepackage{float}     \floatname{mySpecialFloat}{Special Float}     \newfloat{mySpecialFloat}{tbhp}{lst}[chapter]     \newcommand{\listofSpecialFloats}{\listof{mySpecialFloat}{List of Special Floats}}          %% setting up side captions     \usepackage[wide]{sidecap}                                           \makeatletter     \@ifdefinable\SC@specialFloat@vpos{\def\SC@specialFloat@vpos{b}}     \newenvironment{SCspecialFloat}{\SC@float[\SC@specialFloat@vpos]{mySpecialFloat}}{\endSC@float}     \newenvironment{SCspecialFloat*}{\SC@dblfloat[\SC@specialFloat@vpos]{mySpecialFloat}}{\endSC@dblfloat}     \makeatother          %% setting up formatting for cpations     \usepackage       [         font=footnotesize,         format=plain,         labelfont={bf,sf},         textfont={it},         width=10pt       ]{caption}          \usepackage{lipsum}     \pagestyle{empty}     \begin{document}     \listofSpecialFloats          \begin{mySpecialFloat}       \centering         Hello       \caption[toc entry for hello]{Hello}     \end{mySpecialFloat}          \begin{SCspecialFloat}     \begin{minipage}[t]{\textwidth}       \lipsum[1-2]     \end{minipage}       \caption[toc entry for lipsum]{My caption content}       \label{fig:src:01}     \end{SCspecialFloat}          \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/Jrzku.png) What I find interesting is that everything seems to be working correctly. The listing command knows about all my special floats. The only thing that doesn't seem to be working correctly is the label for the caption for the side caption float. I know this could be accomplished with `newfloat`, but I'm wondering what's happening here. Why is the label name getting lost in the `sidecap` environment? **UPDATE** There seems to be a conflict in naming conventions used by `float` and those expected by `sidecap`. It seems this can be fixed if I add the following line to my code for setting up the captions:               \@namedef{mySpecialFloatname}{Special Float}


title: Beamer copenhagen theme banner height

text: I'm using beamer with Copenhagen theme. I want to use a logo in the right-most corner of all slides. I achieved this using `textblock` and `addtobeamertemplate` facilities. My question is, when I add more sections to my presentation, the banner height increases. When the banner heights increases, I want my logo gets bigger too. So, I need to know the `height` (see added image) programmatically. Is that possible? ![First slide](http://i.stack.imgur.com/6LZdU.png)


title: Setting headers and footers, I have 2 styles

text: I have 2 styles for my header and footers. This one is for 90 %of my pages, I want the section in the header. My name left in the footer and my page right:               \fancypagestyle{standard}{     \fancyhf     \fancyhead[L]{\leftmark}     \fancyfoot[L]{name}     \fancyfoot[R]{Page \thepage}     }      But I also want my name in the footer on a chapters\index\tableofcontentspage + the page should be right aligned:               \fancypagestyle{chapters\index\tableofcontents}{     \fancyhf     \fancyfoot[L]{name}     \fancyfoot[R]{Page \thepage}     }      But how do I set these settings correctly? At the moment I use the "standard" style, but my numbering on chapters is different now, and I want that to be the same on al my pages. And of course a chapter page, index page of table of contents don't need a section name in the header. **Edit:** Let me try be more clear: I want my name left aligned in the footer + the page right aligned on every page. Then on pages that are part of a chapter, I want the chapter name in the header. Thank you so much


title: Overlaying caron and a vowel in boldface and italic styles

text: I found that a lovely typeface I wanted to use did not contain the graphs **ǎ ě ǐ ǒ ǔ ǚ** , which I need for Pinyin romanization in text mode. Discussion below takes **ǎ** as the example. Using the graph `ǎ` as literal text or as its Unicode codepoint `^^^^01ce` produces a blank; the normal caron-composition macro `\v{a}` etc. also produces a blank. Surely all three cases come about because the typeface lacks a glyph for the composite graph. The glyph for `\textasciicaron` alone does exist in the font: ![caron Gyre Termes](http://i.stack.imgur.com/LbTv1.png) and I can create a passable rendering of **ǎ** manually using               `\rlap{\textasciicaron}\kern.7pt a` :       ![ǎ normal Gyre Termes](http://i.stack.imgur.com/nGYp5.png) The problem is that it does not render correctly either in boldface or italics (kerning adjusted to .1pt on the latter): ![ǎ boldface Gyre Termes](http://i.stack.imgur.com/qatGz.png) and ![ǎ italic Gyre Termes](http://i.stack.imgur.com/Fst2V.png) I suppose that is because the `\textasciicaron`, either alone or overlaid, is not affected by those processes, at least not in standard syntax. `FakeSlant` and `FakeBold` similarly have no effect on `\textasciicaron`. Can anyone suggest another line of attack to get these glyphs in bold and italic? * * * **EDIT** : My original posting concerned the font TeX Gyre Termes; shortly after posting, I realized that my version of the font was out of date and the new version has the glyphs I was discussing. So I have removed discussion of the font but left my question, since I think it is a valid one that I was unable to solve on my own.


title: Making a daily devotional

text: > **This question led to a new package:**   >  `scrjrnl` I'm searching for packages to write a daily devotional such as this one (Click "Search inside this book" and see in the end of the preview for example). I could not find a suitable package on the CTAN to do that. I'm thinking that I could use a `book` or `scrbook` class and either redefine or encapsulate:   * `\chapter` for each month, resetting a counter for every day;   * `\section` for every day of the month, using and incrementing the counter. What would be the best/easiest approach in this case?   * Making a `devotional` class to replace `book`;   * Writing macros to encapsulate `\chapter` and `\section`;   * Redefining `\chapter` and `\section` or playing with definitions used inside `\chapter` and `\section` calls in `book` or `scrbook`;   * Any other enlightened suggestion... The usage I'm thinking about would look like this:               \documentclass{scrbook} % or \documentclass{devotional}     \begin{document}     \tableofcontents          \month{January} % Set counter for month of January     \day*{} % Set a new day -- January 1, do not list in toc     \begin{verse}{Genesis 3.4}     % contents of the verse     \end{verse}     % commentary     % commentary     \begin{prayer}     % contents of prayer     \end{prayer}          \day*{} % Set a new day -- January 2, do not list in toc     % day contents          % etc.     \end{document}


title: Two column layout with text and knitr chunk

text: When making presentations (with latex beamer class), I often go for a frame layout with text and equations on the left and a corresponding figure on the right. My standard solution has been to wrap the text in a `minipage` and figure in another `minipage` and add a small space in between, but it does not work when replacing the figure with a knitr chunk. As this is a common slide design I hope someone out there knows how to produce it. ![enter image description here](http://i.stack.imgur.com/5QFju.png)               %-------------------------------[ Text + pdf on disk works fine ]     \begin{frame}       \begin{minipage}{5cm}         Text       \end{minipage}       \hspace{.5cm}       \begin{minipage}{5cm}         \begin{figure}           \includegraphics{my_figure.pdf}         \end{figure}       \end{minipage}     \end{frame}          %-------------------------------[ Text + knitr chunk does not work ]     \begin{frame}       \begin{minipage}{5cm}         Text       \end{minipage}       \hspace{.5cm}       \begin{minipage}{5cm}     <<echo=FALSE,eval=TRUE,out.width='4cm',out.height='4cm'>>=     plot(1:10)     @       \end{minipage}     \end{frame}


title: Latin's scansion : length of vowels

text: I am a total enthusiastic beginner in LaTeX and my work in latin studies requires some twisty signs to mark the length of the vowels. I would love to find a way to have the length display on the same level. If you know a way to do so, please tell me. Here is a minimal working example of what i'm able to do so far. It's ok, but not perfect : the length marks are not on the same 'level'.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{color}     %custom command : shortcut for formating     \newcommand{\gr}[1]{{\bf \color{red}#1}}     \newcommand{\ro}[1]{{\color{red}#1}}     \newcommand{\g}[1]{{\bf #1}}     \title{Latin' s Scansion}     \begin{document}     \maketitle     \begin{tabular}{rlll}     734 & \ro{h\={a}s} \g{\={i}n}\ro{t\={e}r} / \g{p\={e}s}\ro{t\={e}s} // \g{d\=  {u}}\ro{r\={o}} /// \g{C\u{a}}t\u{o} \gr{m\={i}}l\u{i}t\u{e} \gr{s\={i}c}cum  &   SSSD  & hhhh \\     \end{tabular}      \end{document}      I can do what i want easily with this tool and import in ms Word : http://www.lexilogos.com/clavier/latin.htm But with LaTeX, it doesn't work... Thanks Evelyne


title: Problem with installing TeX Live under Windows 8

text: I am new to LaTeX and wanted to install the required "programs". But when I came to installing TeX Live, there seemed to be a problem:               Can't spawn "cmd.exe": No such file or directory at (directory)      I have no idea what to do, I simply just downloaded the zipped file from the internet, unzipped it at a random location and tried to run it from cmd. My PC is recently formatted with Windows 8 and I haven't installed anything with LaTeX before on it. Hope someone can help.


title: Ipe can't find pdflatex

text: Okay I installed texlive 2012, just by following the guides from http://www.tug.org/texlive/. Now when I downloadend, compiled and installed ipe7, the latest version. Now when I try something, draw/text etc, ipe tells me that it can't find pdflatex. Now I guessed that since I installed it from tug.org and not by a ubuntu package that it is now installed underneath a different directory. Pdflatex is located in the folder `/usr/local/texlive/2012/bin/x86_64-linux/` Now I found in the manual that you can use the command flag `IPELATEXDIR` to point to a different location where pdflatex is located. So I started `ipe --IPELATEXDIR=/usr/local/texlive/2012/bin/x86_64-linux/` but it still tells me that it can't find pdflatex? I tried to find a log file in `~/.ipe/` but only the latex file is located there. Does anybody got any clue?


title: How to get " in TeXnicCenter with auto-replacement for quotation marks enabled

text: I usually appreciate TeXnicCenter's feature of automatically replacing `"` with ```` and `''`, but sometimes I actually need `"` in the source, e.g. in `"|` to prevent a ligature. Is there a clever way (like a special key combination) to achieve this? (Obviously, changing the TeXnicCenter setting is not an option. So far, I'd open up notepad real quick and type, copy, and paste `"`, but I'm looking for a more efficient way.) I use TeXnicCenter 1.0 RC 1.


title: Redefine \title command in custom class

text: I am currently writing a custom class that inherits from a standard class (article), and I would like to redefine the `\title` command, so that the end user can call it, and I would be able to get the result of that command, modify it a tiny bit, and input it to the `\title` command _of the base class_. Actually, when writing this question, I have found a way of doing this. Here is a MWE, with the class file `Test.cls`:               \ProvidesClass{Test}     \LoadClass{article}          \title{\@testTitle, isn't it?}     \renewcommand*{\title}[1]{\def\@testTitle{#1}}          \endinput      And the user file:               \documentclass{Test}          \title{A great article}          \begin{document}     \maketitle     \end{document}      So in the end, the user chooses a title, but the results outputs an article with the modified title. Is it the standard way of doing? How would you improve it?


title: Path shaded perpendicular to its direction

text: Is ist possible to apply a shading to a path perpendicular to it's current tangent. I want to draw some kind of 3d-pipe. My question is related to this question. I want to draw 3d-molecules and I am struggeling with how to draw the bonds between the atoms. I'd like to have something like `\draw[bond color=red; bond width=15pt] (atom1) -- (atom2);` The result should be a pole from coordinate `atom1` to coordinate `atom2`. Pole means a rectangle with a length of the distance beween `atom1` and `atom2` and a height of 15pt filled with a shade red-white-red along the height axis. I could actually do that using `\shade` and `shading angle` but then I'd have to calculate the shading angle myself depending on the coordinates of `atom1` and `atom2`. Any suggestions for that? Thanks


title: How to write a multiple choice test book with LaTeX?

text: I want to write a book which will consist of many multiple choice exam sheets. Putting the codes below into my preamble, I wrote the question like as               \begin{enumerate}     \item $2+2=?$     \choice $1$   \choice $2$  \choice $3$   \choice $4$   \choice $5$     \end{enumerate}      For each exam sheet, in the footer I want to create a table of correct answers. Is there any simple way to do this, or a LaTeX macro script to do this automatically by mentioning correct answer in its LaTeX codes? For example;               \choice 1 \choice 2 \choice 3 \correctchoice 4 \choice 5      In addition, since the choices are not side by side, I have lost many spaces. Is there any LaTeX codes to write choices more symmetrically and automatically in one or two row?               %%% Codes in preamble %%%          \newcounter{choice}     \renewcommand\thechoice{\Alph{choice}}     \newcommand\choicelabel{\thechoice)}     \newenvironment{choices}%     {\list{\choicelabel}% {\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}% \settowidth{\leftmargin}{W.\hskip\labelsep\hskip 1.5em}% \def\choice{% \item } % choice \labelwidth\leftmargin\advance\labelwidth-\labelsep \topsep=0pt \partopsep=0pt }% }%     {\endlist}          \newenvironment{oneparchoices}%         {% \setcounter{choice}{0}% \def\choice{% \refstepcounter{choice}% \ifnum\value{choice}>1\relax \penalty -50\hskip 1em plus 1em\relax \fi \choicelabel \nobreak\enskip }% choice % If we're continuing the paragraph containing the question, %then leave a bit of space before the first choice:          \ifvmode\else\enskip\fi     \ignorespaces     }%


title: My pixel perfect picture gets blurry when compiled in LaTex

text: Here's my problem. I have this picture: http://dl.dropbox.com/u/3394117/Temp/fig1.png (I have the original in Pixen and could export it to several different formats. I went with png though since it's lossless.) Anyhow. When I open my picture in Preview (OS X) and zoom in, it looks fine. The characters have extremely sharp boarders between them and the background. However, when I put it into my latex document, compile it to a pdf (using TexShop) and then zoom in, it suddenly have gotten blurry (see screenshot: http://dl.dropbox.com/u/3394117/Temp/Screen%20shot%202011-02-13%20at%2012.46.30.png). Minimal working example:               \documentclass[12pt]{article}     \usepackage{graphicx}     \begin{document}     \includegraphics[scale=1]{fig1.png}     \end{document}      In the end, I would like to be able to scale the picture freely without there being any blurring at all. Does anybody have any solution to my problem?


title: Switch off anti-aliasing in bitmaps

text: > **Possible Duplicate:**   >  My pixel perfect picture gets blurry when compiled in LaTex When including a small bitmap scaled to a larger size: how can I disable anti- aliasing?               \documentclass{article}     \usepackage{graphicx}     \begin{document}     \includegraphics[scale=15]{sqares.png}     \end{document}      yields ![output with anti-aliased sqares](http://i.stack.imgur.com/jiWzD.png) with this image: ![squares.png](http://i.stack.imgur.com/mT37z.png)


title: Enclosing place: publication in parentheses

text: Using biblatex and author-date styles, how do I go about customising my bibliography so that place/address: publisher becomes (address: publisher) e.g. (London: Routledge) rather than London: Routledge. Similarly how do I customise vol and no in a periodical to read vol:no? There is no style file for the (Blackwell) journal I wish to submit to and my old BST file made in makebst no longer works with biblatex/biber.


title: Using \cref and custom labels for inference rule names

text: I have an array environment that is used to present inference rules (via a custom command). Now, these inference rules have names and i would like to refer to them using \label and \cref commands. I am guessing this is possible though the details elude me. As a small example, this is the command:               \newcommand{\typerule}[3]{\ensuremath{\begin{array}{c}\textit{\scriptsize ({#1})} \\#2 \\\hline{\ensuremath{#3}}\end{array}}}      It produces an inference rule with hypotheses (#2), a line, a conclusion (#3), all topped by a name for the rule (#1). My idea would be to add another parameter and something \label-style related to it, so that in the text later on i can use cleveref's \cref{} and then the name saved in the environment (and the related category name) pop up. So i would write               \typerule{name}{premise}{conclusion}{labelidentifier}      and somewhere else               The \cref{labelidentifier} does ...      and the produced output should be something like               The rule name does      where _rule_ is generated by cleveref and _name_ is the one i specified previously.


title: Example of Javascript form within pdflatex

text: 1. Can someone please show me an example of how to include a simple Javascript form within a pdflatex document?    2. Can someone please show me an example of accessing and modifying the PDF file's DOM from Javascript within a pdflatex document?   3. Is there some reasonably friendly document to describe how to intermix PDF and Javascript?


title: Lyx error when creating nomenclature: "No file (%.nls."

text: I have a new installation of Lyx 2.0.7. I'm trying to create a minimal nomenclature listing. I've added a single "Nomenclature Entry..." and a single "List / TOC -> Nomenclature". When I try to Update, I get               ...     Running: pdflatex  "Arbiter.tex" > nul     19:35:11.984: Error while exporting format: pdf2      and checking the log file I find               ...     LaTeX Font Info:    ... okay on input line 14.     No file Arbiter.nls.     (C:\Users\Stout\AppData\Local\Temp\lyx_tmpdir.Hp2560\lyx_tmpbuf2\Arbiter.aux) )      Thanks.


title: TeXShop search not working for multiple file source

text: I am using TeXShop 3.26 under Mavericks. I have SyncTeX selected as the sync method. Searching works both ways in general (source to pdf and pdf to source). However, when editing a multifile source where there is a "root" document with sections included with \input{}, and similarly subsections within those, forward search (source to pdf) doesn't work. Nothing happens. Pdf to source still works fine. Is this known/expected behaviour? Is there any setting I can make to fix it?


title: Install beamer in Windows

text: I am new to using LaTeX in Windows environment. Somehow I managed to install MiKTeX 2.9 in my system and the TeXworks editor. Now I want to install `beamer`. I found this link and installed TeXnicCenter as specified. Now I cannot find any MiKTeX program from the Windows start menu. How am I suppose to get to MiKTeX options to install beamer?


title: Citation style: pages punctuation

text: Look at following `\autocite`-example: > `\autocite[15]{kant}` > > Immanuel Kant: Freizeitparks im Harz, S. 15. How can I change the comma into a period? For the bibliography it's easy. I can use:               \renewcommand*{\bibpagespunct}{\addperiod\addspace}      But for the citation?


title: work on documents on Linux and Windows (umlaut, newline)

text: We work on a latex document with three persons using emacs on linux, emacs on windows and texniccenter on windows. We encountered problems with umlauts and linebreaks. I would like to know:   * We should probably use utf8 encoding. Can I tell Texniccenter or other "easy to use" Latex editors on windows to use utf8 and keep a unix-formatted file (concerning linebreak) in that format?   * Are there general recommendations for this problem?


title: lstlisting in a newenvironment

text: I have a problem with the `lstlisting` package. I want to define an `\newenvironment` with one obligatory parameter, which will be the caption name for the `lstlisting`. I will also have other `lstlisting` environments, that is why I am trying to define them separately. I am also having some difficulties with `\lstinline` command (I set up a `\newcommand` to gain easier coding), which typesets keywords in normal text. Why can't it be in captions and similar? I suppose something could be wrong with the preamble, that's why all the packages used are listed.               \documentclass{book}     \usepackage[a4paper, top=3cm, bottom=3cm, heightrounded, outer=3cm, inner=3cm, marginparwidth=1.5cm, marginparsep=0.5cm]{geometry}      \usepackage{tocloft}     \usepackage{amsmath}      \usepackage{eurosym}     \usepackage{url}     \usepackage{array}     \usepackage{tabularx}     \usepackage{multirow}      \usepackage{multicol}      \usepackage{graphics}     \usepackage[dvips]{graphicx}      \usepackage{epstopdf}      \usepackage[dvipsnames]{xcolor}      \usepackage{verbatim}     \usepackage{fancyvrb}      \usepackage{fancyhdr}     \usepackage{paralist}      \usepackage{listings}      \usepackage{pifont}      \usepackage{indentfirst}           \lstset{language=[Visual]Basic, %     keywordstyle=\color{blue},commentstyle=\color{ForestGreen},stringstyle=\color{Maroon},%     basicstyle=\ttfamily\normalsize, frame=lines, %     showspaces=false, showstringspaces=false,%     tabsize=4, aboveskip=10pt, belowskip=10pt, %     lineskip=2pt, numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt,%     numberblanklines=false, %     breaklines, breakatwhitespace, prebreak=\_, breakindent=0pt %     }          \lstset{morekeywords={Or, Loop, Until, To, As, Single, Module, Double, ByVal}}          \lstset{emph={Console}, emphstyle=\color{Aquamarine}}          \newenvironment{case}[1]{\renewcommand\lstlistingname{Case}%     \begin{lstlisting}[caption={#1}]}%     {\end{lstlisting}}          \newcommand{\code}[1]{\lstinline[basicstyle=\rmfamily\normalsize, prebreak=, keywordstyle=\ttfamily]{#1}}           \begin{document}          Example with inline, that works: \code{Console, Sub in Module}.          \begin{case}{Hello world} %doesn't work     Module Module1         Sub Main()             Console.WriteLine("Hello World!")             Console.ReadKey()     End Sub     End Module     \end{case}          \end{document}      Thank you in advance!


title: Why can't I scale my image?

text: I'm using the `graphics` package and I can insert my graphic into the document without any difficulty, apart from the fact that it's huge! I am using the following command:               \documentclass{article}          \usepackage{graphics}            \begin{document}            \begin{figure}[b]            \centering            \includegraphics{cinema}            \caption{Fig. 1: Simple Past}       \end{figure}          \end{document}      But when I insert the scaling option: `[scale=0.75]` etc. It won't work and I get the message                Runaway argument?     scale=0.75]{cinema} \caption {Fig. 1: Simple Past} \end {figure}      ! Paragraph ended before \Gin@iii was complete.     <to be read again>                         \par


title: How do I make a header for whole document?

text: I was looking for this topic. How could I solve it? I have an issue with the code, when I define the header:               \documentclass[12pt,a4paper]{book}     \title{\textbf{TITLE}}     \usepackage[spanish]{babel}     \usepackage{pdflscape}     \usepackage{color, colortbl}     \definecolor{Gray}{gray}{0.9}     \usepackage{caption}     \usepackage{enumitem}          \captionsetup[table]{skip=10pt}     \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{         \markboth{#1}{}}     \renewcommand{\sectionmark}[1]{         \markright{\thesection\ #1}}     \fancyhf{}     \fancyhead[LE,RO]{\bfseries\thepage}     \fancyhead[LO]{\bfseries\rightmark}     \fancyhead[RE]{\bfseries\leftmark}     \renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \addtolength{\headheight}{0.5pt}     \fancypagestyle{plain}{         \fancyhead{}         \renewcommand{\headrulewidth}{Opt}     }          \begin{document}          \maketitle     \newpage     \tableofcontents          \section{RESUMEN EJECUTIVO}     \begin{enumerate}[label=\Alph*]     \item Los Par\'asitos     \item Cuantificar     \end{enumerate}          \end{document}


title: PDF reference links when using hyperref and (`ruled`) algorithm2e

text: I was testing some links within my produced PDF file and recognized that all of the links to an algorithm (from the `algorithm2e` package) will jump to the beginning of the algorithm with skipping half of the algorithm's header and the caption of the algorithm. I use the `ruled` option of the `algorithm2e` package such that the caption will be above the actual algorithm. Here is a minimal example:               \documentclass{scrbook}          \usepackage[colorlinks=true,linkcolor=blue]{hyperref}          \usepackage[ruled]{algorithm2e}          \begin{document}        Der Algorithmus \ref{alg:roundoff} approximiert das ''Closest Vector Problem``.         \newpage            \begin{algorithm}             \caption{\label{alg:roundoff}Babais \textsf{ROUNDING OFF-PROCEDURE}}                  \emph{Berechne $r_1, r_2, \ldots, r_n \in R$, sodass $\vec{q} = r_1\vec{b}_1+r_2\vec{b}_2+\cdots+r_n\vec{b}_n$ gilt.}\\             $\vec{v} := \vec{0}$\\             \For{$i = 1,2,\ldots,n$}             {                 $\vec{v} := \vec{v} + \lfloor r_i\rceil \cdot \vec{b}_i$             }          \end{algorithm}     \end{document}      This code will produce a (blue) link on the first page to the algorithm on the second page. But when zoomed and after clicking the link, it will jump to the following part of the algorithm: ![Wrong jump target on ruled algorithm](http://i.stack.imgur.com/rADbr.png) Question: Is it possible to adjust the jump position for algorithms (from package `algorithm2e`) such that a click will jump to the position before the algorithm header/caption even if the `ruled` option of the `algorithm2e` package is used?


title: What is the difference between \fboxsep=1cm and \setlength{\fboxsep}{1cm}?

text: Question has been written above.


title: How to change text color in footline

text: I hope this is not a duplicate question, but I did not find my answer. I have seen how to change the background color of footline, but not how to change text color. I have this code for my footline:               \makeatletter     \newdimen\mywidth%     \setlength{\mywidth}{\paperwidth}%     \addtolength{\mywidth}{-\beamer@sidebarwidth}%     \setbeamertemplate{footline}     {       \leavevmode%       \hbox{%       \begin{beamercolorbox}[wd=\beamer@sidebarwidth,ht=2.25ex,dp=1ex,right]{sidebar}%       \end{beamercolorbox}       \begin{beamercolorbox}[wd=\mywidth,ht=2.25ex,dp=1ex,right]{normal text}%         \usebeamerfont{date in head/foot}\hfill\insertshortauthor{}\hspace*{2em}         \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}       \end{beamercolorbox}}%       \vskip0pt%     }     \makeatother      This code produces just what I want: Author and frame number in footline, but I want it to show the text in a specific color I have defined before:               \definecolor{beamer@ColorIPN}{RGB}{140,17,17}      My question is, how do I change text color in foot line from black to IPN color?


title: Unequally spaced columns in XYpic

text: I often need to create a diagram in XYpic where the distance between the columns varies. This is usually when one has a map to some object X where the definition of X is in the diagram itself, like               \begin{equation*}     \xymatrix{         A \ar[r] & B = \{c \in C \mid f(c) = 0 \}         \\         a \ar@{|->}[r] & b     }     \end{equation*}      If you actually typeset this, the lower b will be aligned to the center of the rather large second column, while one wants it below the upper B. A solution is to write               \begin{equation*}     \xymatrix{         A \ar[r] & B & = \{c \in C \mid f(c) = 0 \}         \\         a \ar@{|->}[r] & b     }     \end{equation*}      so that the definition of B is in the third column. The problem is now that the equal sign is too far from the B to which it refers. Such a thing is easy to do in kuvio, but kuvio does not support pdflatex, and moreover my coworkers have chosen xypic instead.


title: On Windows 7 install mktexpk places fonts under \users\userid......

text: I have an installation of Texlive on a Windows 7 system. `TEXMFHOME` is set to `C:/texlive/whb/texmf`. When I run `mktexpk --mfmode cx --bdpi 300 --mag 1+180/300 --dpi 480 cmr12` it finds the fonts in the `TEXMFHOME` tree ok, but it places the results in `C:/Users/Bill/.texlive2010/texmf- var/fonts/pk/cx/public/cm/cmr12.480pk`. This is a problem for me because I want to use this with Mediawiki on a server and the user there will be the `IIS_USERS` account. When I try to run under IIS, `mktxpk` fails trying to create the directory: `C:/Windows/system32/config/systemprofile/.texlive2010/texmf-var` Is there some way to tell `mktexpk` to place the fonts under `TEXMFHOME`? Or some other specific directory tree?


title: pdflatex mysteriously loses half a line

text: I have encountered a very mysterious problem. When I send my document to my professor, he found half a line of text is missing in the PDF file, meaning that it left as blank but occupies correct spaces. I checked my .tex file, it is OK. But when I compile it again, it appears as that. If I delete some random words, it may not reproduce that error. I will try to produce a minimal W.E. I am working with Win 7 + MiKTeX 2.9 + pdflatex


title: Delimiting a macro argument with the macro itself

text: Any command sequence can be used to delimit a macro parameter. Even one that has not been defined. For example:               \def\YY#1,#2\@@{#1,#2}          \YY123,2345\@@      will happily work, even if the macro `\@@` has not been defined. In the LaTeX source there is an unusual macro, where the name of the macro itself was used as a delimiter. In simple terms the example below works, with no errors.               \def\XX#1,#2\XX{#1,#2}          \XX12,13\XX      **Does this offer any memory or speed advantage or any other advantage for that matter?** Short MWE for experimentation is listed below:               \documentclass{article}     \begin{document}     \makeatletter     \def\YY#1,#2\@@{#1,#2}     \YY123,2345\@@          \def\XX#1,#2\XX{#1,#2}     \XX12,13\XX          \makeatother     \end{document}


title: Defining environments based on other ones: What's the right way?

text: Assume that I want to define a new environment that is a variant of an existing one. For example, I seek an `italicquote` environment that acts like the `quote` environment but displays its contents in italic. The approach endorsed in section A.1.3 of the _LaTeX Companion_ is to write the internal environment as one would use it in the text body, i.e.               \newenvironment{italicquote}{%       \begin{quote}%       \itshape     }{%       \end{quote}%     }      However, in this answer to Defining my own description environment Martin Scharrer advocates writing the internal environment into its plain form, i.e., transforming my example into               \newenvironment{italicquote}{%       \quote       \itshape     }{%       \endquote     }      His reasoning: > The internal environment is written into the plain form [...] to avoid > confusing error messages when [`\end{italicquote}`] is missing. In this case > the last `\begin` would be the one of the internal macro and its name would > be printed in the error message instead of the one written in the source > file. This isn't a problem for your own small environments, but important if > they are used by other people. Is the second way of defining "derived" environments to be preferred without exception? If yes, why did the _LaTeX Companion_ use the first way? If no, in what situations should one prefer to write `\begin{quote}` ... `\end{quote}` in my example environment?


title: Rotating a TikZ fading.

text: With PGF/TikZ one can produce fadings, like               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fadings}     \begin{document}     \begin{tikzpicture}         \fill[green,path fading=south] (90:4) -- (210:4) -- (-30:4) -- cycle;     \end{tikzpicture}     \end{document}      ![fading example](http://i.stack.imgur.com/U4RvM.png) Now I would like to rotate this picture by 120°, so that the fading starts at the left corner. TikZ has a `fading angle` key, so that I thought the following should work:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fadings}     \begin{document}     \begin{tikzpicture}         \fill[green,path fading=south, fading angle=120] (90:4) -- (210:4) -- (-30:4) -- cycle;     \end{tikzpicture}     \end{document}      To my surprise, this produces the following picture: ![rotated fading](http://i.stack.imgur.com/xquHa.png) Note that the fading doesn't start immediately at the corner and doesn't fade all the way to white (the upper vertex is at 25% saturation and the right one at 33%). What is going on here and how can I produce the correct rotated picture?


title: Full names with Chicago bibliographystyle

text: I'm using `\bibliographystyle{chicago}` and the `Natbib` package. I would like to have the FULL NAMES of the authors listed in the bibliography. For instance: `Lastname1, Name1, and Name2 Lastname2. 2013. My Paper Title. *My Journal Title* 1(1):1-25.` Chicago is the style closest to my needs. Is there any way to tweak the original code to get the full Names. Thanks a lot, PS: Apologies if this question has been raised before. I could not find it myself.


title: Put variable text at a fixed location on every beamer slide.

text: Is there an option that I can use within `\begin{frame}... \end{frame}` so that the enclosed text always appears at same location on different beamer slides? Ideally, I want something like this:               \begin{frame}{slide title}     some-option{\bf mytext}      .....     \end{frame}      What I want is that no matter what "mytext" is, and no matter what the stuff following it is "....", "mytext" is always placed at same location: just below the title, at the right corner. I tried using `\hspace{..}\vspace{..}{\bf mytext}`, but I need to change the space values in every single slide manually. And even then, the placement looks only approximately same on slides (visually).


title: emacs macro: A sentence on each line

text: It is not a a latex question, rather an emacs one but related to latex! Does anyone know of a macro or ... that makes the following formatting possible: I want each line to contain only a single sentence. It is useful in latex, in order to keeps diffing easier, since changes to a sentence will not cascade a change to the following line and hence easier diff !! Thanks!


title: Why are there lowercase letters in TeX and LaTeX?

text: ![TeX](http://i.stack.imgur.com/V7qcR.png) ![LaTeX](http://i.stack.imgur.com/6aWHl.png) Notice that the letters here are all uppercase. Is there any reason why we write TeX and LaTeX respectively? Is it for emphasis? Or does it just make it look similar to the staggered lettering of their logos?


title: Palatino with text figures, not in math mode or headings

text: I'm working on a document which is fairly math-heavy, but also contains numbers outside of math mode. I want these numbers to be displayed as old- style/text figures. I also want a Palatino-type font (either `mathpazo` or `tgpagella`). Using `tgpagella` with `textcomp` gives me text figures, but then math mode is displayed in the regular Computer Modern font. Using `mathpazo` with the `[osf]` option gives me text figures everywhere---even in titles, headings, and math mode, where they don't belong. I can't seem to figure out how to mix text and lining figures with Palatino-like math fonts.


title: Truncated text in resized gnuplot LaTeX output

text: I have a recurring issue when generating latex documents from gnuplot as soon as I specify a `set size n,m` where n or m is greater than one. Here are the minimal codes producing the issue: ### Gnuplot instructions               set terminal latex     set output "plot.tex"     set size 1,2     set title "Graph Title"     set xlabel "$x$ axis"     set ylabel "$y$ axis"     plot sin(x)      ### (very minimal) LaTeX document               \documentclass{article}          \begin{document}          \begin{figure}     \input{plot}     \end{figure}          \end{document}      I then run `gnuplot plot.gp` followed by either `xelatex document.tex` or `pdflatex document.tex` or `latex document.pdf`, since any of them will produce the issue. The result is that no **text** displays outside of the default size zone. As you can see, both axis labels and numbering stops at the half of the _y_ axis, as well as no title at top of the graph: ![No text displays screenshot](http://i.stack.imgur.com/Usczc.png) Can anyone reproduce this issue on his computer, or is there an issue with my LaTeX/gnuplot installation ? I would be glad if anyone could provide with a solution for this issue.


title: Reordering the index

text: When I index a molecular formula, I use the syntax `\index{C8H12O4}` and `\index{C10H16O5}`. The resulting output will have C10 before the C8 compound. What I understand is: in the second entry, C is followed by 1, whereas in the first case, C is followed by 8. 1 is less than 8, hence C10 comes before C8. The question is how to reorder so that C with lower number comes first and then the other. In the above case, C8 first, followed by C10. A related question is: the CAS numbers “100-51-7” will appear before “88-45-6”. How to make it work the other way round? Here is my MWE               \documentclass[a4paper,10pt]{book}        \usepackage{imakeidx}  % as i have multiple indexing     \makeindex  % as i have multiple indexing     \begin{document}          The illustrative example to show the problem I'm facing with indexing. C8H12O4\index{C8H12O4} and C10H16O5\index{C10H16O5} are interesting compounds. The resulting output will have C10 above the C8 compound.          Also checked for CAS numbers: 100-51-7\index{100-51-7} and 88-45-6\index{88-45-6} has to be indexed in the reverse order.  First 88-45-6, then 100-51-7.          \printindex     \end{document}


title: Sharelatex - Nomenclature

text: Recently, Sharelatex added the possibility of using `\makeindex`. However, I would like to add a nomenclature, preferably in the same style as in this topic How to achieve nomenclature entries like: symbol, Description, Dimension and unit, etc?. However, if I add the code of the answer in that topic, the nomenclature is not printed. It seems that the `nomencl` package does not work in Sharelatex, but that would be strange since Sharelatex now supports `\makeindex`. Should this not work in Sharelatex, is there then a workaround to use such a nomenclature in Sharelatex without using the `nomencl` package?


title: How do you remove the axis multiplier?

text: A chart with data in the range of 200,000 and small difference between max and min values, will be assigned a 10^5 multiplier to the entire axis. This results in the ticks becoming meaningless, since all become 2. Example:-               \begin{tikzpicture}     \begin{axis}       \addplot coordinates {       (100,200001)       (200,200003)       (300,200005)       };         \end{axis}     \end{tikzpicture}      When this is plotted the y-axis has 5 ticks, all of which are 2. The y-axis has a multiplier of 10^5. This has effectively removed all information from the graph. I may use the below to set the explicit value of the tick values but this does not implement change in the display "style" of the axis ticks.               ytick = {200000, 200005, 200010}      I have also tried increasing the precision of the tick label to 5. However this only results in the graph showing labels such as 2.00000, 2.00005, 2.00010 with a 10^5 axis multiplier.               yticklabel style={precision = 5,}      My question is "How do I remove/change this 10^5 multiplier, such that the y-axis ticks are displayed in the form 200000, 200005, 200010.


title: Missing something obvious with tick label styles in pgfplots

text: Why does this not produce y tick labels in fixed number format? (pgfplots version 1.9 produces y tick labels in scientific format)               \documentclass[12pt]{article}               \usepackage{pgfplots}          \begin{document}               \begin{tikzpicture}      \begin{axis}[y tick label style={/pgf/number format/fixed}]      \addplot{cos(x)/12.0};      \end{axis}     \end{tikzpicture}     \end{document}