title: How to "highlight" text/formulas with tikz?

text: I try to construct a yellow rectangle (with `tikz`) so that I can use it to "highlight" a piece of text. Below you see a minimal example. It already looks good, but how can I avoid the word "dummy" to be raised? All words should be located at the same height.               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[american,ngerman]{babel}     \usepackage{tikz}          \newcommand*{\yellowemph}[1]{%       \tikz\node[rectangle, fill=yellow, rounded corners, inner sep=0.3mm]{#1};%     }          \begin{document}     Just some \yellowemph{dummy} text to see what happens.     \end{document}      **UPDATE** Thank you all for your help. Below, I included a short overview/comparison about the suggested approaches. Unfortunately, Versions 3 and 4 overwrite the text. Version 2 (soul) did not work _within_ math mode (not even by wrapping it in `\text{}`). I like Version 1. See this page for how to automatically determine if in math mode or not: \newcommand: How to determine if in math mode (and then include $ $)?               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage[american,ngerman]{babel}     \usepackage{tikz}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          % version 1: needs $ $ in math mode; not work across line boundaries     \newcommand*{\yellowemph}[1]{%       \tikz[baseline=(text.base)]\node(text)[rectangle, fill=yellow, rounded     corners, inner sep=0.3mm]{#1};%     }          % version 2: does not seem to work in math mode, not even with $ $     \usepackage{soul}% use \hl{} to highlight          % version 3: does not work across line boundaries     % see http://tex.stackexchange.com/questions/35319/a-boxed-alternative-with-minimal-spacing/35357#35357     \usetikzlibrary{calc, shapes}     \makeatletter     \newcommand*{\@DrawBoxHeightSep}{0.030em}%     \newcommand*{\@DrawBoxDepthSep}{0.025em}%     \newcommand{\@DrawBox}[3][red]{% #1=style, #2=height, #3=depth         \tikz[overlay,remember picture]{         \draw[#1]           ($(bl)+(-0.2em,#2+\@DrawBoxHeightSep)$) rectangle           ($(br)+(0.2em,-#3-+\@DrawBoxDepthSep)$);}     }     \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}     \newdimen\@myBoxHeight%     \newdimen\@myBoxDepth%     \newcommand{\MyBox}[2][red]{%         \settoheight{\@myBoxHeight}{#2}% record height of box         \settodepth{\@myBoxDepth}{#2}% record height of box         \tikzmark{bl}#2\tikzmark{br}\@DrawBox[#1]{\@myBoxHeight}{\@myBoxDepth}% draw the box     }     \makeatother          % version 4: text gets overwritten     % see     % http://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex     % \usepackage{soul}     % \usepackage{tikz}     % \usetikzlibrary{calc}     \usetikzlibrary{decorations.pathmorphing}          \makeatletter          \newcommand{\defhighlighter}[3][]{%       \tikzset{every highlighter/.style={color=#2, fill opacity=#3, #1}}%     }          \defhighlighter{yellow}{.5}          \newcommand{\highlight@DoHighlight}{       \fill [ decoration = {random steps, amplitude=1pt, segment length=15pt}             , outer sep = -15pt, inner sep = 0pt, decorate             , every highlighter, this highlighter ]             ($(begin highlight)+(0,8pt)$) rectangle ($(end highlight)+(0,-3pt)$) ;     }          \newcommand{\highlight@BeginHighlight}{       \coordinate (begin highlight) at (0,0) ;     }          \newcommand{\highlight@EndHighlight}{       \coordinate (end highlight) at (0,0) ;     }          \newdimen\highlight@previous     \newdimen\highlight@current          \DeclareRobustCommand*\highlight[1][]{%       \tikzset{this highlighter/.style={#1}}%       \SOUL@setup       %       \def\SOUL@preamble{%         \begin{tikzpicture}[overlay, remember picture]           \highlight@BeginHighlight           \highlight@EndHighlight         \end{tikzpicture}%       }%       %       \def\SOUL@postamble{%         \begin{tikzpicture}[overlay, remember picture]           \highlight@EndHighlight           \highlight@DoHighlight         \end{tikzpicture}%       }%       %       \def\SOUL@everyhyphen{%         \discretionary{%           \SOUL@setkern\SOUL@hyphkern           \SOUL@sethyphenchar           \tikz[overlay, remember picture] \highlight@EndHighlight ;%         }{%         }{%           \SOUL@setkern\SOUL@charkern         }%       }%       %       \def\SOUL@everyexhyphen##1{%         \SOUL@setkern\SOUL@hyphkern         \hbox{##1}%         \discretionary{%           \tikz[overlay, remember picture] \highlight@EndHighlight ;%         }{%         }{%           \SOUL@setkern\SOUL@charkern         }%       }%       %       \def\SOUL@everysyllable{%         \begin{tikzpicture}[overlay, remember picture]           \path let \p0 = (begin highlight), \p1 = (0,0) in \pgfextra             \global\highlight@previous=\y0             \global\highlight@current =\y1           \endpgfextra (0,0) ;           \ifdim\highlight@current < \highlight@previous             \highlight@DoHighlight             \highlight@BeginHighlight           \fi         \end{tikzpicture}%         \the\SOUL@syllable         \tikz[overlay, remember picture] \highlight@EndHighlight ;%       }%       \SOUL@     }     \makeatother          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}     \noindent     word $\frac{1}{2}$ $\displaystyle\frac{1}{2}$\\     \yellowemph{word} \yellowemph{$\frac{1}{2}$}     \yellowemph{$\displaystyle\frac{1}{2}$} $\yellowemph{$\displaystyle\frac{1}{2}$}$; Version 1: does not work across lines\\     \hl{word} \hl{$\frac{1}{2}$} \hl{$\displaystyle\frac{1}{2}$}     %$\text{\hl{$\displaystyle\frac{1}{2}$}}$     ; Version 2: soul, does not work \emph{within} math mode!\\     \MyBox[fill=yellow, draw=yellow, opacity=0.3]{word} \MyBox[fill=yellow,     draw=yellow, opacity=0.3]{$\frac{1}{2}$} \MyBox[fill=yellow, draw=yellow,     opacity=0.3]{$\displaystyle\frac{1}{2}$}     %$\MyBox[fill=yellow, draw=yellow, opacity=0.3]{$\displaystyle\frac{1}{2}$}$     ; Version 3: overwrites text; does not work \emph{within} math mode or across lines\\     \highlight{word} \highlight{$\frac{1}{2}$}     \highlight{$\displaystyle\frac{1}{2}$} $\highlight{$\displaystyle\frac{1}{2}$}$;     Version 4: overwrites text     \end{document}


title: What tools are there to make LaTeX more viable at work

text: I do data mining in R, Python and various object oriented languages. I like using LaTeX to present my results; either to myself (i.e. use them for result interpretation/analysis) or to send to colleagues. What are tools are there that I can use to speed up the mass and automated production of results (tables and charts)? I know of `Sweave` which was a necessary condition for me to be able to justify LaTeX over an alternative of automatically generating HTML documents with my results. Without this I would not be able to use LaTeX in my work. What tools are there that I can use to make the 'next step' and leave HTML in the dirt once and for all? I use `Eclipse` with `StatET` at the moment.


title: Wrong vertical space in theorem environment closed by an equation

text: It happens that LaTeX, to fill a page vertically, adds extra spaces around equation environments (and other vertical spaces). Now suppose I have a theorem environment (using amsthm) which ends with an equation, like:               \begin{theorem}       It holds       \begin{equation}         2+2=4       \end{equation}     \end{theorem}          \begin{proof}       Straightforward.     \end{proof}      and suppose that this piece of code rendered inside a page which is strechted vertically by LaTeX. Then LaTeX adds the extra vertical space only BEFORE the equation, and not after, and this looks ugly. Where is the problem? EDIT: The problem appears only if I use a customized theorem style. So the question is: how should I use the command \newtheoremstyle so that the spacing is handled properly? For example               \newtheoremstyle{myplain} {2cm}% ⟨Space above⟩     {2cm}% ⟨Space below⟩     {\itshape}% ⟨Body font⟩     {}% ⟨Indent amount⟩     {\bfseries}% ⟨Theorem head font⟩     {.}% ⟨Punctuation after theorem head⟩     {.5em}% ⟨Space after theorem head⟩2     {}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩      gives the problem above, while               \newtheoremstyle{myplain} {\topsep}% ⟨Space above⟩     {\topsep}% ⟨Space below⟩     {\itshape}% ⟨Body font⟩     {}% ⟨Indent amount⟩     {\bfseries}% ⟨Theorem head font⟩     {.}% ⟨Punctuation after theorem head⟩     {.5em}% ⟨Space after theorem head⟩2     {}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩      does not. EDIT2: A working example:               \documentclass[a4paper]{amsart}          \usepackage{amsthm}     \newtheoremstyle{myplain} {2cm}% ⟨Space above⟩     {2cm}% ⟨Space below⟩     {\itshape}% ⟨Body font⟩     {}% ⟨Indent amount⟩     {\bfseries}% ⟨Theorem head font⟩     {.}% ⟨Punctuation after theorem head⟩     {.5em}% ⟨Space after theorem head⟩2     {}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩     \theoremstyle{myplain}     \newtheorem{theorem}{Theorem}          \begin{document}     \begin{theorem}       It holds       \begin{equation}         2+2=4       \end{equation}     \end{theorem}          \begin{proof}       Straightforward.     \end{proof}          \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip     \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip          \begin{gather}       2\\       2\\       2\\     \end{gather}     \end{document}


title: How to compile a LaTeX file in WinEdt 6

text: I downloaded WinEdt 6 but I do not know how to compile and run the file as compiled in previous versions.


title: How to count cells in tabular (horizontal and vertical)?

text: Thank Herbert, I have a part of code with list of students and presence at lesson. Now I need counting cells horizontal and vertical in table. And counting rows too. Thank you for helping me. I am beginner at TeX and programming at all... Table has to look like this ![enter image description here](http://i.stack.imgur.com/DpLrx.png) my code :               \documentclass[a4paper,10pt]{article}          \usepackage{filecontents}          \begin{filecontents*}{doc.txt}          \r Jozko:Mrkvicka:010:100:111:          \r Ferko:Redkovka:110:100:111:          \r Dezo:Repka:011:100:001:          \r Julo:Petrzlen:011:100:101:          \r Ivan:Hrasok:110:101:010:          \r Peter:Fazulka:010:111:101:          \r Milan:Borovicka:010:101:100:          \r Anca:Malinova:010:110:110:          \end{filecontents*}          \usepackage{array}               \def\Short#1#2!!{#1. }     \def\Conv#1#2#3!!{%       \ifnum#1=0 -\else $\times$ \fi & \ifnum#2=0 -\else $\times$ \fi & \ifnum#3=0 -\else $\times$ \fi}     \def\r#1:#2:#3:#4:#5:{ & #2 \Short#1!!  & \Conv#3!! & \Conv#4!! & \Conv#5!! \\}               \begin{document}          \begin{tabular}{||c|l| *9{c}| c ||}\hline        \textrm{nb} & \textrm{LastName and FirstName} & \multicolumn{9}{c}{ \textrm{Lesson}} & $\sum$ \\ \cline{1-12}        \hline       \input{doc.txt}       \hline     \end{tabular}          \end{document}


title: Draw bivariate normal distribution in x-z plane

text: In draw-a-bivariate-normal-distribution-in-tikz, the bivariate normal distribution was plotted on the x-y plane. Is it possible to plot this on the x-z plane/y-z plane?


title: Preventing page break in register between reference and page number (ConTeXt)

text: Problem: The page number of an reference in the register is set to th next page - pake breaking between the reference and the page number. I do not know how to produce a smaller Example:               \definepapersize[MyBook][A6]     \setuppapersize[MyBook][A6] % Prints on paper the size of MyBook          \starttext          \index{A} blub     \index{B} blub     \index{C} blub     \index{D} blub     \index{E} blub     \index{F} blub     \index{G} blub     \index{H} blub     \index{I} blub     \index{J} blub     \index{K} blub     \index{Long Long Long} blub     \index{M} blub     \index{N} blub          \completeindex     \stoptext      The page numer of the reference "Long Long Long" is set to the next page. How to prevent this?


title: Missing number, treated as zero with nested tabu

text: I have this minimal example:               \documentclass{article}     \usepackage{colortbl}     \usepackage{longtable}     \usepackage{tabu}          \begin{document}          \begin{longtabu} {|ll|}       a & \begin{tabu}{l}         1 \\         red 2 \\       \end{tabu} \\     \end{longtabu}          \end{document}      Using pdflatex from texlive 20120628 on cygwin gives me this error:               ! Missing number, treated as zero.     <to be read again>                    \tabu@1.H0     l.13 \end{longtabu}      If I leave out `\usepackage{colortbl}` the error is gone. Unfortunately my actual document is a lot larger and I need this package. Using pdflatex from MiKTex 2.9 gives me no error. Where does this error come from and how can I fix it? I need to be able to compile this document using texlive as well.


title: How to emphasize within a listing two successive identifiers separated by a space?

text: I have this `pgfplots` code that I want to put in a `lstlisting` environment:               \pgfplotsset{        every axis x label/.append style = {           font = \small        },        every axis y label/.append style = {           font = \small,           rotate = -90,           xshift = 0.5em        }     }      How can I convince the `listings` package that those strings like `every axis x label` have to be treated as identifiers? I don't like the idea of assigning the role of keyword to the single substrings `every`, `axis`, `x`, `label`.


title: How to add a keyword with a blank space in Listings package?

text: I am trying to define a listing style in order to have fortran source codes which look like vim style colors. For example, I would like to give a specific color to `end program` or `end module` or `double precision` ect ... It is easy for keywords without blank character but I do not know how to do for keyword such as those above. As you can see in the example below, the color of `program` is the good one but the color of `end program` is not the good one.               \documentclass{article}          \usepackage{xcolor}     \definecolor{keycolor}{RGB}{172, 42, 42}     \definecolor{vimvert}{RGB}{46, 139, 87}          \usepackage{listings}          % global parameters     \lstdefinestyle{global}{       basicstyle=\ttfamily\scriptsize\color{black!90},%       stringstyle=\itshape\color{magenta},%       showstringspaces=false,%       keywordstyle=\bfseries\color{keycolor},%       commentstyle=\color{gray}\slshape,%     }          % fortran style     \lstdefinestyle{fortranstyle}{       language=Fortran,%       style=global,%       emph=[1]{implicit none, integer, real, double precision, character, len, parameter, structure, common},%       emphstyle=[1]\bfseries\color{vimvert},%       emph=[2]{program,end program, module, end module, subroutine, end subroutine, function, end function},%       emphstyle=[2]\color{violet}\bfseries\slshape,%       emph=[3]{call, true, false},%       emphstyle=[3]\color{teal}\slshape%     }          \begin{document}          \begin{lstlisting}[style=fortranstyle]     program calcPi            implicit none            integer            :: i, nbreDansCercle       integer, parameter :: npts = 1000000000       double precision   :: x, y, r, pi            nbreDansCercle = 0       do i = 1, npts, 1           call random_number(x)           call random_number(y)           x = 2.d0 * x - 1.d0           y = 2.d0 * y - 1.d0           r = x**2 + y**2                if (r < 1.d0) then               nbreDansCercle = nbreDansCercle + 1           end if       end do            pi = 4.d0 * dble(nbreDansCercle) / dble(npts)       write(*,"('pi = ', F20.17)") pi          end program calcPi     \end{lstlisting}          \end{document}      ![enter image description here](http://i.stack.imgur.com/1Ya4B.png)


title: Package for UML component diagrams?

text: Do you know any package to model **component diagrams** of UML? There are some packages like `tikz-uml` that support class diagrams or sequence diagrams, but I haven't found any for component diagrams. Any help will be appreciated.


title: Wrapfigures beneath section headings misbehave

text: I'm writing a chemistry thesis and my experimental basically consists of section headings (naming the compound), followed immediately by a wrapfigure (an eps of the compound structure), followed by the experimental procedure and characterisation data (which wrap around the structure). However, if there isn't enough space between where the wrapfigure is called and the end of the page: (a) if the figure is floating, it is pushed onto the next page, beside the next paragraph which is invariably a new compound, so it overlaps with the structure that is supposed to be there, (b) if the figure is non-floating, it hangs below the lower margin on that page and pointless whitespace is created on the next page where the image is hypothetically "hanging."               \documentclass{book}          \usepackage{color,graphicx}     \usepackage{float}     \usepackage{wrapfig}          \title{Thesis}     \author{}          \begin{document}          \chapter{Experimental}          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          \subsection{Toluenesulfonic acid 2-azidoethyl ester}          \begin{wrapfigure}{L}{0.18\textwidth}         \includegraphics[scale=0.65]{img.eps}     \end{wrapfigure}          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.  In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          \subsection{Toluenesulfonic acid 2-azidoethyl ester}          \begin{wrapfigure}{L}{0.18\textwidth}         \includegraphics[scale=0.65]{img.eps}     \end{wrapfigure}          In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.  In our previous papers, we reported the palladium-catalyzed cross-coupling reaction of stuff. The compounds are readily accessible by hydroboration of alkenes and alkynes, the stereochemistry of 1-alkenyl groups both on boron and halides are completely retained in the products, many functional groups including ester, ketone, and aldehyde are tolerated, and high turnovers of the palladium catalysts are observed.          \end{document}      I don't know how to add img.eps on here... but I assume anything would work. To see the non-floating case the optional argument [L] is changed to [l].


title: line break aware custom environment

text: I have a use-case where I would like to specify some special formatting for the text being input via the \input command. This text is customer's address being printed in some sort of a form. Ideally the input file should not contain any TeX commands and be aware of line breaks. So if the input file is:               John Doe     Some Street X     ZIP City      the LaTeX template contains:                \begin{customer}        \input{customer}      \end{customer}      I know how to create a new environment, but how can I preserve line breaks from the customer.tex. I don't want the .tex file to contain \\ for the line breaks. Verbatim environment does not fit well here since it uses an own font and formatting. P.S.: A short note: verbatim environment does not work, since it does not preserve the formatting from the customer environment. I need to merge the ability of line breaks into my customer environment. E.g. customer environment can cause the text to be formatted as {\large \textsc{...}}, or whatever else.


title: Links in beamer theme Warsaw don't work if notes are shown and title is set

text: I wonder that I found this issue nowhere in the web. For me this occurs since years over different versions. Now I took the time to figure out under which conditions it happens. I would be very happy if someone could help me or even tell me where I can find help. Under the conditions:   * Documentclass `beamer`   * Theme `Warsaw`   * Option `show notes on second screen`   * Title is set The links generated by section and subsection set by the Warsaw theme (in the top, not the standard `beamer` links) are not working. Most time it happens nothing or leading to a wrong page, when pressing. If you hide the notes or delete the title, it works. Here a short example:               \documentclass{beamer}     \usepackage{pgfpages}     \usetheme{Warsaw}     \setbeameroption{show notes on second screen}     \begin{document}     \title{How to number the ...?}      \author{My name}      \date{06.06.2005}      \begin{frame}     \titlepage     \end{frame}     \section{First}     \begin{frame}     First Frame     \end{frame}     \section{Second}     \begin{frame}     Second Frame     \end{frame}     \section{Third}     \begin{frame}     Third Frame     \end{frame}     \end{document}      Edit: Because until now no one has an idea how to solve it and it looks like a bug, I reported it here. But I don't think that this will be a solution, because there are a lot of bugs open from 2010. Is there an alternative to beamer package?


title: Drawing tri-axial ellipsoid and intersecting it with a sphere

text: I would like to draw a tri-axial ellipsoid (that is, an ellipsoid with three different main axes). I'd also like to draw a sphere in the same picture, showing the curves of intersection between the sphere and the ellipsoid. I have seen TikZ code that makes a ellipsoid, but it's always an ellipsoid of rotation, so with the same x and y size. In principle, it is enough to have solid shapes for the ellipsoid and the sphere, longitudinal and latitudinal planes are not necessary. Could anyone help me with this/show me some example code for a tri-axial ellipsoid? I would prefer to have a 3D image, e.g. like Example: Stereographic and cylindrical map projections. At the moment, it looks something like this (the white lines are artefacts of the jpg conversion), ![enter image description here](http://i.stack.imgur.com/sCBWF.jpg) but I'd like to improve it.


title: Remove URL in IEEEtran bibliography

text: The question refers to the topic: Disabling URLs in bibliography Could you think of a solution, which allows to have the URL in bibliography entry or not depending on the entry type. I. e. remove the URL from the bibliography for `article`-type entries, but keep it for `manual`- or `techreport`-type entries?


title: texmaker automatically sets scale=1 in the includegraphics tool. Can this be customised?

text: I got this set up in Kile, but can't figure it out in texmaker. I want almost all my figures to be as wide as the text, at the moment I have to type this in manually each time. There is already a default size argument (scale=1), how can I customise this default?


title: Linking text nodes in a page

text: I'd like to know what package can link nodes in different parts of a page. To simplify my question I uploaded an example extracted of tkz-linknodes manual (AlterMundus). Please note that the page shows exactly what I need, but the manual doesn't explain how can I do that (actually, the tkz-linknodes package is applied to equation environments).


title: Latex command for unfilled star

text: I would like to use \medstar from the MnSymbol package, but it seems that MnSymbol conflicts with other packages I am using including amsmath. I've tried to use \FiveStarOpen from bbding as suggested here: Latex command for unfilled \bigstar But for some reason \FiveStarOpen does not display an unfilled star, but the figure '9' instead. Here is the list of packages that I am using: cite, graphicx, epstopdf, tikz, amsmath, amsfonts, amsthm, cancel, array, mdwmath, mdwtab, fixltx2e, url, color, enumerate, comment. I am a beginner at Latex, so any help will be greatly appreciated! --- edit ---   mwc:               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage{cite}      \usepackage{graphicx}      \usepackage{epstopdf}      \usepackage{tikz}      \usepackage{amsmath}      \usepackage{amsfonts}      \usepackage{amsthm}      \usepackage{cancel}      \usepackage{array}      \usepackage{mdwmath}      \usepackage{mdwtab}      \usepackage{fixltx2e}      \usepackage{url}      \usepackage{color}      \usepackage{enumerate}      \usepackage{comment}     \usepackage{bbding}          \begin{document}     \FiveStarOpen     \end{document}


title: Beamer: how to make each frame appear in the PDF toc?

text: I would like to have a beamer presentation in which _every_ frame appears in the PDF table of contents (i.e. has a bookmark). My specific presentation only has sections, so all of the frames can appear as a "subsection" on the PDF. Note that I don't want to make a subsection for each frame. One way to do that is make up a command that patches frametitle by calling the appropriate bookmark command of hyperref. Is there any better way?


title: How to join two or more external .tex file using another .tex file and then compile?

text: Suppose I have two tex files `file1.tex` and `file2.tex`. I want to join them in another tex file. I have tried to do this with the following one :               \documentclass{book}       \begin{document}       \chapter{Chapter-1}       \section{Section-1}     \begin{theorem}     Theorem 1.1.1     \end{theorem}          \input{file1}     \input{file2}               \begin{lemma}     Lemma        \end{lemma}     \end{document}        But this shows error. Is it possible to do so ? file1.tex is given below :   \input{mks}               \begin{document}                              \begin{center}     {\textbf{\huge{Abstract Algebra}}}     \end{center}               \noindent\large{\textbf{Part-B}}     \begin{enumerate}      \item Consider a group  $G$. Let $Z(G)$ be its centre. i.e.,$Z(G)=\{g \in G : gh=hg \mbox{~for all~} h \in G\}$. For $n \in \mathbf{N}$, the set of      positive integers , define $J_n=\{(g_1,\dots,g_n)\in Z(G)\times \dots \times Z(G) : g_1\dots g_n=e\}.$ As a subset of the  direct product group      $G\times \dots \times G$($n$ times direct product of the group $G$), $J_n$ is      \begin{enumerate}      \item not necessarily a subgroup.     \item a subgroup but not necessarily a normal subgroup.     \item a normal subgroup.     \item isomorphic to the direct product $Z(G)\times \dots \times Z(G)$($(n-1)$ times).     \end{enumerate}                \item Let $G$ be a group of order $77$. Then the center of $G$ is isomorphic to     \begin{enumerate}[(a)]     \begin{multicols}{4}      \item $\mathbf{Z}_{(1)}$     \item $\mathbf{Z}_{(7)}$     \item $\mathbf{Z}_{(11)}$     \item $\mathbf{Z}_{(77)}$     \end{multicols}     \end{enumerate}          \end{enumerate}                         \end{document}        where mks.tex is :               \documentclass[11pt,twoside,a4paper]{article}     \usepackage{amsthm,amsmath,amssymb,graphicx}     \usepackage{enumerate}          \usepackage[margin=0.45in]{geometry}     \usepackage{multicol}     \usepackage{tikz}     \DeclareMathOperator{\rank }{rank }     \DeclareMathOperator{\trace }{trace }     \DeclareMathOperator{\lcm }{lcm }     \DeclareMathOperator{\nullity }{nullity }             and file2.tex is :                 \documentclass{book}     \usepackage[a4paper,margin=.5in]{geometry}           \usepackage{amsthm,xypic,graphicx}     \theoremstyle{plain}     \newtheorem{theorem}{Theorem}[section]     \newtheorem{corollary}[theorem]{Corollary}     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \theoremstyle{definition}     \newtheorem*{example}{Example}     \newtheorem{definition}{Definition}     \theoremstyle{remark}     \newtheorem*{remark}{Remark}          \begin{document}     \markboth{Right}{Left}     \chapter{First Chapter}     \section{Section 1.1}     \begin{theorem}      Theorem     \end{theorem}     \begin{lemma}      lemma1     \end{lemma}          \begin{theorem}      Theorem     \end{theorem}                                                                           $$     \xymatrix{& S\ar@{-}[ld]\ar@{-}[rd] &\\     \{0,a,b,s\}\ar@{-}[d] & &\{0,c\}\ar@{-}[ldd]\\     \{0,a\}\ar@{-}[rd] & & \\     & \{0\} &     }     $$     \begin{center}      figure A.1 : chosen subsets of $S$ see book b119     \end{center}                    $$     \xymatrix{ h_{C}(C) \ar[r]^{\eta(C)}\ar[d]^{h_C(f)} & T(C)\ar[d]^{T(f)} \\     h_C(X)\ar[r]^{\eta(X)} & T(X)      }     $$     \begin{center}      figure B.1 : commutativity of the rectangle     \end{center}               $$     \xymatrix{(h_C,T)\ar[rr]^{\theta= \theta_{C,T}}\ar[d]^{N_*(\alpha)} & & T(C)\ar[d]^{\alpha(C)}\\     (h_C,S)\ar[rr] & & S(C)     }     $$     \begin{center}      figure B.3 : commutativity of the rectangle     \end{center}                    $$     \xymatrix{(h_C,T)\ar[rr]^{\theta_C= \theta_{C,T}}\ar[d]^{N_*(f)} & & T(C)\ar[d]^{T(f)}\\     (h_D,T)\ar[rr]^{\theta_D=\theta{D,T}} & & T(D)     }     $$     \begin{center}      figure B.4 : commutativity of the rectangle     \end{center}                    $$     \xymatrix{h_C(C)\ar[r]^{\eta_{(C)}}\ar[d]^{h_C(f)} & & T(C)\ar[d]^{T(f)}\\     h_C(D)\ar[rr]^{\eta_{(D)}} & & T(D)     }     $$     \begin{center}      figure B.5 : commutativity of the rectangle     \end{center}                              $$     \xymatrix{A(U)\ar[rr]^{h(U)}\ar[d]^{r_{_{V,U}}} & & B(U)\ar[d]^{T_{U,V}}\\     A(V)\ar[rr]^{h(V)} & & B(V)     }     $$     \begin{center}      figure B.6 : commutativity of the rectangle     \end{center}                         \end{document}


title: Problem with accents and special characters in document, using Legrand Orange Book template

text: I am writing a series of documents, that I want to show the best look I can get. In the process, I found an amazing template, that of course I would like to use with those documents. From the very start, I was in trouble. I made a lot of investigation, but I cannot solve my problem with the accents, that not show in the final PDF. Of course, I get lot of errors in the compilation process. The curious fact is that in the titles (index, chapter, subchapter, and so on) the accents look grood. But, in the text, te text show with no accents and special characters. I got the template as is. In fact, the only change I made to the template is the language, that is                \usepackage[english]{babel}      for                \usepackage[spanish]{babel}      In my opinion, the error that show my problem is               ! Package inputenc Error: Unicode char \u8:éri not set up for use with LaTeX.     See the inputenc package documentation for explanation.      but I don't know how can I solve it.


title: Description environment, indent first line

text: Is there a neat way to push the first line of an item in a `description` environment over to the right so that it is flush with the second line of the item? I'm trying to define a LaTeX list environment that lines up with my quotes. The list items will be named, rather than numbered, and so I've been trying to use a `description` environment to do this. What I would like to get is this:                 Here is some regular text. Note the regular para-     graph indenting.              Here is some text inside a default quote envir-         onment.          Here is some regular text.              Apples: Here is the first item.              Oranges: Here is the second item. It wraps on-         to a second line, and is flush with the first         line about oranges.          Here is some more regular text.      I'm struggling to get this result. I've been playing around with `enumitem`, but without success (possibly my own fault - I've never been able to get my head around the `enumitem` spacing commands). If it comes to it, I can get the result using `quote` environments rather than any kind of list, but that's obviously not ideal. Any suggestions greatly appreciated.


title: Passing an argument with the alignment operator (&) to a macro within another aligned environment

text: I am trying to write macros for quickly formatting matrices in math mode. Here is a simple, working example:               \documentclass{article}     \usepackage{amsmath}     \newcommand{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}}          \begin{document}     \begin{displaymath}     M = \pmat{1&0\\0&1}     \end{displaymath}     \end{document}      This also works if used _within_ an aligned environment (a `table`, `align` environment, `cases` environment, etc.):               \documentclass{article}     \usepackage{amsmath}     \newcommand{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}}          \begin{document}     \begin{align}     M &= \pmat{1&0\\0&1}     \end{align}     \end{document}      Normally, within the `align` environment the `&` symbol tells LaTeX to start a new column, but since the matrix values are contained between `{}` group tokens, LaTeX does not attempt to parse the `1&0\\\0&1` argument and thus everything works as it was intended. Let's create a new macro that does not use the group tokens `{}` to denote the macro argument. For example, it is fairly common to use square brackets to group an argument as in this working example (try it!):               \documentclass{article}     \usepackage{amsmath}     \newcommand{\bmat}[1][]{\begin{bmatrix}#1\end{bmatrix}}          \begin{document}     \begin{displaymath}     M = \bmat[1&0\\0&1]     \end{displaymath}     \end{document}      So far, so good. Here comes the problem! If I try to use my new macro `\bmat` _within_ another aligned environment:               % DOES NOT WORK!!!     \documentclass{article}     \usepackage{amsmath}     \newcommand{\bmat}[1][]{\begin{bmatrix}#1\end{bmatrix}}          \begin{document}     \begin{align}     M &= \bmat[1&0\\0&1]     \end{align}     \end{document}      I get an error because LaTeX tries to interpret the `&` within the matrix argument as part of the outer `align` environment. The difference between the way LaTeX treats the first macro `\pmat{}` and the second one `\bmat[]` is that the group tokens `{}` prevent LaTeX from parsing the argument contained within the curly braces until after the macro `\pmat` has been called. On the other hand, when LaTeX sees the `\bmat[arg]` macro, the argument is not surrounded by group tokens and so LaTeX tries to parse it _before_ getting eaten up by `\bmat`. The extra `&` character screws up the syntax of the `align` environment and so LaTeX crashes. At least, that is my understanding of what is going on, and I could be wrong! So, the question is whether or not it is possible to force LaTeX to treat the argument in the `[]` case just as it did in the `{}` case (without causing additional problems). In other words, I want to be able to write a macro a-la `\bmat[1&0\\\0&1]` that works in aligned environments but retains the square bracket syntax. CONCLUSION: Here is the final macro with working `[]` syntax, thanks to egreg (requires `xparse` and must be contained in a separate package file or between `\makeatletter` and `\makeatother` in preamble):               \DeclareDocumentCommand\mat{}{{\ifnum\z@=`}\fi\@mat}     \DeclareDocumentCommand\@mat{ g o d() d|| }     {         \IfNoValueTF{#1}         {             \IfNoValueTF{#2}             {                 \IfNoValueTF{#3}                 {                     \IfNoValueTF{#4}                     {()}                     {\begin{vmatrix}#4\end{vmatrix}}                 }                 {                     \begin{pmatrix}#3\end{pmatrix}                     \IfNoValueTF{#4}{}{|#4|}                 }             }             {                 \begin{bmatrix}#2\end{bmatrix}                 \IfNoValueTF{#3}{}{(#3)}                 \IfNoValueTF{#4}{}{|#4|}             }         }         {             \begin{matrix}#1\end{matrix}             \IfNoValueTF{#2}{}{[#2]}             \IfNoValueTF{#3}{}{(#3)}             \IfNoValueTF{#4}{}{|#4|}         }         \ifnum\z@=`{\fi}     }      This macro works like an overloaded function with different argument delimiters `{}`, `[]`, `()`, or `||`. There are probably many reasons why this is a terrible idea --- so please, post your comments below. I would like to hear from those who know better than me.


title: wasysym symbols render to something different

text: I would like to use the wasysym package to get access to characters such as lightning and clock. However, the following MWE for me gives different symbols.               \documentclass{article}     \usepackage{wasysym}     \begin{document}     $\lightning\clock$     \end{document}      This results in the following when I run `pdflatex` on it. ![enter image description here](http://i.stack.imgur.com/PWdRj.png) That is, lightning is instead rendered to a backtick and clock is instead rendered to a 0. I have TeXLive 2012 on Ubuntu 12.04 and the same shows up when using Evince or Okular to view. I do not know if this is a problem with my LaTeX code or with my TeX installation or some encoding problem particular to my machine.


title: Compiling a tikzpicture including \ref

text: I've been reading and gathering material from multiple sources online about what steps are required to externalize a document that contains TikZ pictures which store a reference to their legends using `legend to name=<name>` and use `\ref{<name>}` to include the legends at the bottom of, for example, `groupplots`. Options include using `list and make` instead of `convert with system call`, or using a trick/hack which does not externalize the reference by using the following in the preamble:               \pgfplotsset{       invoke before crossref tikzpicture={\tikzexternaldisable},       invoke after crossref tikzpicture={\tikzexternalenable},     }      Since my document includes 30+ figures and I have not found a way to make `list and make` not re-produce the figures every time (two passes are needed as well!), my only option is to try the "hacky" way. Below is a MWE of what I have. # MWE:               \documentclass{article}          \usepackage{tikz,pgfplots}     \usepgfplotslibrary{groupplots}     \usepgfplotslibrary{external}     \pgfplotsset{       compat=newest,       invoke before crossref tikzpicture={\tikzexternaldisable},       invoke after crossref tikzpicture={\tikzexternalenable},     }     % \tikzexternalize          \begin{document}       \begin{figure}[]         \centering         \begin{tikzpicture}           \begin{groupplot}[             group style={               group size=2 by 1,},]             \nextgroupplot[scale only axis,width=0.35\textwidth,height=0.35\textwidth,legend to name=grouplegend,]             \addplot               coordinates {(1,1) (2,2) (3,3)};             \addlegendentry{Legend 1}             \addplot               coordinates {(1,3) (2,2) (3,1)};             \addlegendentry{Legend 2}             \nextgroupplot[scale only axis,width=0.35\textwidth,height=0.35\textwidth]             \addplot               coordinates {(1,1) (2,2) (3,3)};             \addplot               coordinates {(1,3) (2,2) (3,1)};           \end{groupplot}           \node (legend) at ($(group c1r1.south)!0.5!(group c2r1.south)$)             [below, yshift=-3\pgfkeysvalueof{/pgfplots/every axis title shift}]             {\ref{grouplegend}};         \end{tikzpicture}%         \caption{The caption.}       \end{figure}     \end{document}      If I compile this with two passes of `pdflatex -shell-escape <file>`, the reference is resolved and the legend shows up correctly at the bottom of my two figures. Similarly, when `list and make` is used, running `pdflatex -shell-escape <file>` and `make -B -f <makefile>` twice also resolves the reference. When `\tikzexternalize` is used however, I can't find the right sequence of commands which resolves the reference. No matter how many times I run `pdflatex -shell-escape <file>`, the reference remains unresolved and the legend shows "??". Does anyone know why the trick in the preamble has no effect? Am I doing something wrong?


title: Turning a T1 text-mode character into a maths-mode character

text: I would like to use the T1 font character Ð, `\DH`, as a mathematical symbol, as so in a quick and dirty way I defined               \newcommand{\dH}{\text{\DH}}      However, in my theorem environments, where the default is italic text, the Ð is italicised, which is not the case for my equation symbols which are standard roman characters. For instance,               \begin{lemma}\label{depth_bounds}     The depth function $\dH_{Y'}$ satisfies the inequalities     \[     \dH_{Y'}(x,y) \le lcm(\dH_{G/K}(x),\dH_Y(y))     \]     \end{lemma}      The disparity with `\dH_Y` outside the lemma environment, for example, is blatantly obvious: _Ð_ Y vs ÐY, modulo HTML spacing issues.


title: Symbols in Math Mode

text: I am trying to put the following into LaTeX, using math mode.                 $ \urcorner \box (Alarm = On \wedge DoorControls = Enabled) $      This is an LTL statement, when I inserted the above everything is printed except for the \box. I also get the following error message.               Missing $ inserted     Leading text: $ \urcorner     Missing number, treated as zero     Leading text: $ \urcorner \box (      Can somebody please help me with this. Thanks


title: Help with left align?

text: I was trying to left align this equation by using code               $$\begin{equation}     \begin{aligned}     E_\theta(L(\delta_1(X)) &=& E_\theta[(1-\frac{b}{a+X^2}) X-\theta]^2\nonnumber\\                             &=&E_\theta[Y-\frac{b}{a+(Y+\theta)^2}(Y+\theta)]^2\nonnumber\\                              &=& n-2bE\frac{Y(Y+\theta)}{a+(Y+\theta)^2}+b^2E\frac{(Y+\theta)^2}{[a+(Y+\theta)^2]^2}\nonnumber\\                              &<&n-2bE\frac{Y(Y+\theta)^2-b/2}{a+(Y+\theta)^2} \label{eq:21}\end{aligned}\end{equation}$$      However, it turns out it's still right aligned and it is labelled (1) instead of (2.1) My preamble is               \documentclass[12pt]{article}               \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage[fleqn]{amsmath}


title: Presentations with flexible page layout

text: I'm new to presentations with LaTeX; can the Beamer class be used to create flexible page layouts, such as shown below (yellow boxes will be filled with either images or text)? Each page may use a different combination of these yellow boxes, except the leftmost one always stays. I would appreciate any hint to get started. I have the manuals for beamer and TikZ & PGF. I am ready to spend some time customizing a template and defining commands if the end product will be reasonably flexible and easy to use. ![enter image description here](http://i.stack.imgur.com/YKqoI.jpg)


title: How can I define a ForEach loop on the basis of the existing ForAll loop?

text: Is there a way to define new command in `algpseudocode` based on existing one? In particular, in my document I need to use both `\ForAll` and `\ForEach` commands. It turns out that just renaming `\ForAll` doesn't work for me. I would like to define a new command `\ForEach` in such a way that it keeps all the functionalities of `\ForAll` (including typesetting "do" and "end for", and indenting all states inside the loop). The code below shows what I've tried so far, but obviously that's not the way to go. I need lines 3,4,5 to be shifted together with the new command, and "end for" to be typeset.               \documentclass{article}      % Specifies the document class          \usepackage{amsmath}     \usepackage{algpseudocode}     \usepackage{algorithm}          \algnewcommand\algorithmicforeach{\textbf{for each:}}     \algnewcommand\ForEach{\item[ \algorithmicforeach]}          \begin{document}          \begin{algorithm} \caption{Iterative Policy Evaluation Algorithm}     \begin{algorithmic}[1]     \Require $\pi$, the policy to be evaluated     \State Initilize $V(s) = 0$, for all $s \in \mathcal S^+$     \Repeat     \ForEach {$s \in \mathcal S $}     \State $v \gets V(s)$     \State $V(s) \gets \sum_a \pi(s,a) \sum_{s'} \mathcal P_{ss'}^a [ \mathcal R_{ss'}^a + \gamma V(s')$     \State $\Delta \gets \max(\Delta, |v- V(s)|)$     %\EndFor     \Until {$\Delta < \theta \text{ (a small positive number)}$}     \Ensure $V \approx V^\pi$     \end{algorithmic}     \end{algorithm}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Ob09k.png)


title: Using Sagetex on cloud.sagemath.com, is it possible to make Sageblock code wrap automatically?

text: Creating a LaTeX document on the Sage Math Cloud. Whenever I use a `sageblock`, I end up with endless typesetting warnings because the notes and code inside the `sageblock` does not automatically wrap when a line gets too long. Is there a simple fix for this? edit: I'm referring specifically to `overfull \hbox` warnings. For example, in trying to define the following plot, the `sageblock` code that displays in the finished pdf will not automatically wrap onto the next line.               \begin{sageblock}     realtopcircleplot=plot(realtopcircle,downbaseterminus-1,circleEnd-1)     \end{sageblock}


title: Putting different types of references in natbib harvard style.

text: I am using natbib and its agsm style for the harvard style reference formatting in my report. A sample would be like this.               Kivi, A. (2009), ‘Measuring mobile service usage: methods and measurement points’,      International Journal of Mobile Communications 7(4), 415–435.      This works fine for different journal papers, conference papers, books etc. But I also want to add references to websites, white papers and other web resources. The problem is that these resources won't have a specific author attributed but mostly have the name of the organisation involved. Lets say Nokia, Ericsson, Facebook etc. Now how would I fit these types of references with the one above. They are ordered by the authors name and that too as Lastname, FirstnameAbbrv. I want the bibliography entry to show the whole name of the organisation instead of this human name form. How would I do this? I want to know how to give the references for these different types of resources - websites, white papers, online resources etc.


title: Scale (resize) large images (graphics) that exceed page margins

text: ## Background A large number of screen captures have been scaled 300% at 288dpi. They appear correctly when embedded in OpenOffice, but not LyX. ## Problem Images that do not extend beyond the margins (small images) appear perfectly. Images that are too big extend beyond the margins. ## Attempt #1               \setkeys{Gin}{width=1.0\textwidth}       However, that code scales the smaller images to also fit the width, which is undesirable. (The smaller images become distorted.) ## Attempt #2 Didn't attempt this, but it looks useful.               % Redefine includgraphics for avoiding images larger than the screen size     % If the size is not specified.     \let\py@Oldincludegraphics\includegraphics          \newbox\image@box%     \newdimen\image@width%     \renewcommand\includegraphics[2][\@empty]{%       \ifx#1\@empty%         \setbox\image@box=\hbox{\py@Oldincludegraphics{#2}}%         \image@width\wd\image@box%         \ifdim \image@width>\linewidth%           \setbox\image@box=\hbox{\py@Oldincludegraphics[width=\linewidth]{#2}}%           \box\image@box%         \else%           \py@Oldincludegraphics{#2}%         \fi%       \else%         \py@Oldincludegraphics[#1]{#2}%       \fi%     }      Source: http://svn.python.org/projects/external/Sphinx-1.0.5/sphinx/texinputs/sphinx.sty ## Attempt #3               % Resize figures that are too wide for the page     \let\oldincludegraphics\includegraphics     \renewcommand\includegraphics[2][]{%       \makeatletter%       \def\maxwidth{\ifdim\Ginnatwidth>\linewidth\linewidth%       \else\Ginnatwidth\fi}%       \makeatother%       \oldincludegraphics[width=\maxwidth]{#2}%      ## Packages Using `graphicx`. Other package suggestions are welcome. ## Question Without adding LaTeX code to every image that exceeds the margins, what can be done to resize just those images that are too big? ## Example The following image is an example of many, many images that must be scaled back to fit the page width: ![](http://i.stack.imgur.com/UhGrV.png) ## Related   * How to make images appear at their actual size?   * http://compgroups.net/comp.text.tex/A-modified-includegraphics


title: In LyX with classicthesis.sty, cross-references to Chapters don't work

text: I am using classicthesis with some minor (I think) edits. I have child documents for each chapter. Everything renders fine apart from cross references to chapters which pdflatex renders as ??


title: How to add length and right angle to triangle

text: The following creates a triangle. Q1. How can I add lengths such as 5cm, 6cm and xcm for each side. Q2. How can I add a right angle sign to A?                \item[b)]           \begin{tikzpicture}     % Draw the triangle             \draw[fill=gray!10]  (0, 0) coordinate (A)              -- (0,5) coordinate (C)              -- (6,0) coordinate (B)              -- (0, 0);          % Draw nodes             \node at (A)[anchor=north] {A};             \node at (B)[anchor=north] {B};             \node at (C)[anchor=south] {C};           \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/nt8Rw.png)


title: Color lines in source code that is embedded in LaTeX

text: I am looking for a way to mark some lines in a source code sample that will be integrated into my LaTeX code. I already found solutions to embed source code and have syntax highlighting like this solution: Including XML file into LaTeX But this is not exactly what I need. Imagine a source code file I include (XML, if this may be important in any way) and I only want to highlight lines 14, 15 and a part of line 16. I already thought about putting my code in word or open office writer and mark it there and include a screenshot instread of the code-file but there must be a better solution than this. Anyone can help?


title: Using \href instead of \ref

text: The link produced by `\ref{defn:First Defined Term}` works fine, but as I would prefer to have text instead of a number so thought `\href{defn:First Defined Term}{First Defined Term}` should work, but it doesn't: ![enter image description here](http://i.stack.imgur.com/O9USt.png)               \documentclass{article}     \usepackage{thmtools}     \usepackage{hyperref}     \usepackage{lipsum}          \declaretheorem[name=Definition]{DefinitionTheorem}          \newenvironment{Definition}[1]{%         \begin{DefinitionTheorem}         \label{defn:#1}     }{%         \end{DefinitionTheorem}     }          \begin{document}     \lipsum[1-7]     \begin{Definition}{First Defined Term}         \lipsum[1]     \end{Definition}     \lipsum[8-10]          \begin{Definition}{Second Defined Term}         \lipsum[1]              \bigskip          This link works great: \ref{defn:First Defined Term}\par\bigskip          But this link does not: \href{defn:First Defined Term}{First Defined Term}     \end{Definition}     \end{document}


title: Problem with a counter inside a \ul command

text: The following MWE gives a compilation error. If i move the `\arabic{count}` outside from the `\ul` command, it works               \documentclass{article}     \usepackage{soul}     \begin{document}          \newcounter{count}%     \setul{0.5ex}{0.3ex}%     \ul{text \arabic{count}}          \end{document}


title: Section in page header and TOC without number and no indention

text: I'm looking for advise about handling sections a a special way. What I want:   1. Sections should not be numbered,   2. they should be listed in the TOC and be available in the page header,   3. and they should have not left indention. A very much abridged version of what I'm currently trying is this:               \documentclass{book}          % No section numbers.     \renewcommand{\thesection}{}          \begin{document}          \tableofcontents          \chapter{Foo}          % This section should be in the TOC and the page header.     \section{Bar}          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy     eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam     voluptua.           \end{document}      Unfortunately this does not produce the desired result. 1. and 2 work but 3. doesn't: the section titles have a left indention in the text. How can I make all three requirenments work at the same time?


title: Lyx inserts and removes words randomly

text: I have a problem with my lyx file. Lyx randomly inserted words like max or plain in my document, changed numbers in my table, and removed spacing between words. It all happened after I edited my work in Lyx 2.0.6 then reopened and inserted citations in Lyx 2.0.0. I didn't change any setting except the color of my note background. I'm using Windows 7. Does anyone know what could be causing that? Below is as example where Lyx changed dash to be "Plain L":               Figures ([fig1]Plain L[fig2]) plot the fit....


title: Arrow head not showing up

text: I am not sure what I am doing wrong, but the arrow head on the link from the bottom left box to the upper right box does not show up. I want it to be the same as the arrow heads on the other edges. Thanks.               \documentclass{scrartcl}                  \usepackage{tikz}          \usetikzlibrary{shapes,positioning,arrows}          \tikzstyle{every entity} = []     \tikzstyle{every link} = []     \tikzstyle{smentity} = [rectangle, draw, black,                            minimum width=4em, minimum height=2em,                           every entity]     \tikzstyle{link} = [>=triangle 60, draw, thick, every link]          \begin{document}     \begin{tikzpicture}[node distance=1.5cm, every edge/.style={link}]          \node[smentity] (3)  {0001 1000};     \node[smentity] (4) [right= of 3] {1000 0001} edge[<-,dashed] node[above] {\small{01000}} (3);          \node[smentity] (5) [below= of 3] {1000 0000};     \node[smentity] (6) [right= of 5] {1000 0100} edge[->,dashed] (4);          \draw[>=triangle 60,dashed,thick] (5.east) -- ++(0.8,0) node[below,xshift=-0.4cm]{\small{01000}} -| ++(0,2) -- (4.196);          \end{tikzpicture}     \end{document}        ![enter image description here](http://i.stack.imgur.com/mI3oz.png)


title: "File ended while scanning use of \align*"

text: This is really odd. I have ended all environments. Triple checked them. When I add this last bit of equations using the `align*` environment, all kinds of errors appear. Predominantly, in this case > "File ended while scanning use of `\align*`" In case I leave space below the environment and add text or something, this error changes into > "missing `\endgroup`" Given that I delete this last bit of equations, all proccesses are exited normally. Of course, this does not let me continue with writing my file. If it helps, this error started appearing when I first used the `epstopdf` package. Tried deleting it, still the same.


title: Centering commutative diagram (using diagrams package)

text: When one has long text in a centered commutative diagram, apparently the diagram is centered as if the long text wasn't there. The result is that the diagram does not appear to be centered. I would like the amount of whitespace on the left to be the same as on the right. Here is a MWE:               \documentclass[11pt]{article}     \usepackage[balance,small,nohug]{diagrams}          \begin{document}     \begin{center}     \begin{diagram}      a & b & very long text goes here and it just keeps going.\\      c & d & e\\      f & g & h     \end{diagram}     \end{center}     \end{document}      And a screen shot of the result.![enter image description here](http://i.stack.imgur.com/21yJ3.png) How can I accomplish this?


title: superscript in my reference--bibtex

text: I'm using bibtex to edit my references. My code is as follow:               @article{goldbeter1990,         author = "A and B",         title = "Model for signal-induced Ca2+ and IP3 oscillations",         journal = "ABC",         volume = "87",         pages = "1-11",         year = "1990",     }      In the "title" section, I would like to make the "2+" as superscript and "3" as subscript. How could I get it?


title: Distinguishing with labels a,b,... instead of another author

text: I'm wondering how biblatex efforts to make citations unique works. Consider an example:               \documentclass{article}          \usepackage{filecontents}     \begin{filecontents}{file.bib}          @ARTICLE{ex1,        author = {{Ď{}urech}, J. and {Vokrouhlický{}}, D. and {Kaasalainen}, M. and          {Weissman}, P. and {Lowry}, S.~C. and {Beshore}, E. and {Higgins}, D. and          {Krugly}, Y.~N. and {Shevchenko}, V.~G. and {Gaftonyuk}, N.~M. and          {Choi}, Y.-J. and {Kowalski}, R.~A. and {Larson}, S. and {Warner}, B.~D. and          {Marshalkina}, A.~L. and {Ibrahimov}, M.~A. and {Molotov}, I.~E. and          {Michalowski}, T. and {Kitazato}, K.},         title = {{New photometric observations of asteroids (1862) Apollo and (25143) Itokawa - an analysis of YORP effect}},       journal = {Astronomy and Astrophysics},          year = 2008,         month = sep,        volume = 488,         pages = {345-350},     issn = {1432-0746},     }          @ARTICLE{ex2,        author = {{Ď{}urech}, J. and {Vokrouhlický{}}, D. and {Kaasalainen}, M. and          {Higgins}, D. and {Krugly}, Y.~N. and {Gaftonyuk}, N.~M. and          {Shevchenko}, V.~G. and {Chiorny}, V.~G. and {Hamanowa}, H. and          {Hamanowa}, H. and {Reddy}, V. and {Dyvig}, R.~R.},         title = {{Detection of the YORP effect in asteroid (1620) Geographos}},       journal = {Astronomy and Astrophysics},          year = 2008,         month = oct,        volume = 489,         pages = {L25-L28},     issn = {1432-0746},     }     \end{filecontents}          \usepackage{csquotes}          \usepackage[     maxcitenames=2,      style=authoryear,     firstinits=true,     backend=biber,     dashed=false,     ]{biblatex}          \addbibresource{file.bib}          \begin{document}     \cite{ex1}, \cite{ex2}     \printbibliography     \end{document}      There are two articles with same year and also same first three authors. Biblatex solves this with printing 4 names in citation to make the two entries unique, this is despite the fact, that the maxcitenames=2. This looks awful to me and I wanted to distinguish these two entries in sense: Ďurech et al. (2008a) and Ďurech et al. (2008b) I know that in this case it should be possible to distinguish them using different month, but let's pretend that we don't know it or it is also the same.. I was not successful with uniquelist and uniquename options as biblatex will add name to make it unique, not only initials or something like this... Is there any possibility to say biblatex to look only at first n authors and then (if they are the same) use a,b after year to make entries unique, instead of adding names? Or something other what would do what I want? Thanks, * * * **Edit:** cslstr have already solved my original question, however I had addition issue to making the solution work. I'm now a little like Alice in Wonderland. I have tried this solution with both uniquelist/name=false - it didn't worked. Then I made a little trick to solve this. I added braces around initial of the first author in one of the two entries - this made bibblatex to think they are different authors and made what I wanted. After your reply I thought that the place in biblatex preamble does matter and used it as you do - it woks. But then I tried to use it at the end of biblatex preamble as I have used it before I wrote at this forum - it also works. How is it possible? I'm sure I was only adding and removing the two options in preamble of biblatex and also the braces, and sure I'm using it now exactly the same way - didn't work yesterday, works now.


title: Fixed column-width table with text left-aligned in cells

text: \section{Section Title} %label{8.4.47}     \subsection*{Some note on Section}     \begin{footnotesize}     \begin{tabular}{p{2cm}|p{4cm}|p{3cm}|p{3cm}}     Heading 1 & Heading 2 & Heading 3  & Heading 4 \\     \hline     Text 1  & Text 2 & A\textsuperscript {6/1} B\textsuperscript {5/1} C\textsuperscript {1/2}  D\textsuperscript {7/1} (E + F)\textsuperscript{8.4.46} (G + H)\textsuperscript{8.4.45} Some more text\textsuperscript{6.1.72} \\     \end{tabular}     \end{footnotesize}      In the above table `|p{3cm}` is making the columns justified. I get some unwanted space between the characters, is there a way to make it align to the left, if the text does not fit in a line either put a "-" and continue to next line or simply start from a new line. Also can I post my code with Unicode characters?


I have the following LaTeX document:               \documentclass{article}     \usepackage[utf8]{inputenc}     \begin{document}     φΔδ汉     \end{document}      But I get the following error:               $ latex foo     This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)     restricted \write18 enabled.     [...]     ! Package inputenc Error: Unicode char \u8:φ not set up for use with LaTeX.      How can I use these and other UTF-8 characters? Note: This and this look like duplicates but they are slightly different and don't answer my question.


title: Formatting is changing spacing

text: I'm currently working on my thesis, and have come across little problem. If you take a look at the attached images below: ![Format problem](http://i.stack.imgur.com/MgIcM.png) ![Not format problem](http://i.stack.imgur.com/tCIhc.png) Here you can see, that there is clearly a problem in the first one, with too much spacing after the subsubsection, and it even makes a break before an indent. The only difference is this: ![Format problem](http://i.stack.imgur.com/ioQyT.png) ![enter image description here](http://i.stack.imgur.com/a7tG7.png) Don't know if you can see it, but basically, the only difference in the two is, that the first one has a few more lines of text than the other. And it is this that is causing this error (I have it some other places to). I really have no idea what is going on. I've tried to write it over a couple of times, and if I just write something random, instead of the whole segment, it actually works. So if I change the last segment with: "My name is Robert", then it formats correctly. But somehow, when the text is the other thing, then I get this formatting error. The code I'm using, before the document begins is:               \documentclass[12pt,twoside]{report}     \usepackage[utf8]{inputenc}     \usepackage[danish]{babel}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{mathptmx}     \graphicspath{ {images/} }     \usepackage[font={footnotesize},labelfont=bf]{caption}     \usepackage{subcaption}     \usepackage[a4paper,width=140mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}     \usepackage{fancyhdr}     \usepackage{quoting}     \usepackage{wrapfig}     \usepackage[toc,page]{appendix}     \usepackage{changepage}     \usepackage[nottoc,numbib]{tocbibind}     \fancyhead[RE]{}     \fancyhead[RO]{}      \fancyhead[LO,LE]{\slshape \leftmark} % chapter     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername}\ \thechapter. \ #1}{}}          \fancyfoot[C]{\thepage}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}               \renewcommand{\labelitemi}{$-$}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \setlength{\headheight}{15pt}               \usepackage[style=authoryear, dashed=false, backend=biber,maxbibnames=10, maxcitenames=3]{biblatex}     \DefineBibliographyStrings{danish}{andothers = {et\addabbrvspace al\adddot}}     \addbibresource{references.bib}     \setlength\bibitemsep{1.5\itemsep}     \renewcommand*{\nameyeardelim}{\addcomma\space}          \title{Thesis Title}     \author{Author Name}     \date{Day Month Year}      So yeah, anyone know why it's doing this ? Thanks in advance.


title: Glossaries package and pagenumbering

text: I am using the `glossaries` package to maintain an Acronyms list and a Glossary. My problem is that the Acronyms list is too big. Currently it is occupying 2 pages. The first page is numbered as `vi`, which is how I want it. However, the second page is numbered as `1`, which is incorrect. It should be `vii`. Can someone help me? This is how my master file looks like:               \begin{document}          \input{glossary} % The Glossary and Acronym entries.          \pagenumbering{alph}     \setcounter{page}{1}     \maketitle          \input{abstract}     \input{acknowledgments}          \pagenumbering{roman}     \setcounter{page}{1}          \tableofcontents     \addcontentsline{toc}{chapter}{Contents}          \listoffigures     \addcontentsline{toc}{chapter}{List of Figures}          \listoftables     \addcontentsline{toc}{chapter}{List of Tables}          \lstlistoflistings     \addcontentsline{toc}{chapter}{List of Listings}          \printglossary[type=\acronymtype] % Acronym list          \pagenumbering{arabic}     \setcounter{page}{1}          % Document body          \printglossary[title={Index of Terms},toctitle={Index of Terms}]     \end{document}


title: MiKTeX 2.9 Does NOT Support `hypernat`

text: Today I migrated from MiKTeX 2.8 to MiKTeX 2.9 (on Windows XP). Starting to compile old LaTeX files, I noticed the following error:               ! LaTeX Error: File `hypernat.sty' not found.      A little search revealed the following page: http://az.ctan.org/pkg/hypernat. It says that `hypernat` package is not available in MiKTeX. I further read MiKTeX FAQ. Among other things, it says: > [A package might be missing from MiKTeX] if the package's license doesn't > meet the requirements of the Debian Free Software Guidelines. To me, it seems that `hypernat` license was once compatible with Debian Free Software Guidelines, but it then became incompatible, and the MiKTeX team decided to remove it from their latest distribution (2.9). Am I right? Next, I want a solution for this. I just want to somehow install `hypernat` on the MiKTeX. I downloaded `hypernat.zip` and tried: `mpm --verbose --install hypernat.zip` but apparently MiKTeX does not recognize this package. Before posting any solutions, please kindly note that my environment is such that:   1. I don't want to use distributions other than MiKTeX (say TeX Live).   2. I don't want to use alternatives to `hypernat`.


title: Using space instead of comma for large numbers?

text: Is there a package I could use to insert a space instead of a comma for large numbers? For example, > 12 345.67 instead of > 12,345.67 If needed, I am using the `extbook` environment. All of my numbers are in math mode. **Edit** : Is there a way I can do this formatting without having to type in `num` (from `siunitx`) for every single number?


title: How to change captions and dots?

text: I've received my master thesis from proofreader. I've received a lot of small things to fix but they're defined inside my document class which is `report`.   1. How to change caption name from "Table" to something else (in polish it's "Tablica" and I would like to change it into "Tabela".   2. How to change colon after number in caption into dot?   3. How to get rid of name Chapter - when I put `\chapter{Method} \label{sec:Method}` in output I receive "Chapter 2" and below this "Method" (without any numbering).   4. How to put dot after every numbering in sections and subsection? (I have 2.1 and I would like to have 2.1. )


title: How can I highlight some lines from source code?

text: I am preparing a presentation (using `beamer`) and I'll need to include many snippets of source-code. For including source code, I'll probably use `listings` package. (I know there is also `minted` package, but it's not available in my distro repositories, and thus it will be a lot harder and annoying to install). However... In the middle of the source code, I want to highlight some lines, as I want to show which lines I've added, deleted or changed (when compared to the previous snippet). How can I do that? In addition, maybe I might want to highlight some words from one line, but not the entire line. (and by "highlight" I mean any kind of different style: maybe a background change, a font weight change, a color change...)


title: Boldface and subscripts in verbatim mode?

text: How do I create boldface and subscripts in verbatim mode? I've seen mention of a `fancyvrb` package that might be able to help. Can anyone provide working LaTeX code, either with or without `fancyvrb`?


title: How do I get selective bold in Verbatim?

text: I previously wrote a computer professional book in which I showed what the user typed on the console and the computer's resultant output. The way I liked to do this was with everything in courier and with the user's input in **bold**. Something like this:               <tt>     $ <b>echo foo</b>     foo     $     </tt>      I typed this as HTML because I don't know how to do this in Markdown (what StackExchange uses) and I don't know how to easily do it in LaTeX. I can certainly do it with `\texttt{\$ \textbf{echo foo}}`, but I would rather not have to quote everything. I don't want to use lstlisting as recommended by Using bold/italic text inside listings?, because I don't want LaTeX deciding what's bold. Any other recommendations?


title: Aligning address with body of letter in scrlttr2

text: In `scrlttr2`, I wish to align the address with the body of the letter. I tried this:               \@setplength{toaddrhpos}{\oddsidemargin}      But it moves the address almost to the left edge of the paper. How can I achieve the alignment that I desire? Example: ### h.lco               \ProvidesFile{h.lco}[2012/07/25]          \@setplength{toaddrhpos}{\oddsidemargin}          \endinput      ### letter.tex               \documentclass[h]{scrlttr2}          \usepackage[english]{babel}               \begin{document}          \begin{letter}{Name\\Address\\City}               \opening{Dear Madam or Sir:}          Hello.          \closing{Very truly yours,}               \end{letter}     \end{document}


title: using tabularx 2.09 in a \newenvironment produces errors

text: The `tabularx` package with new version `2014/04/22 v2.09` produces errors with the following code which compiled without errors before:               \documentclass{article}          \usepackage{array}     \usepackage{tabularx}          \def\myfooA{\tabularx{\linewidth}{|X|}}     \def\myfooB{\endtabularx}          \newenvironment{myfoo}{\myfooA}{\myfooB}          \begin{document}          \begin{myfoo}     Test     \end{myfoo}          \end{document}      I do need `\myfooA` and `\myfooB` for my application, so I can't use `\tabularx` inside the environment definition directly (which would work with the new `tabularx` version). How do I have to change `\myfooA` and `\myfooB` to work with `\tabularx 2.09` ? **Addendum:** Here is a MWE for the application which stopped to work:               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}          \usepackage[table]{xcolor}     \usepackage{tcolorbox}          \begin{document}          \begin{tcolorbox}[tabularx={X},title=My table]     Group     \end{tcolorbox}          \end{document}      **Update:** The problem was solved by David Carlisle with tabularx v2.10


title: Plugin for outlining tex files VOom does not work

text: I installed VIM plugin called VOom which has latex support for outlining sections and subsections and other commands. You can have a look here: http://www.vim.org/scripts/script.php?script_id=2657 After installation, I tested tex files. :Voom command creates the two-pane window but there is no section or subsections outlined in the right window. I don't know what is going wrong. Is there any known conflict of this plugin with latex-suite itself? The author provides a screen shot of how it works: http://vim- voom.github.io/pics/voom_latex.png In the screenshot I see no latex-suite menus. That creates the suspicion that latex-suite might be interfering with this. Other type of files like *.vim file is working just fine. It would have been great to have this feature working with vim-latex-suite. In case VOom does not work with latex-suite, anybody can suggest some other outlining alternatives?


title: Why does not MakeSentenceCase work with escaped math accents in bibliography titles?

text: I read here that if I want to automatically adjust capitalization for titles, I could use `\DeclareFieldFormat[article]{titlecase}{\MakeSentenceCase{#1}}`. However this breaks compilation. Here is a somewhat minimal example               \documentclass{article}     \usepackage{biblatex}     \usepackage{accents}     \DeclareFieldFormat[article]{titlecase}{\MakeSentenceCase{#1}} %%% <- offending line     \usepackage{filecontents}     \begin{filecontents}{test.bib}     @article{A01,       author = {Author, A.},       year = {2001},       title = {Alpha: {$Q_t=H\left(\underaccent{\leftarrow}S,\underaccent{\leftarrow}R,\Delta_t\right)A$}},       journaltitle = {Some journ.}     }     \end{filecontents}     \addbibresource{test.bib}          \begin{document}     Can it survive titlecase \autocite{A01}?          \printbibliography     \end{document}      PDF is not produced at all with offending line uncommented. EDIT 6/8/2014 What a gaffe. I made a typo while I was moving things around. I had both lines, but I guess I was confused while making a minimal example. Original code still produces some "abstract" error `Undefined control sequence` and an error like `Illegal parameter number in definition of \@tempa`. I'd like to "suspend" this question till I clarify the situation. I suspect it is because of math in title, also it is contained within `{}`. EDIT 6/9/2014 I updated the sample code. It compiles okay as is unless I uncomment that line with _titlecase_. Note that math is contained within curly braces. EDIT 6/10/2014 Example was made lean and mean without unnecessary stuff as per request in comments.


title: cellspacebreak macro

text: (I am rolling my own little system to take my LaTeX file and convert it to reasonable HTML and Epub. I have run into the following problem.) I would like to keep my `tabular`s very simple. There are some (header) cells that I would like to have broken at spaces.               \begin{tabular}{lr}                     & long column name \\         interesting & 2     \end{tabular}      inside a tabular, using a `\\\` is hazardous. I also do not want to make my `tabular` programming very complex. Ideally, I want a macro               \begin{tabular}{lr}                     & \cellspacebreak{long column name} \\         interesting & 2     \end{tabular}      that breaks spaces to lines, as if I had had `\begin{minipage}{\widestwidth} long\\\column\\\name \end{minipage}`. this is probably easier in LuaTeX, but I need a solution for pdfTeX. I also have a preference, not absolute, to stick to the standard tabular environment. both of these are necessitated by the fact that a number of users will use this, and they may not have very recent TeX installations or sophistication. Does this exist?


title: Errors with a custom .bst file

text: I am preparing an article for a Taylor & Francis journal, using their house styles. When I run BibTeX on the file, I obtain some curious errors:               Running `BibTeX' on `my-file' with ``bibtex my-file''     This is BibTeX, Version 0.99d (TeX Live 2012/Debian)     The top-level auxiliary file: my-file.aux     The style file: gCOM.bst     bbl.plainin is an unknown function---line 1981 of file gCOM.bst     format.plaindate is an unknown function---line 2929 of file gCOM.bst     format.chaptertitle is an unknown function---line 2933 of file gCOM.bst     format.trntitle is an unknown function---line 2937 of file gCOM.bst     format.englishtitle is an unknown function---line 2941 of file gCOM.bst     format.trnbookedition is an unknown function---line 2945 of file gCOM.bst     format.booknote is an unknown function---line 2965 of file gCOM.bst     Database file #1: refs.bib     Warning--empty chapter in abc87     Warning--empty chapter in abc08     Warning--empty chapter in xyz91     (There were 7 error messages)          BibTeX exited abnormally with code 2 at Tue Jan 14 22:57:09      I'm mighty confused with all of this: and the references with "empty chapter"s are in fact all books (and listed with `@book` in my .bib file). Also, the gCOM.bst file is in fact only 1951 lines long, which makes the error messages above even more confusing. I suppose I could contact the publishers directly, but maybe somebody here can help?


title: Storing environment arguments by \immediate\write

text: As I have stated already in other questions I am writing a problem/solution `package`. There are many of them, for sure, I have made much progress, using it in 'everydays' productivity for my needs, but is not designed for other users so far. I came across some strange behaviour, which I initially thought is my fault of wrong usage. Basically I use a parent `environment` which is on one hand responsible for formatting the problem (configurable via `xkeyval` keys), on the other hand is is the driver, that stores the solution (contained in a similar `environment`, say called 'child') to an extern file, which is afterwards read at the position the user wants to have it. The problem is now, that this will fail as soon as there are other commands handed over to the key values. This is a MWE which fails during the `\immediate\write` process when the second `parent` call is done with the `ChildOutputStyle=\YetAnotherOutputStyle`.               \documentclass{minimal}     \usepackage{xkeyval}     \usepackage{xcolor}               \newcommand{\DefaultTextStyle}[1]{%     \textbf{\textcolor{blue}{#1}}%     }%          \newcommand{\YetAnotherOutputStyle}[1]{%     \textbf{\textcolor{green}{#1}}%     }%               \newwrite\OutputFileHandle%          \makeatletter%     \define@key{FamilyA}{ChildOutputStyle}[\DefaultTextStyle]{%     \def\KVMacroChildOutputStyle{#1}%     }%          \makeatother          \newcommand{\Child}[2][]{%     \setkeys{FamilyA}{#1}%          \KVMacroChildOutputStyle{#2}%          }% End of \newcommand{\Child} %                    \newcommand{\Parent}[3][]{%     \setkeys{FamilyA}{#1}%          %  Do some stuff before with 2nd arg of command ('problem')     #2\par %%%%%     %%%%     %     % Now write solution ('child') content to filehandle     \immediate\write\OutputFileHandle{%     \string\Child[#1]{#3}%     }%     }%  End of \Parent command               \begin{document}     \presetkeys{FamilyA}{ChildOutputStyle={\DefaultOutputStyle}}{}%     \immediate\openout\OutputFileHandle=\jobname.myext               \textbf{\textcolor{violet}{First 'Parent' content}}%      \par     \Parent{One Ring To Rule Them All}{One Ring To Find Them}  % I hope, Tolkien does not mind!           %%% This code breaks when tried to save it immediately to another file!!!!     \Parent[ChildOutputStyle=\YetAnotherOutputStyle]{When shall we three meet again}{In Thunder, lightning or in rain} % William Shakespeare will not mind ;-)     %%%%               \immediate\closeout\OutputFileHandle          \textbf{\textcolor{red}{Now 'Child' content}}%      \par     \input{\jobname.myext} % replace it afterwards with \IncludeIfFileExists... etc.          \end{document}      The compilation fails with this message               ! Use of \XKV@resa doesn't match its definition.     \XKV@for@n #1#2#3->\XKV@tempa@toks {#1}\edef #2{                                                     \the \XKV@tempa@toks }\ifx #...     l.57 ...t again}{In Thunder, lightning or in rain}      Is there any workaround (besides using the `verbatim`/`moreverb` packages?) Some remarks at the end:   * I have replaced the `\newenvironment` statements from my original package by `\newcommand`s, to make the example shorter, but I prefer the environment style.   * The `\DefaultTextStyle` and `\YetAnotherOutputStyle` commands are just placeholders for some 'arbitrary' commands.   * I omitted `\AtBeginDocument` for opening the file and `AtEndDocument` for closing it also to keep the code short. I am sure other users will profit from a solution as well.


title: Is there a preferred capitalization style for reference types in BibTeX/biblatex?

text: When looking at examples of reference lists, I've seen three capitalization styles used for reference types in .bib files:   * @misc   * @Misc   * @MISC I notice the all-lowercase style appears to be the most common and additionally fits with the typical lowercase style of LaTeX. Therefore, it seems to me that it makes sense to stick to that format. Is all-lowercase indeed the generally preferred format? Is there any strong reason to use a particular format?


title: Replace \input{fileX} by the content of fileX automatically

text: Suppose I have a document with multiple include or input statements               \input{fileA}     \input{fileB}      etc. Is there an easy way to generate a single `.tex` file where `\input{fileA}` is replaced by the actual content of `fileA` etc. without copying it manually?


title: Preprocess LaTeX file, a latex -E equivalent

text: > **Possible Duplicate:**   >  Replace \input{fileX} by the content of fileX automatically I'm developping a framework for managing LaTeX project's dependencies but I can't figure out if there is a simple way of getting a preprocessed LaTeX file. For instance, if my `main.tex` looks like :               \documentclass{article}     ...     \newcommand{\specialpath}[0]{../foo/}     \input{\specialpath extracommands}     ...     \begin{document}         \input{introduction}         ...     \end{document}      I want to have:               \documentclass{article}     ...     % Content of ../foo/extracommands.tex     \usepackage{minted}     \newcommand{\whatever}     % end     ...     \begin{document}         % Content of introduction.tex         \section{Introduction}         \lipsum[1-4] % Or even the developpement of the command         % end         ...     \end{document}      In other words, is there an equivalent of the `gcc` flag `-E` for LaTeX (or an utility capable of doing that)?


title: Consolidated latex code

text: My latex document consists of hundreds of TeX files that are loaded by the main file using the `\input` command. I need to submit the TeX code to the publisher of a scientific journal for publishing. Is there a way of running the original TeX file, loading all the `\input`'s and produce one TeX file with the code loaded by `\input` in the file?


title: Switching between multiple .tex files and single .tex file

text: I'm using LaTeX to draft a journal paper and I'm writing with TeXMaker. To make the navigation easier, I broke down the paper into several .tex files. The master .tex file looks like this:               \section{Introduction}     \input{introduction.tex}     \section{Method}     \input{method.tex}     ...      The journal to which I am submitting the draft (FYI I refer to Physical Review E) requires me to submit only one .tex file, meaning that I am not allowed to use `\input`. For the first submission I just manually copied and pasted all the contents of separate .tex files into the master .tex file. Since it's likely that there will be several revisions before the paper is accepted, I would like to keep the separate .tex files structure to make revision easier. Therefore, my question is: Is there an automatic way (scripts, special program, etc.) to combine those separate .tex files into one single master .tex file? or better yet, a way to switch between having separate .tex files and having one single master .tex file?


title: Problem with table in matlab2tikz on Ubuntu

text: I have been using matlab2tikz last year on mac and it worked perfectly fine. Now I'm using it on Ubuntu and encounter some problems. FYI in installed texlive-full which does include pgf 2.1 and in my preamble I added \usepackage{tikz} and \usepackage{pgfplots}. When I compile my latex document (beamer class) in KILE I get following error message:                `(./TIKZTest.tikz     ! Missing \endcsname inserted.     <to be read again>                         \def      l.25 };               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };          ! Missing control sequence inserted.     <inserted text>                      \inaccessible      l.25 };               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };          ! Undefined control sequence.     <recently read> \pgfplotstable@loc@TMPa           l.25 };               ! Package pgfplots Error: The requested list entry with index 0 of \pgfplots@ta     ble is too large; this list has not enough elements..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };               ! Package pgfplots Error: Sorry, could not retrieve column '' from table '\\pgf     plots@table@@table@name '. Please check spelling (or introduce name aliases)..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };               ! Package pgfplots Error: The requested list entry with index 1 of \pgfplots@ta     ble is too large; this list has not enough elements..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };               ! Package pgfplots Error: Sorry, could not retrieve column '' from table '\\pgf     plots@table@@table@name '. Please check spelling (or introduce name aliases)..          See the pgfplots package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.25 };          ! Package pgfplots Warning: the current plot has no coordinates (left?)          ! Package pgfkeys Error: I do not know the key '/tikz/legend cell align' and I      am going to ignore it. Perhaps you misspelled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.28 \end{axis}          ) <use Queenslscapelogocmyk-eps-converted-to.pdf>     <use Aqua-spot-rgb-clear10025.jpg> <use TUHHLogo-eps-converted-to.pdf> [10]     (./GroupSemPres.aux)          LaTeX Font Warning: Size substitutions with differences     (Font)              up to 1.0pt have occurred.               LaTeX Font Warning: Some font shapes were not available, defaults substituted.     )`      It does show the coordinate system and legend, but doesn't plot any data. I just now discovered that it does plot something when I give the data as coordinates and not as a table. Might there be a general problem with the table in tikz on linux or am I missing something. Otherwise I would have to convert the whole tikz file matlab2tikz gives me to a coordinates list. Here is the tikz-file I get from matlab2tikz (I deleted some data to make it shorter):                   % This file was created by matlab2tikz v0.4.7 running on MATLAB 8.1.     % Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>     % All rights reserved.     % Minimal pgfplots version: 1.3     %      % The latest updates can be retrieved from     %   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz     % where you can also make suggestions and rate matlab2tikz.     %      \begin{tikzpicture}            \begin{axis}[%       width=5cm,       height=4cm,       scale only axis,       xmin=0,       xmax=0.018,       ymin=0.00015,       ymax=0.0005,       legend style={draw=black,fill=white,legend cell align=left}       ]       \addplot [color=blue,solid]         table[row sep=crcr]{0 0.000311697265625003\\       0.001953125 0.000321697265625003\\       };       \addlegendentry{wp1Exp};            \end{axis}       \end{tikzpicture}%


title: Lower Caret Symbol

text: What is the code for creating the caret-like symbol as in the following image? ![enter image description here](http://i.stack.imgur.com/FWWAO.jpg)


title: Latex can not read my files in french

text: I use Linux mint 17 an unofficial Ubuntu distribution. I have download and install texlive 2014 from CTAN, then I have install the IDE Kile (editor KDE). My problem is: when I compile my work which contains a file called `calcarénite-block.pdf`, Latex does not know this file and it marks an error. But when I rename this file `calcarenite-block.pdf`, I have no problem. I used the same distribution texlive 2014 in windows 7 + TeXniccenter 2.2, and all is well !!   * is it necessary to install a package more to read files in French ?   * the problem is in kile ?   * where is the problem in your opinion ? Thank you.


title: width of sidebar and width of text

text: I'm having a slight problem with the width of the sidebar and the width of the text in the sidebar using beamer. ![enter image description here](http://i.stack.imgur.com/J1U9G.png) As seen here, I have manually set the width of the sidebar to 2.9cm, but while there are plenty of room, the text in the sidebar (which currently acts as a table of contents) are still a fixed size, hence some items taking up two lines instead of one. Complete MWE:               \documentclass[aspectratio=169]{beamer}     \usepackage[utf8]{inputenc} % UFT8 - danske bogstaver     \usepackage[T1]{fontenc}     \usepackage[version=3]{mhchem}          \usepackage{asymptote}          \usetheme{Hannover}     \usecolortheme{rose}     %\useoutertheme{infolines}          \def\swidth{2.2cm}     \setbeamersize{sidebar width left=\swidth}     \setbeamertemplate{sidebar left}     {       {\usebeamerfont{title in sidebar}%         \vskip1.5em%         \usebeamercolor[fg]{title in sidebar}%         \insertshorttitle[width=\swidth,center,respectlinebreaks]\par%         \vskip1.25em%       }%       {%         \usebeamercolor[fg]{author in sidebar}%         \usebeamerfont{author in sidebar}%         \insertshortauthor[width=\swidth,center,respectlinebreaks]\par%             \vskip1.25em%           }%           \hbox to2cm{\hss\insertlogo\hss}           \vskip1.25em%           \insertverticalnavigation{\swidth}%           \vfill           \hbox to2cm{\hskip0.6cm\usebeamerfont{subsection in               sidebar}\strut\usebeamercolor[fg]{subsection in               sidebar}\insertframenumber/\inserttotalframenumber\hfill}%           \vskip3pt%     }%                    \title{Teknikfags-eksamen}     \date{}     \author{Philip Jakobsen}          \setbeamersize{sidebar width left = 2.9cm}          \begin{document}     %     \begin{frame}     \titlepage     \end{frame}          \begin{frame}     \frametitle{Indhold}     \tableofcontents     \end{frame}          \section{NMR - kort teori}     %     \begin{frame}          \begin{itemize}         \item $x$-aksen: elektrontæthed omkring det atom, som proton(erne) er     bundet til         \pause         \item $y$-aksen: antal \ce{^{1}H}-kerner          \pause         \item Intensitet $=$ areal (integral) under signal         \pause         \item Kan ``mærke'' nærliggende \ce{^{1}H}-kerner $\to$ opsplitning     \end{itemize}          \end{frame}          \section{Isoeugenol Acetat}     %     \begin{frame}          \end{frame}               \subsection{Syntese}     %     \begin{frame}          \end{frame}               \subsection{NMR-spektrum}     %     \begin{frame}          \end{frame}     \end{document}


title: align text in tikz figure

text: I am trying to put some text above a figure in beamer like               \begin{tikzpicture}                 \node[anchor=top ,inner sep=0] (image) at (0,0) {\includegraphics[width=60mm,height=110pt]{./chapter6/figures_susy/RankingMET08.eps}};                 \node[align=top west,black] at (image.center) {TEXT HERE};             \end{tikzpicture}      but the text appears in the middle of the plot - How can I make align the text to the top of the figure?


title: Change contrast in beamer navigation between active and not active

text: I want to change the color between the active and not active menu. I can't get it to work! Its too grey. My active font is white, the not active is a little bit grey... I want it whiter... my LaTeX code:               \definecolor{mycolor}{RGB}{0, 94, 156}          % Set up color for header and footer          \setbeamercolor{palette primary}{fg=mycolor,bg=white}          \setbeamercolor{palette secondary}{fg=white,bg=mycolor}          \setbeamercolor{section in head/foot}{parent=palette secondary}          \setbeamercolor{subsection in head/foot}{parent=palette secondary}      I tried `\setbeamertemplate{section in head/foot shaded}[default][10]` already but it didnt work. It has no effect?! Edit: The whole code: My test document:               \documentclass{beamer}     \usepackage{graphicx}     \usepackage{graphics}     \usepackage{hyperref}     \usepackage[english]{babel}     \usepackage{eso-pic}     \usepackage{tikz}               \mode<presentation>         {         \usetheme{test}         \setbeamercovered{transparent = 28}         }                              \begin{document}          \begin{frame}[plain]         \titlepage     \end{frame}                         \end{document}


title: Ground symbol from circuits.ee.IEC library

text: I wish to draw a ground symbol in a circuit diagram using the circuits.ee.IEC TiKZ library. The example in the PGF Manual (pdf) on page 311 shows exactly what I want. However, when I try to draw it, the wire is extended beyond the ground symbol:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}          \begin{document}     \begin{tikzpicture}[circuit ee IEC]     \draw (0,0) to[ground] (3,0);     \end{tikzpicture}     \end{document}      ![Ground symbol does not end wire](http://i.stack.imgur.com/MJsz4.png) How do I fix this, so the ground symbol ends the wire as in the example?