title: A new environment to decide dynamically which commands to run?

text: I am having some user defined commands defined and used in my latex document. I need a way to check whether any of the commands is used. I want to make decisions based on the argument used in the command. Can I do this by defining a user defined environment? Please let me know what should be done here. Example code:               \documentclass[12pt]{article}     \usepackage{ulem}     \usepackage{color}     \newcommand{\deleteline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{red}{\sout{#2}}}     \title{Latex Document}     \author{Eddy}     \begin{document}     \maketitle     As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.}      I want to find out programmatically if `\deleteline` command is used in the content. I also want to find out what's the first argument used. _Edit_ : I am going to add a detailed use case of my current requirement. My input code is as follows. Please note that `\begin{analyze}{eddy}` is the new environment that is to be defined yet.               \documentclass[12pt]{article}     \usepackage{ulem}     \usepackage{color}     \newcommand{\deleteline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{red}{\sout{#2}}}     \newcommand{\addline}[2]{\textsuperscript{\textcolor{black}{ #1}} \textcolor{green}{#2}}     \title{Latex Document}     \author{Eddy}     \begin{document}     \maketitle     \begin{analyze}     As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}     \end{analyze}     \end{document}               If no argument is passed to the new environment,          \begin{analyze}     As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}     \end{analyze}      Output: All changes done by all users are taken into consideration ![Expected output when no argument is passed](http://i.stack.imgur.com/RITmR.png) If 'eddy' is given as an input,               \begin{analyze}{eddy}     As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}     \end{analyze}      Output: Only changes by done by Eddy is considered. Other users changes are ignored. ![Expected output when 'eddy' is passed](http://i.stack.imgur.com/wTUqH.png)               \begin{analyze}{Margret}     As part of this project, we intend to study the complex structures of Latex. \deleteline{eddy}{This line will be stroked through.} \addline{Margret}{This line is to be added.}     \end{analyze}      Output: Only changes done by Margret is considered. All other changes are ignored. ![enter image description here](http://i.stack.imgur.com/mmFz0.png)


title: Is it possible to redefine \alpha this way?

text: I was thinking about doing something crazy, namely, I want to define a "newcommand" by               \renewcommand{\alpha}{\ensuremath{\alpha}}      so that later in text mode I can just do `\alpha` instead of `$\alpha$` (The actual macro will have `\xspace` in it, but let's ignore that.). The question is, how do I let the system know, when it replace `\alpha` by `\ensuremath{\alpha}` to use the "built-in" macro `\alpha`, instead of the renewed one, and thus not stuck in an infinite loop? Or, is there a way to make sure the macro only "expand" once?


How to clip a rectangle with multiple shapes (circle)? I need to create a complex venn diagram and need to clip the outer rectangle in a shape that is combined with multiple circle. Not sure how to do it. I could do it with one circle though,               \documentclass{minimal}          \usepackage{graphicx, tikz}          \begin{document}          \def\Space{(-5,-5) rectangle (5,5)}     \def\Item{(-1.9,0.62) circle (2.5cm)}          \begin{tikzpicture}         \begin{scope}[shift={(3cm,-5cm)}, fill opacity=1.0]             \fill [orange, even odd rule] \Space \Item;         \end{scope}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/dblr2.jpg)


title: Why are my Images not correctly centered?

text: First of all this is my first posting here on tex.stackexchange.com. I'm new to the tex world and I need a little bit of your help. I am trying to align text relative to a figure. How it should look like in the end:                                    an a4 paper         _______________________________________________         |              _______________                |         |              |             |                |         |       desc   |  a figure   | desc           |         |              |_____________|                |         |              _______________                |         |              |             |                |         |       desc   |  a figure   | desc           |         |              |_____________|                |         |              _______________                |         |              |             |                |         |       desc   |  a figure   | desc           |         |              |_____________|                |         |              _______________                |         |              |             |                |         |       desc   |  a figure   | desc           |         |              |_____________|                |         |                0  5  15  30    min          |         |                                             |         |            Figure 1: A caption              |         |                                             |         |                                             |         |                                             |         |_____________________________________________|      The descriptions on the right and left vary in length. They also vary in length for the different pictures. The pictures itself would be of the same dimension. However the figures should stay in the middle of the page which means the caption should end up in the horizontal center under the figures. The figures are in .png format. I am using pdfLatex. I tried using several approaches to this problem including placing the png's inside an eps with psfrag reference points for the text however like that i did not see the possibility to center align the actual picture since with psfrag the variable length text will be placed inside the picture and also left alignment of the landslide text was not possible. See example 1. I tried using the floatrow package to place the text as subcaptions left of the figure. It never really worked and I haven't even started to place the text on the right side of the figure. So I ended up placing the figures inside a table but again I am having problems aligning the pictures to the center. See example 2 for general tabular idea. See example 3 for central alignment of the blots. The idea of the tabular is to set the width of the first row to .33\textwidth so the image would always start centered of the page [EDIT: logical error -> see comment, i guess it should be .33\textwidth-.5{width of the figure in the second row of the table}]. In the second row is the figure, in the third row is the other description. I dont want the label on the left side to be flushedright because the description of the figure would always follow this format: IP something WB something, so the IP should vertically align. Example 3 is close but not perfect... and it's very uncomfortable to setup so maybe there is an easier/more simple approach? I thought of something like that but it does not work properly? The used figures can be found look like that: png ![png](http://i.stack.imgur.com/eqIk1.png) eps ![eps](http://i.stack.imgur.com/hATEB.png)                   \begin{tabularx}{\textwidth}{XlMl}         \multicolumn{2}{p{.333\textwidth}}{}    \\     &Ip EphA2 Wb PTEN   &\includegraphics[width=4cm]{gfx/blots/test.png}    & -- \SI{100}{\kilo\dalton} \\         \end{tabularx}      Example 1                   \documentclass[11pt]{article}         \usepackage{blindtext}         \usepackage[]{auto-pst-pdf}         \usepackage{psfrag}         \begin{document}         \blindtext         \begin{figure}[bth]         \footnotesize         \psfragfig{gfx/test}         \caption{Some Blots.}         \label{fig:blot}         \end{figure}         \end{document}      The corresponding test-psfrag.tex contains this code:                   \psfrag{1}[br]{IP EphA2 WB EphA2}         \psfrag{2}[br]{IP NHERF1 WB Cbl}         \psfrag{3}[br]{IP pPTEN WB pTyr}         \psfrag{4}[br]{IP EphA2 WB NHERF1}         \psfrag{a}[bl]{-- \SI{110}{\kilo\dalton}}         \psfrag{b}[bl]{-- \SI{120}{\kilo\dalton}}         \psfrag{c}[bl]{-- \SI{130}{\kilo\dalton}}         \psfrag{d}[bl]{-- \SI{140}{\kilo\dalton}}         \psfrag{w}[l]{0}         \psfrag{x}[l]{5}         \psfrag{y}[l]{15}         \psfrag{z}[l]{30}      Example 2:                   \documentclass{scrartcl}         \usepackage{array}         \usepackage{showframe}         \usepackage{tabularx}         \usepackage{siunitx}         \usepackage{graphicx}         \newcolumntype{y}{>{\centering\arraybackslash}X}         \newcolumntype{M}{>{\centering\arraybackslash}m{4cm}}         \begin{document}         \begin{figure}         \centering         \begin{tabularx}{\linewidth}{lMX}         {\begin{tabularx}{.333\textwidth}{Xl}&Ip EphA2 Wb pPTEN\\\end{tabularx}}&\includegraphics[width=4cm]{gfx/blots/test.png}    &-- \SI{110}{\kilo\dalton} \\         &{\begin{tabularx}{4cm}{yyyy}0 & 5 & 15 & 30\end{tabularx}}             & min \\         \end{tabularx}         \caption{Some Blots}         \end{figure}         \end{document}      Example 3:                   \documentclass[11pt]{scrartcl}         \usepackage{blindtext}         \usepackage{tabularx}         \usepackage{array}         \usepackage{multirow}         \usepackage{graphicx}         \usepackage{showframe}         \newcolumntype{y}{@{}>{\centering\arraybackslash}X@{}}         \newcolumntype{M}{@{}>{\centering\arraybackslash}m{4cm}@{}}         \begin{document}         \blindtext         \begin{figure}              \centering             \begin{tabular}{l@{ }M@{ }l}         Ip EphA2 Wb PTEN    &\includegraphics[width=4cm]{gfx/blots/test.png}    & -- \SI{100}{\kilo\dalton} \\         &{\begin{tabularx}{4cm}{yyyy}                             0 & 5 & 15 & 30                             \end{tabularx}}                                     & min \\             \end{tabular}         \caption{Some Blots}         \label{fig:ppf}         \end{figure}         \end{document}      Example 4                   \documentclass{article}         \usepackage{graphicx}         \usepackage{array}         \usepackage{tabularx}         \newcolumntype{C}{%         >{\llap\bgroup}c<{\egroup\hskip 1em}%         @{}>{$\vcenter\bgroup\hbox\bgroup}c<{\egroup\egroup$}@{}         >{\hskip 1em\hbox to 0pt\bgroup}c<{\egroup}%         }%              \newcommand{\myblotsize}{3cm} %devine blotsize         \newcommand{\myblot}[1]{\includegraphics[width=\myblotsize]{#1}}         \newcolumntype{y}{%         @{}>{$\vcenter\bgroup\centering\bgroup}X<{\egroup\egroup$}@{}         }%         \newcommand{\stimulation}[4]{%                 &\begingroup                 \begin{tabularx}{\myblotsize}{yyyy}                 #1 & #2 & #3 & #4\\                 \end{tabularx}\endgroup                 &min                 } %         \begin{document}         \begin{figure}     \small     \centering     \renewcommand\arraystretch{2}     \begin{tabular}{C}                 IP EphA2 WB EphA2   &\myblot{gfx/test}  &-- 130 kDa \\                 IP EphA2 WB pPTEN   &\myblot{gfx/test}  &-- 54 kDa  \\                 IP EphA2 WB PTEN    &\myblot{gfx/test}  &-- 54 kDA  \\                 IP EphA2 WB Cbl     &\myblot{gfx/test}  &-- 118 kDa \\                 \stimulation{--}{5}{15}{30}\\             \end{tabular}             \caption{A caption}             \label{fig:figure1}         \end{figure}         \end{document}      Final code:                   \documentclass{article}         \newcommand{\myblotsize}{4cm} %Change the width of all blots in the document here         \newcommand{\myblottextsize}{\scriptsize} %tiny, scriptsize, footnotesize, small, normalsize         \newlength\widestLeftEntryLength %needed for left alignment of left describtion         \usepackage{graphicx}         \usepackage{array}         \usepackage{booktabs} %better management of spaze between rows         \usepackage{tabularx} %already loaded previously         \newcolumntype{C}{% blotcolumns centered on blot                 % >{\llap\bgroup}c<{\hskip 1em\egroup} %right alignment of left describtion ATTENTION to \hskip 3.2 in last column                 @{}>{\llap\bgroup\hbox to \widestLeftEntryLength\bgroup}c<{\hss\egroup\egroup}@{}%left alignment of left describtion                 @{}>{$\vcenter\bgroup\hbox\bgroup}c<{\egroup\egroup$}@{}                 @{}>{\hskip 3.2pt\hbox to 0pt\bgroup}c<{\egroup}@{}%                 }%         \newcommand{\myblot}[3]{#1&\includegraphics[width=\myblotsize,]{#2}&-- \SI{#3}{\kilo\dalton}\\}         \newcolumntype{y}{%                 @{}>{$\vcenter\bgroup\centering\bgroup}X<{\egroup\egroup$}@{}                 }%         \newcommand{\stimulation}[4]{%                 &\begingroup                 \begin{tabularx}{\myblotsize}{yyyy}                 #1 & #2 & #3 & #4\\                 \end{tabularx}\endgroup                 &min                 } %         \begin{document}         \centering\rule{\myblotsize}{3pt} %test the horizontal alignment of the following table         \begin{figure}             \myblottextsize             \centering             \settowidth\widestLeftEntryLength{IP EphA2 WB pPTEN\hskip 3pt} %                  \begin{tabular}{C}                 \myblot{IP EphA2 WB EphA2}{gfx/test}{130}\addlinespace                 \myblot{IP EphA2 WB pPTEN}{gfx/test}{54}\addlinespace                 \myblot{IP EphA2 WB PTEN}{gfx/test}{54}\addlinespace                 \myblot{IP EphA2 WB Cbl}{gfx/test}{118}                 \stimulation{--}{5}{15}{30}             \end{tabular}             \caption{A caption}             \label{fig:figure1}         \end{figure}         \end{document}


title: LaTeX Capabilities: Complicated and Important Equations

text: As I am introducing LaTeX to an audience, I'd like to show how it can render equations beautifully. As such, I'd like **one equation** (math/physics) that combines many different formatting requirements, such as integrals, sums, greek, other fonts, maybe even matrices. This is (closely) secondary but it would be good if the equation had some theoretical significance. It would also be interesting if it involved matrices, but I don't think that's very possible. **Edit:** For now, I have chosen the following equation, a functional equation that is crucial in the proof of the Prime Number Theorem: ![Functional equation crucial in the proof of the Prime Number Theorem](http://i.stack.imgur.com/H9WC1.png) If anyone has a better equation, please answer below! I'd love a better one.


title: Compiling LaTeX in pedantic mode

text: Some compilers for general purpose programming languages such as GCC have a switch for turning warnings into actual errors: > $ gcc -Werror main.c There is a similar mechanism for compiling LaTeX documents?


title: Problem with \ref using texshop

text: I'm a noob with latex and I've some problems with texshop. Actually I need to use the `\ref` but here's the problem. If I use `\begin{equation}\label{abc}...\end{equation} ... \ref{abc}` then latex "eat" the text. (The same is with `\label{eq:abc} and \ref{abc}`) If I use `\begin{equation}\label{abc}...\end{equation} ... \ref{eq:abc}` then I'll have "(??)" (I run two times...) Can you help me? PS: english isn't my first language ... so excuse me for my grammatical horrors...


title: How to type higher order derivatives using Lagrange's primes notation

text: This is what i have been using but it dosen't look quite right               $$\large y', y^{\prime\prime}, y^{\prime\prime\prime},        {y^{\prime\backprime\prime}}, {y^{\backprime\prime}},        {y^{\backprime\prime\prime}}, {y^{\backprime\prime\prime\prime}},        {y^{\backprime\prime\prime\prime\prime}},\dots$$      * * * ### MWE by Qrrbrbirlbel (`\large` removed, as it is invalid in math-mode, TeX throws a warning, too):               \documentclass{article}     %\usepackage{amsmath} ?     \usepackage{amssymb}     \begin{document}     $$ y', y^{\prime\prime}, y^{\prime\prime\prime},        {y^{\prime\backprime\prime}}, {y^{\backprime\prime}},        {y^{\backprime\prime\prime}}, {y^{\backprime\prime\prime\prime}},        {y^{\backprime\prime\prime\prime\prime}},\dots$$     \end{document}      ### Output ![enter image description here](http://i.stack.imgur.com/sesVY.png)


title: Suppress message during compilation

text: I use a macro with `\write18` and `\@@input`, several times in each page of a large document. But `\@@input` output a message during compilation:               (filename)      This is very annoying and flood the other relevant informations. Is there a way to make `\@@input` quiet during compilation in my macro (I use `pdflatex`)? What I have now is the following:               \makeatletter     \newcommand*{\gpNorm}[3][\jobname.eval]{%       \edef\inp@t{#3}%       \immediate\write18{gnuplot -e 'set print "#1"; print norm(\inp@t)'}%       \everyeof{\noexpand}%       \edef#2{\@@input #1 }%     }     \makeatother      I use `write18` to get a computation result from `gnuplot`. But the line with the `\@@input` keep output the `(filename)` message. Can I use something else to read the output of `gnuplot`? To use it: `\gpNorm{\res}{1}` will assign the result of the computation by `gnuplot` to the macro `\res`.


title: How to remove toc title in KOMAscript classes?

text: In the "normal" classes one can remove the TOC title (the "Content" heading) with               \renewcommand\tableofcontents{\@starttoc{toc}}      But when I do this on KOMAScript classes (e.g. `scrartcl`) this also changes some other settings (e.g. vertical spaces) of KOMAscript which I don't want to change. **How can I remove only the table of contents' headline without changing anything else?** Note: I don't want the line to be empty (so, not an empty string `""`, like `\renewcommand{\contentsname}{}` would do), but so that the headline is not there at all and the space gets "freed".


title: Errors Mpgraph in ConTeXt

text: I need to put some bar charts in a ConTeXt document. I'm using mkiv from TeX Live 2011, under Gentoo GNU/Linux. I tried using Gnuplot but I found `mpgraph` suits better my needs. I'm using this TeX file               \usemodule[graph]     \usemodule[sarith]          \enableregime[utf-8]     \starttext          \startMPcode     beginfig(1)       draw begingraph(12cm,6cm);         glabel.lft(btex Eje Y etex, OUT);         glabel.bot(btex Eje X etex, OUT);         gdata("data.d",             $,             path p;             augment.p (0,$1);             augment.p ($2,$1);             augment p ($2,$1 Sadd "1");             augment p (0,$1 Sadd "1");             gdraw p withpen pencircle scaled 2bp withcolor red;         );       autogrid(grid.bot,grid.lft) withcolor .85white;       endgraph;     endfig;     \stopMPcode     \stoptext      and this data file               1 4     2 2     3 1     4 2     5 4      as a minimal 'working' example. However, some strange is happening: I can't use any operator from `sarith` module (used in `mpgraph` module for drawing boxes). I got this output with ConTeXt. I tried compiling with Metapost, although I got no errors or warnings the output .dvi is corrupted. I've tried also with TeX Live 2012 under Windows 7. I can't compile there because of the `sarith` thing, but when I comment that lines it works. But doing the same thing in my Gentoo box works, excepting that text for labels or axis doesn't appear, just a very little square. I don't understand what is happening, even the example from the ConTeXt wiki doesn't work. Clues? Any help is very appreciated!


title: Beamer + MusixTex

text: can I use MusixTex with beamer class? It doesn't work for me, only with article. With beamer there are a lot of errors (more then 50). Thanks for advice. This is without errors:               \documentclass{article}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage[czech]{babel}     \usepackage{musixtex}          \begin{document}          \begin{music}     \startextract     \NOtes\qu{ad}\en%     \endextract     \end{music}          \end{document}      This is with 53 errors:               \documentclass{beamer}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage[czech]{babel}     \usepackage{musixtex}          \begin{document}          \begin{music}     \startextract     \NOtes\qu{ad}\en%     \endextract     \end{music}          \end{document}      I am using TeXnic Center 2.0 edited. Sorry about that guys.


title: How can dramatist verse speech prefixes be put on the same line as speeches?

text: Using the `verse` environment from the `dramatist` package, I would like to have the speech prefixes on the same line as the speeches, as they are for the prose environment. There are a number of hooks for customizing the formatting, but I can't see how they can be used to do this. This is related to this question, but I'm not trying to mix prose and verse, so I hope there is a simpler solution. I'm typesetting a long verse play, so it would be very inconvenient to have to wrap every speech in its own environment.


title: Left and right aligned text boxes

text: I am writing a thesis and at the bottom of the title page, I need to include two participating institutes. So far, I have come up with this (using `\parbox`, but I cannot figure out how to right align the second block because `\begin{flushright}` starts a new paragraph and thus adds another line:               \parbox[t][3cm][t]{7cm}{\normalsize Figurative Unit (Optional)\\     Department of Blabla\\     University of Blabla}      \parbox[t][3cm][t]{7cm}{\normalsize Chair of Mickey Mouse Science\\     Institute of Disneyland Studies\\     FSF Blabla}       This results in: ![enter image description here](http://i.stack.imgur.com/IQy2A.png) As I said, I would like the right text block to be right-aligned to the margin of the page, which is set to 40mm ( `\newgeometry{left=40mm,right=40mm,top=30mm}` ). In the above example I used absolute distance measures but I assume it could be done more elegantly.


title: Tikz: joining points on a circle

text: I have the following figure ![enter image description here](http://i.stack.imgur.com/CsJOo.png) I would like to draw portions of circles between some of the red points. More explicitly, I would like to go from ac1 to ab1 and then to ac2 following circle A, then go to bc1 following circle C and to ab2 following circle B and back to ac1 following circle A. There is probably a solution using the `arc` operation, but this would require computing the angles for every portion of circle, which can get tedious. Is there a simple way to do that ? (I was thinking maybe drawing circles with `\clip`, but I can't figure out how to do it) Here is my example code               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc,intersections}          \begin{document}          \begin{tikzpicture}     \coordinate (a) at (0,0);     \coordinate (b) at (-1,-1);     \coordinate (c) at (1,-1);          \draw[name path=circleA] (a) circle (1.5cm);     \draw[name path=circleB] (b) circle (1.5cm);     \draw[name path=circleC] (c) circle (1.5cm);          \fill [red, name intersections={of=circleA and circleB,name=intAB}]     (intAB-1) circle (2pt) node[above left] {ab1}     (intAB-2) circle (2pt) node[below right] {ab2};     \fill [red, name intersections={of=circleA and circleC,name=intAC}]     (intAC-1) circle (2pt) node[above right] {ac1}     (intAC-2) circle (2pt) node[below left] {ac2};     \begin{scope}     \clip (a) circle (1.5cm);     \fill [red, name intersections={of=circleB and circleC,name=intBC}]     (intBC-1) circle (2pt) node[below] {bc1}     (intBC-2) circle (2pt) node {bc2};     \end{scope}          \node (A) at ($(a)+(0,1)$) {$A$};     \node (B) at ($(b)+(-1,0)$) {$B$};     \node (C) at ($(c)+(1,0)$) {$C$};     \end{tikzpicture}          \end{document}


title: In latex to HTML converters like latex2wp what is the alternative to eqnarray or align

text: Though my primary problem has been solved, I am trying to put my document on my group's blog. I use Luca Trevisan's latex2wp but it does not render either of the two. Reason, if I correctly read on wordpress' blog is that > One thing to keep in mind is that WordPress puts all of your \LaTeX code > inside a \LaTeX math environment. If you try to use \LaTeX that doesn’t work > inside the math environment (such as \begin{align} ... \end{align}), you > will get an error So is there any way around it anyone here knows?


title: titlesec formatting

text: ![enter image description here](http://i.stack.imgur.com/AtENp.jpg)               \documentclass[12pt,letterpaper]{report}     \usepackage{blindtext}     \usepackage[utf8]{inputenc}     \usepackage[margin=1in,showframe]{geometry}     \usepackage{titlesec}               \titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]     \titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}          \begin{document}               \chapter{INTRODUCTION}          This is the first section.          Lorem  ipsum  dolor  sit  amet,  consectetuer  adipiscing       elit.   Etiam  lobortisfacilisis sem.  Nullam nec mi et      neque pharetra sollicitudin.  Praesent imperdietmi nec ante.      Donec ullamcorper, felis non sodales...      how do I do this using titlesec package what do I put in:                \titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]      and:                 \titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}


title: I used eqnarray ignorantly and now must change all to align.. any solutions?

text: Other than manually going over all the dozen plus instances where I ignorantly used eqnarray must all be changed to align. I first tried doing a finad replace all and replaced align, and then, for example, making the changes:               \begin{align}     S(x) &= S_0+S_1 x+\sum_{n=2}^\infty S_{n+1} x^n - \sum_{n=2}^\infty S_{n-1} x^n  -\sum_{n=2}^\infty x^n\\     &= S_0+S_1 x+\frac{1}{x}\sum_{n=2}^\infty S_{n+1} x^{n+1} - x\sum_{n=2}^\infty S_{n-1} x^{n-1}  -\sum_{n=2}^\infty x^n\\     &= S_0+S_1 x+\frac{1}{x}(S(x) - S_0 - S_1 x -S_2 x^2) - x(S(x) - S_0 )  -\frac{x^2}{1-x}     \end{align}      To what was initially just               \begin{eqnarray}     S(x) = S_0+S_1 x+\sum_{n=2}^\infty S_{n+1} x^n - \sum_{n=2}^\infty S_{n-1} x^n -\sum_{n=2}^\infty x^n\\      S(x) = S_0+S_1 x+\frac{1}{x}\sum_{n=2}^\infty S_{n+1} x^{n+1} - x\sum_{n=2}^\infty S_{n-1} x^{n-1} -\sum_{n=2}^\infty x^n\\      S(x) = S_0+S_1 x+\frac{1}{x}(S(x) - S_0 - S_1 x -S_2 x^2) - x(S(x) - S_0 ) -\frac{x^2}{1-x}      \end{eqnarray}      Now I am getting hundreds of error prompts, constituted solely of these four               ! LaTeX Error: Environment align undefined.     ! Misplaced alignment tab character &.     ! Missing $ inserted.     ! Extra }, or forgotten $.      Is there any hope?


title: Compatibility of bibtex and biblatex bibliography files?

text: In the answer to bibtex vs. biber and biblatex vs. natbib the advantages and disadvantages of Biber vs. BibTeX (and of `natbib` vs. biblatex) were explained. However, one point was omitted: The question of compatibility of bibliographies between BibTeX and `biblatex`. After using BibTeX for a while, you get a collection of bibliographies in BibTeX style. Furthermore, many journals give BibTeX entries for citations on their home page. A lot of bibliography management programs either support BibTeX export, or even manage BibTeX files directly. Also, advanced editors like Emacs have special support for BibTeX bibliographies. In short, there's a massive infrastructure for creating and managing BibTeX bibliographies and a big stock of existing ones. Moreover, as was noted in the other question, you cannot use Biber together with `natbib`, which is used by quite a few journals. Therefore the following question arises: Is the bibliography format of Biber compatible with the bibliography format by BibTeX? Or if not, it there at least an automatic conversion tool? Note that both directions are interesting: If Biber cannot use existing BibTeX bibliographies, this means that you have to convert every existing BibTeX bibliography, and do so also for BibTeX entries from journals (unless they also offer Biber, but often it's just BibTeX and EndNote) and bibliographies exported from bibliography management programs. On the other hand, if Biber files cannot be used for BibTeX and no conversion exists, it means that any Biber bibliography is useless for journals using `natbib`, and any programs interpreting directly BibTeX bibliography files cannot be used any more (including editor support). Also, in case that Biber can read BibTeX files, but not vice versa: Does Biber still have advantages over BibTeX if the files are restricted to BibTeX- compatible ones?


title: Get label target type

text: I'm looking for a solution to my previous question "Relative chapter references", and find myself struggling with trying to get the target "type" of a label from the label itself. Allow me to clarify: I want to determine whether a given label points to either a chapter, section, subsection, figure, table, etc. Ideas? (cuz I'm plain out) PS: the solution should be compatible with the `hyperref` package at the very least.


title: Filtering font substitution warnings caused by the combination of lmodern and tipa

text: This question is a follow-up to Combining lmodern and tipa: I tried to filter the harmless warnings that occur when using `tipa` with the Latin Modern font. Doing so crashes both `pdflatex` and regular `latex`. I haven't tested this on any OS other than Windows yet.               \documentclass{article}     \usepackage{lmodern}     \usepackage[]{tipa}     \usepackage{silence}     \WarningFilter{latexfont}{LaTeX Font Warning}     \begin{document}     \textipa{\textesh}     \end{document}      Log:               ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"))     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\lm\lmodern.sty")     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tipa\tipa.sty"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fontenc.sty"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tipa\t3enc.def"     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\lm\ot1lmss.fd"))     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\ot1enc.def")))     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\silence\silence.sty")     (C:\Users\removed\test.aux)     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tipa\t3cmr.fd")     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\lm\ot1lmr.fd")     pdflatex: Windows API error     87: Falscher Parameter.     pdflatex: Data:       C:\removed\AppData\Local\MiKTeX\2.9\miktex/data/le\df2c24cb21984fa85003c1ecc818ff83.fndb


title: Use node text as argument for a macro

text: I would like to create a TikZ style that adds a thick outline to the node text using the `\contour{<colour>}{<text>}` macro from the `contour` package (as in the answer to the question TikZ: halo around text?), i.e. I want to define a style `halo` so that               \node [halo] {Text};      is equivalent to               \node {\contour{red}{Text}};      My problem is that I cannot tell TikZ to use the node text as an argument for a macro. The `font` option only works with switches like `\itshape` (as opposed to `\textit{}`, which requires the text to be italicised to be provided in the argument). There are two keys `execute at begin node={<code>}` and `execute at end node={<code>}` that can be used to call code at the beginning and end of the node, but I can't split the `\contour` command up using `execute at begin node={\contour{red{}` and `execute at end node={}}` because the brackets don't match. Replacing `{` with `\bgroup` and `}` with `\egroup` fails with `Missing } inserted`. Here's am MWE to play with:               \documentclass{article}          \usepackage{tikz}     \usepackage[outline]{contour}     \contourlength{1.2pt}               \begin{document}              \begin{tikzpicture}         \node {\contour{red}{Text}};     %    \node [font=\contour{red}{}] {Text}; % Doesn't change the text     %    \node [execute at begin node={\contour{red}{},execute at end node={}}] {Text};  % Fails with ``Runaway argument?''     %    \node [execute at begin node={\contour{red}\bgroup},execute at end node={\egroup}] {Text};  % Fails with ``Missing } inserted''         \end{tikzpicture}     \end{document}


title: Improving the legibility of a pdfTeX produced PDF on Google Docs

text: My draft dissertation (google docs link here) shows up remarkably poorly on google docs. It was rendered on ConTeXt MkIV with the default pdf engine (pdftex, I believe.) What steps do I need to take to make the google docs output more legible at its default zoom? My guess as to the problem is that it's performing a downsample of the 12 point font rather than rerendering the fonts from the embedded fonts (if the font is indeed embedded) I'm using the default roman font.


title: Runtime error while importing a poster from .tex to .lyx

text: I try to import a `.tex` file (an A0 poster created from `baposter` template in some older version of MikTex) to Lyx (2.0.6), but the conversion fails with `Runtime error tex2lyx "poster.tex" "poster.lyx"` error message. I made sure there are no characters which made problems in this case. I guess the problem is in some missing support for the A0 poster class. Should this be fixed by some upgrade of LyX, or is it more complicated? EDIT: I assured this error occurs only while importing A0 posters, LaTex document created from "article" template was imported correctly.


title: How to vertically align text in table cell?

text: Here is the latex code to create a table in BibTxtMng                \begin{table}[!htbp]      \centering      \caption{Spanish Traffic Sign according to the color and shape \cite{Paper12}}       \begin{tabular}{|>{\raggedright}p{3.1cm}|>{\raggedright}p{3.1cm}|>        {\raggedright}p{3.1cm}|}        \hline        Color          & Shape    & Meaning \tabularnewline        \hline         Red Rim        & Circle   & Prohibition\tabularnewline         \hline         Red Rim (Up)   & Triangle & Danger      \tabularnewline         \hline          Red Rim (Down) & Triangle & Yield       \tabularnewline         \hline             Red            & Octagonal & Stop\tabularnewline         \hline           Blue  & Square &  Recommendation \tabularnewline            \hline           Blue &    Circle &    Obligation \tabularnewline          \hline          White  & Circle    & End of Prohibition \tabularnewline          \hline         Yellow & Circle & End of Prohibition (construction)\tabularnewline           \hline            \end{tabular}            \label{Spanish_TS}            \end{table}      Here is the output table I got ![enter image description here](http://i.stack.imgur.com/hv6S6.png) I want that yellow and circle text (in the last row) being located in the centre of vertical. Not tin the top like that.. How to do it??


title: Turn off Hyphenation Without Text Running Into the Margins

text: I am rewriting (and updating) my resume in LaTeX. I was dismayed because LaTeX automatically hyphenates words that need to go onto a new line when a line is too long. I found a way to turn off hyphenation (see code below), however this makes the line ragged and it runs into the margin and looks terrible. Is there a way to turn off hyphenation such that if a word is too long, the whole word is moved to the next line so a line won't run into the margin of a document?               \usepackage[none]{hyphenat}     Education \\     U. Chicago \hfill 2008-2012 \\     \begin{itemize}     \item Long bullet point describing all of my technical skills that goes for several lines     \end{itemize}


title: Making an enclosing, fitting PDF for a table

text: I want to make a document out of a single table, for inclusion into PowerPoint, etc., as a PDF just the size of the table, with a small customizable margin. Which document class should I use, and how do I set the margins?


title: TikZ: Track the bounding rectangle of created nodes (Storing values?)

text: In the main part of the `tikzpicture` I'd like to simply create `block`s. So I need somewhere in theirs' style definition to perform tracking of their common bounding rectangle. I've tried to access `current bounding box`, but it is obviously set to node's rectangle, thus, unfortunately, duplicating the `path picture bounding box`. I'm going to use this box when creating another type of nodes (say, `foo`, which is to be implemented shortly). So, again, it should be accessible from inside `foo`'s style definition. The goal is to make this calculations invisible from the user (drawer) perspective, though he will be restricted to declare nodes in two consecutive sections. Is there a way to do this task in a somewhat more comfortable way than writing it with low-level commands, such as `ifdim`, etc.? What is preferred way of storing values, when drawing with TikZ? I guess, this is not by using `\newcommand`, which defines macros available at global scope. Up to now I've managed to store values using `\pgfkeys` but I stuck at getting the main picture's bounding box.               \documentclass[landscape]{article}          \usepackage{tikz}     \usetikzlibrary{scopes,chains,shapes.multipart,backgrounds,positioning,fit,calc}          \newcommand{\setup}{         \tikzset{             node distance=5mm and 3cm,             block/.style={rectangle, %draw, thick,                 path picture={                     \draw[red, thick] (current bounding box.south west) rectangle (current bounding box.north east);                 }             },             %foo/.style={circle},             every edge/.style={->, rounded corners, thick, draw,                 to path={                     let \p1=(\tikztostart.east),                         \p2=($ (\tikztostart.east) + (1cm,0) $),                         \p3=(\tikztotarget.west) in                     (\p1) -- (\p2) \ifdim\y2=\y3  -- \else |- \fi (\p3)                     \tikztonodes                 }             }         }     }          \begin{document}          \begin{tikzpicture}         \setup              % First section. This blocks will build up the bounding rectangle, which is to be used in the next section.         \node[block=1] (A) {System A};         \node[block=2] (B) [above right=of A] {System B};         \node[block=3] (C) [right=of A] {System C};         \node[block=4] (D) [below right=of A] {System D};              % Second section. Positioning of this nodes depends on the resulting bounding rectangle of the previous section.         %\node[foo] (o1) {circle 1};         %\node[foo] (o2) {circle 2};              \path         (A) edge (B)             edge (C)             edge (D);     \end{tikzpicture}          \end{document}


title: Background for table cells in LyX

text: The title speaks for itself - how do I choose a background color for table cells in LyX?


title: How is possible to set interline inside this block of code?

text: Have this code that generate an aside section:               \RequirePackage[absolute,overlay]{textpos}     \setlength{\TPHorizModule}{1cm}     \setlength{\TPVertModule}{1cm}     \newenvironment{aside}{%       \let\oldsection\section       \renewcommand{\section}[1]{         \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}       }       \begin{textblock}{3.6}(1.5, 4.33)       \begin{flushright}       \obeycr     }{%       \restorecr       \end{flushright}       \end{textblock}       \let\section\oldsection     }      Works well but i want to increase the interline in the text inside `aside` section... Have tried to insert after `\obeycr` command this line:               \par\vspace{.25\parskip}%      but change the interline between `aside` sections, not on text lines inside the sections. This is the .tex source               \begin{aside}       \section{info}         Homer J. Simpson         123 Fake Street         Springfield, NJ 08105-442         555-966-5786         \href{mailto:homer@simpson.com}{homer@simpson.com}     \end{aside}      ![and this is the output](http://i.stack.imgur.com/7BlMd.png) I need to increase interline between andress and phone number, and from phone number and email link.


title: line numbers on flalign environment

text: Why is there an additional line being numbered in the following example? I would like to remove this so that the line numbers only correspond to the equations specified. I realize that this is due to a mistake on my part but I can't see what I have done wrong:               \documentclass{article}     \usepackage{amsmath}     \usepackage{lineno}     \linenumbers     \date{}     \begin{document}     \begin{linenomath*}     \begin{flalign}     &Q_{h} = \rho_{a}C_{pa}C_{h}U_{a}\left(T_{s} - T_{a}\right)&\\     &Q_{e} = \rho_{a}LC_{e}U_{a}\left(q_{s}^{*}-q_{s}\right)&\\     &Q_{b} = 0.985\sigma{T_{s}^{4}}\left(\left(0.39-0.05\right)e_{a}^{0.5}\right )\left(1-{0.6 {nc}}\right)     \end{flalign}     \end{linenomath*}     \end{document}


title: How to put a text, shifted to the right into the customized \section

text: I have the following code:               \documentclass[11pt]{article}     \usepackage[a4paper]{geometry}     \usepackage[cm]{fullpage}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{lipsum}     \usepackage{fancyhdr}     \pagestyle{fancy}     % no line in header area     \renewcommand{\headrulewidth}{0pt}          %section with predefined text     \renewcommand{\section}[1]{\addtocounter{section}{1}       \begin{center}\Large{\bf{Problem N \arabic{section}}}\end{center}}     \begin{document}     \fancyhead[HR]{Variant 1}     \section{}     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/mW83I.png) I want to achieve the same effect without using any extra packages:   1. Shift the text "Variant 1" to the right of the page, aligning it by the text right border.    2. Keep it at the same line with "Problem N"?


title: how to change font size in tikz automata?

text: This is my tikz code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,}     \usepackage{amsmath}          \begin{document}          \begin{tikzpicture}[shorten >=1pt,auto,node distance=5 cm, scale = 0.5, transform shape]            \node[initial,state] (A)                                  {$q_0$};       \node[state]         (B) [right of=A,node distance=3 cm]              {$q_1$};       \node[state]         (C) [right of=B,node distance = 6.5 cm]              {$q_2$};       \node[state]         (D) [below right of=B]       {$q_3$};       \node[state]         (E) [below right of=D]                   {$q_5$};       \node[state]         (F) [below left of=D]                {$q_4$};                 \path[->] (A) edge [above]            node [align=center]             {a} (B)             (B) edge [loop above]       node [align=center]             {a} (B)             edge [bend right,below]     node [align=center]         {b} (C)             edge [left]             node [align=center]         {a} (D)             (C) edge [loop above]       node [align=center]         {b} (C)             edge [bend right,right]     node [above,align=center]       {a} (B)             edge [right]            node [align=center]             {a} (D)             (D) edge [bend left,right]      node [align=center]         {d} (E)             edge [bend right,left]      node [pos=0.4,align=center]     {a} (F)             (E) edge [bend left]        node [pos=0.2,align=center]     {c} (D)             (F) edge [bend right,above]     node [pos=0.6,align=center]     {b} (D)             edge [bend left]        node [pos=0.7,align=center]     {a} (A);               \end{tikzpicture}     \end{document}      And the output is : ![enter image description here](http://i.stack.imgur.com/xD1YL.jpg) I want to increase the size of the font over edges. How do I do that?


title: Justify text in moderncv cover letter

text: I am writing a cover letter and CV using `moderncv`. Everything works fine so far, but the text in the cover letter is not justified. I think it is good that it is not hyphenated, but it would look much nicer if the text was justified. Here is a minimal example:               \documentclass{moderncv}     \moderncvstyle{classic}          \usepackage{lipsum} % just for dummy text          \firstname{John}     \familyname{Doe}          \begin{document}     \recipient{Prof.\ Dr.\ Foo Bar}{}     \opening{Dear Professor Dr.\ Bar,}     \closing{Yours sincerely,}     \enclosure[Attached]{curriculum vit\ae}          \makelettertitle     \lipsum[1]     \makeletterclosing          \clearpage          \makecvtitle          \section{Education}     \cventry{2009--present}{PhD Student}{here}{and}{there}{}     \end{document}      ![output](http://i.stack.imgur.com/0IkVn.png)


title: Don't separate section heading from its line

text: I have my sections format defined with titlesec like this:               \documentclass{report}               \usepackage{xcolor}     \usepackage{titlesec}     \definecolor{shadecolor}{HTML}{A3B9FF}               \titleformat{\chapter}{}{}{20pt}{\bf  \Huge}     \titleformat{\section}{}{}{1pt}{\bfseries \Large}[\color{shadecolor}\titlerule]     \titlespacing{\section}{0pt}{40pt}{10pt}     \begin{document}          \chapter{First Chapter}          \section{First section}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis malesuada arcu nec bibendum pellentesque. Vivamus id volutpat tellus, vitae volutpat dolor. Etiam ultrices a mauris a mattis. Curabitur sed lacus sit amet tortor blandit tempus quis sed nibh. Donec ipsum libero, ornare sit amet sodales vitae, hendrerit eget justo. Cras varius sed nibh in tincidunt. Suspendisse facilisis imperdiet diam eu accumsan. In mollis sollicitudin mauris adipiscing interdum. Etiam quis porta nunc. Fusce accumsan mauris at iaculis semper. Sed in ligula nec dolor condimentum euismod.          In sodales, nisi id tincidunt accumsan, enim enim varius velit, id pulvinar massa sem id augue. Proin facilisis neque in sapien fermentum, sit amet bibendum ipsum gravida. Suspendisse et blandit erat. Fusce lacinia pulvinar mauris eu molestie. Duis laoreet risus ut viverra dignissim. Nulla ultricies, nulla vel placerat tempor, purus est lobortis lectus, malesuada posuere sem mauris nec ante. Nulla rutrum orci quis lacus tristique blandit. Suspendisse mattis mi lorem, at condimentum eros ultrices sed.          Phasellus condimentum egestas suscipit. Sed a blandit enim, et adipiscing felis. Ut in euismod nisl. Quisque feugiat auctor leo volutpat tincidunt. Donec vitae metus nibh. Donec aliquet metus sem, at lacinia risus tincidunt eu. Nulla porttitor varius mi eget vehicula. Phasellus euismod tortor arcu, in varius eros ultricies eu. In hac habitasse platea dictumst. Proin facilisis nulla vel dui pretium congue. Fusce a dignissim diam, nec mollis sem. Quisque in sollicitudin augue, non dignissim erat. Donec elementum porttitor purus vel semper. Mauris nisl ligula, ultrices non tellus at, ornare lacinia mi. Integer et ullamcorper lorem.          Aenean aliquam vulputate eros eget porttitor. Nullam posuere luctus neque, porta commodo mi suscipit ac. In sit amet sollicitudin libero. Nulla nec viverra nulla, ut pulvinar nisi. Curabitur sed orci eget lorem condimentum pulvinar.          \section{Second section}          More Text. More text.     \end{document}      The "problem" here is that sometimes the heading gets separated from its rule by a page break. Is there some way to treat the whole heading as a unit so it doesn't get separated?


title: Change bibitem style

text: I use standard bibliography options, it provides me with the following result that is an enumerated list:                8  Atkin A.O. Elliptic curves and primality proving // Mathematics of         Computation, 1993, Vol. 61, P. 29–68.      9  Menezes A. Reducing elliptic curve logarithms to logarithms in a finite field         // IEEE Transactions on Information Theory, 1993, Vol. 39, P. 1639–1646.     10  Menezes A., Elliptic Curve Public Key Cryptosystems. Kluwer Academic         Publishers, Boston, 1993.      I need a slight different bibliography style: text paragraphs with the first line indent, like this:                   8 Atkin A.O. Elliptic curves and primality proving // Mathematics of     Computation, 1993, Vol. 61, P. 29–68.         9 Menezes A. Reducing elliptic curve logarithms to logarithms in a finite field     // IEEE Transactions on Information Theory, 1993, Vol. 39, P. 1639–1646.         10 Menezes A., Elliptic Curve Public Key Cryptosystems. Kluwer Academic     Publishers, Boston, 1993.      How can I change the style for bibliography list in my custom class (derived from `report`)?


title: Layout issue with biblatex

text: On the screenshot you can see that the ISBN number breaks the layout: ![broken layout](http://i.stack.imgur.com/xy3nG.png) How can I fix the layout? On my small attatched example the layout is not so much demaged like in my real work but you will see also the problem.               \documentclass[         a4paper,         12pt,         bibtotoc,         liststotoc,         ]{scrreprt}          \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[utf8]{inputenc}     \usepackage[english, ngerman]{babel}     \usepackage[backend=bibtex, natbib=true, citestyle=alphabetic, bibstyle=alphabetic]{biblatex}          \bibliography{source}          \begin{document}     \chapter{Intro}     Some info \cite{Hoehne2010}          \printbibliography     \end{document}      And my bibtex file:               @BOOK{Hoehne2010,       title = {Verfahren zur Anonymisierung von Einzeldaten},       publisher = {Statistisches Bundesamt},       year = {2010},       author = {Höhne, Jörg},       series = {Statistik und Wissenschaft, Teil 16},       address = {Wiesbaden},       isbn = {9783824609017},       type = {text},       url = {http://www.destatis.de}     }


title: How do I fix the vertical spacing in documents which go over one page?

text: When LaTeX is unable to fit content onto a page, it sometimes inserts a large amount of whitespace between the two elements that fit on the first page, rather than just leaving space at the bottom of the page. Minimal example:                 \documentclass[a4paper]{memoir}       \usepackage{tikz}       \newcommand{\Rectangle}{%           \begin{minipage}{\linewidth} \tikz \draw (0,0) rectangle (2,16); \end{minipage}%       }            \begin{document}       \begin{center} Hello \end{center}            \Rectangle            \Rectangle       \end{document}      I would like the spacing to be such that the whitespace is just at the bottom of the first page rather than the large hole in the middle of the text and the rectangle. This can be fixed by either using the `article` class instead of `memoir` or getting rid of the `\begin{center}` and `\end{center}` but neither compromise is satisfactory for me. What is the best way to get the whitespace to appear at the bottom of the page?


title: Show state of matter with chemmacros

text: Consider the following example.               \documentclass{article}          \usepackage{chemmacros}          \begin{document}          \ch{CaCO3 <=> Ca^{2+}{\aq} + CO3^{2-}{\aq}}          \end{document}      How do I show that the calcium carbonate is in a solid state? I tried both               CaCO3{\s}      and               CaCO3{\solid}      but neither `\s` nor `\solid` are defined. (The manual can be found here.)


title: Changing the defaut star in radio buttons in PDF forms

text: In PDF forms, is there any way to change the default star in radio buttons to a solid circle?


title: Why does LaTeX throw an error when I write _ in text mode

text: Why LaTex return error when I write `_` in normal mode (not math mode). Why we have decided to return error, we couldn't just print `_`. I mean if we write `_` in a normal mode it print `_` and in normal mode it will have another definition. What are the reasons for choosing that decision?


title: Is there a package for doing this in LaTeX?

text: I'd like to do something like this ![enter image description here](http://i.stack.imgur.com/q9v2s.png) What would be the code? does it use a package for doing the `$$f\mapsto f\circ \pi$$` part?


title: problem in equation begining

text: I wrote the code of the equation but i have an error while writing `Jij`, any help? ![equation](http://i.stack.imgur.com/BVNvF.png)               \begin{equation}     J_i_j = \left\{        \begin{array}{l l}         \frac{1}{k}exp\left(-\frac{{||x_i - x_j||}^{2}}{{2a}^{2}}\right) \quad x_i is nearest neighbor of x_j,\\         0 \quad \text{else}       \end{array} \right.     \end{equation}


title: How can I draw a transparent cube in 3D perspective?

text: I would like to draw a transparent, `flattened cube' in perspective with dotted lines from both vanishing points to each of the vertices of the 3D solid. Is there a PSTricks package for this? It is much like Jan Hlavacek's answer to What is the easiest way to draw 3D cube with TikZ? but with the vanishing points and dotted lines from these, and then the `cube' should be transparent. Unfortunately I do not know TikZ. **Update** The following code shows what I would like to achieve: ![screenshot](http://i.stack.imgur.com/DCeIK.png)               \documentclass{article}          \usepackage{auto-pst-pdf,pstricks-add}          \begin{document}          \begin{figure}     \def\HAa{-5.25 }     \def\HBa{12.5 }     \def\Ab{-0.85 }     \def\Bb{3.05 }     \def\Ia{-1.8 }     \def\Ja{2.65 }      \centering      \psset{unit=0.765cm}       \begin{pspicture}(\HAa,\Ab)(\HBa,\Bb)        \pnode(!\HAa 0){H1}        \psdot(H1)        \pnode(!\HBa 0){H2}        \psdot(H2)        \pnode(!\Ia 0){P9}        \pnode(!\Ja 0){P10}        \pcline[linestyle=dashed](H1)(P9)        \pcline[linestyle=dashed](P10)(H2)        \pnode(!0 \Ab){P1}        \pnode(!0 \Bb){P2}        \pnode(!\Ia \HAa \Ia sub \HAa div \Ab mul){P3}        \pnode(!\Ia \HAa \Ia sub \HAa div \Bb mul){P4}        \pnode(!\Ja \HBa \Ja sub \HBa div \Ab mul){P5}        \pnode(!\Ja \HBa \Ja sub \HBa div \Bb mul){P6}        \psIntersectionPoint(H1)(P5)(H2)(P3){P7}        \psIntersectionPoint(H1)(P6)(H2)(P4){P8}        \multido{\i=1+1}{8}{\psdot(P\i)}        \pcline(P1)(P2)        \pcline(P1)(P3)        \pcline(P2)(P4)        \pcline(P3)(P4)        \pcline(P1)(P5)        \pcline(P2)(P6)        \pcline(P5)(P6)       \psset{linestyle=dotted}        \pcline(P3)(H1)        \pcline(P4)(H1)        \pcline(P5)(H1)        \pcline(P6)(H1)        \pcline(P3)(H2)        \pcline(P4)(H2)        \pcline(P5)(H2)        \pcline(P6)(H2)        \pcline(P7)(P8)       \end{pspicture}     \end{figure}          \end{document}      I would like to make this drawing when knowing just the width, depth, and height of the box plus the point of view, instead of maunally calculating the `\def` values. P.S. I do not know how to include images, sorry. **Update 2** I have changed the code a bit. (The `\def` names are changed and the hiddens lines in the cubiod are dashed instead of dotted.)               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{figure}     \def\venstre{-5.25 }     \def\hoejre{12.5 }     \def\vinkel{-0.85 }     \def\hoejde{3.05 }     \def\dybde{-1.8 }     \def\bredde{2.65 }      \centering      \psset{unit=0.684cm}       \begin{pspicture}(\venstre,\vinkel)(\hoejre,\hoejde)        \pnode(!\venstre 0){H1}        \pnode(!\hoejre 0){H2}        \psdot(H1)        \psdot(H2)        \pnode(!\dybde 0){P9}        \pnode(!\bredde 0){P10}        \pcline[linestyle=dashed](H1)(P9)        \pcline[linestyle=dashed](P10)(H2)        \pnode(!0 \vinkel){P1}        \pnode(!0 \hoejde){P2}        \pnode(!\dybde \venstre \dybde sub \venstre div \vinkel mul){P3}        \pnode(!\dybde \venstre \dybde sub \venstre div \hoejde mul){P4}        \pnode(!\bredde \hoejre \bredde sub \hoejre div \vinkel mul){P5}        \pnode(!\bredde \hoejre \bredde sub \hoejre div \hoejde mul){P6}        \psIntersectionPoint(H1)(P5)(H2)(P3){P7}        \psIntersectionPoint(H1)(P6)(H2)(P4){P8}        \multido{\i=1+1}{8}{\psdot(P\i)}        \pcline(P1)(P2)        \pcline(P1)(P3)        \pcline(P2)(P4)        \pcline(P3)(P4)        \pcline(P1)(P5)        \pcline(P2)(P6)        \pcline(P5)(P6)       \psset{linestyle=dotted}        \pcline(P3)(H1)        \pcline(P4)(H1)        \pcline(P7)(H1)        \pcline(P8)(H1)        \pcline(P7)(H2)        \pcline(P8)(H2)        \pcline(P5)(H2)        \pcline(P6)(H2)       \psset{linestyle=dashed}        \pcline(P7)(P3)        \pcline(P7)(P5)        \pcline(P7)(P8)        \pcline(P8)(P4)        \pcline(P8)(P6)       \end{pspicture}     \end{figure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/XR2J8.png) **Update 3** Here is what I ended up with:               \documentclass{article}          \usepackage{pst-solides3d}          \begin{document}          \begin{figure}      \psset{viewpoint=10 45 8 rtp2xyz,Decran=5}       \begin{pspicture}[solidmemory](-5,-5)(6,12)        \psSolid[object=point,args=6 0 1.42,name=L]        \psSolid[object=point,args=-12 9.75 1.42,name=R]        \psSolid[object=line,linecolor=red!40,linestyle=dashed,linewidth=2pt,args=R L]        \psSolid[object=parallelepiped,a=4.56,b=4.56,c=3.90,RotZ=-8,fillcolor=yellow!40,name=Cube,action=draw*](0 0 2)        \multido{\iA=0+1}{8}{%          \psSolid[object=point,definition=solidgetsommet,args=Cube \iA,name=C\iA]        }        \multido{\iA=0+1}{8}{%          \psSolid[object=line,linecolor=blue!40,linestyle=dotted,args=L C\iA]          \psSolid[object=line,linecolor=blue!40,linestyle=dotted,args=R C\iA]        }        \psSolid[object=parallelepiped,a=4.56,b=4.56,c=3.90,RotZ=-8,name=Cube,action=draw](0 0 2)       \end{pspicture}     \end{figure}          \end{document}


title: Fix page numbering format for latex listings package (lstlistoflistings)

text: I have a problem with the listings of my latex document. I am using the "listing* _s_ *" package (not the "listing" package). Although the pagenumbering is still set to "roman" right after the titlepage, the \lstlistoflistings command produces a page where the numbering is "arabic". Apparently I am not the only one with that problem. Is this maybe a bug of the listings package? Can somebody help me with this? Here is a code sample of my .tex file.                   ...         \begin{document}         \dominitoc[e]          \pagestyle{empty}              \include{titlepage}              \pagenumbering{roman}              \include{firstquote} % page numbering ok "i"         \include{preamble} % page numbering ok "ii"              \pagestyle{headings}               \include{abstract}              \begin{spacing}{1.2}                  \renewcommand{\contentsname}{Table of Contents}             \tableofcontents % page numbering ok "iii"             \listoffigures % page numbering ok "iv"             \listoftables % page numbering ok "v"             \lstlistoflistings % here is the page that produces de problem, page numbering "1"              \end{spacing}              \pagenumbering{arabic}              \addtolength{\parskip}{0.25\baselineskip}              \include{chapters/01-introduction}         ...


title: Centering the frontpage using memoir

text: I'm using `memoir` (two-side layout). I have the problem that my front page is centered with respect to the margins, which are **not equal** in left and right side. `\begin{center}` will not solve this, since it will center the content with respect to the margins. How to fix this?


title: Specify different fonts for bold and italic with fontspec

text: The main font I use for my LuaLaTeX document lacks bold and italic variants. I'd like to specify a different font for those variants using the `fontspec` package. Initially what I had in my preamble was this:               \usepackage{fontspec}     \setmainfont{GFS Elpis}     \setmonofont{Courier}      and in order to use a different font for italics and bold, say Minion Pro, I tried putting the following line in the preamble just after the above shown lines:               \fontspec[BoldFont={Minion Pro}, ItalicFont={Minion Pro}]{GFS Elpis}      Unfortunately it doesn't seem to have any effect. Italics and bold passages in the document remain in upright font. Could someone please help me with this issue?


title: Do a chemical notation of an element

text: So, at school (outside the US) our teacher has given us this type of chemical notation: ![notation](http://i.stack.imgur.com/AHGQK.jpg) Where Ar is the relative atomic mass, Z atomic number, p protons, n neutrons. Example: ![enter image description here](http://i.stack.imgur.com/e93NO.jpg) **UPDATE:** I want to make a macro out of it, but there's a porblem with \atomicnumber, I think it returns a string instead of an integer or something:               \documentclass[a4paper]{article}     \usepackage{chemmacros}     \usepackage{bohr}     \usepackage{tikz}     \newcounter{neutron}     \newcommand{\mychemistry}[2]{\setcounter{neutron}{\numexpr#2-\atomicnumber{#1}\relax}\ch{^{#2}\atomicnumber{#1}#1}\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=2pt] (char) {+\atomicnumber{#1}};}(\atomicnumber{#1} p,\theneutron n)}     \begin{document}     \mychemistry{O}{18}     \end{document}


title: Caption on tabular environment

text: I have got codes like the following (generated by Kile). How can I add a caption. I guess I should have used the table environment. Is there any solution now?               \newcommand{\mc}[3]{\multicolumn{#1}{#2}{#3}}     \begin{center}     \begin{tabular}{rccll}          &   & \mc{3}{c}{Colin}\\          &   & a & \mc{1}{c}{b} & \mc{1}{c}{c}\\\cline{3-5}     Rose & \mc{1}{c|}{A} & \mc{1}{c|}{(1,2)} & \mc{1}{c|}{(2,5)} & \mc{1}{c|}{(4,4)}\\\cline{3-5}          & \mc{1}{c|}{B} & \mc{1}{c|}{(7,4)} & \mc{1}{c|}{(3,5)} & \mc{1}{c|}{(0,6)}\\\cline{3-5}     \end{tabular}     \end{center}


title: Different styles and classes (my own + IEEEtran)

text: I'm writing my thesis based on `documentclass{report}`. It uses my own style (some other information about it here), and everything works just fine. Now, according to my University requirements, I should include ---as appendix--- in my dissertation the papers I wrote while doing it. These papers are also written in LaTeX, but they are written using the `documentclass{IEEEtran}`, which, of course, uses its own IEEE style depending if it is an article or conference proceedings. My question is, can I used any of the packages mentioned here to include the code of my papers in my thesis? Is it going to be any problem with the `hyperrref` package or any other for that matter?


title: mix marginnotes with marginpars without overlap

text: We are trying to put the figure caption as well as the footnotes in the margin and got very good results with the `tufte-latex` package. However, we have to manually adjust the offset of each sidenote or caption so that they do not overlap. Please see the following part of a page. Please note, how reference 64 was manually moved up to not be too close to the caption. ![thesis example page](http://i.stack.imgur.com/VJZ5B.png) Now, we have to find something fully automatic and I found the `marginfix` package. It works great and can move `\marginpar`s around to get very pleasing results. Please see this article how it works. I tried to make the sidenote package to combine the look with the automatic feature. Nevertheless, it is not useful to move a figure caption away from the adjacent figure. Therefore, the caption is placed with a `\marginnote` from the `marginnote` package. If the margin gets very crowded, the `\marginpar`s start to overlap with the `\marginnote`s. It seems, that was addressed in the first version of `marginfix`. I could 'block' some part of the margin with `\blockmargin`. Does anyone know why `\blockmargin` was dropped in the rewrite of `marginfix`? I asked the author, but got no response. The repository of `marginfix` is here. Or is there another way to 'forbit' some area of the margin for `\marginpar`? I tried a MWE to generally demonstrate the problem. Please replace the filename in the `\includegraphics` macro.               \documentclass[]{article}          \usepackage{lipsum}     \usepackage{graphicx}     \usepackage{marginnote}          \usepackage[paperwidth=170mm, paperheight=240mm, left=40pt, top=40pt, textwidth=260pt, marginparsep=20pt, marginparwidth=100pt, textheight=560pt, footskip=40pt]{geometry}          \begin{document}     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.      \marginpar{This could be a couple of references and other sidenotes.}     Donec vehicula augue eu neque.      \marginpar{This could be a couple of references and other sidenotes.}     Pellentesque habitant morbi tris- tique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices.     \marginpar{This could be a couple of references and other sidenotes.}     Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.           \begin{figure}[h]     \marginnote{This would be where the caption should be.}     \includegraphics{broken_loop}     \end{figure}          \lipsum[3]               \end{document}


title: Error in equation

text: I wrote the code of this image but it doesn't work? Any help ![equation](http://i.stack.imgur.com/gnKYJ.png)               \begin{equation}     F(n) = \left\{        \begin{array}{l l}         n/2 & \quad \text{if $n$ is even}\\         -(n+1)/2 & \quad \text{if $n$ is odd}       \end{array} \right.     \end{equation}


title: How to concatenate a whole paper into one big line of text + footnotes

text: I've helped my girlfriend typeset her Bachelor's degree paper with LaTeX. I'd like to create a single-page poster version of the whole text. Cf. "All the World's a Page" posters, e.g. http://www.all-the-worlds-a- page.com/products/das-kapital Specifically, I need to deal with concatenating all the things into one continuous line. There's only one figure, a small table. Bonus points for emedding the table, but I'd rather get rid of it and not worry about floating text around the table.   1. How can I remove the newline and spacing from paragraphs and replace it with the `§` glyph instead? Although I'd have to do the same for the headings and normalize their font sizes, I could just as well remove the markup instead. So the body text will be just simple paragraphs.   2. How can I concatenate footnotes the same way, remove newlines that is? I use biblatex with the footnote-dw style. **Update:** footnotes are already solved via `footmisc` it seems.


title: Insert relative date and time specifications?

text: How can I specify a relative date and let LaTeX insert the resulting absolute one? For example like this:               \somedatecommand{next thursday}      Which should result in:               Thursday, 20.10.2011      Or:               20.10.2011      Great would be also babel support (e.g. for non-english documents).


title: Partial triangular arrows with TikZ/PGF

text: I'd like to draw a partial arrow (i.e. with only "half" of the tip) but with a triangular tip shape (e.g. using >=latex), instead of the standard single line you get with "left to", "right to", etc. The result should be something like the following image: ![Triangular partial arrow](http://i.stack.imgur.com/hqVb0.png) How can I achieve this? I haven't seen any such tip in the TikZ/PGF manual.


title: Why is \lcm not defined as default?

text: Using only a class (`report` for example) we can use `\gcd`. But `\lcm` is not defined. Why?               \documentclass{report}     \begin{document}     \[  \lcm  \]     \end{document}       Why new distributions of TeX Live or MiKTeX don't have this command defined?


title: Combine arydshln and longtable-with-fake-shadowbox?

text: I have tried to use the solution provided by David Carlisle to add a `\shadowbox`-like shadow to a `long table` in my document and ran in to a strange issue: ![table border line gone AWOL](http://i.stack.imgur.com/NVY1z.png) After some poking around, I've narrowed the issue down to the `arydshln` package. I don't even have to use that package in the table in question -- as soon as I load it, the table gets distorted. From the package documentation I get the impression that there's quite a history of incompatibilities between `arydshln` and `longtable` \- have I just found the next one? Is there a workaround -- or an alternative to `arydshln`? MWE:               \documentclass[10pt]{scrartcl}     \usepackage{longtable,multirow,array}     % \usepackage{arydshln} Enabling this line breaks the table, although the package is not used at all...          \def\lsdw{\smash{\lower5pt\rlap{{\vrule width 4pt height\dimexpr\ht\strutbox+2pt\relax depth \dp\strutbox}}}}          \begin{document}          \begin{longtable}{|l!{\vline\lsdw}}     \hline      X \\     \hline     \endhead     \hline     \multispan{1}\kern4pt{\leaders \vrule height 4pt\hfill}\mbox{}\kern-4pt     \endfoot         Y \\\pagebreak     \hline     Z \\     \hline     \end{longtable}          \end{document}


title: Conflict between babel and university style sheet

text: I am a Linguistics PhD student at U.Florida, writing my dissertation. The LaTeX class from our editorial office conflicts with `babel` (among other packages). Is there a way to override the style sheet temporarily in order to use `babel`? The template can be downloaded from http://helpdesk.ufl.edu/wp- content/uploads/2012/12/latex_spring_2011.zip. The template is actually a number of different .tex files. When I have `\usepackage[russian,english]{babel}` in the `packages.tex` file, Russian glyphs appear in the PDF, but in the Table of Contents (with very specific requirements from the university editorial office) 'REFERENCES' (good) reverts to 'Bibliography' (not good). As soon as I comment out `\usepackage[russian,english]{babel}`, I get 'REFERENCES' back (good), but I lose my Russian glyphs. I assume the problem is with the university's style sheet. Any thoughts on how to make it work?               \documentclass[12pt,dvipdfm,final,CPage]{ufthesis}       \usepackage[T2A,T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[russian,english]{babel}     \renewcommand{\sfdefault}{phv}     \renewcommand{\familydefault}{\sfdefault}     \newcommand{\sfcyrillic}{PTSans-TLF}     \usepackage{xpatch}     \xpatchcmd{\Russian}     {\selectfont}     {\fontfamily{\sfcyrillic}\selectfont}     \xshowcmd\Russian     \begin{document}     \renewcommand{\sfcyrillic}{PTSans-TLF}\normalfont     English text.\\     Russian text: \\     \textcyrillic{у меня есть жиншина. я очень харашо.}\\     \end{document}


title: Adding "continued" text to framed paragraphs using tikz and framed

text: I trying to adapt the following example: http://www.texample.net/tikz/examples/framed-tikz/ So far I have managed to change the colour scheme and replace the irregular edges with a simple rounded corner border. The final change I am wanting to achieve is to get the title of the box to appear again with the suffix "continued" when the box continues into the next page. The example applies different styles depending how the box is situated and was hoping to use that same method for the titles but I am having difficulty adding the titles to the macros. Here is what I have so far:               % Nice shaded/framed paragraphs using tikz and framed     % Author: Jose Luis Diaz     \documentclass[a5paper]{article}     \usepackage{lipsum}   % To generate test text      \usepackage{framed}     \usepackage{tikz}     \usetikzlibrary{shapes}     \pgfmathsetseed{1} % To have predictable results     % Define a background layer, in which the parchment shape is drawn     \pgfdeclarelayer{background}     \pgfsetlayers{background,main}          % Define Colour Styles     \definecolor{Border}{HTML}{204C82}     \definecolor{Background}{HTML}{D2DBE6}          % define styles for the normal border and the torn border     \tikzset{         mybox/.style={             draw=Border,             fill=Background,             very thick,             rectangle,             rounded corners,             inner sep=10pt,             inner ysep=20pt         },         fancytitle/.style={             draw=Border,             fill=Background,             rounded corners         }     }          % Macro to draw the shape behind the text, when it fits completly in the     % page     \def\parchmentframe#1{     \tikz{       \node[inner sep=2em] (A) {#1};  % Draw the text of the node       \begin{pgfonlayer}{background}  % Draw the shape behind       \fill[mybox]              (A.south east) -- (A.south west) --              (A.north west) -- (A.north east) -- cycle;       \end{pgfonlayer}}}          % Macro to draw the shape, when the text will continue in next page     \def\parchmentframetop#1{     \tikz{       \node[inner sep=2em] (A) {#1};    % Draw the text of the node       \begin{pgfonlayer}{background}           \fill[mybox]              % Draw the ``complete shape'' behind             (A.south east) -- (A.south west) --              (A.north west) -- (A.north east) -- cycle;       \end{pgfonlayer}}}          % Macro to draw the shape, when the text continues from previous page     \def\parchmentframebottom#1{     \tikz{       \node[inner sep=2em] (A) {#1};   % Draw the text of the node       \begin{pgfonlayer}{background}          \fill[mybox]             % Draw the ``complete shape'' behind             (A.south east) -- (A.south west) --              (A.north west) -- (A.north east) -- cycle;       \end{pgfonlayer}}}          % Macro to draw the shape, when both the text continues from previous page     % and it will continue in next page     \def\parchmentframemiddle#1{     \tikz{       \node[inner sep=2em] (A) {#1};   % Draw the text of the node       \begin{pgfonlayer}{background}          \fill[mybox]             % Draw the ``complete shape'' behind             (A.south east) -- (A.south west) --              (A.north west) -- (A.north east) -- cycle;       \end{pgfonlayer}}}          % Define the environment which puts the frame     % In this case, the environment also accepts an argument with an optional     % title (which defaults to ``Example'', which is typeset in a box overlaid     % on the top border     \newenvironment{parchment}[1][Example]{%       \def\FrameCommand{\parchmentframe}%       \def\FirstFrameCommand{\parchmentframetop}%       \def\LastFrameCommand{\parchmentframebottom}%       \def\MidFrameCommand{\parchmentframemiddle}%       \vskip\baselineskip       \MakeFramed {\FrameRestore}       % Looks like I need to remove this and place it within a macro above somehow       \noindent\tikz\node[fancytitle, inner sep=1ex, right=10pt, anchor=west, overlay] at (0em, 2em) {#1};\par%      }     {\endMakeFramed}          % Main document, example of usage     \pagestyle{empty}     \begin{document}     \begin{parchment}[Short text]       \lipsum[11]     \end{parchment}     \lipsum[11]     \begin{parchment}[Long text spanning over pages]     \lipsum[11]       \begin{itemize}         \item \lipsum[14]       \end{itemize}     \lipsum     \end{parchment}     \end{document}


title: Letter "p" ruining vertical alignment

text: I have a simple diagram I have created.               \begin{figure}[t]       \begin{center}         \setlength{\unitlength}{10pt}         \begin{picture}(24,4)           \setlength\fboxsep{0pt}           \put(0,2){$\underbrace{\strut \fcolorbox{black}{teal0}{\framebox(6,2){Preamble}}\fcolorbox{black}{purp0}{\framebox(7,2){Start code}}}_\textrm{Stage 1: estimate M}$}           \put(13,2){$\underbrace{\strut \fcolorbox{black}{lime0}{\framebox(5,2){Data}}\fcolorbox{black}{orange0}{\framebox(6,2){Stop code}}}_\textrm{Stage 2: sample and decode}$}         \end{picture}         \caption{Packet format.}         \label{fig:packet}       \end{center}     \end{figure}      and it creates the following: ![enter image description here](http://i.stack.imgur.com/ncNS1.png) However, if you look closely you will notice the text in the last box is out of alignment with the text in the other boxes because of the "p". I would like to put it in alignment. Solution should be as close to the original image as possible, and not require additional packages like TikZ.


title: Arrow pointing to subscript in equation

text: I'm writing an equation for the components of a contracted tensor. I want to label one of the lower (covariant) indices with the text "rth positon," and have an arrow pointing to it from below. Any way to do this easily? Something like this: > ![enter image description here](http://i.stack.imgur.com/hBwAT.png) I'd also like to be able to do something like this from above so I can label upper (contravariant) indices.


title: How to position wide figures in two column documents

text: I want to an image at the bottom of a page in a two column document. Using `figure*` causes the image to jump to the bottom of the document. Is there a way to avoid this? Here is an example:               \begin{figure*}[h]     \includegraphics[width=6 in]{image.png}     \caption{info}     \label{fig:1}     \end{figure*}      This results in all the images jumping to the bottom of the document. Using `[b]`,`[!b]`,`[h]`, `[!h]`,`[ht]` or `[!ht]` also results in the images jumping to the bottom of the document. Even if the figures are reduced in size, smaller than text width, I end up with several pages of text and then some pages of figures. This is what I currently use.               \documentclass[twocolumn,pre,floats,aps,amsmath,amssymb]{revtex4}     \usepackage{graphicx}     \usepackage{bm}     \begin{document}     \title{document title }     \author{name}     \affiliation {place }     \date{\today}     \maketitle     \section{Introduction}     \label{sec:intro}     \begin{figure*}[h]     \includegraphics[width=5 in]{1.png}     \caption{A sample schematic diagram for an experiment.}     \label{fig:1}     \end{figure*}     \section{Materials and Methods}     \label{sec:experiment}     \section{Results}     \label{sec:results}     \begin{figure*}[h]     \includegraphics[width=6 in]{2.png}     \caption{A sample schematic diagram for an experiment.}     \label{fig:2}     \end{figure*}.     \begin{figure*}[h]     \includegraphics[width=6 in]{3.png}     \caption{A sample schematic diagram for an experiment.}     \label{fig:3}     \end{figure*}      \section{Conclusion}     \label{sec:conclusion}     \begin{figure*}[h]     \includegraphics[width=6 in]{4.png}     \caption{A sample schematic diagram for an experiment.}     \label{fig:4}     \end{figure*}     \subsubsection*{References}      citation~\cite{ABC}, article citation~\cite{author}comment      \begin{thebibliography}{99}     \bibitem{ABC}reference {\it } ()     \end{thebibliography}     \end{document}


title: How to print Appendix A like Chapter 1

text: I get Chapter 1 Name of Chapter. But how to get Appendix A Name of appendix               \documentclass{scrbook}      \renewcommand*{\chapterformat}{%       Chapter~\fontsize{80}{88}\selectfont\thechapter\enskip}     \begin{document}     \chapter{Name of chapter}     \appendix     \chapter{Name of appendix}     \end{document}


title: How do I cause a faded out version of certain lines of code and highlight a few. (See example)

text: ![enter image description here](http://i.stack.imgur.com/j0oT6.png) I need to know how the first 4 lines of code, are faded, the and how the Ck and Ck' are made with different colors. It'd be of great help if I could get the code for just saw the first 4-5 lines. Thank You.


title: delete all \textdoublevertline and hyphen from dictionary header

text: **I have a dictionary (https://www.writelatex.com/343314jtmhbx), which appears the words ordering in groups / family (saves paper and helps in the learning), like this:**               \documentclass[a4paper,twoside,12pt]{scrbook}              \usepackage{fancyhdr,multicol,lipsum}         \usepackage[bf,sf,center]{titlesec}      Text encoding (the original language is "magyar" instead of english)                   \usepackage[english,latin]{babel}         \usepackage[T3,OT2,T1]{fontenc}         \usepackage[utf8]{inputenc}         \usepackage[noenc]{tipa}      % Font               \usepackage{times}     \usepackage[scaled=0.85]{helvet}     \addtokomafont{section}{\centering}      % Headers and footers               \fancyhf{}     \fancyhead[L]{\textsf{\rightmark}}     \fancyhead[R]{\textsf{\leftmark}}     \fancyhead[C]{\textbf{\textsf{\thepage}}}          \renewcommand{\headrulewidth}{0.4pt}     \setlength{\columnsep}{20pt}     \setlength{\columnseprule}{0.4pt}     \setlength{\parindent}{15pt}      % Entry command : \dict{head word in the header}{head word in the body of the text}{description}               \newcommand{\dict}[3]{         \markboth{#1}{#1}         \par\vspace{0.25\baselineskip}         \phantom{#1} \textbf{#2} #3     }          \pagestyle{fancy}          \usepackage{amssymb}      produces the "\thicksim" symbol, the wave line before the derivative words from the headword               \begin{document}          \section*{A}     \begin{multicols}{2}          \dict{abdic\={a}tio}{ab-dic\textdoublevertline\={a}tio}      <\-- the two headwords are different, because of the second contains \textdoublevertline. The \textdoublevertline marks off the root of the word and the derivatives --> `\lipsum[1] $\thicksim$` <\-- a curly line, which signs the root of the word, after that the second half of the derivative word)               \textbf{affix}\lipsum[1] $\thicksim$ \textbf{affix} \lipsum[1] $\thicksim$ \textbf{affix} \lipsum[1]                 \dict{accio}{accio}      <\-- the two headwords are the same in the header and the body of the text               \lipsum[1]         \dict{accumul\={a}tor}{ac-cumul\textdoublevertline \={a}tor}      <\-- this headword contains moreover a hyphen. This is not appears in the header, too               \lipsum[1] $\thicksim$ \textbf{affix} \lipsum[1] $\thicksim$ \textbf{affix} \lipsum[1]          \end{multicols}     \end{document}      In the entry command, the `\phantom{#1}` contains the word, which is in the header without `\textdoublevertline` and hyphen, and the `\textbf{#2}` contains `\textdoublevertline` and hyphen in the dictionary entry in the body of the page. Therefore I have to write every headword twice. I would like to mass the `\phantom{#1}` and `\textbf{#2}`, to avoid having to write the headwords twice. I have tried the glossaries and xstring packages, but the xsting allows working with one character at once.


title: Wrong chapter in heading tufte latex

text: I have a Tufte-book with some chapters and a bibliography and index. This is set up as:               \begin (document}          \mainmatter          %then I include several chapters:          \include{Chapter/chaptertitle}           \end{document}      For some reasons, after typesetting, it shows the wrong chapter name in the heading for the last chapters. Who can help?


title: Place a two-column picture under the author affiliation and above abstract

text: I've been searching through the similar questions but none has worked for me. Basically, I am writing a two column conference paper with a existing template, what I want very simple is to place a picture span across two column right under the author affiliation and above the abstract, I've tried to apply the `figure*` but no matter I place the code fragment the picture will got pushed down to the second page. This is what I've got so far:               \documentclass{sigchi}     \pagenumbering{arabic}               % Load basic packages     \usepackage{balance}  % to better equalize the last page     \usepackage{graphics} % for EPS, load graphicx instead     \usepackage{times}    % comment if you want LaTeX's default font     \usepackage{url}      % llt: nicely formatted URLs          % llt: Define a global style for URLs, rather that the default one     \makeatletter     \def\url@leostyle{%        \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\bf\ttfamily}}}     \makeatother     \urlstyle{leo}               % To make various LaTeX processors do the right thing with page size.     \def\pprw{8.5in}     \def\pprh{11in}     \special{papersize=\pprw,\pprh}     \setlength{\paperwidth}{\pprw}     \setlength{\paperheight}{\pprh}     \setlength{\pdfpagewidth}{\pprw}     \setlength{\pdfpageheight}{\pprh}          \usepackage[pdftex]{hyperref}     \hypersetup{     pdftitle={SIGCHI Conference Proceedings Format},     pdfauthor={LaTeX},     pdfkeywords={SIGCHI, proceedings, archival format},     bookmarksnumbered,     pdfstartview={FitH},     colorlinks,     citecolor=black,     filecolor=black,     linkcolor=black,     urlcolor=black,     breaklinks=true,     }          % create a shortcut to typeset table headings     \newcommand\tabhead[1]{\small\textbf{#1}}               % End of preamble. Here it comes the document.     \begin{document}          \title{SIGCHI Conference Proceedings Format}          \numberofauthors{3}     \author{       \alignauthor 1st Author Name\\         \affaddr{Affiliation}\\         \affaddr{Address}\\         \email{e-mail address}\\         \affaddr{Optional phone number}       \alignauthor 2nd Author Name\\         \affaddr{Affiliation}\\         \affaddr{Address}\\         \email{e-mail address}\\         \affaddr{Optional phone number}         }          \maketitle          \begin{figure*}[tp]          \includegraphics[width=1.5\columnwidth]{1}          \caption{With Caption Below, be sure to have a good resolution image       (see item D within the preparation instructions).}     \label{fig:figure1}     \end{figure*}                    \begin{abstract}     In this paper we describe the formatting requirements for     SIGCHI Conference Proceedings, and this sample file     offers recommendations on writing for the worldwide     SIGCHI readership. Please review this document even if     you have submitted to SIGCHI conferences before, some     format details have changed relative to previous years.     \end{abstract}                              \end{document}      Could anyone help? Thanks a lot!!


title: \qed for theorems without proofs

text: It is common to place a `\qed`-Box at the end of a theorem statement (or lemma, corollary, ...) if we give no proof for that statement. How can I do this in LaTeX? If I place a qed-box at the end of the statement there is an additional linebreak, which is inacceptable formating.


title: Badbox with Bibtex, how to fix it?

text: **The problem:** How to fix bad boxes done by bibtex? Latex copy and paste bibtex formatted entries to the text, but these entries exceed the correct space. **Details:** I using main.tex with this header:               \documentclass[a4paper,12pt,fleqn,oneside,openright]{book}      with this content at the end of it:               \addcontentsline{toc}{chapter}{Referências Bibliográficas}     \bibliographystyle{apalike}     \bibliography{12.Referencias_Bibliograficas}      I had too this bibtex entry:               @BOOK{chenpatton:99,       AUTHOR =       "J. Chen and R. J. Patton",       TITLE =        "Robust model-based fault diagnosis for dynamic systems",       PUBLISHER =    "Dordrecht:   Kluwer Academic Publishers",       YEAR =         "1999"      } and finally this phrase:               A literatura apresenta muitas classes de estratégias para tratar o problema de FDI \cite{chenpatton:99}.     Estas estratégias podem ser, em geral, classificadas em abordagens baseadas em modelos quantitativos ~\cite{VR:03I} ~\cite{VR:03III} e em modelos qualitativos \cite{VR:03II} \cite{VR:03III}. Esta classificação é ilustrada na Figura~\ref{benchmark_1}.      My problem is, after the compilation I have this badbox ![Overfull](http://i.stack.imgur.com/bKEnv.png) and I don't know how to fix it. See if I put a `~` before this `cite` looks like nothing happens and I have the same badbox. If I put a `\\` I lose the justified text ![Overfull2](http://i.stack.imgur.com/2sCi8.png) How can I solve this?


title: Name separators, if condition for same command

text: I am new to LaTeX, just a Beginner, Basically a perl developer, I have created a `.tex` file               \begin{document}          \cont{\iname{\isurname{Name1}\ifname{K. C. G.}}\iname{\isurname{Name11}\ifname{Y. Q.}}\iname{\isurname{Name111}\ifname{C.-Z.}}\ititles{Some title Text}\ipage{995}}          \end{document}      Now my need is to define the commands, and the display should come as the below >   1. `\iname` \- Person Name will repeat several times   2. `\isurname` \- Surname of a person   3. `\ifname` \- First Name of a person   4. `\iname` will repeat any number of times, say 1 to ... If only one `\iname` found inside `\cont,` display should be like the below > Name1 K. C. G. Some title Text - 995. If only two `\iname` found inside `\cont`, display should be like the below > Name1 K. C. G. and Name11 Y. Q. Some title Text - 995. If more than two `\iname` found inside \cont, display should be like the below (and should come after last `\iname`) > Name1 K. C. G., Name11 Y. Q. and Name111 C.-Z. Some title Text - 995. I am able to define `\iname` seperated by comma, but I don't know how to write a macro to define `\iname` with different outputs based on the if condition, Is it possible to define that, I am totally a beginner with LaTeX, please guide me Thanks & Regards


title: Beamer Frame is displayed wrong

text: i made a Code for alerting through a frame. It adds an empty (just looks empty very light text) frame in front of the greyed out frame (Picture below). It only appears to add a frame, if i use Column Layout. Any ideas to get rid of this "redundant" frame?               \subsection{H263 / MPEG-4 Teil 2}     \begin{frame}[<+-| alert@+>]{H263 / MPEG-4 Teil 2}     \begin{columns}         \column{.55\textwidth}                 \begin{itemize}                     \item Weiterentwicklung Richtung H261                     \item Webvideos                     \item Sorenson Spark Format                     \item H\"ohere Aufl\"osung                     \item DVD                     \item .3gp, .avi                     \item Project Mayo (DivX)                 \end{itemize}         \column{.45\textwidth}                 \includegraphics[width=150pt]{divx.jpg}     \end{columns}     \end{frame}      ![Alert Image](http://i.stack.imgur.com/xNmSM.png) EDIT: Maybe there is a way to add alert statement to column?


title: Inserting a portion of a PDF as an image

text: I want to insert some images from some sources in my latex document. I have taken the screenshots and saved each image as a PDF in my system. However, this PDF has image saved in A4 size while my images are around a quarter of A4 page. I only want to insert the part of the image in latex and not the whole A4 page of PDF. How can I do this?


title: Different vertical alignment with multirow

text: I have longtable with multirow:               \documentclass[a4paper,12pt]{report}     \usepackage{multirow}     \usepackage{longtable}     \usepackage{makecell,array}          \begin{document}          {     \begin{longtable}[H]{|p{\dimexpr0.33\linewidth-2\tabcolsep}|m{\dimexpr0.33\linewidth-2\tabcolsep}|p{\dimexpr0.33\linewidth-2\tabcolsep}|}     \caption{Title}     \tabularnewline\hline     \multirow{4}{\linewidth}{ \centering \textbf{Long long  long long long long long long long long long long long long long long long long text}} & Long long  long long long long long long long long long long long long long long long long text & 1111 \tabularnewline \cline{2-3}      & Long long   long long long long long long long long long long long long text & 1111 \tabularnewline \cline{2-3}      & Long long  long long long  long long long long long long long long long long long text & 1111 \tabularnewline \cline{2-3}      & Long long  long long  long long long long long long long long long long long text & 1111 \tabularnewline \cline{1-3}     \end{longtable}     }          \end{document}      ![enter image description here](http://i.stack.imgur.com/KyCsR.png) I need use columns with specific width **\dimexpr0.33\linewidth-2\tabcolsep** Here I use a simple example, but in general, the column can be larger and the text is not fixed length. I want the last column has vertical alignment. I have problem in first column. I want to get one of the images: ![enter image description here](http://i.stack.imgur.com/pAfx3.png) ![enter image description here](http://i.stack.imgur.com/kxxDT.png) How can I fix it? **Update.** I need use mulrirow and longtable. The figure is the full version of the table in which the problem occurred. ![enter image description here](http://i.stack.imgur.com/e8BUk.png)


title: Coordinates A, B: compute |B-A| and angle between +x and (B-A)

text: This question has two parts:   1. why is the angle computed always 0 (should be 45)   2. what is a straightforward way to compute distance between coordinates (there is How can I compute the distance between two points in TikZ, though I was hoping for something easier, posibly via defining `\coordinate` for both points and getting their distance. The application I have in mind is to define a `scope` with local coordinate system with origin in `A` and local +x axis having the direction `B-A`. If there is an easier way for that, I will be happy to discover it.               \documentclass{minimal}     \usepackage{tikz}     \begin{document}         \tikz{             \def\A{(1,1)}             \def\B{(2,2)}             %% {1} this returns 0.0 although it should be 1.414213...             \pgfmathanglebetweenpoints{(1,0)}{\B-\A}             \let\abAngle\pgfmathresult             %% {2} how to compute eyclidean distance of coordinates?             %% we would have to extract x and y components of B-A to be able to use \pgfveclen{}{}             %\pgfveclen{??}{??}             \let\abLength\pgfmathresult             \message{|\B-\A| = \abLength, angle between +x and (\B-\A) = \abAngle}         }     \end{document}      with the result:               |(2,2)-(1,1)| = 0.0, angle between +x and ((2,2)-(1,1)) = 0.0


title: Random form letter text

text: I want to randomize some of the text contained within some letters. For e.g.:               \random{Dear \name,}{Hello \name,}{Greetings \name,}{Hi \name,}{To \name,}     \random{You are invited to}{You are welcome to}{I would like to invite you to}{This is an invitation to}{You may want to} attend...      When compiled, this would randomly select one of the phrases to use, so that each of the letters is a bit different. How can this be done?


title: Run modular TEX files using subfiles

text: I'm running into a little error here and I hope somebody can help me. I am setting up a modular Tex document, the structure is as follows               |[tex]     |-environment.tex     |main.tex     |bibtex.bib     |mystyle.sty      with environment.tex               \documentclass[../main.tex]{subfiles}     \begin{document}     Hello World~\cite{DNV-RP-C205}.     \end{document}       and main.tex               \documentclass[11pt]{article}     \usepackage{./mystyle}     \begin{document}     \subfile{environment}     \bibliography{bibtex}      \end{document}      Running main.tex works fine, but running envorinment.tex produces the following error:               ! LaTeX error: file ./mystyle.sty not found      Apperantlty, the relative location of mystyle.sty is not clear when compiling a subdocument. However, for me this is important, to be able to run subdocuments as well instead of having to compile the complete doc every time. Any clue on how to fix this? Thanks!


title: Simulating hand-drawn lines

text: I am working on a project that will have some vector graphics, perhaps using `TikZ` (or a similar package). All of the graphics consists of lines, in shades of gray. However, the lines from `TikZ` appear too clean. Is there any way to make the lines appear as if they were produced by a graphite pencil?


title: How to embed a minted environment inside a tabular environment?

text: I'm using packages `minted` and `booktabs`, and would like to put a minted environment within a tabular one. However, the following does not work:               \documentclass[11pt]{article}     \usepackage{minted}     \usepackage{booktabs}          \begin{document}     \begin{tabular}{rp{0.5\textwidth}}     \toprule     A & B\\     \midrule     testing &     \begin{minted}{text}     testing     \end{minted}\\     \bottomrule     \end{tabular}     \end{document}      Any ideas how this can be achieved?