title: Creating text symbols with TikZ

text: I seem to recall a macro which was used to create symbols which could be inserted into text, but cannot remember the name nor find it using search. I could do it myself easy enough               \newcommand{\reddot}{\tikz{\fill[red] (0,0) circle (4pt);}}      but don't want to reinvent the wheel.


title: newtxmath and can't find file 'zxxrl7z'

text: I use BasicTeX on OS X 10.9 Mavericks (for space problems on a Macbook Air). I usually manage to find the packages that I miss by interpreting `pdflatex`-errors, but this time I cannot find a clue to what package I miss. I tried using               \usepackage{newtxmath}      but I get the following error message:               ! I can't find file `zxxrl7z'.      Of course the package `newtx` is installed. Could someone tell me which package `zxxrl7z` belongs to?


title: Begin a text at a certain distance from the margin after an hyphenation

text: I ave a command to include a title and to begin my fake environment, fake in the sense that it is not called by a \begin{myenv}, the problem is that the long titles do break on the second line, but it is more pleasant if the content of the tile on the second line begins at a certain horizontal space from the margin. So the command is defined as (it may be imperfect), it uses the amsmath package               %declare my env taking a font and the possible title     %plus stuff to glue in order to avoid pagebreaks          \DeclareDocumentCommand\myenv{m o}{%     \par%     \normalfont%     \nointerlineskip%     \begingroup%     \@ifempty{#2}%         {\makebox{\textit{My kind of env}}}     {\makebox{\textit{My kind of env} \textbf{\scshape{{#2}}}}}     \endgroup%     \begingroup%     {#1}\selectfont%     \par%     \vgl@\nointerlineskip%     \nopagebreak%     }      There also exists the macro to close the group,               \newcommand{\closingmyenv}{%     \unskip\removelastskip%     \penalty-8000%     \endgroup\par\normalfont%     \penalty2000%     }      then I call \myenv[Possible title] blabla \closingmyenv in my text. If the title is too long, it continues on the second line but, as expected, it begins at the left margin just like a normal text. I want it to begin where the title (on the first line) begins, that is to say, just after the text "My kind of env". Perhaps a solution is to use the everyshi package to check when a title breaks to the second line, but 1/ I do not have the skills for that 2/it requires a package. The \textit{My kind of env} must begin at the leftmargin.


title: pgfplots + animate: complicated line-by-line animation

text: I want a retangle with 80 diagonal lines:               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \begin{axis}[     %------------------------     %% Options     %------------------------         width= 100mm,         %height = 50mm,         xmax=70,         xmin=0,         ymax=50,         ymin=0,         axis x line=bottom,         axis y line=left,         enlargelimits     ]     %------------------------     %% Define Clipping     %------------------------     \pgfplotsextra{%         \clip (axis cs:0,0) rectangle (axis cs:60,40);         % http://www.latex-community.org/forum/viewtopic.php?f=45&t=22837&start=0     }        %------------------------         %% Loop     %------------------------     \foreach \i in {1,2,...,80} {     \addplot[     domain=0:60,     line width=1pt,     ]       {4/6*x+40-\i};      }     %------------------------     %% Draw retangle     %------------------------     \draw[red,line width=2pt] (axis cs:0,0) rectangle (axis cs:60,40);       \end{axis}          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/zD53n.png) Now I have a data file that looks like               4, % Line 1 is the top left corner     5,     50,     51,     52,     6,     7,     8,     9,     10,     22,     ...      Now I want that the 80 lines appear in a animate animation in that order line- by-line. I made a animated gif manually to show the desired output: ![enter image description here](http://i.stack.imgur.com/FXfBH.gif) But from here I do not have the right idea to proceed. **Solution from Jake** Thanks for the answers! I accept Jake's answer because it uses an external file which is important for me. My real example hat over 1200 lines. Here's the solution (Jake's answer is missing the filecontents envoronment):               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{animate}          \usepackage{filecontents}          \begin{filecontents}{index.dat}     4,     5,     50,     51,     52,     6,     7,     8,     9,     10,     22,     \end{filecontents}          \begin{document}          \pgfplotstableread[col sep=comma]{index.dat}\indextable          \begin{animateinline}[controls]{2}     \multiframe{11}{imax=0+1}{     \begin{tikzpicture}     \begin{axis}[     %------------------------     %% Options     %------------------------         width= 100mm,         %height = 50mm,         xmax=70,         xmin=0,         ymax=50,         ymin=0,         axis x line=bottom,         axis y line=left,         enlargelimits     ]     %------------------------     %% Define Clipping     %------------------------          \pgfplotsextra{%         \clip (axis cs:0,0) rectangle (axis cs:60,40);         % http://www.latex-community.org/forum/viewtopic.php?f=45&t=22837&start=0     }        %------------------------         %% Loop     %------------------------          \foreach\i in {0,...,\imax}{     \pgfplotstablegetelem{\i}{[index]0}\of{\indextable}     \edef\currentindex{\pgfplotsretval}     \addplot[     domain=0:60,     line width=1pt,     ]       {4/6*x+40-\currentindex};     }          %------------------------     %% Draw retangle     %------------------------     \draw[red,line width=2pt] (axis cs:0,0) rectangle (axis cs:60,40);       \end{axis}          \end{tikzpicture}}     \end{animateinline}          \end{document}      Here is the result: ![enter image description here](http://i.stack.imgur.com/4JfTo.gif)


title: Eating a dot after a command

text: I have a bibliography in which URLs are printed with a following "." I would like to omit the URLs to save space and I could do this by redefining the URL command, but this would leave me with a dot. Is there a way to define a command that eats a following "."?


title: TexShop integration with Dropbox problem

text: I store my `.tex` files in Dropbox and use a TexShop at mac in my office and WinEdt at PC at home for editing them. I leave my `.tex` files open (but saved) on both computers. When I come home and make a `.tex` file window active on my WinEdt, it informs me that if the file has changed in Dropbox and loads the most current version. How can I make TexShop do the same? Sometimes I make significant edits in TexShop and only when I try to save them TexShop informs me that I am working on an old version of the file. Admittedly, it is a small issue, since I can always close and reopen a file before I start working on it, to make sure that I work on the latest version, but it would be nice not to have to do it, since it is easy to forget about it.


title: Spacing for homogeneous coordinates

text: Homogeneous coordinates in projective geometry are usually denoted like this: $[x:y:z]$. However, I think that ':' plays the role of a comma, and should be surrounded by much smaller spaces than for other uses of ':'. Is there a simple way in LaTeX to automatically adjust the spacing in homogeneous coordinates, without messing with the spacing of other uses of ':'?


title: Access the chapter/section number and the chapter/section label through variables

text: Often I find myself in the situation that I'd like to design how chapters and sections look. I know there are packages that help to design such things, but non of them seems to give me the option to use the chapter/section number and the label as variables (like #1, #2). Stefan has done something close to what I want in his blog using titlesec, but I was wondering: Is there a pure LaTeX way of accessing the number and label of chapter/sections and use those in variables while I design a pagestyle?


title: Set distance between Captions

text: I've got a question about the placement of captions, specifically the distance between the captions. The problem is that I have two figures next to each other (through `minipage`) that both require a caption with a lot of text. However, as the picture below indicates, it quickly becomes unreadable, so I would like to add some whitespace there. Does anybody know how to achieve this? ![enter image description here](http://i.stack.imgur.com/UbFa7.png) * * * The actual code               \begin{figure}          \begin{minipage}{.5\textwidth}          \includegraphics[scale=0.45]{3b_01.png}          \caption{Synchronisation map for the two coupled cells: blue points indicate that          the systems synchronise, red points indicate that the system does not. The map          is an average of three equal systems with each a different initial condition.          Gamma goes from 0 to 1 (each increment in y direction = 1/15 ) where as Tau goes          from 0 to 1 (each increment x direction = 1/60). }          \label{fig:3b_01}          \end{minipage}%     \begin{minipage}{.45\textwidth}          \includegraphics[scale=0.45]{3b_02.png}          \caption{Synchronisation map for the two coupled cells: blue points indicate that         the systems synchronise, red points indicate that the system does not.The map is         an average of three equal systems with each a different initial condition. Gamma          goes from 0 to 1 (each increment in y direction = 1/15 ) where as Tau goes from          0 to 1 (each increment x direction = 1/60). Notice how the different tolerance          leads to a larger area but with an equal shape }          \label{fig:3b_02}          \end{minipage}          \end{figure}


title: How do I change the math italic font in XeTeX/fontspec?

text: I have a document where the main font is Gotham Book. So in my preamble I have:               \usepackage{fontspec}     \setmainfont{Gotham Book}      As the fontspec manual describes, this sets the math roman font to also be Gotham Book. But the math _italic_ font remains from the Computer Modern family. I know that `\setmathrm` will change the math roman font, and there are cousins `\setmathtt`, `\setmathsf`, and `\setboldmathrm`. But there's no `\setmathit`. What am I missing?


title: Splitting subfigures across multiple pages -- but programmatically!

text: I am using the `subfig` package to make many subfloats in a `figure` environment. It works well, as long as you realize that it tracks the whitespaces within the `float` environment. It also has an option to split figures over multiple pages using a `\ContinuedFloat` command. This means that once a number of subfigures fill up a page, then you end the figure and in a new page start a figure with this `\ContinuedFloat` command -- and it resumes laying out the subfigures (preserving the counts, etc.) Note that the usepackage command should be as described, and the `caption` and `captcont` package should _not_ be loaded, as it causes undesired redefinitions and incompatibilities.               \usepackage[caption=false]{subfig}    % don't load caption or captcont          \begin{figure}     \subfloat[First]{\includegraphic{first} } \,     \subfloat[Second]{\includegraphic{second} } \,     \subfloat[Third]{\includegraphic{third} } \,     \end{figure}      Then to continue subfigures later (presumably, on a new page)               \begin{figure}     \ContinuedFloat     \subfloat[Fourth]{\includegraphic{fourth} } \,     \subfloat[Fifth]{\includegraphic{fifth} } \,     \subfloat[Sixth]{\includegraphic{sixth} } \,     \caption{All of my six subfigures}     \end{figure}      Nifty! But for this you have to know how big your subfigures are, or how many of them you have. I have potentially 30 or 40 or 100 subfigures that I would like to lay out in an array on a page, continuing over into the next page. Also based on the dataset, the aspect ratio of the images maybe different and some will have 5 images per row, and others maybe only 3. These are basically the results from data analysis of some images, and I am producing the tex file programmatically. Main question: Is there a way to detect that after N subfigures the page is full, and to continue the remaining subfigures in a new page? Or any other suggestions on how to deal with this issue are also welcome!


title: How to align the new environment

text: I have to define the new environment, similar to the proof environment. I learned on our site how to define it, but I do not know how to customize it. In particular, I design a book by using `gsm` document class, the output looks like the following:               Problem Blah Blah Blah...              Solution:.....      I want the solution line is not indented, like               Problem : Blah Blah Blah          Solution Blah Blah Blah ....      How can I do this? Here is the MWE: (The new environment is defined by `\newenvironment{sol}{\paragraph{\bf Loi giai:}}{\hfill $\square$}`)               \documentclass{gsm-l}     \usepackage[utf8]{vietnam}     \newtheorem{exe}{Bài toán}     \usepackage{lipsum}     \newenvironment{sol}{\paragraph{\bf Loi giai:}}{\hfill $\square$}     \makeindex     \begin{document}     \begin{exe} Here is the problem, or the exercise.     \end{exe}     \begin{sol}     Here is the solution.      \end{sol}     \end{document}      By defining like this the `$\square$` symbol (small square at the end of the proof) sometimes appears at the beginning of a new line. How can I put it on the right side like using the `flushright` command?


title: Formatting Chapter Titles

text: I'm working on my thesis, and I need my chapter titles to be centered so it says "CHAPTER " and then immediately under it the actual chapter title. Right now I have `\titleformat{\chapter}{\normalfont \center}{CHAPTER \thechapter}{}{}` but I can't figure out how to get the new line to work, as `\titleformat{\chapter}{\normalfont \center}{CHAPTER \thechapter \\\\}{}{}` fails to compile.


title: URL field inherited despite separate cross reference item

text: The following code produces a list of references that contains the URL three times. I use crossreferencing to save space. Is there a way to get rid of the URL in the entries that refere to a main entry?               \documentclass{article}          \usepackage{natbib}          \usepackage{url}          \begin{document}          \citet{Flickinger2008a,VanEynde2008a}          \bibliographystyle{plainnat}      \bibliography{test}     \end{document}      test.bib:               @inproceedings{Flickinger2008a,             Author = {Daniel P. Flickinger},             Crossref = {Mueller2008a-ed},             Title = {Transparent Heads}}               @inproceedings{VanEynde2008a,             Author = {Frank {Van Eynde}},             Crossref = {Mueller2008a-ed},             Pages = {253--273},             Title = {Predicate Complements}}               @proceedings{Mueller2008a-ed,             Booktitle = {Proceedings of the 15th International Conference on Head-Driven Phrase Structure Grammar},             Editor = {Stefan M{\"u}ller},             Title = {Proceedings of the 15th International Conference on Head-Driven Phrase Structure Grammar},             Url = {http://cslipublications.stanford.edu/HPSG/9/},             Year = {2008}}


title: Table of results is not closing from above

text: The problem is that the table is not closing from above. Secondary problem (which I don't really care) is that a vertical line is replicated. Here is the code:               \resizebox{\linewidth}{!}{     $\displaystyle     \begin{tabular}{|l|l|l|l|l||l|l|l|}     \multicolumn{8}{|c|}{CGAL statistics} \\     \hline     tree & N & dim & nodes & depth & brute & cgal & speedup \\     \hline     \multirow{1}{*}{5e-06} & 150 & 20 & 69 & 9 & 0.000008 & 0.00006 & 0.14\\     \hline     \multirow{1}{*}{1.1e-05} & 150 & 30 & 68 & 9 & 0.00001 & 0.00006 & 0.16\\     \hline     \multirow{1}{*}{1.2e-05} & 150 & 50 & 68 & 9 & 0.00001 & 0.00008 & 0.13\\     \hline     \end{tabular}     $}      Outcome: ![enter image description here](http://i.stack.imgur.com/ydG6y.png)


title: Handling typesetting of plural class names

text: I'm sorry if this is the wrong stackexchange to ask in, but it seems to be the place where people care about typography :) I'm writing lecture notes on Android development, and I like to put class names and code fragments in monospaced in order to make it easier to read. For instance `\texttt{Activity}` is used a lot. My question is how should I typeset the plural reference? `\texttt{Activity}s` looks wrong `activities` doesn't distinguish from other text `\texttt{Activities}` removes the verbatim nature that I'm trying to convey using the texttt. Any recommendations and guidelines will be appreciated.


title: LaTeX and Glyph Scaling for Justified Text

text: I am very new to LaTeX - and I am not sure if Latex has the capability to do what I want, so I thought I would ask here. I am working with publishing books in Khmer (the language of Cambodia) in Unicode. I am using OpenOffice to do the basic layout of the book (which allows me to use a spelling checker and grammar checker for Khmer). The problem is using justified paragraphs in OpenOffice with Khmer looks really bad. Khmer has no spaces between words (we do use a zero-width-space between words though), and so what I really need is something like what Adobe InDesign does - glyph scaling. Does anyone know a LaTeX solution that would allow me to specify glyph scaling for Khmer Unicode? And what is the best way to go from OpenOffice to a LaTeX format?


title: Which auxiliary LaTeX files should be ignored by Version Control Software?

text: I'm about to start version controlling my LaTeX documents with Git but I haven't used either very much. I would like to version only the files needed to compile the document but I use different OS's (OSX, Windows and different distros of Linux). I did a search for a `.gitignore` file for LaTeX and came up with 3 different ones:   * https://gist.github.com/149016   * https://gist.github.com/871983 (a fork of the above but for Mac)    * https://github.com/github/gitignore/blob/master/LaTeX.gitignore (another for LaTeX in general) Here's a comparison of each in alphabetical order in tabular format:               *.acn               *.acn                    *.acr               *.acr                    *.alg               *.alg                    *.aux               *.aux               .aux     *.bbl               *.bbl               *.bbl     *.blg               *.blg               *.blg     *.dvi               *.dvi               *.dvi                                             *.fdb_latexmk     *.glg               *.glg               *.glg     *.glo               *.glo               *.glo     *.gls               *.gls               *.gls     *.idx               *.idx               *.idx     *.ilg               *.ilg               *.ilg     *.ind               *.ind               *.ind     *.ist               *.ist               *.ist     *.lof               *.lof               *.lof     *.log               *.log               *.log     *.lot               *.lot               *.lot     *.maf               *.maf                                        *.mp                     *.mtc               *.mtc                    *.mtc1              *.mtc1                                                           *.nav                                             *.nlo     *.out               *.out               *.out                         *.pdf                                                            *.pdfsync                                             *.snm     *.synctex.gz        *.synctex.gz        *.synctex.gz                         *.tmp                    *.toc               *.toc               *.toc                         *.top                                        *.tui                                                            *.vrb                              # Mac IDE files                                      *.swp                                        *~                                       *(Autosaved).rtfd/                                       Backup[ ]of[ ]*.pages/                                       Backup[ ]of[ ]*.key/                                         Backup[ ]of[ ]*.numbers/                                              # Mac finder files and hidden folders                                        .DS_Store      Can anyone suggest why some might be missing from others and if it's okay just to include them all in one `.gitignore` file for use on all OS's?


title: Macro for a sequence of variables

text: Currently, I have a macro `\bigseq` which takes a variable name and a last number and produces `#1_{1},#1_{2},\ldots,#1_{#2}`, and for example `x_{1},x_{2},\ldots,x_{n}`. Now, sometimes I want to produce a full sequence when given specific numbers. I would like a macro `\seq` that takes a first and last index and outputs the entire sequence. For example, for `3` and `7`, I want to get `x_{3},x_{4},x_{5},x_{6},x_{7}`. Is that possible?


title: linebreaks for cjk languages?

text: What do I need to write documents in a CJK language? I'm getting no linebreaks at all on Japanese text. (overfull hboxes, text going off-page) Here is a (mostly) stripped-down test:               \documentclass[a4paper]{article}          \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{CJK}          \defaultfontfeatures{Mapping=tex-text}     \setmainfont[Mapping=tex-text]{VL Gothic}          \begin{document}     \begin{CJK}{UTF8}{VL Gothic}     すべての人間は、生れながらにして自由であり、かつ、尊厳と権利とについて平等である。人間は、理性と良心とを授けられており、互いに同胞の精神をもって行動しなければならない。     \end{CJK}     \end{document}      I'm not sure I'm using the CJK package correctly -- it seems to make no difference. What am I doing wrong? I am using XeLaTeX.


title: Table of contents makes pdf generation fail.

text: I am using TeXworks to try and create a PDF file. The problem is that it seems that the `\tableofcontents` is making the pdf generation fail. Here is part of my code which seems to be causing the trouble:               \tableofcontents     \addtocontents{toc}{entry text}     \thispagestyle{empty}     \clearpage      As soon as I remove that from the script, the pdf is generated. I am very new to LaTeX so I am definitely doing something that I shouldn't. Anyone can tell me what is there problem or where can I look? I have reduced my code to this (and still managed to replicate the error               \documentclass[a4paper,12pt]{article}     \begin{document}                    \tableofcontents     \addtocontents{toc}{\protect\thispagestyle{empty}}          \clearpage          \setcounter{page}{1}     {\Huge Sample Text}     \section{Introduction}                    \section{Background}          \section{Aims and Objectives}          \section{Rationale}          \section{Methodology}          \section{Work Packages}          \section{Relevance to Beneficiaries}          \section{Justification of resources}          \begin{thebibliography}{12}          \end{thebibliography}          \end{document}      The error I get: {section}{\numberline{1}Introduction}{1} Thanks


title: Chapter Name not appearing

text: I wanted to style the chapter name. I referred the following link : how-to- create-specific-chapter-style-in-book-documentclass Here is my code:               %Template for Technical Document     \documentclass{book}     \usepackage[explicit]{titlesec}     \usepackage{titlesec}     % Can also use centering, or hcentering          \titleformat{\chapter}[display]       {\bfseries\Large}       {\filright\MakeUppercase{\chaptertitlename}\Huge\thechapter}       {1ex}       {\titlerule\vspace{1ex}\filleft}       [\vspace{1ex}\titlerule]          \begin{document}     \chapter{Install Backtrack on an Android Device}     \section{What is Backtrack?}     BackTrack is a distribution designed by Jason Dennis based on the Ubuntu Linux distribution aimed at digital forensics and penetration testing use. BackTrack provides users with easy access to a comprehensive and large collection of security-related tools ranging from port scanners to Security Audit. Support for Live CD and Live USB functionality allows users to boot BackTrack directly from portable media without requiring installation, though permanent installation to hard disk and network is also an option.\par     \end{document}       I get the following output: ![enter image description here](http://i.stack.imgur.com/WljSz.png) After using the `explicit` option in `titlesec` and numbering the chapter as per the solution given, I get this output: ![enter image description here](http://i.stack.imgur.com/rkS7z.png)


title: Problem to include flowchart

text: I am trying to include a flow chart as figure in my document but I think I am doing something wrong. After compile I get blank page in my PDF document. I am using MiKTeX 2.9 and Windows 7. Here is part of the LaTeX file:               \documentclass{article}     \usepackage[latin1]{inputenc}     \usepackage{graphicx}     \usepackage{subfig}     \usepackage{tikz}     \usetikzlibrary{matrix, shapes, arrows, positioning}     \usepackage{verbatim}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{5pt}%     \begin{document}     \pagestyle{empty}     \tikzstyle{decision} = [diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]     \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em]     \tikzstyle{line} = [draw, -latex']     \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em]     \begin{figure}     \centering     \begin{tikzpicture}[node distance = 2cm, auto]\label{flowchart:algorithmchart}      Place nodes with matrix nodes      \matrix[matrix of nodes, column sep=1cm, row sep=1cm]{%         \node [block] (init) {Set Quotient to 0};\\         \node [block] (identify) {Subtract Divisor from Dividend};\\         \node [block] (evaluate) {Add 1 to Quotient};\\         \node [decision] (decide) {is Result Register Greater than 0?};\\         \node [block] (stop) {Stop - Quotient is Correct};\\};      Draw edges         \path [line] (init) -- (identify);         \path [line] (identify) -- (evaluate);         \path [line] (evaluate) -- (decide);         \path [line] (decide) -- node[right]{No} (stop);         \path [line] (stop) -- ++(2,0) |- (identify);       \end{tikzpicture}     \end{figure}     \end{document}


title: Center narrow columns under wider caption in ctable

text: I have a narrow table but a long-ish caption. Rather than run the caption to several lines, I have set the `ctable` width to `0.5\textwidth`. However, the two narrow table columns are now set to the left of the available space. Is there a way to center them under the caption, without padding with dummy columns? * * * OK, here's an example (truncated)               \ctable[%       caption= {Model fit to observational data, parameters: $log(q)$=8.5, $\tau$=$\infty$, $\kappa$=$\infty$},%       doinside=\small, pos=h, captionskip=3pt, width=0.45\textwidth,%       label=t2, center ]{cc}{}{%        \toprule[1.5pt] Z & T \\        \midrule    7.320 & 16543.3 \\                    7.388 & 16370.8 \\                    7.457 & 16185.5 \\                    7.525 & 15974.7 \\                    7.594 & 15725.7 \\      \addlinespace[5pt]\bottomrule[1.5pt]\addlinespace[5pt]%     }


title: Adjustbox do not scale up smaller image does not work

text: I am trying to set the max width of an image by using the `adjustbox` package. What I want is that an image only scales DOWN to `\linewidth` if needed. But if it smaller than `\linewidth` then it should NOT be scaled at all. However when using the following code, the image gets still scaled to `\linewidth`               \documentclass[a4paper]{scrreprt}               \usepackage[pdftex]{graphicx}               \usepackage[export]{adjustbox}                \begin{document}     xxxxx     \begin{figure}[H]         \centering         \adjincludegraphics[max width=\linewidth]{images/dialog.png}         \caption[asdf]{asdf}         \label{fig:dialog}     \end{figure}     yyyyyyyyyy     \end{document}      ![enter image description here](http://i.stack.imgur.com/LS7Ij.png) What did I miss?


title: Why is this simple exam document couldn't be compiled?

text: I am learning how to type an exam under the exam documentclass, below is how I typed it, but it couldn't be compiled and I have no clue why.               \documentclass[11pt,addpoints,a4paper]{exam}            \begin{questions}       \question Why is there air?       \question What if there were no air?       \end{questions}      I think there shouldn't be any mistake and I have checked that I have the exam.cls.   Many thanks for any help, I will really appreciate it!


title: Aquamacs opening TexShop viewer instead of Skim

text: When I click View in Aquamacs after clicking Latex, it opens TexShop and a TexShop viewer. I want it to open Skim. I have set preferences to Skim as per other posts on this site. This behavior happens with some latex files but not others, meaning for some the viewer does open as Skim and for some as TexShop. Could you advise on how I can make it always be Skim? Why would it differ depending on the latex file? As an orthogonal question, I could live with TexShop preview if it did automatic updates. From other posts I understood that for that I needed only to check the Automatic Preview Update option in the preview preferences and re-start TexShop, which I did, but when TexShop opens under Aquamacs, it will not automatically update. Thanks!


title: How to change the color of text inside equation environments in Kile?

text: The default color of fonts and symbols inside the equation environments in **Kile** is pale green, which is not very pleasant to my eyes... Is there an easy way to change this?


title: Draw red X over an external image using PGF/Tikz

text: I want to draw a thick red X over an image from a PNG file, as a part of a Tikz picture. How can this be done? The documentation regarding external images in PGF is a bit vague.


title: Prevent a paragraph break after a section heading

text: In my `.cls` file for my thesis, I have defined `\subsection` as follows:               \newcommand{\subsection}[1]{%       \pagebreak[2]       \refstepcounter{subsection}       \addcontentsline{toc}{subsection}{         {\protect\makebox[0.3in][r]{\thesubsection.} \hspace*{3pt}#1}}       \noindent       \textbf{\thesubsection\space\space{#1}. }     }      However, the thesis examiner has told me that the proper way to format subsection headings is to make the first paragraph continue on the same line as the subsection heading. I can make this work if my document says               \subsection{A Subsection}     Lorem ipsum dolor sit amet...      typesets to               3.1.1 A Subsection.  Lorem ipsum dolor sit amet...      But if I have a blank line at the beginning of the subsection, I get a paragraph anyway.               \subsection{A Subsection}          Lorem ipsum dolor sit amet...      typesets to               3.1.1 A Subsection.         Lorem ipsum dolor sit amet...      Is there any way to force this to typset like the first version, even if there's a blank line after the `\subsection` command? If not, is there at least a way to get a warning?


title: How to use pgfkeys' /.style args handler without knowing the exact form of the input?

text: I would like to be able to create a command (using `pgfkeys`) that can take inputs that are of a limited set of forms, and for which certain pieces will come from a limited set of values. More specifcally, any input will have some piece `A` (which will come from a known list), and for some values of `A`, additional information `#1`, `#2`, etc. (not from a known list) **can** also be specified, using a limited set of forms, but need not be. For a made-up example, let's say that my command is `\meal`, and `A` will be an element of the list               chicken, beef, tofu      When `A` is either `chicken` or `beef`, the following forms of additional information **can** be specified like this:               chicken with #1     chicken on a bed of #1     beef with #1     beef with #1 or #2      I would like to have the _greatest possible versatility_ in what happens once the correct form is determined, and the input is understood. For example, suppose I want               \meal{chicken}                                ->   Chicken     \meal{chicken with #1}                 ->   CHICKEN (with #1? uggh)     \meal{chicken on a bed of #1}    ->   #1, underneath chicken     \meal{beef}                                      ->   Beef     \meal{beef with #1}                       ->   Beef and a side of #1     \meal{beef with #1 or #2}           ->   Beef with your choice of #1 or #2 as a side     \meal{tofu}                                      ->   Tofu      I realize this is already a pretty tall order (ha ha), but for some modicum of simplicity, assume that we will never need to write               \meal{chicken on a bed of beef with chicken}      or other things that would be confusing to the computer. Now, I was doing some preliminary testing (before trying to make something that did all of the things I wanted), and I ran into a problem. The code I wrote, after being adapted to this made-up example, would be               \documentclass{article}     \usepackage{pgfkeys}     \pgfkeys{%         mealname/.initial = ,%         overform/.style args = {#1 over #2}{mealname = #1 over #2},%         andform/.style args  = {#1 and #2}{mealname = #1 and #2}%         noform/.style        = {mealname = #1}%     }     \newcommand{\meal}[1]{%     \pgfkeys{%         overform/.try  = #1,%         andform/.retry = #1,%         noform/.retry  = #1,%         mealname/.get  = \mealname}%     \mealname%     }          \begin{document}          \meal{A over B}          \end{document}      This runs fine; however, when I replace `A over B` with `A and B`, I get the error               File ended while scanning use of \pgfkeys@code      What I assume is happening is that `pgfkeys` is attempting to find an occurrence of the word `over` in the input `A and B`, and is in an infinite loop or in one way or another breaks because it cannot find it. I had hoped that after failing to find `over` anywhere, an error would be thrown that told `/.try` to stop, but this does not appear to be the case. Now, I realize that what I am asking for may be a little silly, given that `pgfkeys` is for "key-value arguments", because a solution that is much easier to code (but slightly less intuitive to use) would be to have each of the different forms (`chicken`, `chicken with`, etc.) be its own key, and accept inputs like this:               \meal{chicken}     \meal{chicken with = #1}     ...      or alternatively, have each value of `A` be a family, with the forms as subkeys; e.g., calling the key `chicken` would `/.cd` us into the `/chicken/` family, where there are keys `/chicken/with` and `/chicken/on a bed of`, so that one could write               \meal{chicken}     \meal{chicken, with = #1}     ...      Perhaps I am just being unreasonably picky in wanting to avoid the equals signs; but to the greatest extent possible, I would want the code of my document to model natural English expressions (in addition to just wanting to figure out how to do it out for the challenge / out of curiosity). So, my question is: is there any way of achieving my desired command with `pgfkeys`? Is there some other package or approach that can do it? Assuming my approach was at least somewhat on the right track: is there any way I can use the `/.style args` key handler (perhaps together with the `/.try` handler?) to determine which form the input is, and do the correct operations for that form, without running into an infinite loop trying to test whether the input is of a given form?


title: How to report a bug in LuaTeX?

text: I think I found a bug in LuaLaTeX. I use the current version from TeX Live 2012.               lualatex --version     This is LuaTeX, Version beta-0.70.2-2012052410 (TeX Live 2012)      When I compile the following document               \documentclass{standalone}     \begin{document}     $\displaystyle\sqrt{\sum_{k=1}^{n} x_k}$     \end{document}      it works fine with `pdflatex`; ![correct formula](http://i.stack.imgur.com/05HTo.png). But with `lualatex` I get ![bad rendering](http://i.stack.imgur.com/xL2nX.png). So, where should I report this? And how can I get around it?


title: Shorten Tikz Edges from node to node

text: I am making simple Finite State Machines for a paper. My code is listed below:               %\usetikzlibrary{arrows,automata} in the preamble     \begin{tikzpicture}[>=stealth', auto,node distance=2.75cm]       \node[state] (start)      {};       \node[state]         (s1) [right of=start, align=left]  {isProvider\\Enabled};       \node[state]         (s2) [right of=s1] {};       \node[state]         (s3) [right of=s2] {};       \path[->] (start)  edge      node {} (s1)             (s1) edge              node[text width=1cm,align=center, pos=.4] {requestLocation\\Updates} (s2)             (s2) edge              node[text width=1cm,align=center, pos=.3 ]{addGps\\StatusListener} (s3);     \end{tikzpicture}      I want to decrease the distance from node start to node s1 to 1cm... but only that distance between nodes. All the other edges should stay 2.75 centimeters. Any ideas or suggestions are appreciated.


title: Possible package missing

text: I started using LaTeX yesterday and there's something I can't figure out: I've noticed that I don't have some commands, for example right now I'm trying to use `\vphantom` and `\phantom`, but when I type these commands they are not recognized. I've been googling but haven't found anything useful; am I missing a package or something? I've been using TexMaker and this is the only problem I've encountered so far. Any suggestions on what is going on will be greatly appreciated, Cheers!


title: Vertically center tikz-timing label of custom size

text: # Question Once I re-size the text of my timing labels, the midpoint of the label seems to shift as indicated by the arrows from the code/image below. It aligns to the bottom of the text instead of the middle. **Is there a way to center the tikz-timing label vertically?** Related question: LaTeX tikz-timing - adjust fontsize independently for each row label `\vspace` does not seem like a good option # Code                   \documentclass[border=4pt]{standalone}         \usepackage{tikz-timing}         \newcommand{\arr}[1]{#1 $\Longrightarrow$}         %         \begin{document}         \begin{tikztimingtable}           \arr                              & 4D{normal} \\           \arr{\tiny\color{red}}            & 4D{tiny} \\           \arr{\scriptsize\color{orange}}   & 4D{script} \\           \arr{\footnotesize\color{yellow}} & 4D{footnote} \\           \arr{\small\color{green}}         & 4D{small} \\           \arr{\normalsize\color{blue}}     & 4D{normal} \\           \arr{\large\color{purple}}        & 4D{large} \\           \extracode             \tablegrid         \end{tikztimingtable}         \end{document}      # Resulting Image ![enter image description here](http://i.stack.imgur.com/LtOP2.png) # Why would you want to move a label around? When using tikz-timing along with PGF syntax you might get yourself into a tight-spot where you want to move around tikz-timing labels (which are by default anchored to the bottom of the bounding box). In the example below, vertical lines, nodes, and line labels are automatically expanded using a `\foreach` loop all relatively referenced to make expanding the timing diagram easier. In addition, I am taking advantage of the tikz- timing macros inside of my "analog" waveforms as well; see analog_sig1 where I wanted to illustrate an unknown analog output. > I would want to move the "critical_point" label up a little so that I could > align to the staggered t0...t15 line labels/nodes. **Problem Illustration** Below is an example waveform I put together with "debug" grids, markings, and vertical lines. ![enter image description here](http://i.stack.imgur.com/Te5Zh.png) **Solution**                   {\tiny\color{blue}\raisebox{1mm}{critical\_point$\Longrightarrow$}} &      ![enter image description here](http://i.stack.imgur.com/JzuJe.png)


title: The Latex Font Catalogue - Calligra Font

text: I'm trying to get the following example working:               \documentclass[danish,a4paper,11pt]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{babel}     \usepackage{slantsc}     \usepackage{array}     \usepackage{amsmath}     \setkomafont{subsection}{\usefont{T1}{fvm}{m}{n}}     \setkomafont{section}{\usefont{T1}{fvs}{b}{n}\Large}     \setcounter{secnumdepth}{0}     \pagestyle{empty}     \usepackage{calligra}     \usepackage[T1]{fontenc}          \begin{document}     \section*{Calligra}     \subsection*{\textbackslash calligra}     \normalfont\calligra     \input catalogue     \newpage     \normalfont\calligra     \input fonttable          \end{document}      This can be found under Calligra - Text example. Now I have a problem with the `\input fonttable` line. Where can I download this file or how can I get this working? Thx


title: Include a PDF and ignore page margins?

text: I am writing a document using `pdfLaTeX` for college, and I have been supplied with a title page I need to use. I have altered the `\maketitle` command:               \usepackage{pdfpages}     \renewcommand\maketitle{       \includepdf{title.pdf}     }      It does what it is supposed to do, but there's one problem: LaTeX seems to add a margin to the bottom/right of the page, so that the top/left part of the title page does not fit on the page. To illustrate: on the left is what I want (the blue part being the contents of `title.pdf`), on the right is what I'm getting. ![On the left is what I need, on the right is what I have.](http://i.stack.imgur.com/lQHr9.png) Does anybody know what I might be doing wrong?


title: How can i shrink (or expand) the vertical spacing in \stackrel?

text: I've seen the following command used a lot to make the triangle-equals operator that means "is defined as":               \newcommand{\defeq}{\stackrel{\triangle}{=}}      However, I don't like how far apart the triangle and the equals sign are, so I'd like to reduce the space between them. I tried using a raisebox, but it does not seem to be having any effect:               \newcommand{\defeq}{\stackrel{\raisebox{-10pt}{\(\scriptstyle\triangle\)}}{=}}      It also has no effect if I put different values in for the extend-above and extend-below arguments Does anyone know how to manually adjust the vertical space in `\stackrel`, or why the above does not work?


title: How can I detect if an environment is right after a sectioning command?

text: I'd like to build an environment that would detect if it is right after a sectioning command (`\section`, `\subsection` or `\subsubsection`) and smart enough to detect if a `float`-type environment (say `figure`) has been inserted between the sectioning command and itself. Here is a sketch of what I have in mind (written for the `article` class, my real case is with the `book` class, but I don't think it matters that much).               \documentclass{article}     \newif\ifRightAfterASectioningCommand     \newenvironment{myenv}{%       % Some detection mechanism       % that sets RightAfterASectioningCommand       % to true or false       % ...       \ifRightAfterASectioningCommand         Right after a sectioning command       \else         Not right after a sectioning command       \fi       }{}     \begin{document}          \begin{myenv}     % RightAfterASectioningCommand is false     \end{myenv}          \section{Section}          \begin{myenv}     % RightAfterASectioningCommand is true     \end{myenv}          \begin{myenv}     % RightAfterASectioningCommand is false     \end{myenv}          \subsection{Subsection}          \begin{myenv}     % RightAfterASectioningCommand is true     \end{myenv}          \begin{myenv}     % RightAfterASectioningCommand is false     \end{myenv}          \subsubsection{Subsubsection}          \begin{myenv}     % RightAfterASectioningCommand is true     \end{myenv}          \begin{myenv}     % RightAfterASectioningCommand is false     \end{myenv}          \subsubsection{Subsubsection}          \begin{figure}     \end{figure}          \begin{myenv}     % RightAfterASectioningCommand is true     \end{myenv}          \begin{myenv}     % RightAfterASectioningCommand is false     \end{myenv}          \end{document}


title: CTAN Mirror Integrity - Miktex Update

text: Does the Miktex Updater ensure that the downloaded packages from a CTAN mirror are not corrupted in comparison to the original version? When looking up the update log there are messages about a "database digest", but no verify message for a single package is ever appearing.   Additionally, there is a "mpm.ini" file containing hashes for all (?) packages. But if this file is downloaded from the mirror itself (contained in miktex-zzdb1-2.9.tar.lzma), this could have been changed, for this specific mirror, with malicious purpose. I'm not interested if the files are malicious to begin with (How do CTAN maintainers make sure all the uploaded packages and classess in CTAN are free of malicious code?), but if there are changes to their original versions. Is there any checking done when updating to ensure the equality of mirror to original files? I could not find any explanation on this topic.


title: Koma-script scrpage2 footer height

text: After lots of googling and hair-tearing, I'm turning grey and old, and no wiser... EDIT : see bottom for a half-cooked solution. I switched from LaTeX plain classes (`article`, `report`, etc.) to Koma- Script. And from `fancyhdr` to `scrpage2`/`scrheadings` for headers and footers. Problem is, I utterly fails to properly manage the footer position and height. I banged my head on the same problem for the headers, and found the `headheight` option which solved this point. Not so for the footer. Minimal example :               \documentclass[headheight=1.2cm,headsepline,footsepline,footbotline]{scrartcl}     \usepackage{scrpage2}     \usepackage{lipsum}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[frenchb]{babel}          \pagestyle{scrheadings}     \setkomafont{pagehead}{\normalfont\sffamily}     \setkomafont{pagefoot}{\normalfont\sffamily}          \ihead{}     \chead{}     \ohead{       Line 1 \\ Line 2 \\ Line 3\\Line 4     }          \ifoot{}     \cfoot{\scriptsize%       Line 1 \\ Line 2 \\ Line 3\\Line 4     }     \ofoot{}          \begin{document}     \lipsum[10-20]     \end{document}      Cannot post an image, I'm too new here :( It should be obvious (even if in real life I do not use the footsepline and footbotline) that the footer height is not properly computed or taken into account. And it's placed far too high on the page (that's not visible in the image above). Any idea on how to solve those two problems? EDIT : After a lots of tries and reading, I found something that gets me closer to my target (while waiting for the next release of KomaScript, as said in comment 1). My documents now start with               \documentclass[headheight=1.2cm,headsepline]{scrartcl}     \usepackage[bottom=2cm,footskip=8mm]{geometry}      It's the `bottom` abd `footskip` parameters of `geometry` package that are relevant. The footer is properly placed (not too high) and I have no overlapping between page text and footer.


title: How to Label a Heuristic Proof

text: I am using `\newtheorem{thm}{Theorem}[section]` and would like to my article to read _Heuristic Proof_ instead of the standard _Proof_. I am showing Ito's but not in a rigorous way. Any ideas?               \begin{Heuristic proof}     Since $g(x, t)$ is twice continuously-differentiable, we can apply Taylor's expansion to get      \begin{align*}     dg(W,t) &= g(t+\Updelta t\,,\,W+\Updelta W) - g(t\,,\,W)\\     &= \frac{\partial g}{\partial t}dt + \frac{\partial g}{\partial x}dW + \frac{1}{2}\frac{\partial^2 g}{\partial x^2}(dW)^2 + \frac{1}{2}\frac{\partial^2 g}{\partial t^2}(dt)^2+ \frac{1}{2}\frac{\partial^2 g}{\partial t \partial x}(dt)(dW) + \dots\,\,(*)     \end{align*}     \end{Heuristic proof}


title: Help with the lua-visual-debug package

text: The documentation for `lua-visual-debug` is a little sparse. Can someone interpret the boxes/lines/colors that `lua-visual-debug` produces?


title: How to have a horizontal line work inside a tabbing environment

text: Preface: I am very new to Latex, and may have missed some things here. I have a custom macro to create a horizontal line - not by my making, simply copied and pasted from the `exam` package.               \newlength\linefillheight     \newlength\linefillthickness     \setlength\linefillheight{.25in}     \setlength\linefillthickness{0.1pt}          \newcommand\linefill{\leavevmode         \leaders\hrule height \linefillthickness \hfill\kern\z@}      Unfortunately I have discovered that it doesn't work inside a tabbing environment:               \begin{document}     \linefill     \begin{tabbing}     \linefill      The first \linefill generates a line, but the second does not. How can I change my Latex to have this work with the tabbing environment? Here is an example .tex file that compiles and doesn't produce any horizontal lines, even though I want it to: (also note that \usepackage{examlines} refers to a custom .sty file I made that houses the code from the exam package for \linefill)               \documentclass[a4paper, 12pt]{article}     \usepackage{mathptmx}     \usepackage{examlines}     \newcommand{\tab}{\hspace*{1em}}          \begin{document}     \begin{tabbing}          \textbf{Question 1} \\      \textbf{a.} \tab \= Let $y = \left(- 3 x^{2} - 3 x\right)^{3}$. Find $\frac{dy}{dx}$. \\      \\      \> \linefill \\      \> \linefill \\      \> \linefill \\      \> \linefill \\      \> \linefill \\      \textbf{b.} \tab Let $f(x) = e^{2 x^{2} + 9 x + 5}$. Evaluate $f'(-1)$. \\      \\      \> \linefill \\      \> \linefill \\      \> \linefill \\      \> \linefill \\      \> \linefill \\                Let $f(x) = \left(- 3 x^{2} - 3 x\right)^{3} = u^{3}, u = - 3 x^{2} - 3 x$ \\      $f'(x) = 3 u^{2} \times u'$ \\      $f'(x) = - 81 x^{2} \left(x + 1\right)^{2} \left(2 x + 1\right)$ \\      \\     $f'(x) = \left(4 x + 9\right) e^{2 x^{2} + 9 x + 5}$ \\      $f'(-1) = \frac{5}{e^{2}}$ \\           \end{tabbing}     \end{document}      Here is the code in `examlines.sty`: (I don't use all of it)               %--------------------------------------------------------------------     %                            \fillwithlines               % \fillwithlines takes one argument, which is either a length or \fill     % or \stretch{number}, and it fills that much vertical space with     % horizontal lines that run the length of the current line.  That is,     % they extend from the current left margin (which depends on whether     % we're in a question, part, subpart, or subsubpart) to the right     % margin.     %     % The distance between the lines is \linefillheight, whose default value     % is set with the command     %     % \setlength\linefillheight{.25in}     %     % This value can be changed by giving a new \setlength command.     %     % The thickness of the lines is \linefillthickness, whose default value     % is set with the command     %     % \setlength\linefillthickness{.1pt}     %     % This value can be changed by giving a new \setlength command.               \newlength\linefillheight     \newlength\linefillthickness     \setlength\linefillheight{.25in}     \setlength\linefillthickness{0.1pt}          \newcommand\linefill{\leavevmode         \leaders\hrule height \linefillthickness \hfill\kern\z@}               \def\fillwithlines#1{%       \begingroup       \ifhmode         \par       \fi       \hrule height \z@       \nobreak       \setbox0=\hbox to \hsize{\hskip \@totalleftmargin               \vrule height \linefillheight depth \z@ width \z@               \linefill}%       % We use \cleaders (rather than \leaders) so that a given       % vertical space will always produce the same number of lines       % no matter where on the page it happens to start:       \cleaders \copy0 \vskip #1 \hbox{}%       \endgroup     }     %--------------------------------------------------------------------          \newcommand{\e}{\mathrm{e}}


title: How to close path for complex path in TikZ?

text: I'm doing a bit of 3D primitive fugures using this code:               \documentclass[tikz,10pt]{standalone}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{mathptmx}     \usetikzlibrary{arrows,shadows,calc,shapes,backgrounds,intersections,positioning}      \newcommand{\Grid}[2]{     \draw[white] (0,0)--(#1cm,0)--(#1cm,#2cm)--(0,#2cm)--(0,0);     \draw[very thin,color=gray] (0,0) grid (#1,#2);      \foreach \j  in {0,...,#1} {           \node[] at (\j,0) {$\j$};         }           \foreach \j  in {0,...,#2} {           \node[] at (0,\j) {$\j$};         }}     \begin{document}          \begin{tikzpicture}[line width=1pt,node distance=.1cm]     \tikzset{drawstyle1/.style={draw=cyan,fill=brown!50}}     \tikzset{drawstyle2/.style={draw=black,fill=cyan}}          %GRID     %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     \Grid{8}{10}     %===================================================================     %Brown parr     \coordinate (A) at (0,2);     \coordinate (B) at (0,7);     \coordinate (C) at (0.3,7);     \coordinate (D) at (0.3,2);     \def\Anf{60}     \newcommand{\parr}[7]{     \draw[#7] (#1,#2)--(#1,#2+#3)--(#1+#5,#2+#3)--(#1+#5,#2)--cycle;          \draw[#7] (#1,#2+#3)--++(#6:#4)--++(0:#5)--(#1+#5,#2+#3)--cycle;     \draw[#7](#1+#5,#2+#3)--(#1+#5,#2)--++(#6:#4)--++(90:#3)--(#1+#5,#2+#3)--cycle;     }     \parr{0cm}{2cm}{5cm}{3cm}{0.3cm}{45}{drawstyle1}     \parr{.3cm}{2cm}{.5cm}{3cm}{7cm}{45}{drawstyle2}          \end{tikzpicture}     \end{document}      This is what I got: ![enter image description here](http://i.stack.imgur.com/wwYZ2.jpg) My problem is that I can not found right way to close paths? I close path in drawing rectangles by points like this:               \draw[#7] (#1,#2)--(#1,#2+#3)--(#1+#5,#2+#3)--(#1+#5,#2)--cycle;      But when I start to draw another rectangle touching first, there is a problem with lines at corners. What is the simple or complex way to close paths correctly? Should I use clip somehow?


title: Vertical color background of section title

text: Good night. It's my problem about gradient colored section title, with vertical length. It's codes are,               \documentclass{scrbook}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[svgnames]{xcolor}     \usepackage{lipsum}     \usepackage[explicit]{titlesec}     \usepackage{tikz}          \titleformat{\section}[block]%             {\normalsize\bfseries\itshape\tikz[overlay] \shade[left color=red!20!yellow,right color=black!40!white] (0,-1ex) rectangle  (\linewidth,1em);}%     {\thesection}%                        {1em}%     {\color{Maroon}#1}          \begin{document}     \section{A textwidth section - OK.}     \lipsum[1]     \section{A very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long section - NOT OK.}     \lipsum[1]     \section{A section header full of \lipsum[1]}     \end{document}      But, It is not coloring all of second section. Related HTML pages not exactly for me. Therefore what is the simple code block that should be **added this code**? **Related:** Format section titles as white text on black background Section title gradient How to draw a gradient box around sections


title: Check widows/orphans easily in PDF preview output

text: I'd like to know if there is a easy way to find in the PDF preview the orphans and widows (as does the draft option to search words out of the margins with a black box).


title: How to create and use a new pgf key

text: In this example, I would like to have a new key `NbGrad` then I could write :               \begin{tikzpicture}[>=stealth,x=6cm,font=\footnotesize,NbGrad=12]      And use the key as I use `\NbGrad` or another way if it is better :               \documentclass[10pt,a4paper,french]{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[>=stealth,x=6cm,font=\footnotesize]     \def\NbGrad{12}          \draw [->] (0,0)--(1,0)  ;          \foreach \x in {0,1,...,\NbGrad} {%         \coordinate (\x) at (\x/\NbGrad,0) ;         \draw [very thin] (\x/\NbGrad,+2pt)--(\x/\NbGrad,-2pt) ;              \pgfmathsetmacro\result{2 + \x / 10}         \node[above=1pt]  at (\x)%             {\pgfmathprintnumber[precision=1,fixed,use comma]{\result}};              } ;          \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/lvjen.png)


title: Why cleveref references don´t works in this example?

text: I was compiling with PDFLATEX and appears ?? instead references.               \documentclass[12pt,a4paper]{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \usepackage{amsmath,amsfonts,amssymb,latexsym,subcaption}     \usepackage{graphicx}     \usepackage[cm]{fullpage}     \usepackage[spanish]{cleveref}   %para crear referencias          \usepackage{hyperref}     \hypersetup{colorlinks=true, urlcolor=blue}          \usepackage{mathpazo}       % Fuente MathPazo               \begin{document}          Next you can see the \cref{fig:capitala}.          \begin{figure}[h!]     \centering     \includegraphics[width=.28\linewidth]{example-image-a.jpg}     \caption{Thi is capital a}\label{fig:capitala}     \end{figure}     %\vspace{1cm}          And the \cref{tab:one}, in the \cpageref{tab:twentyfour}          \begin{table}[h!]     \begin{subtable}{.19\linewidth}\centering     {\begin{tabular}{c|c}     $x_i$ & $f(x_i)$ \\     \hline      1 & 1.2\\       2 & 0.4\\     \end{tabular}}     \end{subtable}%     %     \begin{subtable}{.19\linewidth}\centering     {\begin{tabular}{c|c}     $x_i$ & $f(x_i)$ \\     \hline     23 & 6.8\\     24 & 4.0\\     \end{tabular}}     \end{subtable}%     %     %     \caption{24 values}\label{tab:twentyfour}     \end{table}     \end{document}


title: How to enable shell-escape in TeXworks?

text: I require use of the `minted` package of similar one which support Prolog syntax-highlighting. Given that I use the TeXworks "IDE", how do I enable `shell-escape`? ![preferences](http://i.stack.imgur.com/5SO7t.png) Though I attempted—see above—I still receive this in my output:               ! Package minted Error: You must invoke LaTeX with the -shell-escape flag.


title: Slight changes to Harvard's agsm.bst

text: I've been writing my thesis and using bibtex, unfortunately I could not find a `.bst` to match the required format. It requires some particles to change from English to Spanish, as well as some changes in formatting. The most similar style I could find was Harvard's agsm.   1. Authors to be listed with "y" instead of "and".   2. Use "et al" in text when there are more than 3 authors.   3. Underline the title.   4. Place the year after the title. This is shown here! ![enter image description here](http://i.stack.imgur.com/Dpuar.png) Can this please be done by modifying directly the `agsm.bst`? I've tried to use makebst but latex doesn't seem to be able to use the `.bst` produced by that. My code is this:               \documentclass[10pt,oneside,letterpaper,spanish]{book}     \usepackage[utf8x]{inputenc}     \usepackage[activeacute,spanish]{babel}     \addto\shorthandsspanish{\spanishdeactivate{~<>.}}     \decimalpoint %\spanishdecimal{.}          \usepackage[spanish]{babel}     \usepackage[dcucite]{harvard}          \begin{document}     asdasd \cite{chsh_inequality} asdasd \cite{aspect_test_bell}     \bibliographystyle{agsm}     \bibliography{ejem_biblio}          \end{document}      and my bib is               @ARTICLE{chsh_inequality,        author = {{Clauser}, J.~F. and {Horne}, M.~A. and {Shimony}, A. and {Holt}, R.~A.         },         title = "{Proposed Experiment to Test Local Hidden-Variable Theories}",       journal = {Physical Review Letters},          year = 1969,         month = oct,        volume = 23,         pages = {880-884},           doi = {10.1103/PhysRevLett.23.880},        adsurl = {http://adsabs.harvard.edu/abs/1969PhRvL..23..880C},       adsnote = {Provided by the SAO/NASA Astrophysics Data System}     }          @ARTICLE{aspect_test_bell,        author = {{Aspect}, A. and {Grangier}, P. and {Roger}, G.},         title = "{Experimental Tests of Realistic Local Theories via Bell's Theorem}",       journal = {Physical Review Letters},      keywords = {Fluorescence, phosphorescence},          year = 1981,         month = aug,        volume = 47,         pages = {460-463},           doi = {10.1103/PhysRevLett.47.460},        adsurl = {http://adsabs.harvard.edu/abs/1981PhRvL..47..460A},       adsnote = {Provided by the SAO/NASA Astrophysics Data System}     }


title: pfgplottable borders missing

text: I try to place borders on the left and right of my pgfplottable.               \begin{table}          \pgfplotstabletypeset[      % col sep=comma,              %      every head row/.style={       before row={         \hline            & \multicolumn{3}{c|}{Unit [d]}\\       },       after row=\hline     },     % header=false,     every last row/.style={after row=\hline},     every even row/.style={     before row={\rowcolor[gray]{0.9}}},     col sep=comma,     string type,     columns/0/.style={column name={Task}, column type={|l}},     columns/1/.style={column name={A}, column type={|l}},     columns/2/.style={column name={B}, column type={|l}},     columns/3/.style={column name={C}, column type={|l|}},     ]{     Task, A, B, C     Bread, 100, 50, 30     }     \caption{Tasks}     \end{table}      I'd think, that the column types specify to place a border on the outside of the border. But ![this](http://i.imgur.com/8kZq1bS.png) is what I get. Any ideas, why the borders are missing?


title: Cannot get braille font to work

text: I want to use the eurobraille font found here: http://www.fakoo.de/braille- fonts/#achtpunkt in a latex document. I found this script to install ttf fonts: http://devnotcorp.wordpress.com/2011/06/10/use-truetype-font-with-pdflatex/ I did not really know, what options I should use in the script, this is what I did:               TEXMF="/usr/local/share/texmf"     FONTFOUNDRY="linotype"     FONTNAME="HBS-8-Braille Taktil"     FONTFAMILY="braille"     FONTENC="8t"     FONTDEFENC="t1"     FONTENCFILE="T1-WGL4.enc"      Running the script gives me:               *** Finished. The truetype font HBS-8-Braille Taktil is now available as braille in LaTeX.      So I try this document:               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{mathpazo}          \begin{document}     Normal Text          {\fontfamily{braille}\selectfont      Text in Braille%     }          \end{document}      And compilte it with pdflatex. I get this on the way:               LaTeX Font Warning: Font shape `T1/braille/m/n' undefined     (Font)              using `T1/cmr/m/n' instead on input line 8.      And well, it did not work. The Braille font is not used. But I have no Idea what exactly went wrong.


title: How to change the font style in \IEEEkeywords

text: IEEE papers has `\IEEEkeyword` command to write the keywords. I used `\renewcommand\IEEEkeywordsname{Index Terms}` to change that text to Index Terms. But the font of the keywords I obtained is _italics_ and not the normal font. The expected form is this, **_Index Terms_ -words, letters** But what I obtain is this, **_Index Terms-words, letters_** How to obtain normal font instead of italics for all the index terms.


title: title chapter in middle of page latex

text: I try to put title of my chapter in middle of page, so google it and i finish with this,                   \titleformat{\chapter}[display]      {\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}         \titlespacing*{\chapter}{0pt}{200pt}{40pt}      okay that make all chapter title in middle, but no, I want to make all chapter title in middle except introduction and conclusion and title of table of contents, list of figures thanks


title: Definitions of mathematical terms and declaration of symbols

text: When writing articles containing math, I would like to have a way to ensure that I am not using an undefined term or symbol. For instance, I want to use the term "simple algebra" only after I define it. For this, I can create a command               \newcommand{\simplealgebra}{simple algebra}      and place it just before the `\begin{definition}` command in which I define it. On the other hand, if I write another paper, where I use the same term or symbol, I don't want to end up by having duplicate commands, so I want to keep all the commands defined in one place, in the preamble, which possibly I want to share between more documents. Is there any way to combine the two conditions, namely, to have the command defined in the preamble, but to ensure the usage of the command only from one point in the document body? * * * Below is a minimal working example, as requested in comments. The example shows how I can use `\newcommand` to force myself to avoid using a term before being defined with `\begin{definition}`.               \documentclass{article}%          \newtheorem{theorem}{Theorem}     \newtheorem{definition}[theorem]{Definition}          \begin{document}          ...          Some introductory things. Here we don't know what an even number is, and using ``\textbackslash evennumber'' gives error.          %uncomment the following to get an error     %Some text about \evennumber     ...          Starting from here, it is allowed to talk about even numbers.     \newcommand{\evennumber}{even number}     \begin{definition}     An {\evennumber} is an integer that is divisible by $2$.     \end{definition}     \end{document}        * I know how to share a preamble containing definitions of commands.   * I know how to force the usage of a term after being defined. But to do this, I move the `\newcommand` from the preamble   * What I don't know, and I would like to know, is how to keep the `\newcommand` in the preamble, and yet make possible to use it only starting from a given position in the body of the document.


title: the \tkzGetAngle and \tkzAngleResult, precision

text: How can you specify the precision of the angle and using the absolute value of the angle in ° ' and " ![enter image description here](http://i.stack.imgur.com/VojjB.png)               \documentclass{article}     \usepackage{pgfplots}      \usepackage{tkz-euclide}     \usetkzobj{all}     \begin{document}     \begin{center}     \begin{tikzpicture}     \coordinate (M) at (0,0) ;     \coordinate (A) at (canvas polar cs:angle=80,radius=4cm) ;     \coordinate (B) at (canvas polar cs:angle=-40,radius=4cm) ;     \coordinate (C) at (canvas polar cs:angle=30,radius=4cm);     \coordinate (D) at (canvas polar cs:angle=125,radius=4cm);     \coordinate (E) at (canvas polar cs:angle=200,radius=4cm);     \coordinate (F) at (canvas polar cs:angle=245,radius=4cm);     \draw (M) circle (4cm);     \draw (B) -- (A) -- (C);     \draw (B) -- (D) -- (C);     \draw (B) -- (E) -- (C);     \draw (B) -- (F) -- (C);     \tkzDrawPoints(A,B,C,D,E,F,M);     \tkzLabelPoints[above](A);     \tkzLabelPoints(B,C,M);     \tkzLabelPoints[left](D,E,F);     \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,A,C);     \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,D,C);     \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,E,C);     \tkzMarkAngle[fill= red,size=1.5cm, opacity=.4](B,F,C);     %\tkzLabelAngle[pos = 0.8](B,A,C){$\alpha$};       \tkzLabelAngle[pos = 0.8](B,D,C){$\beta$};       \tkzLabelAngle[pos = 0.8](B,E,C){$\gamma$};       \tkzLabelAngle[pos = 0.8](B,F,C){$\delta$};       \tkzGetAngle{angleBAC};     \tkzLabelAngle[pos = 0.8](B,A,C){\tkzAngleResult};        \end{tikzpicture}     \end{center}     \end{document}


title: Remove whitespace around an enumeration in a table

text: I've tried using the `enumitem` suggestion given on http://stackoverflow.com/questions/4968557/latex-very-compact-itemize, but I still see white space around my enumeration:               \documentclass{article}     \usepackage{enumitem,lipsum}          \begin{document}          \begin{table}     \begin{tabular}{lp{.7\textwidth}}     1 & \begin{enumerate}[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]     \item \lipsum[2]{}     \item \lipsum[3]{}     \end{enumerate}\\     2 & \lipsum[5]{}\\     \end{tabular}     \end{table}          \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/pSyfO.png) I found a `compress` trick in one of the answers:               \documentclass{article}     \usepackage{enumitem,lipsum,array}          \makeatletter     \newcommand*{\compress}{\@minipagetrue}     \makeatother          \begin{document}          \begin{table}     \begin{tabular}{l>{\compress}p{.7\textwidth}}     1 & \begin{enumerate}[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]     \item \lipsum[2]{}     \item \lipsum[3]{}     \end{enumerate}\\     2 & \lipsum[5]{}\\     \end{tabular}     \end{table}          \end{document}      This gets rid of the white space above the list, but the one on the bottom still remains: ![enter image description here](http://i.stack.imgur.com/PGtUJ.png) The end result is that the table looks unbalanced — when some of the rows **are not** an enumeration, there is no spacing between them. When a row **is** an enumeration, there is spacing. How can I get rid of the extra white space below an enumeration?


title: Add index item by makro

text: I am struggling with creating a macro that would enable me to create index items by macro. From a former post (LaTeX: is it possible to create a macro to add words to index (using TexMaker)?) I have tried to use the following, but I can't get it to work. I am using TexmMakerX on Mac (home) and Windows (work). I have added               \newcommand\iindex[1]{#1\index{#1}}      to my preamble. I also added the same line to User -> User Macros, but the macro would only print `\newcommand\iindex[1]{#1\index{#1}}` on the screen. Also `\iindex` would not work. I can't figure out how to use this macro... Ideally I'd like it to highlight a word and insert `\index{WORD}` right before that word. I am obviously not a LaTeX pro... and I would really appreciate a hint... * * * Edit/Comment: Thanks alls for your kind answers - sorry for forgetting the MWE. Indexing is working fine generally. All commands in my preamble are working without problems. I have a large document without index, and I want to add an index to it. Since it is really tedious to copy each word that I want to index, then type \index{PASTE} and continue I am looking for a semi-automatic method. In AucTeX on Emacs you could position the cursor within a word and hit a key to index it, but I don't use either one any more. I was trying to achieve sopmething liek this in TexMakerX by combining the `\newcommand` from the first post above with a TexMakerX makro. I like the Andrew's suggestion below, but would prefer highlighting a word and indexing it with a keystroke... Thanks to all, it would be cool if you had an idea to help me.


title: How can I include an image in the title content achieved with \maketitle in the amsart class?

text: I am writing my thesis and using the `amsart` document class. On the first page I have used `\maketitle`, and have specified Title, Author and Abstract in the preamble, so these are produced. I would like to insert an image between the Author and the Abstract. At the moment I have added it after `\maketitle`, but this then follows the abstract, rather than preceding it. Is there a way to resolve this? Edit to include code - I know there's a lot of packages there that probably aren't relevant, but decided to include everything I'm using just in case! Code:               \documentclass[11pt]{amsart}     \usepackage[top=1in, bottom=1in, left=1.5in, right=1in]{geometry}     \geometry{a4paper}      \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{epstopdf}     \usepackage{subfigure}     \usepackage{setspace}     \usepackage{cite}     \usepackage{amsmath}     \usepackage{xfrac}     \usepackage{cleveref}     \usepackage{url}     \usepackage{breqn}     \usepackage[bitstream-charter]{mathdesign}     \usepackage[T1]{fontenc}     \numberwithin{equation}{section}     \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}     \title{Title}     \author{Author}     \begin{document}     \begin{abstract}     Abstract text...     \end{abstract}     \maketitle     \begin{center}\includegraphics[width=0.14\textwidth]{logo}\end{center}     \end{document}


title: What packages do these come from?

text: Just wondering if anyone could tell me the packages I need to call in order to use the following commands, `\notat` and `\acron`? Two examples of the code in use are shown below. These are used for notation and acronyms respectively. I've seem them used but can't seem to track down the package.               \acron{CAD}{Computer Aided Design}     \notat{h}{Height}      Thanks in advance.


title: dealing with strange characters in a bib file

text: I use `mendeley` to generate my `bib` file so I have a very large list of items (3000+) and since `mendeley` collects the bibliography information sometimes from the pdf file, there may be errors and strange characters. I guess this is why I get the following error               ! Package inputenc Error: Unicode char \u8:∗ not set up for use with LaTeX.      What should I do? I use `Pdftexify` on `WinEdt8`. packages are up to date               \documentclass[11pt,captions=nooneline]{scrartcl}         \usepackage[utf8]{inputenc}% For proper input encoding         \usepackage[bitstream-charter]{mathdesign}         \usepackage[citestyle=authoryear,isbn=false,maxcitenames=3,maxbibnames=99,doi=false,url=true]{biblatex} % place in the document preamble         \addbibresource{D:/Gdrive/Drop/Dropbox/STATADO/paper/latex/p2/library.bib}      example of a bib item gone wrong:               @article{Biais2009,     author = {Biais, Bruno and Weill, Pierre-olivier},     file = {:D$\backslash$:/Gdrive/Drop/Dropbox/mendeley/Biais, Weill - 2009 - Liquidity shocks and order book dynamics ∗ - Unknown.pdf:pdf},     keywords = {bid-ask spread,limit-order book,liquidity,search},     pages = {1--51},     title = {{Liquidity shocks and order book dynamics ∗}},     year = {2009}     }      here I guess the `*` is bad...


title: Notepad++ With MiKTeX and Sumatrapdf

text: I've seen similar posts to this one, but none have addressed my specific problem (I think!). I currently use Notepad++ with MikTeX on my Windows 7 desktop. My default pdf viewer is Sumatrapdf. I have two `nppexec` commands that compile my current file. The first is:               npp_saveall     CD $(CURRENT_DIRECTORY)     "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" "$(FULL_CURRENT_PATH)" -output-directory "$(CURRENT_DIRECTORY)"     NPP_RUN $(NAME_PART).pdf      The second is:               npp_saveall     CD $(CURRENT_DIRECTORY)     "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" "$(FULL_CURRENT_PATH)" -output-directory "$(CURRENT_DIRECTORY)"      Of course, I run the first command when I want to open a new pdf window and I run the second when I already have a pdf window open and I just want to update the file. My problem is that my first command always opens a new window. I'd like to just have one command that either opens a new window (if one isn't open already) or brings the updated open window to the front. Does anyone know how to alter my code to do this? Update: I got it to work! My new code is               npp_saveall     CD $(CURRENT_DIRECTORY)     "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" "$(FULL_CURRENT_PATH)" -output-directory "$(CURRENT_DIRECTORY)"     "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" "$(NAME_PART).pdf" -reuse-instance


title: Conditional format for correlation table

text: I'm using the script by Christian Feuersänger:               \documentclass{standalone}     \usepackage{colortbl}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableset{         /color cells/min/.initial=0,         /color cells/max/.initial=1000,         /color cells/textcolor/.initial=,         %         % Usage: 'color cells={min=<value which is mapped to lowest color>,          %   max = <value which is mapped to largest>}         color cells/.code={%             \pgfqkeys{/color cells}{#1}%             \pgfkeysalso{%                 postproc cell content/.code={%                     %                     \begingroup                     %                     % acquire the value before any number printer changed                     % it:                     \pgfkeysgetvalue{/pgfplots/table/@preprocessed cell content}\value                     \pgfmathfloatparsenumber{\value}%                     \pgfmathfloattofixed{\pgfmathresult}%                     \let\value=\pgfmathresult                     %                     % map that value:                     \pgfplotscolormapaccess                         [\pgfkeysvalueof{/color cells/min}:\pgfkeysvalueof{/color cells/max}]                         {\value}                         {\pgfkeysvalueof{/pgfplots/colormap name}}                     % now, \pgfmathresult contains {<R>,<G>,<B>}                     %                      % acquire the value AFTER any preprocessor or                     % typesetter (like number printer) worked on it:                     \pgfkeysgetvalue{/pgfplots/table/@cell content}\typesetvalue                     \pgfkeysgetvalue{/color cells/textcolor}\textcolorvalue                     %                     % tex-expansion control                     % see http://tex.stackexchange.com/questions/12668/where-do-i-start-latex-programming/27589#27589                     \toks0=\expandafter{\typesetvalue}%                     \xdef\temp{%                         \noexpand\pgfkeysalso{%                             @cell content={%                                 \noexpand\cellcolor[rgb]{\pgfmathresult}%                                 \noexpand\definecolor{mapped color}{rgb}{\pgfmathresult}%                                 \ifx\textcolorvalue\empty                                 \else                                     \noexpand\color{\textcolorvalue}%                                 \fi                                 \the\toks0 %                             }%                         }%                     }%                     \endgroup                     \temp                 }%             }%         }     }          % this is my table:          \pgfplotstabletypeset[         color cells={min=0.2,max=0.9,textcolor=-mapped color!80!black},         /pgfplots/colormap/blackwhite,         /pgf/number format/.cd,%sci,         set decimal separator={,},     ]{     1.0 1.0 1.0 0.9 0.3 0.2 0.6 0.5 0.6 0.5 0.5 0.7 0.1 0.2 0.6     1.0 1.0 1.0 0.9 0.3 0.2 0.6 0.5 0.6 0.5 0.5 0.7 0.1 0.2 0.6     1.0 1.0 1.0 0.9 0.3 0.2 0.6 0.5 0.6 0.5 0.5 0.7 0.1 0.2 0.6     0.9 0.9 0.9 1.0 0.4 0.2 0.4 0.4 0.4 0.3 0.4 0.4 0.1 0.4 0.5     0.3 0.3 0.3 0.4 1.0 0.0 0.3 0.2 0.3 0.2 0.3 0.2 0.4 0.4 0.0     0.2 0.2 0.2 0.2 0.0 1.0 0.5 0.4 0.5 0.4 0.1 0.4 0.1 0.0 0.2     0.6 0.6 0.6 0.4 0.3 0.5 1.0 1.0 1.0 0.9 0.7 0.7 0.2 0.1 0.4     0.5 0.5 0.5 0.4 0.2 0.4 1.0 1.0 1.0 1.0 0.5 0.6 0.1 0.0 0.3     0.6 0.6 0.6 0.4 0.3 0.5 1.0 1.0 1.0 0.9 0.6 0.7 0.2 0.1 0.4     0.5 0.5 0.5 0.3 0.2 0.4 0.9 1.0 0.9 1.0 0.5 0.5 0.1 0.0 0.3     0.5 0.5 0.5 0.4 0.3 0.1 0.7 0.5 0.6 0.5 1.0 0.9 0.1 0.1 0.2     0.7 0.7 0.7 0.4 0.2 0.4 0.7 0.6 0.7 0.5 0.9 1.0 0.3 0.2 0.2     0.1 0.1 0.1 0.1 0.4 0.1 0.2 0.1 0.2 0.1 0.1 0.3 1.0 0.9 0.4     0.2 0.2 0.2 0.4 0.4 0.0 0.1 0.0 0.1 0.0 0.1 0.2 0.9 1.0 0.1     0.6 0.6 0.6 0.5 0.0 0.2 0.4 0.3 0.4 0.3 0.2 0.2 0.4 0.1 1.0     }      This image is the result: ![enter image description here](http://i.stack.imgur.com/v6ysQ.png) Now I've to print it in black and white and I can't see the text in some cells. How should the script be changed to make the text color white when it has a non-white background and leave the textcolor black in white cells?


title: Most useful LaTex -macros? Help me to understand a statement with `\[p][s][frac|mat]`

text: I want to understand the below, source here. I am studying material related to real-time-Texing like here. > _As for fractions and matrices, I prefer using LaTeX macros instead of > snippets. The most useful macros I use are the **\[p][s][frac|mat]** : > fraction or matrices, with parenthesis if there is the “p”, small if there > is the “s” (small means suitable for in-line math). Analysts may want to > have macros for (partial) derivatives; and remember that to write > differentials you have to write \mathrm{d} t, not simply d t! The macros > file I use is here (use it with usepackage{Commons})._ Please, provide examples how to use the `"most useful macros"` there and do not hesitate to recite. I can understand `\frac 12` i.e. half i.e. 0.5 but what does this `\\[p][s][frac|mat]` mean?


title: Drawing a half arrow with tikz

text: Is there a command to draw upper half of an arrow in `tikz`? Something similar to: ![](http://i.stack.imgur.com/fsvL3.png)


title: hyperref and xr-hyper break memoir's \titleref

text: I have one document that has `hyperref` loaded, and works fine. I have a second document that I am using `xr-hyper` to reference the first. If I remove `hyperref` from the first document, the `\titleref{}` (from `memoir`) command works as expected. If I use `hyperref` I get "See Chapter 1" instead of "See Chapter Example". Here are the two files that show this behavior:               \documentclass[12pt]{memoir}     \usepackage{xr-hyper}     \usepackage{hyperref}          \begin{document}     \chapter{Example}\label{chap:example}          Examples     \end{document}      Call that one `example.tex`, run `pdflatex` on it, and then the second file references it:               \documentclass[12pt]{memoir}     \usepackage{xr-hyper}     \usepackage{hyperref}          \externaldocument{example}     \begin{document}     See Chapter~\ref{chap:example} on page~\pageref{chap:example} which is called~\titleref{chap:example}.     \end{document}      Compile the second file and the issue will appear. Remove or comment out `\usepackage{hyperref}` in the first file and rerun both `pdflatex` commands and the `\titleref` command will work, but the first document won't have any hyperreferences. I suspect that the problem is that the `example.aux` file has               \newlabel{chap:example}{{\M@TitleReference {1}{Example}}{1}}      in the working case, and               \newlabel{chap:example}{{1}{1}{Example}{chapter.1}{}}      in the case that doesn't work. I suppose I can compile my first file without `hyperref` and then the second file, and then turn `hyperref` on again and recompile the first file.


title: Adding vertical space in a multi-line equation while using IEEEeqnarray

text: how can I add vertical space between lines in an equation while using IEEEeqnarray?


title: Changing section heading style

text: I would like to change the section/subsection style of my LaTeX document. The following is an example of what I would like: **3. Methodology and data: An explanation** (Level 1. 12 font. In **bold**. Period after number.) _3.1. Empirical methods_ (Level 2. Subheading in _italics_ NOT **bold**. Font size same as level 1. Periods after numbers.) _3.1.1. Testing vectors_ (Level 3. Subsubheading in _italics_ NOT **bold**. Font size same as level 1. Periods after numbers.) Similarly, the above section/subsection style should continue on for all subheadings. I would like only the above changes to be applied to my entire document. I want all other section/subsection settings to remain as default (i.e, flushed left etc). Cross referencing should also remain as the default, e.g., _3.1.1._ should be cross referenced as "3.1.1" (no italics and no period after the last number). My MWE is currently:               \documentclass[twoside, a4paper, 12pt]{article}     \usepackage{ragged2e}     \usepackage{booktabs,tabularx}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{verbatim}     \usepackage{amsmath, amssymb}     \usepackage{natbib}     \usepackage{tikz}     \usepackage{enumerate}     \usetikzlibrary{matrix, arrows}     \usepackage{graphicx}     \usepackage{subfig}     \usepackage{listings}     \usepackage{color}     \usepackage{float}     \usepackage{multicol}     \usepackage{booktabs}     \usepackage{lscape}     \usepackage{cases}     \usepackage{multirow}     \usepackage[figuresright]{rotating}     \usepackage{setspace}     \usepackage{lscape}     \usepackage{longtable}     \usepackage{caption}     \usepackage{pslatex}     \usepackage[update,prepend]{epstopdf}     \usepackage[pdftex,colorlinks,linkcolor=black,citecolor=black]{hyperref}     \usepackage[official]{eurosym}          \setlength{\textwidth}{6.5in}     \setlength{\oddsidemargin}{0in}     \setlength{\evensidemargin}{0in}     \setlength{\parindent}{0pt}     \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}          \linespread{2}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}               \begin{document}                         \bibliographystyle{apa-good}     \bibliography{bibliography}     \end{document}


title: Need alt text for images in pdf for screen readers

text: I need the generated PDF to have "alt" text associated with each image so that a screen reader can read the alt text to the visually impaired user. I understand that essentially just including the "alt" text as the caption, or as part of the caption would be sufficient in reality, but we are dealing with government legal requirements and it would be far easier to be able to just check that box. Has anyone done this? Any help appreciated. Thanks.


title: Is there any way to add a background color to the header part of a file that use moderncv?

text: I was wondering if there are any way to set the background color of the header part (the one that contains personal info) of a file that uses `moderncv` in order to visually differentiate the header and the content. I tried with `minipage`, `\hfill` and so on but I guess that `moderncv` uses a heavily customized template and everything I've tried so far lead to a compile error.


title: Figure - Page Number overlap

text: I am new to `Tex` and not very experienced. Unfortunately, I've got a problem: On one page a figure overlaps the page number. Actually the image is positioned very close to the bottom page border which looks odd. I'd be really glad if you could help me solving this issue. MWE:               \documentclass[11pt]{article}          \usepackage{geometry}     \geometry{a4paper}     \usepackage{graphicx}     \usepackage{booktabs}     \usepackage{array}     \usepackage{fancyhdr}     \pagestyle{fancy}          \begin{document}          \begin{figure}[H]     \begin{center}        \includegraphics[width=100mm]{./img0.png}         \caption[Image 1]{Image 1}     \label{fig:t2-2}     \end{center}     \end{figure}          \begin{figure}[H]     \begin{center}        \includegraphics[width=100mm]{./img1.png}         \caption[Image 2]{Image 2}     \label{fig:t2-2}     \end{center}     \end{figure}          \end{document}


title: Typeset content of a PDF text-field without recompilation

text: With respect to preparing a PDF for printing: Is it possible to provide a _text-field_ in PDF where I can type something and it should be typeset for printing? A _resume_ for example : Most of the content in my resume remain same, only few fields require changes, so I was thinking of providing text-fields where I can enter changes and get typeset printouts, without much worrying about compiling it again. This is for portability, most of the printing shops would not have TeX installed on their computers. This will come in handy.


title: Typesetting the "define equals" symbol

text: I'd like to typeset two compound symbols for making definitions. The following   * `\newcommand{\defeq}{\mathrel{\mathop:}=}`   * `\newcommand{\eqdef}{\mathrel{\mathop=}:}` are suggested by the CTAN symbol list in the footnote on page 35. (Well, the first is suggested, and I made up the second.) Is there a better way to do this, short of including `txfonts`? Basically, it always looks like `\defeq` has more space on the left than on the right, and conversely for `\eqdef`. EDIT - Most of the answers are taking about packages that fix the vertical placement of the colon. Ok, that is great and I'm interested to hear it. But let me restate my question. I want to fix the apparent difference in space on the left and right sides of \defeq. To see what I mean, look at typeset equation `$a \defeq b$` in Stefan's answer. The `$a$` and the `$b$` are equal distances from the center. But because the colon is a lighter symbol _it_looks_ the `$a$` is further away. Does that make sense?


title: biblatex: extract fields without starting a page

text: I'm trying to extract some data from bib entries for further processing. Sadly if I use a cite command it starts a page:               \documentclass{article}     \usepackage{biblatex}     \addbibresource{biblatex-examples.bib}          \DeclareCiteCommand{\gettitle}      {}      {\gdef\currenttitle{\thefield{title}}}%      {}{}               \begin{document}     abc     \clearpage     \gettitle{gillies}%     \end{document}      That's a problem as it leads to empty pages in my real document (which involves includepdf). Has someone an idea how I could get the data without interfering with the shipout? # Edit I'm sorry about the confusion with the `\gdef`: I simply used some senseless code which normally wouldn't start a page. The `\sbox` in is an idea but in my actual code I have additionally an `\includepdf` in the code so I don't want to throw away everything, I only want to prevent the starting code to start a page so that the following `\includepdf` (which uses one of the fields as file name) doesn't force an empty page. Egreg's reference to `\leavevmode` lead to the solution                {\makeatletter       \let\blx@leavevmode\relax\let\blx@leavevmode@cite\relax       \gettitle{gillies}}      (`\blx@leavevmode@cite` is executed very early so there is no way to incorporate the code in the definition of `\gettitle`). Another idea is `\AtBeginShipoutDiscard` from the `atbegshi` package:               \DeclareCiteCommand{\gettitle}      {\AtBeginShipoutNext{%       \AtBeginShipoutDiscard}}      {\gdef\currenttitle{\thefield{title}}}%      {}{}      This would remove the need of some wrapper command to hide the leavevmode changes. But I don't know how to check if the page was started by the `\leavevmode` of the cite command (and so can be discarded) or if there is some "normal" text on the page.


title: Configure TexnicCenter with something else than Adobe Reader X

text: My Adobe decided it should be version X now, and it misbehaves in so many ways. One way is that it is impossible to get it to open a pdf document from within TexnicCenter (or I missed something...) Pressing F5 opens up the Adobe with some start menu asking me to open a recent file blablabla. But not the file I want to see. And TexnicCenter tells me the command could not be executed. I've had it with Adobe bloatware, so I want to shift to something else. Nitro comes to mind, as I find it a decent PDF reader and editor. So I wondered if anybody had experience setting up TexnicCenter with Nitro, as I couldn't really find anything on the net. Or is there another one that is better (Sumatra is mentioned as it gives pdfsync, but again, I have no experience in this) Thank you for your answers. EDIT : After some more searching around, I found that there is apparently a problem with the server name for Adobe ( see this discussion ). Still, I've had it with those _censored. more censored_. So any help on linking TC with either Nitro or something else is greatly appreciated


title: Templates for NSF grant applications

text: Are there any good LaTeX templates or classes available which comply to NSF formatting requirements? In particular, I'm looking for a template for the "biographical sketch."


title: How can I pass a shortcut to a `.pdf` to `\includegraphics{}`?

text: I'd like to pass shortcuts to `\includegraphics`. I have the following project structure               /project/report/main.tex     /project/report/myplotshortcut     /project/code/r/output/myplot.pdf      And file:               % main.tex     \documentclass{article}     \usepackage{graphicx}     \begin{document}     \inlcudegraphics{myplotshortcut}     \end{docuemnt}      where `myplotshortcut` is a shortcut to `myplot.pdf`. Things work fine when I pass `myplot.pdf` directly. The shortcut seems to break things. There's no mention of a "pass shortcut" option in the `graphicx` manual. HOWEVER, in my post Project directory organization: where does the output go it was mentioned that I should include dynamic links. My understanding is that (basically) symlinks are to Linux as shortcuts are to Windows. Q: Does what I've posted above work fine with symlinks (as suggested in that linked post)? Q: If it does, how can I set up a similar architecture using Windows shortcuts? UPDATE: I figured out how to make an actual symlink using the `mklink` function from the command line. Still no dice. Doesn't seem to make a difference.


title: Slanted fractions

text: I'm trying to develop a command to typeset slanted fractions. I know about `nicefrac` and `xfrac` packages, have tried both, and disliked both. At the moment, in text mode I use `\nicefrac` with a bit of raising and lowering, because my aim is to get the numerator with the top line aligned with the top of the slash, and the denominator with the baseline aligned with the bottom of the slash. I've come up with this:               \documentclass[a4paper]{report}     \usepackage{amsmath,amsfonts,amssymb}     \newcommand{\Z}{\mathbb{Z}}     \usepackage{xparse}     \global\newcount\qwerty     \newcommand{\e}[1][2]{\ifnum#1>0         \qwerty=0         \loop\!\advance\qwerty by 1\ifnum\qwerty<#1\repeat     \else         \qwerty=0         \loop\,\advance\qwerty by 1\ifnum\qwerty<-#1\repeat     \fi}     \NewDocumentCommand{\xof}{mmO{7.8}O{-9.3}O{1}O{1}}     {\raisebox{#3pt}{$#1\e[#5]$}\bigg/\raisebox{#4pt}{$\e[#6]#2$}}     \usepackage{graphicx}     \newcommand{\scb}{\scalebox}     \usepackage{xfrac,nicefrac}          \begin{document}     \[\xof{\Z}{n\Z}\]     \[\xof{A}{I}[7.8][-9.3][1][2]\]     \[\xof{\scb{0.7}[0.7]{\(\xof{A}{I}\)\hspace{1pt}}}{\scb{0.7}[0.7]{\hspace{0.5pt}\(\xof{J}{I}\)}}[10][-7.5]\cong\xof{A}{\hspace{-1.2pt}J}.\]     \end{document}      ![enter image description here](http://i.stack.imgur.com/Cx8nf.png) All of that looks fine to my eyes. Parameters 1 and 2 are numerator and denominator, parameters 3 and 4 are the raising amount for the numerator and the lowering amount for the denominator respectively, both in `pt`, and the other two are numbers which get turned into as many `\\!`s (i.e. 2->!!) for kerning between the numerator, the denominator and the slash. The point is having to manually regulate those parameters every time is rather annoying. So is there a way to get the alignment as described at the top done automatically? PS I know you will tell me I shouldn't have a string of `\\!`s. I've already been told so about one of `\,`s. It's just that sometimes it's handy to have discrete spacing. In any case I think I will abandon this in favor of parameters to pass to `\hspace`. **Update:** I didn't know about the `\thinskip`, but I will certainly redefine the command adding its use, because it joins a continuous range of spaces and my eye's accustomedness to quantities of `\\!`. As for the other comments, the point in this is not to have fractions, but rather quotients sets, which I regard as something rather different and write in a completely different way. As such, my aim is definitely _not_ to save vertical space. That might be useful for inline fractions, but for that I have a totally different command which sort of adjusts `\nicefrac`. Well, here it is:               \newcommand{\of}[2]{\nicefrac{^{#1}}{_{#2}}}     \newcommand{\mf}[2]{^{#1}\scb{0.5}[1]{/}_{#2}}      either of these, though `\of` is decidedly nicer and of more common usage for me. So `\xof` is displayed formula only. No need to save space there. I agree that thus zoomed they don't look that nice, but that is probably because `\bigg` is too tall. On the other hand, `\Big` seemed too short to me when I tried it. Maybe I can try combining `\left/` and `\right.` with something in the middle, `\vphantom` maybe. That's to be investigated. I HAVE tried `\nicefrac` and `xfrac`'s `\sfrac`, and both looked bad to me. So don't tell me I «don't know about `xfrac`» when I have stated, and restate, I have tried it. Using fractions for quotient sets looks bad to me, otherwise I wouldn't be here. As for the supposedly related answers, this looks like a way to do what I'm doing here in text mode, and these commands I'm studying are for math mode, and this has one answer which aligns only the numerator and one which aligns neither so definitely not what I'm looking for.