title: tikz, modify code for drawing DNA sequence

text: I need to modify how to draw DNA sequences. There is a function `\DNASequence` which does the job. It uses nodes of constant size. However, I need to put **arbitrary** text instead of only one letter in a cell. How to do it? I tried to modify original code but I don't know how to get the actual width of a node.               \documentclass[10pt]{beamer}     \usepackage[utf8]{inputenc} % Language = Spanish     \usepackage{color}     \usepackage{tikz}     \usetheme{Warsaw}      \usecolortheme{whale}     \usepackage{xstring}     \usetikzlibrary{calc, arrows}          \newcommand*{\NodeSize}{0.5cm}%     \newcommand*{\YShiftBetweenRows}{-1cm}% Subsequent rows are shited down so they don't overlap     \tikzset{DNA Style/.style={minimum size=0.5cm, draw=gray, line width=1pt}}{}          \newlength{\YShift}%      \newcounter{ColumnCounter}% Prefix for node labels          \setlength{\YShift}{0cm}%      \setcounter{ColumnCounter}{0}     \newcounter{angle}     \setcounter{angle}{0}     %     \begin{document}     \newcommand*{\DNASequence}[2][Mark]{%     % http://tex.stackexchange.com/questions/12091/tikz-foreach-loop-with-macro-defined-list     \def\Sequence{#2}     \foreach [count=\xi] \Label/\Color in \Sequence {%         \pgfmathsetmacro{\XShift}{\NodeSize*\xi}%         \IfStrEq{\Color}{}{\def\Color{white}}{}         \edef\NodeName{#1-\arabic{ColumnCounter}}         \node [DNA Style, fill=\Color, xshift=\XShift] (\NodeName) {\Label};         \stepcounter{ColumnCounter}     }      }%               \begin{frame}{bla}     \begin{tikzpicture}     \DNASequence{AAAA/cyan,, Big/orange,,,Small/blue,,G/red!25,,C/yellow};     \end{tikzpicture}     \end{frame}     \end{document}      EDIT: I need `\DNASequence` function which draws arbitrary text in the nodes.


title: Animating a plot with pgfplots

text: I'm creating a beamer presentation and I want to animate a plot with pgfplots. This is a MWE of the graphics:               \documentclass{beamer}          \usepackage{tikz,pgfplots}          \begin{document}          \begin{frame}     \begin{figure}     \begin{tikzpicture}     \begin{axis}[%     width=2in,     height=2in,     scale only axis,     minor tick num=10,     xmin=1,     xmax=10,     ymin=1,     ymax=10,     axis x line*=bottom,     axis y line*=left,     ]     \plot[mark=*, mark options={fill=black}]       coordinates{     (1,  1)     (2, 2)     (3, 3)     (4, 4)     (5, 5)     (6, 6)     (7, 7)     (8, 8)     (9, 9)     (10, 10)     };     \end{axis}     \end{tikzpicture}          \end{figure}     \end{frame}          \end{document}      I want to see the points appearing consecutive as animation. I don't know how to do this, any one can help me? Thanks in advance.


title: How to tell if the current section is defined in Beamer?

text: I am customising the footer of my Beamer slides. The footer displays the title of the slides, followed by a ":", and then the current section title. This works fine if the current section is defined. However, if the section is not defined, I am left with the current title followed by a dangling colon. I would like the colon not to be displayed if the current section is not defined. So, how do I determine if the current slide's section is defined, and how do I use this in a conditional in the footer? For completeness, it would also be helpful to know how one would determine if the current subsection is defined. My attempt so far:               \begin{beamercolorbox}[wd=.85\paperwidth,ht=2.25ex,dp=1ex,left]{author in head/foot}%        \usebeamerfont{author in head/foot}        \hspace*{2ex}\insertshorttitle  % insert title in footer               \, : \insertsection             % insert current section [should only be done if section defined]      \end{beamercolorbox}%          % more code to insert the slide number in the footer (not shown)


title: Dashed /^/ in xy package

text: I am trying to make the following arc between two objects using the `/^/` but I need it to be dashed my matrix is as follow:               \xymatrix{         &0\ar@{-->}[r]&0'\ar@{-->}[l]\\         &x\ar@{->}[u]\ar@{->}[r]&x'\ar@{->}[u]\\         &n\ar@{-->}[r]\ar@{->}[u]&n'\ar@{-->}[l]\\         &b\ar@/^/[uuu]\ar@{-->}[r]&b'\ar@{-->}[l]         }


title: Problems using \def commands inside an environment

text: In trying to build the commands `\sol` and `\solutions` to use them inside the exercises environment. The commands must work in this way:               \begin{exercises}       \exer text for exercise 1\sol{solutionA}       \exer text for exercise 2\sol{solutionB}       \exer text for exercise 3       \begin{subexerc}          \sexer text for subexercise 3.a.\sol{solutionC}          \sexer text for subexercise 3.b.\sol{solutionD}      \end{subexerc}     \end{exercises}      the environments are defined here:               \newcounter{exercise}     \def\theexercise{\arabic{exercise}.}     \newenvironment{exercises}       {\begin{list}{\theexercise}{} }       {\end{list}        Solutions\par\solutions}      \def\exer{\refstepcounter{exercise}\item}          \newcounter{subexer}[exercise]     \def\thesubexer{\alph{subexer}.}     \newenvironment{subexerc}       {\begin{list}{\thesubexer}{} }       {\end{list}     \def\sexer{\refstepcounter{subexer}\item}      I'm tried with these definitions:               \def\solutions{}            \makeatletter     \def\sol#1{%       \ifnum\value{subexer}=0           \g@addto@macro\solutions{\par\noindent\theexercise\ #1}%      \else           \g@addto@macro\solutions{\theexercise\thesubexer\ #1\ }%       \fi       }     \makeatother      but I'm obtained: > >     1. text for exercise 1 >     2. text for exercise 2 >     3. text for exercise 3 >           a. text for exercise 3.a >           b. text for exercise 3.b >   >     Solutions >     3. solutionA >     3. solutionB3.b. solutionC 3.b. solutionD >   ...and I'm trying: > >     1. text for exercise 1 >     2. text for exercise 2 >     3. text for exercise 3 >           a. text for exercise 3.a >           b. text for exercise 3.b >   >     Solutions >     1. solutionA >     2. solutionB >     3.a. solutionC 3.b. solutionD >   What's happening? It is like the counters `exercise` and `subexer` have always their last values!


title: Template for Wedding Order of Service?

text: I'm trying furiously to design an Order of Service for a wedding in Latex (wedding is tomorrow...lol). I'm also using Lyx to hopefully speed things up. First off, I can't seem to find a suitable document class, or any example templates online. The closest I found was this guy: http://boyinthebands.com/archives/feature-set-for-latex-order-of-worship- project/ who talks about doing it - but it seems he never got around to actually doing it in Latex. Any ideas of a class/template that would work? Any suggestions at all would be great. (Right now I'm just using article.cls...) An idea of what's on an Order of Service: http://docs-eu.livesiteadmin.com/bf230ef6-82c4-403d-830a-ec9be6b38e19/wedding- order-of-service-template.pdf For ornamental fonts, I was thinking of using adforn or fourier-orns - however, I have no idea to do this from within Lyx? Even the title I'm struggling with...lol. In Latex, I'd use \ to separate - in Lyx, Alt-Return does the same. However, then the lines of the title are too close. I tried changing the line spacing to double, however, it still appears to render exactly the same, with the lines too close:               \begin{doublespace}          \title{The Marriage of\\     Foo Bar\\     to\\     Foo Bar}     \end{doublespace}          \maketitle      Finally, for the songs, I'd need something like:'               Name of song..........Composer/Artist      The Composer/Artist should be right-aligned, and there should be an appropriate number of "..." separating - what's the easiest way to achieve that in Lyx/Latex? I don't even know what the above is called, typesetting wise, so I couldn't Google it. Cheers, Victor


title: LaTeX command for symbol needed. looks like crossed equal

text: I can’t find the LaTeX command for the symbol below. Can anyone help me out to find this symbol? _I wasn't able to find it with Detexify._ ![enter image description here](http://i.stack.imgur.com/7sL5k.png)


title: How to draw compactification and completely regular diagrams in tikz

text: How can we draw diagrams like this: ![enter image description here](http://i.stack.imgur.com/t0XcS.jpg) and ![enter image description here](http://i.stack.imgur.com/KWw24.jpg)


title: Display beamer headline in frames conditional on section and subsection environments

text: I'm trying to create a beamer presentation (in LyX) where frames conditionally display a headline containing section and subsection navigation depending on (a) whether a frame is in a section environment and (b) whether the section environment contains any subsections. Specifically, the following three conditions should apply:   1. If frame outside section: do not display headline (e.g. title frame, toc frame)   2. If frame inside section without any subsections: display for all frames in section only the portion of headline containing section navigation   3. If frame inside section with subsections: display for all frames in section both the portion of headline containing section navigation and the portion containing subsection navigation The following MWE should clarify the desired outcomes:               \documentclass{beamer}          % define colors     \definecolor{black}{RGB}{0,0,0}     \definecolor{darkblue}{RGB}{0,41,103}     \definecolor{lightblue}{RGB}{0,118,188}          \setbeamercolor*{section in head/foot}{fg=white, bg=lightblue}     \setbeamercolor*{section in head/foot shaded}{fg=white, bg=darkblue}     \setbeamercolor{subsection in head/foot}{fg=white, bg=darkblue}          % Create headline environment     \setbeamertemplate{headline}{%     \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}     \end{beamercolorbox}     \begin{beamercolorbox}{section in head/foot}           \vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{\hfill\hfill}\vskip2pt      \end{beamercolorbox}%     \begin{beamercolorbox}[ht=10pt]{subsection in head/foot}%            \vskip2pt\insertsubsectionnavigationhorizontal{\paperwidth}{}{\hfill\hfill}\vskip2pt     \end{beamercolorbox}%     \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}     \end{beamercolorbox}     }          \begin{document}          \frame{\frametitle{Frame outside section environment}      This frame should display neither the section, nor the subsection portion of the headline      }          \section{Section 1 (no subsections)}     \frame{\frametitle{Frame in section environment with no subsections}      This frame should display the section portion of the headline, but not the subsection portion      }          \section{Section 2 (with subsection)}     \subsection{Subsection 2.1}     \frame{\frametitle{Frame in section environment (post-subsection)}      This frame should display both the section and subsection portions of the headline      }          \section{Section 3 (with)}     \frame{\frametitle{Frame in section environment (pre-subsection)}      This frame should display both the section and subsection portions of the headline      }     \subsection{Subsection 3.1}          \section{Section 4 (with subsections)}     \frame{\frametitle{Frame in section environment pre-subsection}      This frame should display both the section and subsection portions of the headline      }     \subsection{Subsection 4.1}     \frame{\frametitle{Frame in section environment post-subsection}      This frame should display both the section and subsection portions of the headline      }     \subsection{Subsection 4.2}          \end{document}      Question(s): How can I achieve this kind of complex conditionality? I am aware that one can use `\ifx` to check whether a certain environment is defined or whether an element is positioned within a certain environment. For example, to check if one is in a section environment, one could use:               \ifx\insertsection\empty         %do this if NOT in section environment%     \else         %do this if in section environment%     \fi      Unfortunately, this only addresses the first of the three conditions stated above. The second two conditions effectively require code that "searches through" a section for defined subsections and evaluates to "true" if any are found and "false" if none are found. I have attempted to address this by playing around with the `\pretocmd` option of the `etoolbox` package and the approach used in the `miniframes` outer theme, but I fear my understanding of said approaches is so lacking that I am effectively just stumbling around in the dark. I'm grateful for any guidance as to how this scenario may be resolved.


title: Create a table with two parts with different tabular features

text: I'm trying to build a table that has two panels with different numbers of columns. For example:               Table 1: An interesting table                     Panel A: Some stuff     First name      Last name       Product     Bubba           Gump            Shrimp     Steve           Jobs            Happiness                      Panel B: Other stuff     School       State     Harvard      MA     Yale         CT     Brown        RI      I would like the 3 columns of Panel A and the 2 columns of Panel B to fill the horizontal space of the table. I imagined using two different \tabular commands within a \table would work, but it doesn't. I also found the `subfigure` package, but I think that only lets you stack tables horizontally, not vertically. Any ideas? Thanks!


title: Problems with landscape mode and Title on the same page

text: For an appendix I am trying to create rotated tables and I am using the landscape mode for this. Only one problem is holding me back; As soon as I am trying to add the title of the appendix to the tables I created, either the title is rotated ( see the following code):               \begin{landscape}     \section{blabla}         \begin{table}          blablabla         \end{table}     \end{landscape}      Or when I write the section name outside the landscape mode, The title starts on an empty page and the tables start on the next page (which is ugly).(see following code):               \section{blabla}     \begin{landscape}          \begin{table}          blablabla          \end{table}     \end{landscape}      Does anyone know how to solve this?


title: How to make a portfolio with LaTeX

text: I've been surfing the CTAN website but I haven't been lucky. Does anybody known an appropriate document class in LaTeX to produce a Graphic Designer portfolio? I wouldn't like to reinvent the wheel. Or maybe do you have some better idea to achieve this in an elegant way in LaTeX? Notice that I don't want to give it a very artistic look, so I would like to go with LaTeX and not any Graphic Design software.


title: Is is possible to install only the required LaTeX tool "pdflatex" in Ubuntu?

text: I do not know the dependencies b/w the tools provided by the LaTeX bulky lib. A suggested command to install LaTeX tools on Ubuntu is:               sudo apt-get install texlive-full      It's full installation requires almost 1,801 MB of disk-space. What I need is only the `pdflatex` command line tool. Is it possible to install the required tool(s) only? If not what is the best way to install the required libs/tools?


title: Spacing between sections using titlesec

text: In my LyX preamble (though, I don't think that this is related to LyX) I have this:               \titleformat{\paragraph}[runin]     {\normalfont\bfseries\scshape}     {\theparagraph}{1em}{}[. \ ]     \titlespacing{\paragraph}{0pt}{10pt}{0pt}          \titleformat{\subparagraph}     {\normalfont}     {\thesubparagraph}{.5em}{}     \titlespacing{\subparagraph}{10pt}{8pt}{0pt}      Following usual text block, the paragraph environment puts 10pt space as expected; however, following a **subparagraph** , it does not. What am I missing? ![enter image description here](http://i.stack.imgur.com/B6y1V.jpg) EDIT: Exported LyX code:               \documentclass[oneside,english]{book}     \usepackage{libertine-type1}     \usepackage{helvet}     \usepackage{beramono}     \renewcommand{\familydefault}{\rmdefault}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[paperwidth=36pc,paperheight=54pc]{geometry}     \geometry{verbose,tmargin=6pc,bmargin=9pc,lmargin=6pc,rmargin=6pc}     \pagestyle{plain}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \setlength{\parskip}{\medskipamount}     \setlength{\parindent}{0pt}     \usepackage{amsthm}     \usepackage{amsmath}          \makeatletter     \numberwithin{equation}{section}     \numberwithin{figure}{section}          \usepackage{fmtcount}          \usepackage[tracking=false]{microtype}          \usepackage{xcolor}     \usepackage{titlesec}          \titleformat{\chapter}[display]     {\normalfont\Large\filcenter\normalfont\color{gray}}     {\normalsize\MakeUppercase{\textls[400]{\chaptertitlename}} \textls[400]{\NUMBERstring{chapter}}}     {0pt}     {\vspace{1pt}%     \LARGE\scshape\color{darkgray}}                    \titleformat{\paragraph}[runin]     {\normalfont\bfseries\scshape}     {\theparagraph}{1em}{}[. \ ]     \titlespacing{\paragraph}{0pt}{10pt}{0pt}               \titleformat{\subparagraph}     {\normalfont}     {\thesubparagraph}{.5em}{}     \titlespacing{\subparagraph}{10pt}{10pt}{4pt}          \AtBeginDocument{       \def\labelitemi{\(\cdot\)}     }          \makeatother          \usepackage{babel}     \begin{document}          \title{Titlesec Problem}          \maketitle          \chapter{Titlesec Spacing}               \paragraph*{Philosophy}          Game before slam. Always. Until it is settled in which strain we expect     to play, control-bidding does not apply.               \paragraph*{Paragraph}          Lorem ipsum dolor sit amet, rebum laudem fabulas has ne. An vix oratio     adipisci nominati. Mea et tale quaeque appareat, te nam viris congue,     ex nonumes reformidans per. Ea mei graeco electram, in vix sumo liber     graecis. Aliquip intellegat an pri, no usu tritani legendos.               \paragraph*{Another Paragraph}          Tation mollis prodesset has at. Iudico patrioque mei no, sed at solum     labore impetus. Mel virtute singulis ea, nec ut utinam iuvaret ancillae,     vix consetetur referrentur ei. Ut mei legere omittam imperdiet, quod     simul cum eu, vix justo blandit ut.          Ei sit modus aperiam persequeris, ei viris veritus cum. Cibo nominati     ne quo. Viris integre ut per. Ne assentior vituperatoribus usu. Eam     nullam numquam te.               \subparagraph*{(1) Subparagraph}               \subparagraph*{(2) Another subparagraph}               \paragraph*{Paragraph}          Dicit dolores torquatos eos in. Vel labitur abhorreant ne. Ei vis     harum dolore, eam ea altera nusquam mediocritatem. Nostrud senserit     voluptatum cum ea, vix ei expetendis scriptorem.          Ea viderer oblique neglegentur nec. Sea saepe laboramus honestatis     ex, tamquam contentiones eu qui. Augue electram periculis eu cum,     in pri nobis verterem. Mel te falli dictas. Et splendide quaerendum     vel, aeque ludus labores ne quo, option intellegat duo ei. Posse inciderint     nam te.     \end{document}


title: legend problem in highlighting a data plot

text: I followed the tips on highlighting in data plots at http://www.howtotex.com/tips-tricks/highlighting-in-tikz-plots/ The highlighting does not work well with `\addlegendentry`. A MWE is shown below.               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \usetikzlibrary{external}     \tikzexternalize     %\tikzset{external/mode=list and make}     %\tikzset{external/check=diff}     \tikzset{external/force remake}     %\tikzsetexternalprefix{figure-build/, up to date check=md5, force remake}          \pgfplotsset{compat=1.8}     %\pgfplotsset{compat=newest} % necessary for new features          % start code to enable highlighting     \pgfkeys{%       /tikz/on layer/.code={         \pgfonlayer{#1}\begingroup         \aftergroup\endpgfonlayer         \aftergroup\endgroup       }     }          \pgfplotsset{         highlight/.code args={#1:#2}{             \fill [every highlight] ({axis cs:#1,0}|-{rel axis cs:0,0}) rectangle ({axis cs:#2,0}|-{rel axis cs:0,1});         },         /tikz/every highlight/.style={             on layer=\pgfkeysvalueof{/pgfplots/highlight layer},             blue!20 % default color of highlighted area         },         /tikz/highlight style/.style={             /tikz/every highlight/.append style=#1         },         highlight layer/.initial=axis background    % default depth     }          \usepackage{filecontents}          \begin{filecontents}{data}     1790 -0.002923 0.005438 0.005438 0.001646 0.010007 0.004569 4.647375 4.720160 4.721806 0.018075 0.005438     1791 -0.000842 0.002737 0.002737 0.001249 0.004828 0.002091 4.651944 4.730167 4.731415 0.020812 0.002737     1792 0.001305 0.002307 0.002307 0.002377 0.003379 0.001072 4.654035 4.734995 4.737372 0.023119 0.002307     1793 -0.005790 0.006761 0.006761 0.000710 0.013261 0.006500 4.655107 4.738374 4.739084 0.029880 0.006761     1794 -0.001449 0.002468 0.002468 0.000567 0.004484 0.002016 4.661608 4.751634 4.752201 0.032348 0.002468     1795 0.004092 0.004121 0.004121 0.005267 0.005296 0.001175 4.663623 4.756118 4.761385 0.036469 0.004121     1796 0.001135 0.001165 0.001165 0.003397 0.003427 0.002262 4.664798 4.761414 4.764811 0.037634 0.001165     1797 -0.000894 -0.000894 -0.000861 0.000118 0.000151 0.001012 4.667060 4.764841 4.764959 0.036773 -0.000861     1798 -0.002721 -0.002721 -0.002688 0.000569 0.000602 0.003290 4.668073 4.764992 4.765561 0.034085 -0.002688     1799 -0.003568 -0.003568 -0.003541 0.000188 0.000215 0.003756 4.671363 4.765594 4.765782 0.030544 -0.003541     1800 -0.000879 -0.000879 -0.000848 0.000709 0.000740 0.001588 4.675119 4.765809 4.766518 0.029696 -0.000848     1801 0.001929 0.001961 0.001961 0.003127 0.003159 0.001198 4.676707 4.766549 4.769676 0.031657 0.001961     1802 -0.000059 -0.000059 -0.000020 0.001011 0.001050 0.001070 4.677906 4.769708 4.770719 0.031637 -0.000020     1803 -0.000024 0.000017 0.000017 0.001097 0.001138 0.001121 4.678976 4.770758 4.771855 0.031654 0.000017     1804 -0.001896 -0.001896 -0.001859 0.000068 0.000105 0.001964 4.680097 4.771896 4.771964 0.029795 -0.001859     1805 -0.002589 -0.002589 -0.002555 0.000066 0.000100 0.002655 4.682062 4.772001 4.772067 0.027240 -0.002555     1806 -0.000969 -0.000969 -0.000937 0.000032 0.000064 0.001001 4.684717 4.772101 4.772133 0.026303 -0.000937     1807 -0.001087 -0.001087 -0.001051 0.001283 0.001319 0.002370 4.685718 4.772165 4.773449 0.025252 -0.001051     1808 -0.001766 -0.001766 -0.001728 0.000454 0.000492 0.002220 4.688088 4.773484 4.773938 0.023524 -0.001728     1809 -0.000970 -0.000970 -0.000938 0.000032 0.000064 0.001002 4.690308 4.773977 4.774009 0.022586 -0.000938     1810 -0.000526 -0.000526 -0.000490 0.000516 0.000552 0.001042 4.691310 4.774041 4.774557 0.022096 -0.000490     1811 -0.004600 -0.004600 -0.004559 0.000362 0.000403 0.004962 4.692353 4.774593 4.774954 0.017537 -0.004559     1812 -0.005381 -0.005381 -0.005347 0.000323 0.000357 0.005704 4.697314 4.774996 4.775318 0.012190 -0.005347     1813 -0.005619 -0.005619 -0.005587 0.000032 0.000064 0.005651 4.703018 4.775353 4.775385 0.006603 -0.005587     1814 -0.000906 -0.000906 -0.000869 0.000101 0.000138 0.001007 4.708669 4.775417 4.775518 0.005734 -0.000869     1815 0.000603 0.000641 0.000641 0.001719 0.001757 0.001116 4.709676 4.775555 4.777273 0.006375 0.000641     1816 -0.001316 -0.001316 -0.001278 0.000086 0.000124 0.001402 4.710791 4.777312 4.777397 0.005097 -0.001278     1817 -0.001534 -0.001534 -0.001494 0.000304 0.000344 0.001838 4.712193 4.777436 4.777739 0.003603 -0.001494     1818 -0.001896 -0.001896 -0.001855 0.000077 0.000118 0.001973 4.714032 4.777780 4.777857 0.001748 -0.001855     1819 -0.001642 -0.001642 -0.001608 0.000125 0.000159 0.001767 4.716004 4.777897 4.778022 0.000140 -0.001608     1820 -0.001103 -0.001103 -0.000141 0.000358 0.001320 0.001461 4.717771 4.778056 4.778414 0.000000 -0.000140     \end{filecontents}          \begin{document}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     When highlight does not work with addlegendentry, the display is fine.     \vspace{0.5cm}          \tikzsetnextfilename{myfig1}     \begin{tikzpicture}         \begin{axis}[                 set layers,                 xmode=linear,                 ymode=linear,                 axis x line*=bottom,                 axis y line*=left,                 tick label style={font=\small},                 grid=both,                 tick align=outside,                  tickpos=left,                 xlabel=x,                 ylabel=y,                 width=0.45\textwidth,                 height=0.4\textwidth,             ]             \addplot [raw gnuplot, color=red] gnuplot {                     plot "data.tex" using 1:3 w lines;             };             \addlegendentry{z1};             \addplot [raw gnuplot, color=blue] gnuplot {                     plot "data.tex" using 1:4 w lines;             };             \addlegendentry{z2};             \addplot+[%                     no marks, raw gnuplot, color=green,                     % first highlighted area (in blue by default)                      highlight=1790:1800,          % range                     % second highlighted area                      highlight=1805:1807,              % range             ] gnuplot {                     plot "data.tex" using 1:11 w lines;             };             %\addlegendentry{z3}             \addplot+[%                     no marks, raw gnuplot, color=yellow,                     highlight style={red!20}, % color                     % first highlighted area                     highlight=1810:1820,          % range             ] gnuplot {                     plot "data.tex" using 1:12;             };             %\addlegendentry{z4}         \end{axis}     \end{tikzpicture}          \vspace{1.5cm}     When highlight works with addlegendentry, the display is bad.     \vspace{0.5cm}          \tikzsetnextfilename{myfig2}     \begin{tikzpicture}         \begin{axis}[                 set layers,                 xmode=linear,                 ymode=linear,                 axis x line*=bottom,                 axis y line*=left,                 tick label style={font=\small},                 grid=both,                 tick align=outside,                  tickpos=left,                 xlabel=x,                 ylabel=y,                 width=0.45\textwidth,                 height=0.4\textwidth,             ]             \addplot [raw gnuplot, color=red] gnuplot {                     plot "data.tex" using 1:3 w lines;             };             \addlegendentry{z1};             \addplot [raw gnuplot, color=blue] gnuplot {                     plot "data.tex" using 1:4 w lines;             };             \addlegendentry{z2};             \addplot+[%                     no marks, raw gnuplot, color=green,                     % first highlighted area (in blue by default)                      highlight=1790:1800,          % range                     % second highlighted area                      highlight=1805:1807,              % range             ] gnuplot {                     plot "data.tex" using 1:11 w lines;             };             \addlegendentry{z3}             \addplot+[%                     no marks, raw gnuplot, color=yellow,                     highlight style={red!20}, % color                     % first highlighted area                     highlight=1810:1820,          % range             ] gnuplot {                     plot "data.tex" using 1:12;             };             \addlegendentry{z4}         \end{axis}     \end{tikzpicture}     \end{document}      This file main.tex is compiled by               pdflatex -shell-escape main.tex      Whenever, the highlight is used in `\addplot`, the legend becomes a large box which covers the main data plot. Do you have a suggestion to deal with this case? Thank you.


title: AUCTeX/RefTeX, the `import` package and cross reference

text: Today I switched to the `import` package with the hope that it will simplify the management of the files of my text. It surely did that, but.... It broke `RefTex` in emacs. Now, I cannot lookup my labels using `reftex-reference` (normally bounded to `C-c )`). It doesn't parse the files that were included/imported/added using the `import` package. Thus, I don't get this nice list with all the labels of my whole document. Is there a way to enjoy both worlds? ## Edit: I found this thread which suggests that this is an open problem... It seems that the problem comes from the way `reftex` parses the document. Adding `import` and `subimport` to the variable `reftex-include-file-commands` cannot solve the problem, since it is documented explicitly that `RefTeX` expects to have the filename right after the command - this is not the case when using `import` package.


title: Make aligned equation vary alignment to avoid equation numbers on new line

text: I need to write a mathematical programming model composed of several constraints. Constraints are represented as two-columns rows: the first column is the equation and the second is its domain, e.g.               x_i > l_i & \forall i \in S      But both columns can be quite long so if on one hand it would be preferrable to have all of them aligned horizontally in some way, on the other one the colum ns may end up being splitted vertically or printed overruning other elements of the page. I thought then that a decent solution would be to use one align-like environment so that each first column is aligned to the others and each second column is aligned to the others as well. However if no space for the eq. number is left on the line then I would like the second column, i.e. the domain, to be right-aligned so to fill the space after the first column to avoid the eq. number to be printed on the new line. Consider the following               \documentclass[a4,13pt,reqno,twoside, openright]{article}     \usepackage[utf8x]{inputenc}     \usepackage{float}     \usepackage{subfig}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{mathtools}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{amssymb}          \allowdisplaybreaks          \textwidth = 14cm      \hoffset = -1.5cm      \voffset = -2.0cm          \begin{document}     \begin{subequations}     \begin{align}     & y^D_{tzgm} \le y_{tzgm} & \forall t \in T, z \in Z, g \in G_z, m \in \overline{M}_{zg}     \\       & x_{tzg} \leq \sum_{m \in M_{zg}} P_{zgm} \cdot y_{tzgm} + \sum_{m \in \bar M_{zg}} (P^D_{zgm} - P_{zgm}) \cdot y^D_{tzgm} & \forall t \in T, z \in Z, g \in G_z\\       &x_{tzg} \geq \sum_{m \in M_{zg}} p_{zgm} \cdot y_{tzgm} + \sum_{m \in \bar M_{zg}} (p^D_{zgm} - p_{zgm}) \cdot y^D_{tzgm} & \forall t \in T, z \in Z, g \in G_z\\       & o_{1zh} = v_{0h}  &\forall z \in Z, h \in H_z\\       & o_{(|T|+1)zh} = v_{(|T|+1)h} & \forall z \in Z, h \in H_z\\       & o_{tzh} + n_{th} + \eta_{h} \cdot m_{tzh} = o_{(t+1)zh} + s_{tzh} + l_{tzh} & \forall t \in T, z \in Z, h \in H_z     \end{align}     \end{subequations}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7T7dT.png) As you can see I get every eq. number on a new line because the first inequality has a too long domain. An approximation of the result I would like, obtained by adding space by hand, is                   \documentclass[a4,13pt,reqno,twoside, openright]{article}     \usepackage[utf8x]{inputenc}     \usepackage{float}     \usepackage{subfig}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{mathtools}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{amssymb}          \allowdisplaybreaks          \textwidth = 14cm      \hoffset = -1.5cm      \voffset = -2.0cm          \begin{document}     \begin{subequations}     \begin{align}     & y^D_{tzgm} \le y_{tzgm} \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \mathrlap{\forall t \in T, z \in Z, g \in G_z, m \in \overline{M}_{zg}}     \\       & x_{tzg} \leq \sum_{m \in M_{zg}} P_{zgm} \cdot y_{tzgm} + \sum_{m \in \bar M_{zg}} (P^D_{zgm} - P_{zgm}) \cdot y^D_{tzgm} & \forall t \in T, z \in Z, g \in G_z\\       &x_{tzg} \geq \sum_{m \in M_{zg}} p_{zgm} \cdot y_{tzgm} + \sum_{m \in \bar M_{zg}} (p^D_{zgm} - p_{zgm}) \cdot y^D_{tzgm} & \forall t \in T, z \in Z, g \in G_z\\       & o_{1zh} = v_{0h}  &\forall z \in Z, h \in H_z\\       & o_{(|T|+1)zh} = v_{(|T|+1)h} & \forall z \in Z, h \in H_z\\       & o_{tzh} + n_{th} + \eta_{h} \cdot m_{tzh} = o_{(t+1)zh} + s_{tzh} + l_{tzh} & \forall t \in T, z \in Z, h \in H_z     \end{align}     \end{subequations}          \end{document}      ![enter image description here](http://i.stack.imgur.com/cZTyM.png) On a second note, do you think there are better ways to typeset these models? TIA


title: Include PNG Image in TexShop

text: I am wondering what may be missing from this code. I have stored all the LaTeX files in the same folder as the png image I'd like to import. The image is called "Signature" and it is saved as such.               \documentclass[11pt]{article}     \setlength\parindent{0pt}     \usepackage[pdftex]{graphicx}      \begin{document}     \title{Physics Honors Problem Set 1}     \author{Justinian Vladutiu}     \date{September, 2014}     \maketitle          \includegraphics{Signature.png}          \end{document}


title: How do I write a right bracket without writing a left one?

text: I need to use `\right]` in one of my lines, but if I don't write `\left[` in the same formula I get an error (Using texmaker). What I want to do is to type the range of a function, as in $F(x)]_{0}^{5}$. The problem is I can't use a regular bracket `]` because of the line height (There are several fractions in there). Is there any alternative to `\right]` that allows me to skip the left one? I've seen several questions regarding curly braces (Problem being you need to write `\left\\{`, but none that answers this particular question.


title: Latex not Working After Format!

text: I formatted my laptop because of a virus and now my latex doesn't work .... I downloaded latex along with some basic-miktex setup where I also checked the box that said install missing packages on the fly ... but now I get the following error `File 'setspace.sty ' not found` What should I do to get it to work?! Thanks!


title: Circuitikz: changing switches orientation

text: In `circuitikz`, all the switches go from left to right. There is a mirror option that goes from left to right but opens on the bottom. I want the switch to go from right to left with a top opening. How can I do this? Attached is a screen shot from the manual that has MWE and image of what is currently available. All that is needed is               \documentclass{standalone}     \usepackage{circuitikz}     \begin{document}      ![enter image description here](http://i.stack.imgur.com/dcwWr.png)               \end{document}


title: Best practice for fixing a clash between packages without altering the .sty files?

text: Here is another casualty of TeX's flat namespace and another reason to start using LaTeX3... I noticed today that the `algorithm2e` and `keystroke` packages clash. More specifically, they both define a command called `\Return`:   * in `algorithm2e`, `\Return` is a command for typesetting the pseudocode _Return_ keyword;   * in `keystroke`, `\Return` is a command that typesets `Return`. Both packages define their `\Return` command using `\newcommand`; therefore, if both packages are loaded, LaTeX returns an error when it encounters the second `\newcommand\Return`. I solved the problem by giving `keystroke`'s `\Return` a new, unique name that doesn't clash with anything I'm using so far, like so:               \documentclass{article}          \usepackage{keystroke}     \let\ksReturn\Return     \let\Return\relax     \usepackage{algorithm2e}          \begin{document}     \Return \quad \ksReturn     \end{document}      That worked, but I have a question: As a user (not a package writer/maintainer), what is best practice for fixing a clash between two homonymous, yet different, commands defined in two different packages, without altering either of the .sty files? Can my approach have any detrimental side-effect (aside from my new name possibly generating a different clash)? * * * Side note: `keystroke` is quite an old package. At the time of writing this post, the current version dates back to November 2000, whereas the current version of `algorithm2e` was released more recently, in January 2013. **Edit** : a less problematic and more powerful package for typesetting menu sequences, paths, and keyboard shortcuts is the excellent `menukeys` package.


title: How to adjust or move the labels of arrows in tikz matrix of math nodes

text: I am trying to label crossing arrows in my tikz-matrix diagram. By default, the label is placed half-way of the path. Since the arrows cross half-way too, the labelling becomes ambiguous: ![enter image description here](http://i.stack.imgur.com/arc03.png) How can I 'move' the label downwards or upwards? Or is there a better environment for drawing this diagram? Here is the tikz code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix}          \begin{document}           \begin{tikzpicture}       \matrix (m) [matrix of math nodes, row sep=4em,         column sep=0.2em]{         V& \quad \hookrightarrow \quad & H & \cong& H'& \quad \hookrightarrow &V' \\         Q_+& \quad \hookrightarrow \quad & Q & \cong& Q '& \quad \hookrightarrow &Q_+' \\         };       \path[-stealth]         (m-1-1) edge [densely dotted] node [left] {$J_1'$} (m-2-5)          (m-1-3) edge (m-2-7)          (m-2-1) edge  (m-1-5)         (m-2-3) edge [densely dotted] (m-1-7);     \end{tikzpicture}          \end{document}


title: AucTex region preview produces a document with ~10× more pages than the region preview should be. Cached preamble issue?

text: I define the following `\locallabels{}` command to localize labels and references to a certain part of my document               \makeatletter \AtBeginDocument{%       \let\origlabel@in@display\label@in@display       \let\origref\ref \let\origpageref\pageref \let\origlabel\label         \newcommand\locallabels[1]{%         \renewcommand\label[1]{\origlabel{#1##1}}%         \renewcommand\ref[1]{\origref{#1##1}}%         \renewcommand\pageref[1]{\origpageref{#1##1}}%         \renewcommand\label@in@display[1]{\origlabel@in@display{#1##1}}%       }} \makeatother      See this thread for a MWE. However, when I define the following command based on my custom `\locallabels`,               \newcommand{\refalien}[3]{\locallabels{#1}\ref{#2}\locallabels{#3}}      which I use to reference labels outside a particular `locallabels` region of my document, why does **AucTex** region preview, in my non-MWE document, output a DVI that has about 10× more pages with barely any characters on each page? Does this have to do with a preamble-caching issue? thanks


title: How to get a good "divisible by" symbol?

text: In addition to the "divides" relation, denoted _b | a_ , there is also a "divisible by" relation expressing the converse ( _a_ is divisible by _b_ ), often designated with three vertical dots. Up until now, I've settled with               \mathrel{\vdots}      ![Example](http://i.stack.imgur.com/TzfT7.png) But there are two problems with the symbol:   * It is too high relative to the numbers   * It is also somewhat too long A search with Detexify and the Comprehensive LaTeX Symbol List doesn't reveal anything more suitable. How do I get a good looking "divisible by" symbol?


title: Add second enumeration item on the same line?

text: I'm writing a document that has a large number of lists containing short enumeration items, and I'd like to be able to [manually] put multiple items on one line. Thus, for example, I'd like to say                 \begin{enumerate}         \item Goes on first line.         \samelineitem Also goes on first line.         \item Goes on second line.       \end{enumerate}      I'm quite happy with making the one line/two lines decision myself (in fact, I'd prefer it), so all I'm looking for is a macro that will determine the current enum counter, do the right thing regarding horizontal spacing, and print the item. It would be nice if this would work with enumerate, description, and itemize lists (or with general lists). (For a description list, I guess something like `\samelineitem[newlabel] Text of item`). Is there a package with such a capability, or would anyone out there like to tell me how to do it? Thanks.


title: How does one make a proper static flowfram letterhead?

text: Using the `flowfram` package, I have created a two page document where on the first page there is only one column and on the second page there are two columns. What I am trying to do now is create a static letterhead that appears at the top of each page. Below is the markup I have so far, but for some reason the letterhead is only appearing at the top of the second page and is constrained to the width of the second column. Preamble:               \usepackage{lipsum}          \usepackage[draft]{flowfram}          \setlength{\columnsep}{0.5in}          % Column 1, Page 1     \onecolumnStopinarea[1]{0.1\textheight}{\textwidth}{\textheight}{0pt}{0pt}          % Column 1, Page 2+     \onecolumnStopinarea[>1]{0.1\textheight}{0.35\textwidth}{\textheight}{0pt}{0pt}          % Column 2, Page 2+     \onecolumnStopinarea[>1]{0.1\textheight}{0.6\textwidth}{\textheight}{0.4\textwidth}{0pt}          % Static Header     \setstaticframe{all}{label={header}, backcolor=myred, textcolor=white}      Document:               \begin{staticcontents*}{header}     \begin{center}     Letterhead     \end{center}     \end{staticcontents*}          \section{Column 1 on Page 1}     \lipsum[1]          \clearpage          \section{Column 1 on Page 2}     \lipsum[1]          \framebreak          \section{Column 2 on Page 2}     \lipsum[1]      What am I missing here?


title: Modify bibliography categories

text: I'm currently writing my masterthesis (in german) and am using biber in combination with jabref for my citations. I have some citations related to "Masterarbeiten" and "Diplomarbeiten", for which I chose the category "masterthesis". Now, when the bibliography is created in german language, instead of "Masterarbeit" "Magisterarbeit" is shown in the document. This is not correct and so I would like to change this. What do I have to do to change this, so that "Masterarbeit" will be written instead of "Magisterarbeit"? And secondly: What do I have to do if I want to create a second category, so that I can distinguish between the citation of a "Diplomarbeit" and a "Masterarbeit"? I appreciate any help!


title: What is the macro/primitive for the current run time?

text: I've seen (I don't know where) a couple of interesting metadata-oriented control sequences, and I was wondering if such a sequence exists for the job runtime. I can't expect it to give me the _total_ run-time, but the run-time at that specific point would work well enough. I'm putting in a rather braggy colophon, for the interested. My use case would be something like               \documentclass{silly}     \usepackage{mwe}     \begin{document}     \lipsum\lipsum\lipsum          This document was typeset with \XeTeX, which is based on the \TeX\ typesetting     system by Dr.~Donald~Knuth... which is very fast.  This entire work took only     \pdfjobtime\ seconds to compile!     \end{document}


title: tikz, how manipulate with a series of nodes as one object

text: This code draws sequence of words, each word in a separate block. I want to manipulate it as one block. For example, how can I get next picture?![enter image description here](http://i.stack.imgur.com/MgGg1.png) (I want to add $\rho$ in front of it).               \documentclass[border=3pt]{article}     \usepackage{tikz}     \usepackage{xstring,calc}     \usetikzlibrary{calc}          \newlength{\NodeSize}          \tikzset{DNA Style/.style={minimum size=0.5cm, draw=gray, line width=1pt, inner sep = 2pt}}{}               \newcounter{ColumnCounter}% Prefix for node labels               \newlength{\CurrentXPos}     \newcommand*{\PreviousNode}{}%     \newcommand*{\DNASequence}[2][Mark]{%         % http://tex.stackexchange.com/questions/12091/tikz-foreach-loop-with-macro-defined-list         \def\Sequence{#2}%         \def\PreviousNode{}%         \foreach [count=\xi] \Label/\Color in \Sequence {%             \IfStrEq{\Color}{}{\def\Color{white}}{}             \edef\NodeName{#1-\arabic{ColumnCounter}}             \IfStrEq{\PreviousNode}{}{%                 \node [DNA Style, fill=\Color, anchor=west] (\NodeName) {\Label};                 \xdef\PreviousNode{\NodeName}%             }{                 \node [DNA Style, fill=\Color, anchor=west, xshift=-\pgflinewidth] at (\PreviousNode.east)(\NodeName) {\Label};                 \xdef\PreviousNode{\NodeName}%             }             \stepcounter{ColumnCounter}         }      }%


title: Natural deduction (or similar) as TikZ tree

text: I'm wondering if it's possible to make TikZ trees render in a way similar to natural deduction (proof) trees. Specifically I would like a tree which, rather than edges from parent to child, has lines horizontally (assuming the tree grows up or down) over each subtree. I'm still new to TikZ and my best solution so far is to draw the tree without edges and use the `fit` library to construct bounding boxes for all the subtrees and then use the anchors of the bounding boxes to draw lines, hardly a satisfactory solution. (I suspect I could be using chains, but as far as I can see you'd lose the convenient notation for trees.) EDIT: If it was conveniently possible to traverse the tree nodes in a `\foreach` fashion the tedious part could at least be automated, would something like this be possible? EDIT: I guess one could tweak the `level distance` so as to make the edged horizontal, this feels like rather a hack though. EDIT: Here's an example of what I'm after ![example](http://i.stack.imgur.com/EFw2j.png) produced with               \begin{tikzpicture}[grow'=up,level distance=4ex,                       edge from parent/.code={},                       level/.style={sibling distance=10em/#1}]       \node (A) {A}         child { node (B) {B}           child { node (D) {D} }           child { node (E) {E} } }         child { node (C) {C}           child { node (F) {F} }           child { node (G) {G}                   child { node (H) {H} }                   child { node (I) {I} }                   child { node (J) {J} } } } ;       \node (SubA) [fit=(B) (C)] {};       \node (SubB) [fit=(D) (E)] {};       \node (SubC) [fit=(F) (G)] {};       \node (SubG) [fit=(H) (I) (J)] {};       \foreach \root in {SubA, SubB, SubC, SubG}{         \draw [thick] (\root.south west) -- (\root.south east);       };     \end{tikzpicture}


title: How to install microtype 2.8 beta?

text: I want to test microtype 2.8 beta, to get better typography support for XeLaTeX as proposed elsewhere. However, I could not find any reference online how to install the latest beta version, neither for my system MikTeX nor for TexLive or MacTex. How to install it?


title: In table, how to make one column has different font size for different line?

text: I use longtabu to create a table, below is the realted code               \begin{longtabu} to \textwidth {|>{\footnotesize}X[1 , p ] |>{\footnotesize}X[1 , p ] | >{\footnotesize}X[1 , p ]|}      I want the first line of the table (table head) to be footnotesize, and I need one column with tiny font size, but if i change footnotesize to tiny, all lines in that column become tiny, the first line should be footnotesize. How to do it?


title: How to put symbol in specific place and skip it in normal tex

text: I need to put some symbol/paragraph in specific (x,y) place. How I can do it? Is possible to skip this in normal text? Text is big but in specific place i put some words.


title: Pgfplots remove plot line

text: \usepackage{pgfplots}     \pgfplotsset{width=10cm}              \begin{figure}     \centering     \begin{tikzpicture}     \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother     \pgfplotsset{axis line on top/.style={      axis on top=false,      after end axis/.code={         \pgfplotsset{axis line style=opaque,           ticklabel style=opaque,           tick style=opaque,           grid=none}         \pgfplotsdrawaxis}       }     }     \pgfdeclarehorizontalshading{stefan}{50bp}{     color(0.00000000000000bp)=(violet);     color(8.33333333333333bp)=(blue);     color(16.66666666666670bp)=(cyan);     color(25.00000000000000bp)=(green);     color(33.33333333333330bp)=(yellow);     color(41.66666666666670bp)=(orange);     color(50.00000000000000bp)=(red)     }     \begin{axis}[     %height=9cm,     %width=9cm,     grid=major,     xmajorgrids,     xmin=-0.3,     xmax=0.3,     ymin=0,      ymax=6,     point meta min={-0.3},     point meta max={0.3},     axis line on top,     %xtick={-0.3,-0.29,...,0.3},     xticklabels={%     $-0.4$,     $-0.3$,     $-0.2$,     $-0.1$,     $\mu$,     $0.1$,     $0.2$,     $0.3$,     $0.4$},     % note: \frac can be done automatically:     % xticklabel style={/pgf/number format/frac},     minor tick num=4,     xlabel=\large$x$,     ylabel=\large$f_{\mu,\sigma^2}(x)$,     colorbar horizontal,colormap/new,no markers,     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}]     \addplot gnuplot[shading=stefan,color=black,shader=interp,id=DoG,samples=1000,domain=-0.3:0.3,y domain=0:1]{((1/(sqrt(2*pi*0.00570275999999999)))*exp(-(x-0)**2/(2*0.00570275999999999)))}\closedcycle;     \addplot+ [black] coordinates {(0,0)(0,6)};     \pgfplotsset{tick style={thin,black},every mark/.append style={solid}}     \end{axis}     \begin{axis}[     %height=9cm,     %width=9cm,     xmin=-0.3,     xmax=0.3,     ymin=0,      ymax=6,     axis line on top,     axis y line*=right,     axis x line=none     ]     \pgfplotsset{tick style={thin,black},every mark/.append style={solid}}     \end{axis}     \begin{axis}[     %height=9cm,     %width=9cm,     xmin=-0.3,     xmax=0.3,     ymin=0,      ymax=6,     axis line on top,     axis x line*=top,     axis y line=none,     xticklabels={%     $-0.4$,     $-0.3$,     $-0.2$,     $-0.1$,     $\mu$,     $0.1$,     $0.2$,     $0.3$,     $0.4$}     ]     \pgfplotsset{tick style={thin,black},every mark/.append style={solid}}     \end{axis}     \end{tikzpicture}     \caption{Plot}     \end{figure}      Hi all, I want to remove the black line in this plot how i can make?


title: Interference between amsmath and ntheorem

text: I am having some problems that `seem' to me to be a conflict between amsmath and ntheorem. Here is a MWE:               \documentclass[12pt,a4paper,oneside]{report}     \usepackage[left=2.00cm,right=2.00cm,top=2.45cm,bottom=2.5cm]{geometry}     \usepackage[amsmath,amstext,thmmarks]{ntheorem}     \usepackage{color,fancyhdr,framed,latexsym,multicols,slashed}          \theoremclass{Theorem}     \theoremstyle{break}     \newframedtheorem{Theorem}[Theorem]{Theorem}          \begin{document}     \begin{Theorem}     Let $X$ be a set with $n$ elements. Then $\mathcal{P}(X)$ is a set with $2^n$ elements.     \end{Theorem}          \end{document}      Ay help would be greatly appreciated. Thanks.


title: White space between caption and sidewaystable

text: I am using a sidewaystable from the `rotating` package. I am trying to add some white space between the caption and the table (caption is placed above table). I tried using `\captionsetup[table]{skip=10pt}` in the preamble as well as `\captionsetup{skip=10pt}` directly before the `\caption`in the sidewaystable environment. Neither works. The first option affects all regular tables but not the sidewaystable, the latter does not have any effect. Suggestions how I can do this? And it is important, that it is only for this table and does not affect the other table captions.   Thank you!


title: LaTeX hyphenation different for inline optional hyphenation and explicit \hyphenation{...} definition

text: In a text, I get an overfull `hbox`. To avoid this, I define an optional hyphenation point:               bla bla bla un\-known bla bla bla      `pdflatex` indeed hyphenates the word at that point. But when I declare the optional hyphenation point in the preamble like this               \hyphenation{un-known}      then `pdflatex` will NOT hyphenate there. The reason seems to be that LaTeX still thinks that the typeset text does not look good enough with the line break after 'un-'. But then why is the behavior different for the inline optional hyphenation to the optional hyphenation declared in the preamble?


title: how to \multicolumn in booktabs?

text: Following is my code:               \documentclass[a4paper,10pt]{article}     %\documentclass[a4paper,10pt]{scrartcl}          \usepackage[utf8x]{inputenc}     \usepackage{booktabs}               \begin{document}          \begin{table}[htbp]     \caption{Case-studies}     \centering     \begin{tabular}{lllllllllll}     \toprule     \multicolumn{8}{c}{Full}  \\          \cmidrule(r){4-5}     \cmidrule(r){6-7}     \cmidrule(r){8-9}     \cmidrule(r){10-11}          Name & Name & Name & Name & Name. & Name & Name. & Name & Name. & Name & Name. \\     \midrule     John & Doe & $7.5$ \\     Richard & Miles & $2$ \\     \bottomrule     \end{tabular}     \label{case-studies}     \end{table}               \end{document}      The output is : ![enter image description here](http://i.stack.imgur.com/uesHi.png) I want to label "Full" above other columns also. How to do that? And how to change the spacing between two columns?


title: How to position multiple decorations on a path while keeping their separation constant?

text: The `at position=<value>` syntax for decorations obviously makes the positioning of the decorations dependent on the path length:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations.markings}          \begin{document}          \begin{tikzpicture}[decoration={       markings,       mark=at position 0.4       with {\node[draw=blue,fill=blue,inner sep=2pt] {};},       mark=at position 0.6       with {\node[circle,draw=green,fill=green,inner sep=2pt] {};}     }     ]     \node (A) {A};     \node at (1,0) (B) {B};     \draw[magenta,postaction=decorate] (A) .. controls(0.25,2) and (0.75,-2) .. (B);     \begin{scope}[xshift=3cm]     \node (A) {A};     \node at (1,0) (B) {B};     \draw[magenta,postaction=decorate] (A) .. controls(0.25,4) and (0.75,-4) .. (B);     \end{scope}     \begin{scope}[xshift=6cm]     \node (A) {A};     \node at (1,0) (B) {B};     \draw[magenta,postaction=decorate] (A) .. controls(0.25,7) and (0.75,-7) .. (B);     \end{scope}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/gSsYE.png) Since the three magenta paths have increasing length, the markings will be farther apart from each other. Is there a way to place both decorations such that the distance along the path between them remains constant (i.e., placing both decorations at, let's say, half the path but guaranteeing that they will always be `50pt` away from each other along the path)?


title: \bar vs. \overline - when to use what, semantically?

text: Following the question "The \bar and \overline commands" which is simply about the lengths of both, I'd like to know when to use `\bar` and when to use `\overline` from a semantically viewpoint. I always used `\bar`, because up until now I only had single letter mean values to type. But now I came to a problem where I needed a wider "bar". Then I just tried               \documentclass{article}          \begin{document}       \[ \bar{a} \overline{a} \]       \[ \bar{abc} \overline{abc} \]     \end{document}      where one can see that they also differ in position (`\overline` is lower), and also in thickness (`\overline` is thicker). So, the question here is: **What does`\bar` represent semantically? And when to choose it over `\overline` and vice versa?**


title: Is there no good way to write \not\iff?

text: It always comes out funky, and I'd like to avoid `\nLeftrightarrow`. Is there any good way to negate the longer `\iff` double implication arrow?


title: epslatex: relative path issue

text: Please, how one could directly include epslatex graphics into main latex file, say `main.tex`? `main.tex` has its own template provided by a third party. I used this command within `main.tex` file to include the fig:               \def \Fig{figures/results1/figure}     ...           \begin{figure*}[thpb]       \centerline{         \subfigure[]{\bimOther{\input{\Fig}} }       ...       }     \end{figure*}      where figure is first generated under gnuplot as follows               set terminal epslatex 8 color colortext      set output '/tmp/figure.tex'     ...     set macros     filename = "'/tmp/data/signal.dat'"      plot @filename u 1:2 w l ls 1  linecolor rgb "red" notitle      The issue is that when using `\input` command, the main latex file (main.tex) will look to the path specified by gnuplot, and not that specified in its core, i.e. `figures/results1/` in our example. This does not allow for portability. Assume that we have different successive trial results, i.e, figure_1, ...., figure_n. How one could include them, after noticing that the /tmp file would be reverted after each trial? One solution would be to create for each trial a separate gnuplot code, which is clearly aberrant! Any help please? I spend more than one day trying to fix this issue....


title: Include both eps and png figures, problem with dvipdfmx

text: I want to include both `.eps` and `.png` figures in a latex document. I did some research and find out the solution is to use dvipdfm package. However, this package does not include my `.eps` files in the document and report following warnings: `$ dvipdfmx test.dvi` `** WARNING ** "ps: plotfile" found (not properly implemented)` I am using following headers in my `.tex` file:               \usepackage[dvipdfmx]{graphicx}     \input{psfig.sty}      I used to stack Latex, dvi2ps, ps2pdf command to get a `.pdf` file including `.eps` figures. I use following command to include figures in the documet:               \begin{figure}[bthp]          \centerline{\psfig{figure=Results/Rsrch.Evict.eps,width=5in}}         \caption{Total workload }         \label{fig:ftl-map}     \end{figure}      Any idea to fix this issue ?


title: How to extend pgf-umlcd with self association connection?

text: I have the following UML diagram describing an OrganizationUnit with Persons that fill zero to many Vacancies. The problem lies with need to have nested OrganizationUnits, since pgf-umlcd does not support self association and the graphical result of using `\association` is bad.               \begin{tikzpicture}         \begin{class}[text width=8 cm]{OrganizationUnit}{0,0}        \attribute{name: String}        \attribute{contactInformation: List<String>}        \end{class}      \begin{class}{Person}{-5, -5}        \attribute{name : String}        \attribute{title: String}        \attribute{yearOfBirth: Integer}      \end{class}      \begin{class}{Vacancy}{5, -5}        \attribute{title: String}      \end{class}           \association{OrganizationUnit}{}{1}{Person}{0..*}{belongs to}        \association{OrganizationUnit}{}{1}{Vacancy}{0..*}{}        \association{Vacancy}{}{0..*}{Person}{1}{fills}        \association{OrganizationUnit}{}{1}{OrganizationUnit}{}{0..*}      \end{tikzpicture}      How would I go about extending the pgf-umlcd to implement `\selfAssociation`?


title: How to create an annex when I have changed the structure of \chapter{}?

text: How to create an annex when I have changed the structure of `\chapter{}` ? I've also changed the structure of `\chapter*{}` with a similar code. Here the full code of the change:               \def\@makechapterhead#1{%     \vspace*{10\p@}%     {\parindent \z@     {\reset@font     \usefont{OT1}{phv}{m}{n}     \LARGE Chapitre \thechapter\par\nobreak}%     \par\nobreak     \vspace*{30\p@}     \interlinepenalty\@M     \usefont{OT1}{ptm}{b}{n}     {\raggedright \Huge #1}%     \par\nobreak     \vskip 20\p@     \hrule height 1pt     \par\nobreak     \vskip 45\p@     }}      Thanks a lot!


title: Showing margins/frames in beamer slides

text: With a regular article/report/... class, you can use the `showframe` package to draw outlines of where the various regions of the page lie. I cannot get the same functionality with `beamer`, however. Using `geometry` with its `showframe` option similarly does not work. How can I get this functionality with `beamer`? ## MWE:               \documentclass{beamer}          %\usepackage[showframe]{geometry}  % Doesn't work     \usepackage{showframe}             % Doesn't work          \begin{document}          \begin{frame}{Slide Title}     \centering     Centered Text     \end{frame}          \end{document}      ### Edit: A similar question is posed here that asks for a diagram depicting the layout of the page with lengths of various parameters given. The `\layout` package gives this output when applied to the MWE: ![layout](http://i.stack.imgur.com/w67FQ.png) While this output gives margin information and general layout information, it does not give the visual output that I am looking for, with boxes overlaid on my own content. I am less interested in seeing the value of margins and other lengths than I am in visualizing the fit of my own content on the slide and seeing how close the boxes actually are to content. This is why I desire functionality more close to what the `showframe` package would provide.


title: How to plot a normal curve with proper y-values

text: Follow-up question to Plotting bell shaped curve in TikZ-PGF I'm new to LaTeX, and I'm typesetting a document for my stats class, and trying to use LaTeX to produce a normal probability distribution. I modified the code shown in Jake's answer to the question I referenced here, and got the following:               \documentclass{article}     \usepackage{pgfplots}     \pgfmathdeclarefunction{gauss}{2}{% normal distribution where #1 = mu and #2 = sigma       \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     \begin{document}     \begin{tikzpicture}     \begin{axis}[       no markers, domain=2.1:2.3, samples=100,       axis lines*=left,       height=5cm, width=12cm,       xtick={2.12, 2.14, 2.16, 2.18, 2.2, 2.22, 2.24, 2.26, 2.28}, ytick={0.5, 1.0},       enlargelimits=false, clip=false, axis on top,       ]     \addplot{gauss(2.2,0.0179)};     \end{axis}     \end{tikzpicture}     \end{document}      The problem is that when I compile, the y-axis values are nowhere near where they should be: ![code output](http://i.stack.imgur.com/0DYjS.png) How do I fix that? I'm wondering if it's a system problem, because the output shown in Jake's answer on Bell Curve/Gaussian Function/Normal Distribution in TikZ/PGF has appropriate y-axis values and I don't see why it should be any different.


title: Illegal pream-token in tabular

text: I'm having trouble constructing a `tabular` environment and compiling it with `pdflatex`. Here's what I'm trying to do:               \documentclass{article}     \usepackage[pdftex]{graphicx}     \usepackage{caption,tabularx,booktabs}     \begin{document}     \begin{minipage}{\linewidth}     \centering     \captionof{table}{Left side FBD} \label{tab:title2}     \begin{tabular}{ C C }\toprule[1.5pt]     \bf X & \b     f Y \\\midrule     $0$ & $-F_g$\\     $F_t \sin \theta$ & $F_t \cos \theta$\\     $-F_e$ & $0$\\     \bottomrule[1.25pt]     $0$ & $0$\\     \end{tabular}     \end{minipage}     \end{document}      However, I then get the following error:               ! Package array Error:  Illegal pream-token (C): `c' used.          See the array package documentation for explanation.     Type  H <return>  for immediate help.      ...          l.8 \begin{tabular}{ C C }                               \toprule[1.5pt]          ! Package array Error:  Illegal pream-token (C): `c' used.      I've tried giving each `C` and argument as I've seen in other source code (I'm still not certain exactly what that argument is for) I get another error message. When I replace `C` with `C{.85in}` I now get:               ! Package array Error:  Illegal pream-token (C): `c' used.          See the array package documentation for explanation.     Type  H <return>  for immediate help.      ...          l.8 \begin{tabular}{ C{.85in} C{.85in} }                                             \toprule[1.5pt]          ! Package array Error:  Illegal pream-token (.85in): `c' used.      Does anyone know what I'm doing wrong with my `tabular`? Thanks in advance!


title: Writing source code in LaTeX as text

text: Is there a package that allows source code in LaTeX as text? I rather not use `listings` package because the code takes too much space. Copy/paste is tedious because the spaces are not preserved.


title: knitr and biblatex

text: I'd like to create a PDF report with `knitr` with `LaTeX`-code in `RStudio` with `biblatex` for citations. However, the in-text-citations are always undefined and no bibliography is printed. The same bibliography works perfectly with a pure `.tex`-document stored in the same folder and containing the same citations, same path to the `.bib`-file etc. However, as for all references (also with `hyperref`) I have to compile twice. I thought this might be the problem with `knitr` (that the compilation is run only once), but the `hyperref`-references to figures work well. Any idea what might go wrong with the bibliography when using `knitr` and how I can solve the problem? MWE:               \documentclass{article}          \usepackage[style=authoryear-comp, maxnames=1, bibencoding=utf8, backend=biber]{biblatex}     \bibliography{ZoteroOutput.bib}          \begin{document}          According to the literature \parencite{gonzalez2003} we can assume...          \printbibliography          \end{document}      From the `log`-file:               Package biblatex Warning: Please (re)run Biber on the file:     (biblatex)                mwe     (biblatex)                and rerun LaTeX afterwards.


title: Fitting text to exact specific size

text: I would like to make my text fit a certain size "box" at a specific location. The two problems I am encountering are as follows: This long string should wrap when it hits the 4.5 inch limit but it does not:               \documentclass[landscape]{article}     \usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}          \begin{document}     ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd     \end{document}      And this one just remains constant but I would like to force it to fit the entire 4.5in x 5.875in box, as in enlarge the text to make it fit the box.               \documentclass[landscape]{article}     \usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}          \begin{document}     {\Huge This should fit in a 4.5in x 5.875in box but that is close to the left edge of paper, but it is not conforming to the box size desired....     \end{document}      Thanks for the help.


title: How to use background image in LaTeX?

text: I am generating one report where I need to use background image. But I found that image always starts leaving some margin space to left side.               \documentclass{article}     \usepackage{wallpaper}     \usepackage{mdframed}     \usepackage[top=2cm, bottom=2cm, outer=0cm, inner=0cm]{geometry}     \begin{document}      Some content     \ThisLRCornerWallPaper{1.0}{image.jpg}     \end{document}       How can I use background image covering whole page?


title: How can I reduce the line spacing in a listing?

text: I have some listings in my beamer presentation. Sometimes, the last line of the code I want to explain doesn't fit on the slide. I've already configured the font size to scale `.7`:               \newfontfamily\listingsfont[Scale=.7]{DejaVu Sans Mono}     \lstset{basicstyle=\listingsfont}      Is there a possibility to reduce the line spacing in a listing as well?


title: Custom margin settings for figure in LaTeX

text: I have a fairly large figure in a LaTeX document. This figure is too large for the left and right margin of the document. This results in the figure being placed flush with the left margin, and way beyond the right margin. What I want is to do, is center the figure on the page. Can I do this, e.g. by setting a different left margin for this figure?


title: Intelligent way to autoref / label enumerations

text: I want to automatically label and reference a enumeration of functional requirements. The labeling works, but I can't reference the list items via `\ref{REQ1}` etc.               \begin{enumerate}[label*={\textbf{REQ\arabic*}}, ref={REQ}\arabic*]         \item First requirement         \item Second requirement         \item Third requirement      \end{enumerate}      Output should look like following (that's working already) **REQ1** First requirement **REQ2** Second requirement **REQ3** Third requirement * * * Here's a SSCCE               \documentclass[12pt]{article}          \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{enumitem}     \usepackage{ae}     \usepackage[pdftex]{graphicx}     \usepackage{vmargin}     \usepackage{url}     \usepackage[absolute,overlay]{textpos}     \usepackage[german]{babel}     \usepackage[raiselinks=true,                             bookmarks=true,                             bookmarksopenlevel=1,                             bookmarksopen=true,                             bookmarksnumbered=true,                             hyperindex=true,                             plainpages=false,                             pdfpagelabels=true,                             pdfborder={0 0 0.5},                             colorlinks=false,                                                    linkbordercolor={0 0.61 0.50},                                citebordercolor={0 0.61 0.50}]{hyperref}  %{0.57 0.74 0.57}          \begin{document}          \begin{enumerate}[label*={\textbf{REQ}\arabic*}, ref={REQ}\arabic*]         \item First requirement         \item Second requirement         \item Third requirement      \end{enumerate}          \dots     The capabiltiy of using magic is given to us by fulling the first requirement \ref{REQ1}.     \end{document}


title: Vertical aligment of subfigure to the top edge

text: I have a small problem with vertical alignment in LaTeX. I have 3 figures with different height and I want to show them in one figure (side-by-side). Unfortunately, by default they are aligned to the bottom edge and it doesn't look good. However if I try to align them to the top edge it doesn't look good either, because the captions of subfigures are not aligned. ![The image showing the subfigures align to the top edge](http://i.stack.imgur.com/AgJEi.png) I cannot use `subfig` package, because there are some conflict with another package I use, but I use a lot of packages so I'm not sure what package is making the trouble. Is there some possible way, how to align the subfigures to the top edge and prevent the alignment of the subcaption? Here is my current code:               \begin{figure}[!ht]         \begin{subfigure}[t][1\width]{0.3\textwidth}             \centering\vspace{0pt}             \includegraphics[width=\textwidth]{content/indoor/convex_space}             \caption{Convex Spaces}             \label{fig:convex_space}         \end{subfigure}         ~         \begin{subfigure}[t][1\width]{0.3\textwidth}             \centering\vspace{0pt}             \includegraphics[width=\textwidth]{content/indoor/axial_line}             \caption{Axial Map}             \label{fig:axial_line}         \end{subfigure}         ~         \begin{subfigure}[t][1\width]{0.3\textwidth}             \centering\vspace{0pt}             \includegraphics[width=\textwidth]{content/indoor/intersection_graph}             \caption{Intersection graph}             \label{fig:intersection_graph}         \end{subfigure}         \caption{Examples of some spatial analysis technique\cite{dawes2013}}         \label{fig:scene_walls_3d}     \end{figure}


title: Why does \addplot shift my graph of a \pgfmathdeclarefunction function to the right?

text: When plotting a `\pgfmathdeclarefunction`ed function the graph gets an offset to the right that is proportional to the number of times the function is called in the formula. I have boiled my initial code down to following example, which exhibits the behaviour:               \documentclass[12pt]{scrbook}     \usepackage{tikz,pgfplots}     \begin{document}         \pgfmathdeclarefunction{f}{1}{ \pgfmathparse{#1 * #1} }         \begin{figure}             \centering             \begin{tikzpicture}                 \begin{axis}                     \addplot {x + 2 * x * x}; %no shift (clearly centered                     %\addplot {x + 2 * f(x)}; %little shift to the right                     %\addplot {x + f(x) + f(x)}; %shifted nearly off the sheet                 \end{axis}             \end{tikzpicture}         \end{figure}     \end{document}      In this example it is obviously easy to write the function inside the `\addplot` command. But I have a more complex function which is used all over the place and shifts my plots off the page. I am pretty new to LaTex and probably did an error somewhere, but I can't find it. So what is wrong with this?


title: Cross reference in LyX

text: I would like to use the `\autoref` function in LyX, so that when I refer to a labeled figure or theorem, it is typeset as "Figure #" or "Theorem #". According to this answer, I can redefine the `\ref` command as `\autoref` using               \let\ref\autoref      at the beginning of the document. However, this creates a problem: when I refer to an equation, it comes out as "(Equation #)". This is because LyX does not use `\eqref{eq_label}`, but rather `(\ref{eq_label})` to refer to equations. So my question is: Is there a way to configure LyX so that it uses `\eqref` to refer to equations, and `\autoref` to refer to figures, theorems, etc. I'm using the `article` document class and MikTeX distribution.


title: How to vertically align 'numbers' in a table? [pairs of numbers given as strings]

text: I display two sorts of values (say, A and B) in one table. The values are generated in R and I automatically create strings like "A (B)", so all values of type B are put in parentheses and are appended to the values of A. As you can see from the resulting table, the spacing is not quite right, it depends on the number of digits of B:               \documentclass{article}          \usepackage{tabularx}     \usepackage{booktabs}          \begin{document}     \begin{tabular}{rr}       \toprule        27.8 ( 2.8) &  38.4 ( 3.1)\\       126.8 (10.3) & 171.9 (11.2)\\       \bottomrule     \end{tabular}     \end{document}      I am wondering what good ways are to fix this? One option would be to check the number of digits of B and add `\phantom{0}` accordingly, or `\ \,` also does it. But I would be interested in whether it is possible to align the numbers without these 'hacks'. Ideally, I would like to keep the numbers as they are (for example, to be able to easily use the same table in non-LaTeX documents). In theory, a solution could be to align the numbers according to two dots (like an `alignat` environment in comparison to `align`) . But I'm not sure whether this can be done (with `siunitx` (?)) This is what I found on this topic, but adding `~` is like the above (thus required adjustments of the table entries) and monospaced fonts ... hmmm... doesn't seem very elegant. **UPDATE** Trial after David's post:               \documentclass{article}          \usepackage{tabularx}     \usepackage{booktabs}     \usepackage{dcolumn}     \usepackage{siunitx}          \begin{document}          With \texttt{dcolumn}:     \par\medskip     \begin{tabular}{rD{.}{.}{-1}}       \toprule        27.8 &  38.4 (2.3)\\       126.8 & 171.9 (29.1)\\       \bottomrule     \end{tabular}     \par\bigskip     With \texttt{siunitx}:     \par\medskip     \begin{tabular}{S                     S}       \toprule        27.8 &  38.4(3)\\       126.8 & 171.9(1)\\       \bottomrule     \end{tabular}     \par\bigskip     How it should look like:     \par\medskip     \begin{tabular}{rr}       \toprule        27.8 &  38.4 (\ \,2.3)\\       126.8 & 171.9 (29.1)\\       \bottomrule     \end{tabular}          \end{document}


title: Author et al in text

text: Is there any way to generate say, `Smith \textit{et al.}\cite{Smith2014}` from a single command, say, `\namecite{Smith2014}`, in the text? M (non-working) example:               \begin{document}     \newcommand{\namecite}[1]{Code that extracts the last name of first author{#1}.\cite{#1}}     \maketitle     Developments in this field are not new. \namecite{Smith2014} showed that ...     \end{document}


title: pin angle not accepted

text: I am trying to draw a pin with a 45-degree angle. For some reason, the angle is not accepted and is seen as the pin label:               \documentclass[tikz]{standalone}     \usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}[scale=2.54]      \path[draw,red,name path=thresh] (0,0.4) -- (4.0,0.4);      \path[draw,blue,name path=four] (0,0) -- (4.0,1);      \path[name intersections={of=four and thresh,name=newfour}];      \node[style={fill=black,circle,scale=0.3},           pin={[pin edge={black,thick}]45:{cross}}] at (newfour-1) { };     \end{tikzpicture}     \end{document}      Here is the result: ![enter image description here](http://i.stack.imgur.com/cHpsl.png) How can I fix this issue? _Note: My pgf version is 2.10._


title: Quotes in a different language (Russian)

text: Tex prints question marks instead of the russian text that I want it to print. Help?               \usepackage[russian,english]{babel}     \usepackage[T1,T2A]{fontenc}     \usepackage[utf8]{inputenc}     ...     \title{     \selectlanguage{russian}     Успех в Америке     \selectlanguage{english}     Success in America \\ \vspace{2 mm} {\large Exploring Ukrainian-American Transnationalism}}


title: How to move the field note at the end of the reference

text: I am using the `note`field to add the original publication date and I would like to print it at the end of the reference instead of before the publisher information. I had a look here and tried to come out with a similar solution. Still my macro doesn't work: the `note`field doesn't change position.               \RequirePackage{filecontents}          \begin{filecontents*}{mybib.bib}     @book{habermas_structural_1989,         address = {Cambridge, {MA}},         title = {The structural transformation of the public sphere: {An} inquiry into a category of bourgeois society},         publisher = {MIT {Press}},         author = {Habermas, Jürgen},         translator = {Burger, Thomas and Lawrence, Frederick},         year = {1989},         note = {({Original} work published 1962)}     }     \end{filecontents*}          \documentclass{article}               % Set the values for the bibliography     \usepackage[         style=apa,         backend=biber,         isbn=false,         url=false,         doi=false,         eprint=false,         hyperref=true,         backref=false,         firstinits=false,     ]{biblatex}          \renewbibmacro*{publisher+note}{%       \printlist{publisher}%       \setunit*{\addperiod\space}%       \usebibmacro{note}%       \newunit}          % Recommended by biblatex     \usepackage[utf8]{inputenc}     \usepackage{csquotes}     \usepackage{xpatch}          % Set language     \usepackage[british]{babel}     \DeclareLanguageMapping{british}{british-apa}          \addbibresource{mybib.bib}          \begin{document}          \cite{habermas_structural_1989}          \printbibliography     \end{document}


title: TeXworks and pvc parameter of latexmk

text: When we use TeXworks as editor is there any point in using `-pvc` argument of `latexmk`?


regarding this documentation ftp://ftp.dante.de/pub/tex/info/math/voss/mathCol/mathCol.pdf it should be easy to change the color of an align environment like this:               \documentclass{article}     \usepackage{color,amsmath}     \begin{document}     \begin{align}\color{red}     x &= 1\\     y &= 2     \end{align}     \end{document}      But all that changes to red is the first entry, i.e. the x. I use MiKTeX 2.8 on Windows XP. Any ideas?


title: Is there an (easy) way to create or personalize .bst files?

text: When you prepare an article for a journal (in my case, _Quantum Information and Computation_ , Rinton Press), often they ask you to use some format for your references; in my case, the following: > [1] R. Calderbank and P. Shor (1996), _Good quantum error correcting codes > exist_ , Phys. Rev. A, 54, pp. 1098-1106. > > [2] M.A. Nielsen and J. Kempe (2001), _Separable states are more disordered > globally than locally_ , quant-ph/0105090. > > [3] A.W. Marshall and I. Olkin (1979), _Inequalities: theory of majorization > and its applications_ , Academic Press (New York). The issue is, sometimes (and this is the case) they do not provide a `.bst` style file for `bibtex` users. I (and I guess many other people) prefer not to copy all the references of a bibtex file one by one into a tex document. So here is the question I am trying to answer: > **What is the easiest way to create a** `.bst` **file?** (for Rinton or any > other publisher) At first sight, I thought this would be very easy to do: after all, a `.bst` file is just a mere script to give format to a list. Strangely to me, after a long search I have been unable to find a simple clean solution to this problem. These are the the options I have been looking at:   1. I have tried to **adapt a previous .bst file** : concretely, `apsrev4-1.bst`, which has a similar format. Other people have tried this solution before [1], [2]. However, it is an ugly option. First, it requires going through the script of the .bst and understanding it. Second, the script format used in different .bst files differs (quite annoyingly), so it is not easy to modify them unless you do understand what's written.   2. The above solution is quite hideous and you really lose time on it, so I was wondering: isn't there any **software tool** (hopefully with a GUI) that does this job? It should, after all, pretty easy to program for a .bst script expert some sort of program to generate .bst files. There are some related questions in this site asking for something similar [3], [4]; there I have seen a couple of proposed apps, but going through their manuals they seem not so easy to use. Isn't there some software tool available to generate a .bst in less than 1 hour of work? **Remarks** : _ideally_ I would like to use/personalize/create `.bst` styles that support `eprint` fields (e.g. `aps4-1.bst`).


title: Frame and background color for all figures

text: I want to have all my figure floats framed all through the text something like those in Wikipedia pages. A pale-coloured (grey) frame and very pale background too. I am using `caption` package to customize caption fonts as you can see below:               \usepackage[svgnames]{xcolor}     \DeclareCaptionFont{fontstyle}{\fontfamily{phv}\fontseries{mc}\selectfont}     \usepackage[width=0.8\textwidth ,font={small,fontstyle},labelfont={color=     {DodgerBlue},bf,up}, labelsep=period, format=plain]{caption}      I hope I was clear enough. Thanks


title: How to port this ntheorem solution to amsthm + thmtools?

text: Is it possible to reproduce this pleasant theorem environment using `amsthm` and `thmtools`?


title: Errors when using dot2texi in MikTeX

text: I receive errors in log file while trying to compile the following code:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \usepackage{dot2texi}          \begin{document}       \begin{dot2tex}[neato,options=-tmath]         digraph G {           node [shape="circle"];           a_1 -> a_2 -> a_3 -> a_4 -> a_1;      }     \end{dot2tex}     \end{document}      It is an example from dot2tex website. An example of the error is:               Undefined control sequence \begin{dot2tex}[neato,options=-tmath]      The author of the package suggests on this link, that you should define               \@ifundefined{verbatim@out}{\newwrite\verbatim@out}{}%      inside your package, but I still cannot understand where should I put this command, because I am TeX-newbee. FIX: I have put `\@ifundefined{verbatim@out}{\newwrite\verbatim@out}{}%` into `dot2texi.sty` right in the beginning:               \NeedsTeXFormat{LaTeX2e}[1999/12/01]     \ProvidesPackage{dot2texi}[2008/05/07 v3.0 Run dot2tex from LaTeX]     \RequirePackage{moreverb}     \RequirePackage{xkeyval}[2005/02/22]          \@ifundefined{verbatim@out}{\newwrite\verbatim@out}{}%           \newif\ifdtt@ShellEscape     %\newif\ifmiktex \miktexfalse


title: Upright bold greek with condition in math mode

text: Good day! I googled the whole stackechange, but was not able to find the answer. I'm quite new to Latex, so my approach is not proper. I try to define a macro, that should format greek letter as **upright bold**. I know there are several ways to do it, I would like to avoid usage of isomath and stick to _upgreek_ package. I want to be able to write               \gb{\alpha}     \gb{\Alpha}      and in both cases get upright bold characters. So, here is my code inside:               \newcommand{\gb}[1]{ % Imagine #1=\Psi     \StrGobbleLeft{\detokenize{#1}}{1}[\chrcodet] % variable "\Psi"     \StrGobbleRight{\chrcodet}{1}[\chrcode] % variable "Psi"     \StrLeft{\chrcode}{1}[\chrfirst] % first character "P"     \IfSubStr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{\chrfirst} % Is it capital?         {\boldsymbol{#1}} % Yes - no modification         {\boldsymbol{\csname up\chrcode\endcsname}} % No - glue \up+Psi (that what happens!)     }      I'm trying to get the first character of the control sequence and if it's capital, I call just `\boldsymbol` with no modifications, otherwise I want to modify control sequence by placing `\up` at the beginning. So, when I do that, it produces the following error               ! Undefined control sequence.     \bm@command ->\upPsi      It looks like the "if" condition always gives false, i.e. "P" is not recognized as capital, thus the following MWE will write twice "lowercase":               \documentclass{article}     \usepackage{bm,upgreek}     \usepackage{etoolbox}     \usepackage{xstring}          \newcommand{\gb}[1]{         \StrGobbleLeft{\detokenize{#1}}{1}[\chrcodet]         \StrGobbleRight{\chrcodet}{1}[\chrcode]         \StrLeft{\chrcode}{1}[\chrfirst]         #1 - \IfSubStr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{\chrfirst}{uppercase}{lowercase}     }          \begin{document}          \begin{equation}         \psi,\Psi,\gb{\psi},\gb{\Psi}     \end{equation}          \end{document}      Can anyone give me an idea, why it does not work as expected?


title: framed multicolumns

text: I would like to have:   * two columns (e.g. with multicol)   * framed with title   * can handle pagebreaks   * can handle twoside mode of book-class since mdframed does not support multicol and according to the author he "has no idea how to implement it" (Two columns within mdframed frame), I started to think about how I can get this feature. 1) I could use multicol.str as base and try to add a frame. properly, this could be a good solution, but the implementation would go beyond my skills. 2) so I started to "hack" something with TikZ on the base of this http://www.mrunix.de/forums/showpost.php?p=313183&postcount=11 post. here is my current state:               \documentclass[paper=a4,pagesize,twoside,BCOR8mm,DIV16]{scrbook}          \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{multicol}     \usepackage{lipsum}          \usepackage{tikz}     \usetikzlibrary{backgrounds,positioning,shadows,shapes,fit,arrows}               \newenvironment{Quote}%     {\begin{list}{}%         {\setlength\leftmargin{0.5\multicolsep}\setlength\rightmargin{\leftmargin}}%         \item[]\ignorespaces}%     {\end{list}%     }          %command for a box without a page break      %two arguments: title, content      \newcommand\IBox[2]{\noindent%         \begin{tikzpicture}[line width=1pt]             \pgfmathparse{\textwidth-\pgflinewidth-\multicolsep}             \node(N)[preaction={fill,opacity=0.03}]%                 [draw,text width=\pgfmathresult pt,text justified,inner sep=0.5\multicolsep,outer sep=0pt,inner ysep=\multicolsep]%                 {               \vspace*{1.0\baselineskip}               \begin{multicols}{2}#2%     \vspace*{-3.5\baselineskip} \end{multicols}%             };             \path (N.north west)+(1,0)node[draw,fill=white,anchor=west,rectangle,rounded corners=2mm]{#1};         \end{tikzpicture}     }          %command for a box with exact one a page break from odd to even page     %one optional argument: length correction of the box on the first page     %two obligatory arguments: title, content     \newcommand\IBoxOE[3][1pt]{\noindent%         \begin{tikzpicture}[remember picture, overlay,line width=1pt]             \pgfmathsetlengthmacro\x{1in-\hoffset-\oddsidemargin+\textwidth-26\pgflinewidth}             \pgfmathsetlengthmacro\y{1in+\voffset+\headsep+\headheight+\topmargin+\textheight+0.5\pgflinewidth+#1}             \path(current page.north west)+(\x,-\y)coordinate(B);             \coordinate(O)at (0.5\pgflinewidth,-0.5\pgflinewidth);             \fill[opacity=0.03](O)rectangle(B);             \draw(B-|O)--(O)-|(B)--(B);             \path (O)+(1,0)node[draw,fill=white,anchor=west,rectangle,rounded corners=2mm]{#2};         \end{tikzpicture}%         \begin{Quote}%           \begin{multicols}{2}#3\end{multicols}%         \end{Quote}%         \vspace*{-2\baselineskip}%         \begin{tikzpicture}[remember picture, overlay,line width=1pt]             \pgfmathsetlengthmacro\x{1in+\hoffset+\evensidemargin+\textwidth-0.5\pgflinewidth}             \pgfmathsetlengthmacro\y{1in+\voffset+\headsep+\headheight+\topmargin-0.5\pgflinewidth}             \path(current page.north west)+(\x,-\y)coordinate(B);             \coordinate(O)at (0.5\pgflinewidth,0.5\pgflinewidth);             \fill[opacity=0.03](O)rectangle(B);             \draw(B-|O)--(O)-|(B)--(B);         \end{tikzpicture}     }          %command for a box with exact one a page break from even to odd page     %one optional argument: length correction of the box on the first page     %two obligatory arguments: title, content     \newcommand\IBoxEO[3][1pt]{\noindent%         \begin{tikzpicture}[remember picture, overlay,line width=1pt]             \pgfmathsetlengthmacro\x{1in-\hoffset-\evensidemargin+\textwidth-0.5\pgflinewidth}             \pgfmathsetlengthmacro\y{1in+\voffset+\headsep+\headheight+\topmargin+\textheight+0.5\pgflinewidth+#1}             \path(current page.north west)+(\x,-\y)coordinate(B);             \coordinate(O)at (0.5\pgflinewidth,-0.5\pgflinewidth);             \fill[opacity=0.03](O)rectangle(B);             \draw(B-|O)--(O)-|(B)--(B);             \path (O)+(1,0)node[draw,fill=white,anchor=west,rectangle,rounded corners=2mm]{#2};         \end{tikzpicture}%         \begin{Quote}%           \begin{multicols}{2}#3\end{multicols}%         \end{Quote}%         \vspace*{-2\baselineskip}%         \begin{tikzpicture}[remember picture, overlay,line width=1pt]             \pgfmathsetlengthmacro\x{1in+\hoffset+\oddsidemargin+\textwidth-0.5\pgflinewidth}             \pgfmathsetlengthmacro\y{1in+\voffset+\headsep+\headheight+\topmargin-0.5\pgflinewidth}             \path(current page.north west)+(\x,-\y)coordinate(B);             \coordinate(O)at (0.5\pgflinewidth,0.5\pgflinewidth);             \fill[opacity=0.03](O)rectangle(B);             \draw(B-|O)--(O)-|(B)--(B);         \end{tikzpicture}     }               \begin{document}          \IBox{no page break}{     \lipsum[1-2]     }          \IBoxOE{page break: odd even}{     \lipsum[1-6]     }          \IBoxEO{page break: even odd}{     \lipsum[1-5]     }          \end{document}      unfortunately it hast some drawbacks:   * it needs two runs (but I can life with this)   * different commands for boxes with and without page break are needed   * different commands for page breaks for odd to even and even to odd pages are needed   * can not handle more then one page break (would need new commands for it; but I do not plan to uses such large boxes) Are there any other alternatives I have overlooked? BTW, I'm using LuaLaTeX, maybe one can use some possibilities of Lua. I also have tryed boites and framed, but both can does not break pages when multicol is used. example for boites:               \documentclass[towpages]{book}     \usepackage{boites,boites_exemples}     \usepackage{multicol}     \usepackage{lipsum}          \begin{document}     \begin{boiteepaisseavecuntitre}{ Coucou ! }     \begin{multicols}{2}      \lipsum[1-8]     \end{multicols}     \end{boiteepaisseavecuntitre}     \end{document}


title: How can i change the list of tables heading font

text: I have to make all the headings with 12 pt.s bold. How can i change predefined headings like list of tables generated with command `\listoftables` ? (and content page of course) Here is all packages i'm using.               \documentclass[12pt,a4paper]{article}          \usepackage[utf8]{inputenc}     \usepackage{titlesec}     \usepackage[turkish]{babel}          \usepackage[T1]{fontenc}          \usepackage{pslatex}          \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \titleformat*{\subsection}{\normalsize\bfseries}     \titleformat*{\subsubsection}{\normalsize\bfseries\itshape}          \titleformat{\section}     {\normalfont\fontsize{12}{14.4}\bfseries\MakeUppercase}{\thesection}{1em}{}     \usepackage[overload]{textcase}      \usepackage[left=3.50cm, right=2.50cm, top=3.00cm, bottom=3.00cm,nohead,nofoot]{geometry}


title: Storing and retrieving data in tuc file

text: I want to store some data in the `.tuc` file, which is being picked up in the next run. I suceeded in storing some values but I failed in retrieving them afterwards. Here is my attempt:               \starttext     \startluacode     local collected = utilities.storage.allocate()     local tobesaved = utilities.storage.allocate()          job.register("job.userdata", tobesaved)          tobesaved["foo"] = "value_foo"     tobesaved["bar"] = "value_bar"     \stopluacode     \stoptext      This leads to the following entry in the `.tuc` file:               utilitydata.job.userdata={      ["bar"]="value_bar",      ["foo"]="value_foo",     }      The two values are stored as desired. Side question: I randomly picked the table `utilitydata.job.userdata` to store my values. Is there a default table which should be used for this to avoid clashes with the ones used by the system? I expected to be able to retrieve the data with e.g. `collected["foo"]`, but the `collected` table is empty. The sources tell me that `job.register` has four arguments: `collected`, `tobesaved`, `initializer` and `finalizer`. Maybe that is where my mistake is. I don't know what they are doing. What is the interface to retrieve the values from the `.tuc` file? ~~_(I don't know if the question is ConTeXt centric or generally applies to LuaTeX. If the mechanism is ConTeXt related, feel free to add thecontext tag.)_~~


title: Beamer: change gray out on itemize environment

text: > **Possible Duplicate:**   >  Beamer: double uncover hides instead of watermarks This is a following up question to the solution for this question: Beamer: double uncover hides instead of watermarks I'd like to know, how I have to change the code for the `enumerate` environment               \makeatletter     \BeforeBeginEnvironment{enumerate}{\ifnum\@enumdepth=1        \only<1->{\setbeamercovered{transparent=100}}%       \only<\theenumi->{\setbeamercovered{transparent=15}}%     \fi     }     \makeatother      to get the same for the `itemize` and `description` environment. Some trials from myself end in errors...


title: Replacing dots with comma in `fp` result

text: I am using `fp` to add a few values in LaTeX. How can I replace the . in `\erg` with a comma (In Germany the comma is used as decimal mark).               \documentclass{minimal}     \usepackage{fp}          \begin{document}          \FPset\erg{0}      \FPadd\erg{\erg}{23.20}      \FPadd\erg{\erg}{38.46}     \FPadd\erg{\erg}{22.36}     \FPadd\erg{\erg}{22.00}     \FPadd\erg{\erg}{15.00}     \FPclip\erg\erg          The sum is  \erg\          \end{document}


title: Is LuaLaTeX producing faulty pdfs?

text: If I compile the following minimal code with LuaLaTeX I seem to get a faulty pdf:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Times New Roman}          \begin{document}     text     \end{document}      If I open the resulting pdf-file in Adobe Acrobat and try to export it as a Word Document I an told that this is a bad pdf because of a "bad Type0 font": ![Abobe Acrobat Export error message](http://i.stack.imgur.com/Yg3rn.png) Is it me who is doing something wrong or LuaLaTeX? Or fontspec? (The Font I'm using is the OpenType Times New Roman that comes with Windows7.) Update: The problem also occurs with `\setmainfont{Minion Pro}`, but the error message is slightly different: Instead of "bad Type0 font" it says "cannot find CMap resource file".